zidane-gui 9.3.1 → 9.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/out/main/chunks/{remote-hosts-B8_tzg_n.js → remote-hosts-CSiGJAfm.js} +1 -1
  2. package/out/main/chunks/{session-search-sql-2EUzjHAT.js → session-search-sql-D51BmAO2.js} +5 -5
  3. package/out/main/index.js +4397 -4086
  4. package/out/main/session-search-worker.js +1 -1
  5. package/out/preload/index.mjs +36 -2
  6. package/out/renderer/assets/{24BXRY42-eTlQfl4v.js → 24BXRY42-0UXaaWjY.js} +1 -1
  7. package/out/renderer/assets/{4FHPYW2L-BHx1bBmw.js → 4FHPYW2L-BWpHahlW.js} +1 -1
  8. package/out/renderer/assets/{4LWW3ZNH-D7lTurDT.js → 4LWW3ZNH-CPyJ9o9Y.js} +1 -1
  9. package/out/renderer/assets/{5XYWFMKW-e04QMbw9.js → 5XYWFMKW-ZZpHHfGa.js} +1 -1
  10. package/out/renderer/assets/{64PMEAB3-DTIFpDpU.js → 64PMEAB3-DOEnEuzl.js} +1 -1
  11. package/out/renderer/assets/{6BEWHPQE-BrYtHcZG.js → 6BEWHPQE-C2ZZckdj.js} +1 -1
  12. package/out/renderer/assets/{6PIGVMFT-CoAPPYTl.js → 6PIGVMFT-CRGq6eh3.js} +1 -1
  13. package/out/renderer/assets/{75JW6PN6-JbXPfJg4.js → 75JW6PN6-CYzAa9yx.js} +1 -1
  14. package/out/renderer/assets/{7XWI72E6-CFY3Kecs.js → 7XWI72E6-C_GZbyIF.js} +1 -1
  15. package/out/renderer/assets/{BGW36YJW-DhmSG9tb.js → BGW36YJW-BAwgTZ_z.js} +1 -1
  16. package/out/renderer/assets/{CGIZI67J-Cr9B0EmW.js → CGIZI67J-BxXITbQC.js} +1 -1
  17. package/out/renderer/assets/{CodeEditor-C6EJBlGG.js → CodeEditor-CLsAw7eu.js} +2 -2
  18. package/out/renderer/assets/{ComposerEditor-oFIdMkLB.js → ComposerEditor-BqnIn2NQ.js} +1 -1
  19. package/out/renderer/assets/{DNNCRC2E-CMqlK0W6.js → DNNCRC2E-kbsNJgPT.js} +1 -1
  20. package/out/renderer/assets/DiffsTab--BHt7StP.js +3 -0
  21. package/out/renderer/assets/{E67EBMDD-C_T2QnwF.js → E67EBMDD-BOeJkFNZ.js} +1 -1
  22. package/out/renderer/assets/{EFYWJBJK-Cbn-VZcb.js → EFYWJBJK-CFT5CQUG.js} +1 -1
  23. package/out/renderer/assets/{EXE5EH6O-SXdUe5We.js → EXE5EH6O-Cbj5xPKl.js} +1 -1
  24. package/out/renderer/assets/{EditorWorkers-bVeEZI8X.js → EditorWorkers-CXBU_HFf.js} +1 -1
  25. package/out/renderer/assets/{FilesTab-DtM2Q5R0.js → FilesTab-CZHD0eBx.js} +4 -4
  26. package/out/renderer/assets/{G6GPDDNC-XfFyRa0j.js → G6GPDDNC-Ax6dML4i.js} +1 -1
  27. package/out/renderer/assets/{G76NGGFM-Bj_m2WLJ.js → G76NGGFM-BxPXXNt_.js} +1 -1
  28. package/out/renderer/assets/{GH6G3TJC-wPRy41Zv.js → GH6G3TJC-CiCXY2r6.js} +1 -1
  29. package/out/renderer/assets/{HPNUA7RO-BhLNmX-t.js → HPNUA7RO-DiyW9VGu.js} +1 -1
  30. package/out/renderer/assets/{HQRGC5D7-dvTAT1Uv.js → HQRGC5D7-ArfvIYAC.js} +1 -1
  31. package/out/renderer/assets/{IX6Z2TVR-CzV_umYo.js → IX6Z2TVR-Df9chdw8.js} +1 -1
  32. package/out/renderer/assets/IconButtonTip-D0dQOfg6.js +1 -0
  33. package/out/renderer/assets/{J77NQRCJ-DTwwq3Ci.js → J77NQRCJ-DOWauTsf.js} +1 -1
  34. package/out/renderer/assets/{JAD36DTZ-DArKsMUT.js → JAD36DTZ-CJDdMCD5.js} +1 -1
  35. package/out/renderer/assets/{LF3NJQAX-DjYdE7YV.js → LF3NJQAX-B89ZqOpY.js} +1 -1
  36. package/out/renderer/assets/{LRZCOFJZ-C7m8fw-0.js → LRZCOFJZ-BBX_wZ5T.js} +1 -1
  37. package/out/renderer/assets/{N5NF2FGY-CqGhgjNF.js → N5NF2FGY-BoIFu-8L.js} +1 -1
  38. package/out/renderer/assets/{N7OWWQHY-BRk68LVa.js → N7OWWQHY-CloOgGu1.js} +1 -1
  39. package/out/renderer/assets/{NT5JY5WP-B1NtxJ-K.js → NT5JY5WP-BhjzefjG.js} +1 -1
  40. package/out/renderer/assets/{OT7W3RNY-CtDQ--Ld.js → OT7W3RNY-BRzBqtKB.js} +1 -1
  41. package/out/renderer/assets/{P67P66DB-LeAz_z3Z.js → P67P66DB-Dw-K1Ghu.js} +1 -1
  42. package/out/renderer/assets/{PFLLLM7K-CgODCVD8.js → PFLLLM7K-DfSPUrIT.js} +1 -1
  43. package/out/renderer/assets/{PUAMC4MJ-9REX_vGK.js → PUAMC4MJ-BnY1F2cF.js} +1 -1
  44. package/out/renderer/assets/{PVFCHRLY-CK5jTRjy.js → PVFCHRLY-BcyVPS3n.js} +1 -1
  45. package/out/renderer/assets/{PinnedSavedView-Dtdra7Gq.js → PinnedSavedView-ciRhY0cN.js} +1 -1
  46. package/out/renderer/assets/{QQW2P742-B2snHr_6.js → QQW2P742-D6aitZ24.js} +1 -1
  47. package/out/renderer/assets/{S63OEDPG-BeWWF1tc.js → S63OEDPG-Dlz1a9cD.js} +1 -1
  48. package/out/renderer/assets/{SG5TVYLW-ClCsbQ87.js → SG5TVYLW-Bu7LZZpx.js} +1 -1
  49. package/out/renderer/assets/{SavedViewArtifact-ATjDgAUF.js → SavedViewArtifact-CM9L4mc8.js} +1 -1
  50. package/out/renderer/assets/{SidebarPreviewPane-DHllX0GN.js → SidebarPreviewPane-DkOCt7Gb.js} +1 -1
  51. package/out/renderer/assets/{TranscriptViews-DD_JshFH.js → TranscriptViews-aYvP71ow.js} +1 -1
  52. package/out/renderer/assets/{UGRSUGA2-jP6nv8HL.js → UGRSUGA2-avwOtJG1.js} +1 -1
  53. package/out/renderer/assets/{V44WA6U7-Dr_tS3uH.js → V44WA6U7-DMF87Y7j.js} +1 -1
  54. package/out/renderer/assets/{V67O4WWV-BRn52u9c.js → V67O4WWV-BsDLuBDb.js} +1 -1
  55. package/out/renderer/assets/{VBUCM3YD-0sLtn_Zp.js → VBUCM3YD-C6FrRswP.js} +1 -1
  56. package/out/renderer/assets/{VINGRCPA-n98Gf7V0.js → VINGRCPA-Do3Pv3Tc.js} +1 -1
  57. package/out/renderer/assets/{ViewBlock-DdcTHRu3.js → ViewBlock-B-ppjb34.js} +3 -3
  58. package/out/renderer/assets/{ViewCharts-BAw6tExV.js → ViewCharts-jvS22ppO.js} +2 -2
  59. package/out/renderer/assets/{ViewCustom-BzwMbjqg.js → ViewCustom-yFkoy6a-.js} +1 -1
  60. package/out/renderer/assets/{ViewExtension-Ch5_33Ra.js → ViewExtension-DuHxho6W.js} +1 -1
  61. package/out/renderer/assets/{ViewInputs-BHooAs2f.js → ViewInputs-VAMDh56H.js} +1 -1
  62. package/out/renderer/assets/{ViewMcpApp-CJnOESMk.js → ViewMcpApp-CH_W9CZt.js} +1 -1
  63. package/out/renderer/assets/{ViewSessionAction-BHJv5QNb.js → ViewSessionAction-66veqRhO.js} +1 -1
  64. package/out/renderer/assets/{ViewTables-DBTupg46.js → ViewTables-CKKDcYKH.js} +1 -1
  65. package/out/renderer/assets/{WL6DNKX4-Csfp__Nw.js → WL6DNKX4-Cq-YK4Uf.js} +1 -1
  66. package/out/renderer/assets/{WQ63CJYP-oSbguA5n.js → WQ63CJYP-fjrhTSVs.js} +1 -1
  67. package/out/renderer/assets/{XOYAOB3S-DfDDKmX8.js → XOYAOB3S-CAQPI0he.js} +1 -1
  68. package/out/renderer/assets/{Y5LQLG3M-BnZ8APdi.js → Y5LQLG3M-DKntYAaW.js} +1 -1
  69. package/out/renderer/assets/{YIK6JTN6-Bunk5CDx.js → YIK6JTN6-CcjcC5JX.js} +1 -1
  70. package/out/renderer/assets/{core-BbPUgmX7.js → core-Cj89wpQh.js} +4 -4
  71. package/out/renderer/assets/{file-tabs-CFdJBYJ9.js → file-tabs-PoAgFa7v.js} +1 -1
  72. package/out/renderer/assets/{ghostty-web-Dn7o-dzQ.js → ghostty-web-DiMuvUtH.js} +1 -1
  73. package/out/renderer/assets/{highlights-eTGcn9lP.js → highlights-7WH0ppQl.js} +1 -1
  74. package/out/renderer/assets/{highlights-D4Jo_Sz0.js → highlights-DnSmFBdQ.js} +1 -1
  75. package/out/renderer/assets/index-CiuUSFeC.js +11 -0
  76. package/out/renderer/assets/kit-CD3F-f6F.js +147 -0
  77. package/out/renderer/assets/{langs-CXhlGiW6.js → langs-D5CRC9qz.js} +1 -1
  78. package/out/renderer/assets/{lazy-D3tN-GAO.js → lazy-CUmWiDAP.js} +3 -3
  79. package/out/renderer/assets/{loader-DGyfh0zB.js → loader-CPY9efuc.js} +1 -1
  80. package/out/renderer/assets/{pierre-theme-BZvsTYqQ.js → pierre-theme-BrzM0xZU.js} +3 -3
  81. package/out/renderer/assets/setting-demos-BW7cG2_G.css +1 -0
  82. package/out/renderer/assets/setting-demos-DEURBrvf.js +1 -0
  83. package/out/renderer/assets/{shiki-Wqv4XEGM.js → shiki-DFrbO9j3.js} +1 -1
  84. package/out/renderer/assets/{sidebar-layout-sK8ujsHX.js → sidebar-layout-fobokay5.js} +1 -1
  85. package/out/renderer/assets/{stream-tokenizer-C18hljKL.js → stream-tokenizer-CT1HAjvR.js} +1 -1
  86. package/out/renderer/assets/{themes-Dfx1_kFe.js → themes-Cj62ov9J.js} +1 -1
  87. package/out/renderer/assets/{useFind-BBxfQuQ2.js → useFind-Cdl0rVJO.js} +3 -3
  88. package/out/renderer/assets/{useFolderChanges-BcfSJoBT.js → useFolderChanges-C9L_NOgw.js} +2 -2
  89. package/out/renderer/assets/{view-preview-B2Rj--lZ.js → view-preview-BvCO9WZH.js} +1 -1
  90. package/out/renderer/assets/{zoom-reset-l-YVDJrI.js → zoom-reset-COqHFP45.js} +1 -1
  91. package/out/renderer/index.html +5 -5
  92. package/out/renderer/view-preview.html +6 -6
  93. package/package.json +2 -2
  94. package/out/renderer/assets/DiffsTab-D690H0Dy.js +0 -3
  95. package/out/renderer/assets/IconButtonTip-P9QUxPjA.js +0 -1
  96. package/out/renderer/assets/index-c95EBMdk.js +0 -8
  97. package/out/renderer/assets/kit-C9O_D5xC.js +0 -147
  98. package/out/renderer/assets/setting-demos-B0787McX.js +0 -1
  99. package/out/renderer/assets/setting-demos-vtrBsYTd.css +0 -1
@@ -1 +1 @@
1
- import{f as formatCSSVariablePrefix,a as appendItems,c as createDiffsThemeResolver}from"./pierre-theme-BZvsTYqQ.js";import{B as BaseStreamTokenizer,D as DiffsHighlighter}from"./stream-tokenizer-C18hljKL.js";import{L as LiveTokenizer,a as codeToTokens,i as isSupportedLanguage}from"./default-B6K4UlPD.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";import"./hastToHtml-C4ea9WpN.js";import"./index-C-yjveB4.js";var HighlightsEditorTokenizer=class{options;resolveOptions;#tokenizer;#version;#disposed=!1;#returnedRange;#paused=!1;#capturedLines;#pendingDelivery;constructor(options,resolveOptions){this.options=options,this.resolveOptions=resolveOptions,this.#version=options.textDocument.version,this.#tokenizer=this.#createTokenizer()}#createTokenizer(){return new LiveTokenizer({...this.resolveOptions({lang:this.options.textDocument.languageId,theme:this.options.theme,cssVariablePrefix:formatCSSVariablePrefix("token"),tokenizeMaxLineLength:this.options.tokenizeMaxLineLength??1e3}),code:this.options.textDocument.getText(),renderRange:[0,0],onDeferTokenize:lines=>this.#deliver(lines)})}#deliver(lines){const captured=this.#capturedLines;if(captured!=null){for(const[line,tokens]of lines)captured.set(line,tokens);return}const range=this.#returnedRange;if(range!=null){for(const line of lines.keys())line>=range[0]&&line<range[1]&&lines.delete(line);if(lines.size===0)return}this.options.onDeferTokenize(lines)}#queueDelivery(lines){const pending=this.#pendingDelivery;if(pending!=null){for(const[line,tokens]of lines)pending.set(line,tokens);return}this.#pendingDelivery=lines,queueMicrotask(()=>{const batch=this.#pendingDelivery;this.#pendingDelivery=void 0,batch!=null&&batch.size>0&&!this.#disposed&&this.options.onDeferTokenize(batch)})}tokenize(change,renderRange,hostRealignsRows=!1){const document=this.options.textDocument,start=Math.min(renderRange?.startingLine??0,document.lineCount),end=Math.min(start+(renderRange?.totalLines??1/0),document.lineCount),returnedStart=Math.max(start,change.startLine);this.#paused=!1;let lines;if(this.#version!==document.version)this.#pendingDelivery=void 0,lines=this.#syncDocument(change,[start,end]).lines,this.#version=document.version;else if(this.#tokenizer.lineCount!==document.lineCount)this.#pendingDelivery=void 0,lines=this.#tokenizer.reset(document.getText(),{renderRange:[start,end]}).lines;else{if(lines=new Map,this.#readLines(lines,returnedStart,end),this.#pendingDelivery!=null)for(const line of lines.keys())this.#pendingDelivery.delete(line);return lines}return(change.lineDelta===0?change.changedLineChanges?.some(([,,lineDelta])=>lineDelta!==0)??!1:!hostRealignsRows)&&this.#readLines(lines,returnedStart,end),lines}#syncDocument(change,renderRange){const document=this.options.textDocument,options={renderRange};if(Math.abs(document.version-this.#version)===1&&change.changes.length>0&&this.#tokenizer.lineCount===change.previousLineCount)try{const update=this.#tokenizer.applyEdits(change.changes.map(({range,text})=>({range,newText:text})),options);if(this.#tokenizer.lineCount===document.lineCount)return update}catch(error){if(!(error instanceof RangeError))throw error}return this.#tokenizer.reset(document.getText(),options)}#readLines(lines,from,to){this.#returnedRange=[from,to];try{this.#tokenizer.flush(to)}finally{this.#returnedRange=void 0}for(let line=from;line<to;line++){if(lines.has(line))continue;const{tokens}=this.#tokenizer.getLineTokens(line);lines.set(line,tokens.length===0?[[0,"",""]]:tokens.map(token=>[token.offset,token.color??"",token.content]))}}setTheme(themeName){themeName!==this.options.theme&&(this.options.theme=themeName,this.#tokenizer.dispose(),this.#pendingDelivery=void 0,this.#paused=!1,this.#version=this.options.textDocument.version,this.#tokenizer=this.#createTokenizer())}getStringCommentRegexpRangesInLine(lineIndex){const document=this.options.textDocument;if(this.options.matchBrackets===!1||lineIndex<0||lineIndex>=document.lineCount)return null;const captured=new Map;this.#capturedLines=captured;try{(this.#version!==document.version||this.#tokenizer.lineCount!==document.lineCount)&&(this.#pendingDelivery=void 0,this.#tokenizer.reset(document.getText(),{renderRange:[lineIndex,lineIndex+1]}),this.#version=document.version),this.#tokenizer.flush(lineIndex+1)}finally{this.#capturedLines=void 0,this.#paused&&this.#tokenizer.pause()}return captured.size>0&&this.#queueDelivery(captured),this.#tokenizer.getLineTokens(lineIndex).bracketIgnoredRanges}prebuildStateStack(){}stopBackgroundTokenize(){this.pauseBackgroundTokenize()}pauseBackgroundTokenize(){this.#paused=!0,this.#tokenizer.pause()}resumeBackgroundTokenize(){this.#paused=!1,this.#tokenizer.resume()}dispose(){this.#disposed=!0,this.#pendingDelivery=void 0,this.#tokenizer.dispose()}};const TRIM_LINE_COUNT=1024,DOCUMENT_START={line:0,character:0};var HighlightsStreamTokenizer=class HighlightsStreamTokenizer2 extends BaseStreamTokenizer{options;#tokenizer;#trimLineCount=TRIM_LINE_COUNT;constructor(options){super(),this.options=options,this.#tokenizer=new LiveTokenizer(options)}tokenizeChunk(chunk,stable){const lineBreaks=[...chunk.matchAll(/\r\n|\r|\n/g)],startLine=this.#tokenizer.lineCount-1,position={line:startLine,character:this.#tokenizer.getLineLength(startLine)};this.#tokenizer.applyEdits([{range:{start:position,end:position},newText:chunk}]);const lastLine=this.#tokenizer.lineCount-1;let unstable=[];for(let line=startLine;line<=lastLine;line++){const{tokens}=this.#tokenizer.getLineTokens(line);for(const token of tokens)token.offset+=this.stableOffset;line<lastLine?(appendItems(stable,tokens),this.pushLineBreak(stable,this.#tokenizer.getLineLength(line),lineBreaks[line-startLine][0])):unstable=tokens}const tailLength=this.#tokenizer.getLineLength(lastLine);if(lastLine>this.#trimLineCount){const text=this.#tokenizer.getText(),{lineChanges}=this.#tokenizer.applyEdits([{range:{start:DOCUMENT_START,end:{line:lastLine-1,character:0}},newText:""}]);if(lineChanges.every(change=>change.newEndLine<=1))this.#trimLineCount=TRIM_LINE_COUNT;else{const keptLength=this.#tokenizer.getText().length;this.#tokenizer.applyEdits([{range:{start:DOCUMENT_START,end:DOCUMENT_START},newText:text.slice(0,text.length-keptLength)}]),this.#trimLineCount=lastLine*2}}return{unstable,tailLength}}clone(){this.assertActive();const clone=new HighlightsStreamTokenizer2(this.options);return clone.#tokenizer.reset(this.#tokenizer.getText()),this.copyStateTo(clone),clone}resetSource(){this.#tokenizer.reset(""),this.#trimLineCount=TRIM_LINE_COUNT}releaseSource(){this.#tokenizer.dispose()}},HighlightsHighlighter=class extends DiffsHighlighter{usedThemes=new Map;constructor(){super("highlights",createDiffsThemeResolver("highlights"))}getTheme(name){this.assertNotDisposed();const theme=this.themeResolver.getResolvedTheme(name)??this.usedThemes.get(name);if(theme==null)throw new Error(`Theme "${name}" has not been resolved`);return this.usedThemes.set(name,theme),theme}codeToTokens(code,options){return this.assertNotDisposed(),codeToTokens(code,this.resolveOptions(options))}createEditorTokenizer(options){return this.assertNotDisposed(),new HighlightsEditorTokenizer(options,tokenizerOptions=>this.resolveOptions(tokenizerOptions))}createStreamTokenizer(options){return new HighlightsStreamTokenizer(this.resolveOptions(options))}loadLanguages(){return this.assertNotDisposed(),Promise.resolve()}hasLoadedLanguages(){return!this.disposed}attachLanguages(){this.assertNotDisposed()}releaseResources(){this.usedThemes.clear()}resolveOptions({theme,themes,...options}){const lang=isSupportedLanguage(options.lang)?options.lang:"text";if(theme!=null)return{...options,lang,theme:this.getZedTheme(theme)};if(themes==null)throw new Error("A theme or themes option is required");const resolved={};for(const[key,name]of Object.entries(themes))resolved[key]=this.getZedTheme(name);return{...options,lang,themes:resolved}}getZedTheme(name){const theme=this.getTheme(name);if(theme.zed==null)throw new Error(`Theme "${name}" does not support Highlights`);return theme.zed}};export{HighlightsHighlighter};
1
+ import{f as formatCSSVariablePrefix,a as appendItems,c as createDiffsThemeResolver}from"./pierre-theme-BrzM0xZU.js";import{B as BaseStreamTokenizer,D as DiffsHighlighter}from"./stream-tokenizer-CT1HAjvR.js";import{L as LiveTokenizer,a as codeToTokens,i as isSupportedLanguage}from"./default-B6K4UlPD.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";import"./hastToHtml-C4ea9WpN.js";import"./index-C-yjveB4.js";var HighlightsEditorTokenizer=class{options;resolveOptions;#tokenizer;#version;#disposed=!1;#returnedRange;#paused=!1;#capturedLines;#pendingDelivery;constructor(options,resolveOptions){this.options=options,this.resolveOptions=resolveOptions,this.#version=options.textDocument.version,this.#tokenizer=this.#createTokenizer()}#createTokenizer(){return new LiveTokenizer({...this.resolveOptions({lang:this.options.textDocument.languageId,theme:this.options.theme,cssVariablePrefix:formatCSSVariablePrefix("token"),tokenizeMaxLineLength:this.options.tokenizeMaxLineLength??1e3}),code:this.options.textDocument.getText(),renderRange:[0,0],onDeferTokenize:lines=>this.#deliver(lines)})}#deliver(lines){const captured=this.#capturedLines;if(captured!=null){for(const[line,tokens]of lines)captured.set(line,tokens);return}const range=this.#returnedRange;if(range!=null){for(const line of lines.keys())line>=range[0]&&line<range[1]&&lines.delete(line);if(lines.size===0)return}this.options.onDeferTokenize(lines)}#queueDelivery(lines){const pending=this.#pendingDelivery;if(pending!=null){for(const[line,tokens]of lines)pending.set(line,tokens);return}this.#pendingDelivery=lines,queueMicrotask(()=>{const batch=this.#pendingDelivery;this.#pendingDelivery=void 0,batch!=null&&batch.size>0&&!this.#disposed&&this.options.onDeferTokenize(batch)})}tokenize(change,renderRange,hostRealignsRows=!1){const document=this.options.textDocument,start=Math.min(renderRange?.startingLine??0,document.lineCount),end=Math.min(start+(renderRange?.totalLines??1/0),document.lineCount),returnedStart=Math.max(start,change.startLine);this.#paused=!1;let lines;if(this.#version!==document.version)this.#pendingDelivery=void 0,lines=this.#syncDocument(change,[start,end]).lines,this.#version=document.version;else if(this.#tokenizer.lineCount!==document.lineCount)this.#pendingDelivery=void 0,lines=this.#tokenizer.reset(document.getText(),{renderRange:[start,end]}).lines;else{if(lines=new Map,this.#readLines(lines,returnedStart,end),this.#pendingDelivery!=null)for(const line of lines.keys())this.#pendingDelivery.delete(line);return lines}return(change.lineDelta===0?change.changedLineChanges?.some(([,,lineDelta])=>lineDelta!==0)??!1:!hostRealignsRows)&&this.#readLines(lines,returnedStart,end),lines}#syncDocument(change,renderRange){const document=this.options.textDocument,options={renderRange};if(Math.abs(document.version-this.#version)===1&&change.changes.length>0&&this.#tokenizer.lineCount===change.previousLineCount)try{const update=this.#tokenizer.applyEdits(change.changes.map(({range,text})=>({range,newText:text})),options);if(this.#tokenizer.lineCount===document.lineCount)return update}catch(error){if(!(error instanceof RangeError))throw error}return this.#tokenizer.reset(document.getText(),options)}#readLines(lines,from,to){this.#returnedRange=[from,to];try{this.#tokenizer.flush(to)}finally{this.#returnedRange=void 0}for(let line=from;line<to;line++){if(lines.has(line))continue;const{tokens}=this.#tokenizer.getLineTokens(line);lines.set(line,tokens.length===0?[[0,"",""]]:tokens.map(token=>[token.offset,token.color??"",token.content]))}}setTheme(themeName){themeName!==this.options.theme&&(this.options.theme=themeName,this.#tokenizer.dispose(),this.#pendingDelivery=void 0,this.#paused=!1,this.#version=this.options.textDocument.version,this.#tokenizer=this.#createTokenizer())}getStringCommentRegexpRangesInLine(lineIndex){const document=this.options.textDocument;if(this.options.matchBrackets===!1||lineIndex<0||lineIndex>=document.lineCount)return null;const captured=new Map;this.#capturedLines=captured;try{(this.#version!==document.version||this.#tokenizer.lineCount!==document.lineCount)&&(this.#pendingDelivery=void 0,this.#tokenizer.reset(document.getText(),{renderRange:[lineIndex,lineIndex+1]}),this.#version=document.version),this.#tokenizer.flush(lineIndex+1)}finally{this.#capturedLines=void 0,this.#paused&&this.#tokenizer.pause()}return captured.size>0&&this.#queueDelivery(captured),this.#tokenizer.getLineTokens(lineIndex).bracketIgnoredRanges}prebuildStateStack(){}stopBackgroundTokenize(){this.pauseBackgroundTokenize()}pauseBackgroundTokenize(){this.#paused=!0,this.#tokenizer.pause()}resumeBackgroundTokenize(){this.#paused=!1,this.#tokenizer.resume()}dispose(){this.#disposed=!0,this.#pendingDelivery=void 0,this.#tokenizer.dispose()}};const TRIM_LINE_COUNT=1024,DOCUMENT_START={line:0,character:0};var HighlightsStreamTokenizer=class HighlightsStreamTokenizer2 extends BaseStreamTokenizer{options;#tokenizer;#trimLineCount=TRIM_LINE_COUNT;constructor(options){super(),this.options=options,this.#tokenizer=new LiveTokenizer(options)}tokenizeChunk(chunk,stable){const lineBreaks=[...chunk.matchAll(/\r\n|\r|\n/g)],startLine=this.#tokenizer.lineCount-1,position={line:startLine,character:this.#tokenizer.getLineLength(startLine)};this.#tokenizer.applyEdits([{range:{start:position,end:position},newText:chunk}]);const lastLine=this.#tokenizer.lineCount-1;let unstable=[];for(let line=startLine;line<=lastLine;line++){const{tokens}=this.#tokenizer.getLineTokens(line);for(const token of tokens)token.offset+=this.stableOffset;line<lastLine?(appendItems(stable,tokens),this.pushLineBreak(stable,this.#tokenizer.getLineLength(line),lineBreaks[line-startLine][0])):unstable=tokens}const tailLength=this.#tokenizer.getLineLength(lastLine);if(lastLine>this.#trimLineCount){const text=this.#tokenizer.getText(),{lineChanges}=this.#tokenizer.applyEdits([{range:{start:DOCUMENT_START,end:{line:lastLine-1,character:0}},newText:""}]);if(lineChanges.every(change=>change.newEndLine<=1))this.#trimLineCount=TRIM_LINE_COUNT;else{const keptLength=this.#tokenizer.getText().length;this.#tokenizer.applyEdits([{range:{start:DOCUMENT_START,end:DOCUMENT_START},newText:text.slice(0,text.length-keptLength)}]),this.#trimLineCount=lastLine*2}}return{unstable,tailLength}}clone(){this.assertActive();const clone=new HighlightsStreamTokenizer2(this.options);return clone.#tokenizer.reset(this.#tokenizer.getText()),this.copyStateTo(clone),clone}resetSource(){this.#tokenizer.reset(""),this.#trimLineCount=TRIM_LINE_COUNT}releaseSource(){this.#tokenizer.dispose()}},HighlightsHighlighter=class extends DiffsHighlighter{usedThemes=new Map;constructor(){super("highlights",createDiffsThemeResolver("highlights"))}getTheme(name){this.assertNotDisposed();const theme=this.themeResolver.getResolvedTheme(name)??this.usedThemes.get(name);if(theme==null)throw new Error(`Theme "${name}" has not been resolved`);return this.usedThemes.set(name,theme),theme}codeToTokens(code,options){return this.assertNotDisposed(),codeToTokens(code,this.resolveOptions(options))}createEditorTokenizer(options){return this.assertNotDisposed(),new HighlightsEditorTokenizer(options,tokenizerOptions=>this.resolveOptions(tokenizerOptions))}createStreamTokenizer(options){return new HighlightsStreamTokenizer(this.resolveOptions(options))}loadLanguages(){return this.assertNotDisposed(),Promise.resolve()}hasLoadedLanguages(){return!this.disposed}attachLanguages(){this.assertNotDisposed()}releaseResources(){this.usedThemes.clear()}resolveOptions({theme,themes,...options}){const lang=isSupportedLanguage(options.lang)?options.lang:"text";if(theme!=null)return{...options,lang,theme:this.getZedTheme(theme)};if(themes==null)throw new Error("A theme or themes option is required");const resolved={};for(const[key,name]of Object.entries(themes))resolved[key]=this.getZedTheme(name);return{...options,lang,themes:resolved}}getZedTheme(name){const theme=this.getTheme(name);if(theme.zed==null)throw new Error(`Theme "${name}" does not support Highlights`);return theme.zed}};export{HighlightsHighlighter};
@@ -1,3 +1,3 @@
1
- import{i as isSupportedLanguage,c as codeToHtml}from"./default-B6K4UlPD.js";import{themes}from"./loader-DGyfh0zB.js";import"./kit-C9O_D5xC.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-BbPUgmX7.js";import"./vendor-editor-gVJMCtGz.js";const KEYWORDS=new Set(["graph","flowchart","flowchart-elk","sequenceDiagram","classDiagram","classDiagram-v2","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","mindmap","timeline","sankey-beta","xychart-beta","block-beta","packet-beta","kanban","architecture-beta","radar-beta","treemap-beta","C4Context","C4Container","C4Component","C4Dynamic","C4Deployment","TB","TD","BT","RL","LR","subgraph","end","direction","participant","actor","as","Note","note","over","left","right","of","loop","alt","else","opt","par","and","critical","break","rect","box","autonumber","activate","deactivate","create","destroy","title","section","dateFormat","axisFormat","tickInterval","excludes","includes","todayMarker","weekday","state","class","classDef","style","linkStyle","click","call","href","callback","namespace","accTitle","accDescr","showData","commit","branch","checkout","merge","cherry-pick","x-axis","y-axis","line","bar","quadrant-1","quadrant-2","quadrant-3","quadrant-4"]),ARROW=/(?:<<|<\||\|\||\}\||\|o|\}o|[<*|}])?(?:-{2,}|={2,}|-\.+-?|~{3,}|\.{2,}|-(?=>|x\b|\)))(?:>>|\|>|o\{|\|\{|o\||\|\||[>*)|{]|[ox]\b)?/y,WORD=/[A-Za-z_]\w*(?:-(?![-.>=x)])\w+)*/y,NUMBER=/\d+(?:\.\d+)?%?/y,SPACE=/\s+/y,CLASS_REF=/:::[\w-]+/y,CLOSER={"[":"]","(":")","{":"}","/":"/","\\":"\\",">":"]"};function at(re,line,i){re.lastIndex=i;const m=re.exec(line);return m&&m[0]?m[0]:null}function lexLine(line,out){const push=(text,kind)=>{text&&out.push({text,kind})};let i=0;for(;i<line.length;){const ch=line[i];if(line.startsWith("%%",i)){push(line.slice(i),"comment");return}const space=at(SPACE,line,i);if(space){push(space,"plain"),i+=space.length;continue}if(ch==='"'){const end=line.indexOf('"',i+1),stop=end<0?line.length:end+1;push(line.slice(i,stop),"string"),i=stop;continue}const classRef=at(CLASS_REF,line,i);if(classRef){push(classRef,"type"),i+=classRef.length;continue}const arrow=at(ARROW,line,i);if(arrow){push(arrow,"operator"),i+=arrow.length;continue}if(ch==="["||ch==="("||ch==="{"){let open=ch;for(;i+open.length<line.length&&"[({/\\".includes(line[i+open.length])&&open.length<3;)open+=line[i+open.length];const close=[...open].reverse().map(c=>CLOSER[c]).join(""),end=line.indexOf(close,i+open.length);if(push(open,"bracket"),end<0){push(line.slice(i+open.length),"string");return}push(line.slice(i+open.length,end),"string"),push(close,"bracket"),i=end+close.length;continue}if(ch==="|"){const end=line.indexOf("|",i+1);if(push("|","bracket"),end<0){push(line.slice(i+1),"string");return}push(line.slice(i+1,end),"string"),push("|","bracket"),i=end+1;continue}if(ch===":"){push(":","delimiter");const rest=line.slice(i+1);push(rest,/^\s*-?\d+(?:\.\d+)?%?\s*$/.test(rest)?"number":"string");return}const number=at(NUMBER,line,i);if(number){push(number,"number"),i+=number.length;continue}const word=at(WORD,line,i);if(word){push(word,KEYWORDS.has(word)?"keyword":"variable"),i+=word.length;continue}push(ch,ch===";"||ch===","||ch==="&"?"delimiter":"plain"),i+=1}}function tokenizeMermaid(code){const raw=[],lines=code.split(`
1
+ import{i as isSupportedLanguage,c as codeToHtml}from"./default-B6K4UlPD.js";import{themes}from"./loader-CPY9efuc.js";import"./kit-CD3F-f6F.js";import"./vendor-react-CxJ4vs-5.js";import"./vendor-motion-C2jPaSqL.js";import"./vendor-owxl31sT.js";import"./core-Cj89wpQh.js";import"./vendor-editor-gVJMCtGz.js";const KEYWORDS=new Set(["graph","flowchart","flowchart-elk","sequenceDiagram","classDiagram","classDiagram-v2","stateDiagram","stateDiagram-v2","erDiagram","journey","gantt","pie","quadrantChart","requirementDiagram","gitGraph","mindmap","timeline","sankey-beta","xychart-beta","block-beta","packet-beta","kanban","architecture-beta","radar-beta","treemap-beta","C4Context","C4Container","C4Component","C4Dynamic","C4Deployment","TB","TD","BT","RL","LR","subgraph","end","direction","participant","actor","as","Note","note","over","left","right","of","loop","alt","else","opt","par","and","critical","break","rect","box","autonumber","activate","deactivate","create","destroy","title","section","dateFormat","axisFormat","tickInterval","excludes","includes","todayMarker","weekday","state","class","classDef","style","linkStyle","click","call","href","callback","namespace","accTitle","accDescr","showData","commit","branch","checkout","merge","cherry-pick","x-axis","y-axis","line","bar","quadrant-1","quadrant-2","quadrant-3","quadrant-4"]),ARROW=/(?:<<|<\||\|\||\}\||\|o|\}o|[<*|}])?(?:-{2,}|={2,}|-\.+-?|~{3,}|\.{2,}|-(?=>|x\b|\)))(?:>>|\|>|o\{|\|\{|o\||\|\||[>*)|{]|[ox]\b)?/y,WORD=/[A-Za-z_]\w*(?:-(?![-.>=x)])\w+)*/y,NUMBER=/\d+(?:\.\d+)?%?/y,SPACE=/\s+/y,CLASS_REF=/:::[\w-]+/y,CLOSER={"[":"]","(":")","{":"}","/":"/","\\":"\\",">":"]"};function at(re,line,i){re.lastIndex=i;const m=re.exec(line);return m&&m[0]?m[0]:null}function lexLine(line,out){const push=(text,kind)=>{text&&out.push({text,kind})};let i=0;for(;i<line.length;){const ch=line[i];if(line.startsWith("%%",i)){push(line.slice(i),"comment");return}const space=at(SPACE,line,i);if(space){push(space,"plain"),i+=space.length;continue}if(ch==='"'){const end=line.indexOf('"',i+1),stop=end<0?line.length:end+1;push(line.slice(i,stop),"string"),i=stop;continue}const classRef=at(CLASS_REF,line,i);if(classRef){push(classRef,"type"),i+=classRef.length;continue}const arrow=at(ARROW,line,i);if(arrow){push(arrow,"operator"),i+=arrow.length;continue}if(ch==="["||ch==="("||ch==="{"){let open=ch;for(;i+open.length<line.length&&"[({/\\".includes(line[i+open.length])&&open.length<3;)open+=line[i+open.length];const close=[...open].reverse().map(c=>CLOSER[c]).join(""),end=line.indexOf(close,i+open.length);if(push(open,"bracket"),end<0){push(line.slice(i+open.length),"string");return}push(line.slice(i+open.length,end),"string"),push(close,"bracket"),i=end+close.length;continue}if(ch==="|"){const end=line.indexOf("|",i+1);if(push("|","bracket"),end<0){push(line.slice(i+1),"string");return}push(line.slice(i+1,end),"string"),push("|","bracket"),i=end+1;continue}if(ch===":"){push(":","delimiter");const rest=line.slice(i+1);push(rest,/^\s*-?\d+(?:\.\d+)?%?\s*$/.test(rest)?"number":"string");return}const number=at(NUMBER,line,i);if(number){push(number,"number"),i+=number.length;continue}const word=at(WORD,line,i);if(word){push(word,KEYWORDS.has(word)?"keyword":"variable"),i+=word.length;continue}push(ch,ch===";"||ch===","||ch==="&"?"delimiter":"plain"),i+=1}}function tokenizeMermaid(code){const raw=[],lines=code.split(`
2
2
  `);lines.forEach((line,n)=>{lexLine(line,raw),n<lines.length-1&&raw.push({text:`
3
3
  `,kind:"plain"})});const merged=[];for(const token of raw){const last=merged[merged.length-1];last&&last.kind===token.kind?last.text+=token.text:merged.push({...token})}return merged}const SCOPES={comment:["comment"],keyword:["keyword"],operator:["operator","keyword.operator","keyword"],string:["string"],number:["number","constant"],variable:["variable"],type:["type","title"],bracket:["punctuation.bracket","punctuation","operator"],delimiter:["punctuation.delimiter","punctuation","operator"]},COLOR=/^#[0-9a-f]{3,8}$/i;function scopeStyle(syntax,name){for(let scope=name;scope;scope=scope.includes(".")?scope.slice(0,scope.lastIndexOf(".")):""){const value=syntax[scope];if(value)return typeof value=="string"?{color:value}:value}}function css(settings){if(!settings)return"";const parts=[];return settings.color&&COLOR.test(settings.color)&&parts.push(`color:${settings.color}`),settings.font_style==="italic"&&parts.push("font-style:italic"),typeof settings.font_weight=="number"&&parts.push(`font-weight:${settings.font_weight}`),parts.join(";")}const escape=text=>text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function mermaidToHtml(code,theme){const style=theme.style,syntax=style.syntax??{},styles=new Map,styleOf=kind=>{let value=styles.get(kind);return value===void 0&&(value=kind==="plain"?"":css(SCOPES[kind].map(s=>scopeStyle(syntax,s)).find(Boolean)),styles.set(kind,value)),value},fg=[style["editor.foreground"],style.text,style.foreground].find(c=>typeof c=="string"&&COLOR.test(c)),body=tokenizeMermaid(code).map(({text,kind})=>{const s=styleOf(kind);return s?`<span style="${s}">${escape(text)}</span>`:escape(text)}).join("");return`<pre class="highlights"${fg?` style="color:${fg}"`:""}><code>${body}</code></pre>`}const loaded=new Map;function loadTheme(id){let theme=loaded.get(id);if(!theme){const load=Object.hasOwn(themes,id)?themes[id]:void 0;theme=load?load().then(m=>m.default).catch(()=>null):Promise.resolve(null),loaded.set(id,theme)}return theme}const decoder=new TextDecoder;async function highlightToHtml(code,lang,themeId){if(lang==="mermaid"||lang==="mmd"){const theme2=await loadTheme(themeId);return theme2?mermaidToHtml(code,theme2):null}if(!isSupportedLanguage(lang))return null;const theme=await loadTheme(themeId);return theme?decoder.decode(codeToHtml(code,{lang,theme})):null}export{highlightToHtml};