diffhub 0.1.1 → 0.1.2

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 (154) hide show
  1. package/.next/standalone/apps/web/.next/BUILD_ID +1 -1
  2. package/.next/standalone/apps/web/.next/build-manifest.json +3 -3
  3. package/.next/standalone/apps/web/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/apps/web/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/apps/web/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/apps/web/.next/server/app/_not-found/page.js +1 -1
  12. package/.next/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  15. package/.next/standalone/apps/web/.next/server/app/_not-found.rsc +16 -15
  16. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +16 -15
  17. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  18. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +5 -4
  19. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  20. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  21. package/.next/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/.next/standalone/apps/web/.next/server/app/api/comments/route.js +1 -1
  23. package/.next/standalone/apps/web/.next/server/app/api/comments/route.js.nft.json +1 -1
  24. package/.next/standalone/apps/web/.next/server/app/api/diff/route.js +2 -2
  25. package/.next/standalone/apps/web/.next/server/app/api/diff/route.js.nft.json +1 -1
  26. package/.next/standalone/apps/web/.next/server/app/api/discard/route.js +2 -2
  27. package/.next/standalone/apps/web/.next/server/app/api/discard/route.js.nft.json +1 -1
  28. package/.next/standalone/apps/web/.next/server/app/api/file/route.js +2 -2
  29. package/.next/standalone/apps/web/.next/server/app/api/file/route.js.nft.json +1 -1
  30. package/.next/standalone/apps/web/.next/server/app/api/files/route.js +2 -2
  31. package/.next/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -1
  32. package/.next/standalone/apps/web/.next/server/app/index.html +1 -1
  33. package/.next/standalone/apps/web/.next/server/app/index.rsc +15 -14
  34. package/.next/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  35. package/.next/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +15 -14
  36. package/.next/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +4 -4
  37. package/.next/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +5 -4
  38. package/.next/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  39. package/.next/standalone/apps/web/.next/server/app/page/react-loadable-manifest.json +2 -2
  40. package/.next/standalone/apps/web/.next/server/app/page.js +2 -2
  41. package/.next/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
  42. package/.next/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__05ejtyr._.js +3 -0
  44. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0e2dp4h._.js +3 -0
  45. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0egk6ui._.js +3 -0
  46. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0i6i-~n._.js +3 -0
  47. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0sv4hr9._.js +3 -0
  48. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0t.tl18._.js +3 -0
  49. package/.next/standalone/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__06b81~v._.js → [root-of-the-server]__0giwc4b._.js} +2 -2
  50. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0jit913._.js +3 -0
  51. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0v19a7g._.js +3 -0
  52. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0f40lcw._.js +3 -0
  53. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0oc3qg_._.js +3 -3
  54. package/.next/standalone/apps/web/.next/server/chunks/ssr/{apps_web_0b_ykcu._.js → _0qo42r0._.js} +2 -2
  55. package/.next/standalone/apps/web/.next/server/chunks/ssr/{apps_web_08kf15u._.js → apps_web_0758ax4._.js} +2 -2
  56. package/.next/standalone/apps/web/.next/server/chunks/ssr/node_modules_0v8w2j~._.js +70 -0
  57. package/.next/standalone/apps/web/.next/server/middleware-build-manifest.js +3 -3
  58. package/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
  59. package/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
  60. package/.next/standalone/apps/web/.next/server/server-reference-manifest.js +1 -1
  61. package/.next/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  62. package/.next/standalone/apps/web/.next/static/chunks/{0-ci0c9di0qo8.js → 00zp83w4g1v1r.js} +3 -3
  63. package/.next/standalone/apps/web/.next/static/chunks/042ip11u2i2z6.js +138 -0
  64. package/.next/standalone/apps/web/.next/static/chunks/085s9eg867ha-.js +1 -0
  65. package/.next/standalone/apps/web/.next/static/chunks/0_vmme_k_ff_u.js +67 -0
  66. package/.next/standalone/apps/web/.next/static/chunks/0ap~_hc7r17_6.js +1 -0
  67. package/.next/standalone/apps/web/.next/static/chunks/0nt5-rwas5thn.js +67 -0
  68. package/.next/standalone/apps/web/.next/static/chunks/0p~3-4_.v0cft.js +1 -0
  69. package/.next/standalone/apps/web/.next/static/chunks/0wx-2dr44ql-g.js +1 -0
  70. package/.next/standalone/apps/web/.next/static/chunks/{0syypqto3~pe_.js → 0y0o261rjun_2.js} +8 -8
  71. package/.next/standalone/apps/web/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
  72. package/.next/standalone/apps/web/.next/static/chunks/17b.xoi.b6rcl.js +1 -0
  73. package/.next/standalone/apps/web/.next/static/chunks/turbopack-0_n_4n~_4no2a.js +1 -0
  74. package/.next/standalone/apps/web/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
  75. package/.next/standalone/apps/web/.next/static/media/diffs.worker.09unk0quktc_5.ts +1 -0
  76. package/.next/standalone/apps/web/package.json +4 -4
  77. package/README.md +10 -3
  78. package/package.json +4 -4
  79. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__05vwx85._.js +0 -3
  80. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__09vmjc2._.js +0 -3
  81. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0etmu4u._.js +0 -3
  82. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0g-_a7n._.js +0 -3
  83. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0mshgfw._.js +0 -3
  84. package/.next/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0qixima._.js +0 -3
  85. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0f~hmsk._.js +0 -3
  86. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0khyzju._.js +0 -3
  87. package/.next/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0l2mjim._.js +0 -70
  88. package/.next/standalone/apps/web/.next/server/chunks/ssr/_0kwaklj._.js +0 -3
  89. package/.next/standalone/apps/web/.next/static/chunks/0.ae0sud8tm7k.js +0 -204
  90. package/.next/standalone/apps/web/.next/static/chunks/0di~ntk7iivm4.js +0 -1
  91. package/.next/standalone/apps/web/.next/static/chunks/0pklg0nmdvay8.js +0 -1
  92. package/.next/standalone/apps/web/.next/static/chunks/0up9_7hiwl_dt.js +0 -1
  93. package/.next/standalone/apps/web/.next/static/chunks/0~984a88e4rp9.js +0 -204
  94. package/.next/standalone/apps/web/.next/static/chunks/13y8355z8m13w.js +0 -1
  95. package/.next/standalone/apps/web/AGENTS.md +0 -60
  96. package/.next/standalone/apps/web/CHANGELOG.md +0 -7
  97. package/.next/standalone/apps/web/CLAUDE.md +0 -1
  98. package/.next/standalone/apps/web/README.md +0 -78
  99. package/.next/standalone/apps/web/app/api/comments/route.ts +0 -20
  100. package/.next/standalone/apps/web/app/api/diff/route.ts +0 -15
  101. package/.next/standalone/apps/web/app/api/discard/route.ts +0 -15
  102. package/.next/standalone/apps/web/app/api/file/route.ts +0 -17
  103. package/.next/standalone/apps/web/app/api/files/route.ts +0 -14
  104. package/.next/standalone/apps/web/app/api/open/route.ts +0 -64
  105. package/.next/standalone/apps/web/app/favicon.ico +0 -0
  106. package/.next/standalone/apps/web/app/globals.css +0 -214
  107. package/.next/standalone/apps/web/app/layout.tsx +0 -52
  108. package/.next/standalone/apps/web/app/page.tsx +0 -6
  109. package/.next/standalone/apps/web/bin/diffhub.mjs +0 -147
  110. package/.next/standalone/apps/web/components/ContextMenu.tsx +0 -161
  111. package/.next/standalone/apps/web/components/DiffApp.tsx +0 -419
  112. package/.next/standalone/apps/web/components/DiffViewer.tsx +0 -565
  113. package/.next/standalone/apps/web/components/FileDiffHeader.tsx +0 -119
  114. package/.next/standalone/apps/web/components/FileList.tsx +0 -455
  115. package/.next/standalone/apps/web/components/KeyboardShortcutsDialog.tsx +0 -79
  116. package/.next/standalone/apps/web/components/SidebarHelpMenu.tsx +0 -86
  117. package/.next/standalone/apps/web/components/StatusBar.tsx +0 -212
  118. package/.next/standalone/apps/web/components/icons/file-status-icons.tsx +0 -48
  119. package/.next/standalone/apps/web/components/theme-provider.tsx +0 -12
  120. package/.next/standalone/apps/web/components/ui/button.tsx +0 -90
  121. package/.next/standalone/apps/web/components/ui/empty.tsx +0 -82
  122. package/.next/standalone/apps/web/components/ui/input.tsx +0 -18
  123. package/.next/standalone/apps/web/components/ui/kbd.tsx +0 -14
  124. package/.next/standalone/apps/web/components/ui/separator.tsx +0 -23
  125. package/.next/standalone/apps/web/components/ui/sheet.tsx +0 -109
  126. package/.next/standalone/apps/web/components/ui/sidebar.tsx +0 -700
  127. package/.next/standalone/apps/web/components/ui/skeleton.tsx +0 -9
  128. package/.next/standalone/apps/web/components/ui/toggle.tsx +0 -35
  129. package/.next/standalone/apps/web/components/ui/tooltip.tsx +0 -52
  130. package/.next/standalone/apps/web/components.json +0 -27
  131. package/.next/standalone/apps/web/lib/comments.ts +0 -52
  132. package/.next/standalone/apps/web/lib/export-comments.ts +0 -13
  133. package/.next/standalone/apps/web/lib/git.ts +0 -201
  134. package/.next/standalone/apps/web/lib/use-mobile.ts +0 -19
  135. package/.next/standalone/apps/web/lib/utils.ts +0 -5
  136. package/.next/standalone/apps/web/next.config.ts +0 -19
  137. package/.next/standalone/apps/web/oxfmt.config.ts +0 -6
  138. package/.next/standalone/apps/web/oxlint.config.ts +0 -13
  139. package/.next/standalone/apps/web/postcss.config.mjs +0 -7
  140. package/.next/standalone/apps/web/public/file.svg +0 -1
  141. package/.next/standalone/apps/web/public/glide-variable-italic.woff2 +0 -0
  142. package/.next/standalone/apps/web/public/glide-variable.woff2 +0 -0
  143. package/.next/standalone/apps/web/public/globe.svg +0 -1
  144. package/.next/standalone/apps/web/public/next.svg +0 -1
  145. package/.next/standalone/apps/web/public/operator-mono-book-italic.woff2 +0 -0
  146. package/.next/standalone/apps/web/public/operator-mono-book.woff2 +0 -0
  147. package/.next/standalone/apps/web/public/operator-mono-medium-italic.woff2 +0 -0
  148. package/.next/standalone/apps/web/public/operator-mono-medium.woff2 +0 -0
  149. package/.next/standalone/apps/web/public/vercel.svg +0 -1
  150. package/.next/standalone/apps/web/public/window.svg +0 -1
  151. package/.next/standalone/apps/web/tsconfig.json +0 -34
  152. /package/.next/standalone/apps/web/.next/static/{ZhI_-YaFho-fQoajjgwSH → mAVCL4HCmtJwT35feBPdK}/_buildManifest.js +0 -0
  153. /package/.next/standalone/apps/web/.next/static/{ZhI_-YaFho-fQoajjgwSH → mAVCL4HCmtJwT35feBPdK}/_clientMiddlewareManifest.js +0 -0
  154. /package/.next/standalone/apps/web/.next/static/{ZhI_-YaFho-fQoajjgwSH → mAVCL4HCmtJwT35feBPdK}/_ssgManifest.js +0 -0
@@ -1,204 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,27101,e=>{"use strict";let t=Object.freeze({fromStart:0,fromEnd:0});e.s(["ALTERNATE_FILE_NAMES_GIT",0,/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,"COMMIT_METADATA_SPLIT",0,/(?=^From [a-f0-9]+ .+$)/m,"CORE_CSS_ATTRIBUTE",0,"data-core-css","CUSTOM_HEADER_SLOT_ID",0,"header-custom","DEFAULT_COLLAPSED_CONTEXT_THRESHOLD",0,1,"DEFAULT_EXPANDED_REGION",0,t,"DEFAULT_RENDER_RANGE",0,{startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},"DEFAULT_THEMES",0,{dark:"pierre-dark",light:"pierre-light"},"DEFAULT_VIRTUAL_FILE_METRICS",0,{hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,hunkSeparatorHeight:32,fileGap:8},"DIFFS_TAG_NAME",0,"diffs-container","EMPTY_RENDER_RANGE",0,{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},"FILENAME_HEADER_REGEX",0,/^(---|\+\+\+)\s+([^\t\r\n]+)/,"FILENAME_HEADER_REGEX_GIT",0,/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,"FILE_CONTEXT_BLOB",0,/(?=^@@ )/gm,"GIT_DIFF_FILE_BREAK_REGEX",0,/(?=^diff --git)/gm,"HEADER_METADATA_SLOT_ID",0,"header-metadata","HEADER_PREFIX_SLOT_ID",0,"header-prefix","HUNK_HEADER",0,/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?: (.*))?/m,"INDEX_LINE_METADATA",0,/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,"MERGE_CONFLICT_BASE_MARKER_REGEX",0,/^\|{7,}(?:\s.*)?$/,"MERGE_CONFLICT_END_MARKER_REGEX",0,/^>{7,}(?:\s.*)?$/,"MERGE_CONFLICT_SEPARATOR_MARKER_REGEX",0,/^={7,}$/,"MERGE_CONFLICT_START_MARKER_REGEX",0,/^<{7,}(?:\s.*)?$/,"SPLIT_WITH_NEWLINES",0,/(?<=\n)/,"THEME_CSS_ATTRIBUTE",0,"data-theme-css","UNIFIED_DIFF_FILE_BREAK_REGEX",0,/(?=^---\s+\S)/gm,"UNSAFE_CSS_ATTRIBUTE",0,"data-unsafe-css"])},2612,e=>{"use strict";e.s(["getLineAnnotationName",0,function(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}])},5096,e=>{"use strict";let t=new Set,n=new Set,i=null,r=!1;function o(e){for(let t of(r=!0,n))try{t(e)}catch(e){console.error(e)}n.clear(),t.size>0?(n=new Set(t),t.clear(),i=requestAnimationFrame(o)):i=null,r=!1}e.s(["queueRender",0,function(e){r?t.add(e):(n.add(e),i??=requestAnimationFrame(o))}])},29788,12543,21103,e=>{"use strict";var t=e.i(5096);function n(e,t){return null==e||null==t?e===t:e.top===t.top&&e.bottom===t.bottom}function i({scrollTop:e,scrollHeight:t,height:n,containerOffset:r=0,fitPerfectly:o,overscrollSize:a}){let s=n+2*a,l=o?n:s;if(s>=(t=Math.max(t,l))||o){let n=Math.max(e-r,0);return{top:n,bottom:Math.max(Math.min(e+l,t)-r,n)}}let d=e+n/2-s/2,u=d+s;return d<0&&(d=0),u>t&&(u=t),{top:d=Math.floor(Math.max(d-r,0)),bottom:Math.ceil(Math.max(Math.min(u,t)-r,d))}}e.s(["areVirtualWindowSpecsEqual",0,n],12543),e.s(["createWindowFromScrollPosition",0,i],21103);let r=[0,1e-6,.99999,1],o={overscrollSize:1e3,intersectionObserverMargin:4e3,resizeDebugging:!1},a=0,s=-1;var l=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++s}`;config;type="basic";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...o,...e}}setup(n,i){if(null==this.root){for(let[o,a]of(this.root=n,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:r,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),n instanceof Document?this.setupWindow():this.setupElement(i),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),(0,t.queueRender)(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)},this.connectQueue.entries()))this.connect(o,a);this.connectQueue.clear(),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)}}instanceChanged(e){this.instancesChanged.add(e),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)}getWindowSpecs(){return 0===this.windowSpecs.top&&0===this.windowSpecs.bottom&&(this.windowSpecs=i({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),i=this.getHeight(),r=this.config.intersectionObserverMargin;return!(e<n-r-t||e>n+i+r)}handleContainerResize=e=>{if(null==this.root)return;let n=!1;for(let t of e){let e=t.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:e-a,newSize:e}),a=e)):t.target===this.root?e!==this.height&&(this.heightDirty=!0,n=!0):t.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:e-a,newSize:e}),a=e))}n&&(0,t.queueRender)(this.computeRenderRangeAndEmit)};setupWindow(){if(null==this.root||!(this.root instanceof Document))throw Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(null==this.root||this.root instanceof Document)throw Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),(e??=this.root.firstElementChild??void 0)instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+d(e,this.getScrollContainerElement())}connect(e,n){if(this.observers.has(e))throw Error("Virtualizer.connect: instance is already connected...");return null==this.intersectionObserver?this.connectQueue.set(e,n):(this.intersectionObserver.observe(e),this.observers.set(e,n),this.instancesChanged.add(n),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let n=this.observers.get(e);this.connectQueue.delete(e),null!=n&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),(0,t.queueRender)(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&null!=this.root&&this.root instanceof Document&&(this.scrollDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||null==this.root||this.root instanceof Document||(this.scrollDirty=!0,(0,t.queueRender)(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let r=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;if(0===this.instancesChanged.size){let e=i({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),fitPerfectly:!1,overscrollSize:this.config.overscrollSize});if(n(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let o=this.getScrollAnchor(this.height),a=new Set;for(let e of r?this.observers.values():this.visibleInstances.values())e.onRender(r)&&a.add(e);for(let e of this.instancesChanged)!a.has(e)&&e.onRender(r)&&a.add(e);for(let e of(this.scrollFix(o),this.instancesChanged.size>0&&this.markDOMDirty(),a))e.reconcileHeights();(this.instancesChanged.size>0||r)&&(0,t.queueRender)(this.computeRenderRangeAndEmit),a.clear(),this.instancesChanged.clear()};scrollFix(e){if(null==e)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:i,fileElement:r,fileOffset:o,fileTypeOffset:a}=e;if(null!=n&&null!=i){let e=r.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=d(e,t);n!==i&&this.applyScrollFix(n-i);return}}let s=d(r,t);if("top"===a)s!==o&&this.applyScrollFix(s-o);else{let e=s+r.getBoundingClientRect().height;e!==o&&this.applyScrollFix(e-o)}}applyScrollFix(e){null==this.root||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(e){let t,n=this.getScrollContainerElement();for(let[i]of this.visibleInstances.entries()){let r,o,a,s,l=d(i,n),u=l+i.offsetHeight;if(u<=0?(r=u,o="bottom"):(r=l,o="top"),u>0&&l<e)for(let e of i.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(e instanceof HTMLElement))continue;let t=e.dataset.lineIndex;if(null==t)continue;let i=d(e,n);if(!(i<0)){a=t,s=i;break}}if(t?.lineOffset!=null&&null==s)continue;let h=!1;null==t||null!=s&&(null==t.lineOffset||s<t.lineOffset)?h=!0:null==s&&null==t.lineOffset&&(r>=0&&(t.fileOffset<0||r<t.fileOffset)?h=!0:r<0&&t.fileOffset<0&&r>t.fileOffset&&(h=!0)),h&&(t={fileElement:i,fileTypeOffset:o,fileOffset:r,lineIndex:a,lineOffset:s})}return t}handleIntersectionChange=e=>{for(let{target:t,isIntersecting:n}of(this.scrollDirty=!0,e)){if(!(t instanceof HTMLElement))throw Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");let e=this.observers.get(t);if(null==e)throw Error("Virtualizer.handleIntersectionChange: no instance for target");n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0)}this.visibleInstancesDirty&&(0,t.queueRender)(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=null==this.root?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty&&(this.scrollHeightDirty=!1,this.scrollHeight=null==this.root?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight),this.scrollHeight}getHeight(){return this.heightDirty&&(this.heightDirty=!1,this.height=null==this.root?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height),this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return null==this.root||this.root instanceof Document?void 0:this.root}};function d(e,t){let n=e.getBoundingClientRect(),i=t?.getBoundingClientRect().top??0;return n.top-i}e.s(["Virtualizer",0,l],29788)},39229,86309,e=>{"use strict";let t=new Map,n=new Map,i=new Map,r=new Set;e.s(["AttachedThemes",0,r,"RegisteredCustomThemes",0,i,"ResolvedThemes",0,t,"ResolvingThemes",0,n],86309),e.s(["attachResolvedThemes",0,function(e,n){for(let i of e=Array.isArray(e)?e:[e]){let e;if("string"==typeof i){if(null==(e=t.get(i)))throw Error(`loadResolvedThemes: ${i} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=i,i=i.name,t.has(i)||t.set(i,e);r.has(i)||(r.add(i),n.loadThemeSync(e))}}],39229)},22256,e=>{"use strict";let t=new Map,n=new Map,i=new Map,r=new Set;e.s(["AttachedLanguages",0,r,"RegisteredCustomLanguages",0,i,"ResolvedLanguages",0,t,"ResolvingLanguages",0,n])},64516,36304,49349,85892,6501,68806,e=>{"use strict";var t=e.i(22256);function n(){return"u">typeof WorkerGlobalScope&&"u">typeof self&&self instanceof WorkerGlobalScope}e.s(["attachResolvedLanguages",0,function(e,n){for(let i of e=Array.isArray(e)?e:[e]){if(t.AttachedLanguages.has(i.name))continue;let e=t.ResolvedLanguages.get(i.name);null==e&&(e=i,t.ResolvedLanguages.set(i.name,e)),t.AttachedLanguages.add(e.name),n.loadLanguageSync(e.data)}}],64516),e.s(["cleanUpResolvedLanguages",0,function(){t.ResolvedLanguages.clear(),t.AttachedLanguages.clear()}],36304),e.s(["isWorkerContext",0,n],49349);let i=[{id:"abap",name:"ABAP",import:()=>e.A(16690)},{id:"actionscript-3",name:"ActionScript",import:()=>e.A(74435)},{id:"ada",name:"Ada",import:()=>e.A(96339)},{id:"angular-html",name:"Angular HTML",import:()=>e.A(96546)},{id:"angular-ts",name:"Angular TypeScript",import:()=>e.A(60308)},{id:"apache",name:"Apache Conf",import:()=>e.A(8734)},{id:"apex",name:"Apex",import:()=>e.A(2952)},{id:"apl",name:"APL",import:()=>e.A(14026)},{id:"applescript",name:"AppleScript",import:()=>e.A(10042)},{id:"ara",name:"Ara",import:()=>e.A(27701)},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>e.A(64940)},{id:"asm",name:"Assembly",import:()=>e.A(81996)},{id:"astro",name:"Astro",import:()=>e.A(85223)},{id:"awk",name:"AWK",import:()=>e.A(77689)},{id:"ballerina",name:"Ballerina",import:()=>e.A(87861)},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>e.A(69047)},{id:"beancount",name:"Beancount",import:()=>e.A(66005)},{id:"berry",name:"Berry",aliases:["be"],import:()=>e.A(64129)},{id:"bibtex",name:"BibTeX",import:()=>e.A(86785)},{id:"bicep",name:"Bicep",import:()=>e.A(34475)},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:()=>e.A(73197)},{id:"blade",name:"Blade",import:()=>e.A(84291)},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>e.A(54810)},{id:"c",name:"C",import:()=>e.A(15630)},{id:"c3",name:"C3",import:()=>e.A(21406)},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>e.A(28418)},{id:"cairo",name:"Cairo",import:()=>e.A(96018)},{id:"clarity",name:"Clarity",import:()=>e.A(68805)},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>e.A(85670)},{id:"cmake",name:"CMake",import:()=>e.A(50277)},{id:"cobol",name:"COBOL",import:()=>e.A(8435)},{id:"codeowners",name:"CODEOWNERS",import:()=>e.A(77655)},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>e.A(93919)},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>e.A(99510)},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>e.A(14583)},{id:"coq",name:"Coq",import:()=>e.A(38305)},{id:"cpp",name:"C++",aliases:["c++"],import:()=>e.A(62895)},{id:"crystal",name:"Crystal",import:()=>e.A(15822)},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>e.A(56548)},{id:"css",name:"CSS",import:()=>e.A(68853)},{id:"csv",name:"CSV",import:()=>e.A(8072)},{id:"cue",name:"CUE",import:()=>e.A(79420)},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>e.A(1081)},{id:"d",name:"D",import:()=>e.A(32086)},{id:"dart",name:"Dart",import:()=>e.A(8814)},{id:"dax",name:"DAX",import:()=>e.A(6010)},{id:"desktop",name:"Desktop",import:()=>e.A(11671)},{id:"diff",name:"Diff",import:()=>e.A(99264)},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>e.A(64927)},{id:"dotenv",name:"dotEnv",import:()=>e.A(86855)},{id:"dream-maker",name:"Dream Maker",import:()=>e.A(55357)},{id:"edge",name:"Edge",import:()=>e.A(40814)},{id:"elixir",name:"Elixir",import:()=>e.A(34593)},{id:"elm",name:"Elm",import:()=>e.A(80402)},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>e.A(59962)},{id:"erb",name:"ERB",import:()=>e.A(55306)},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>e.A(79291)},{id:"fennel",name:"Fennel",import:()=>e.A(56334)},{id:"fish",name:"Fish",import:()=>e.A(55953)},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>e.A(72286)},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>e.A(9599)},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>e.A(17187)},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>e.A(6583)},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>e.A(350)},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>e.A(18592)},{id:"gdshader",name:"GDShader",import:()=>e.A(64292)},{id:"genie",name:"Genie",import:()=>e.A(51227)},{id:"gherkin",name:"Gherkin",import:()=>e.A(81674)},{id:"git-commit",name:"Git Commit Message",import:()=>e.A(65886)},{id:"git-rebase",name:"Git Rebase Message",import:()=>e.A(43635)},{id:"gleam",name:"Gleam",import:()=>e.A(69752)},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>e.A(20210)},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>e.A(52204)},{id:"glsl",name:"GLSL",import:()=>e.A(15932)},{id:"gn",name:"GN",import:()=>e.A(46517)},{id:"gnuplot",name:"Gnuplot",import:()=>e.A(34810)},{id:"go",name:"Go",import:()=>e.A(18233)},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>e.A(27502)},{id:"groovy",name:"Groovy",import:()=>e.A(83131)},{id:"hack",name:"Hack",import:()=>e.A(66363)},{id:"haml",name:"Ruby Haml",import:()=>e.A(36482)},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>e.A(19104)},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>e.A(82274)},{id:"haxe",name:"Haxe",import:()=>e.A(43593)},{id:"hcl",name:"HashiCorp HCL",import:()=>e.A(92582)},{id:"hjson",name:"Hjson",import:()=>e.A(32395)},{id:"hlsl",name:"HLSL",import:()=>e.A(36975)},{id:"html",name:"HTML",import:()=>e.A(15475)},{id:"html-derivative",name:"HTML (Derivative)",import:()=>e.A(36812)},{id:"http",name:"HTTP",import:()=>e.A(22332)},{id:"hurl",name:"Hurl",import:()=>e.A(77996)},{id:"hxml",name:"HXML",import:()=>e.A(12671)},{id:"hy",name:"Hy",import:()=>e.A(98975)},{id:"imba",name:"Imba",import:()=>e.A(21794)},{id:"ini",name:"INI",aliases:["properties"],import:()=>e.A(12237)},{id:"java",name:"Java",import:()=>e.A(28056)},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>e.A(92799)},{id:"jinja",name:"Jinja",import:()=>e.A(535)},{id:"jison",name:"Jison",import:()=>e.A(99868)},{id:"json",name:"JSON",import:()=>e.A(92658)},{id:"json5",name:"JSON5",import:()=>e.A(45390)},{id:"jsonc",name:"JSON with Comments",import:()=>e.A(59901)},{id:"jsonl",name:"JSON Lines",import:()=>e.A(44018)},{id:"jsonnet",name:"Jsonnet",import:()=>e.A(32597)},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>e.A(86493)},{id:"jsx",name:"JSX",import:()=>e.A(87672)},{id:"julia",name:"Julia",aliases:["jl"],import:()=>e.A(48045)},{id:"just",name:"Just",import:()=>e.A(4538)},{id:"kdl",name:"KDL",import:()=>e.A(22051)},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>e.A(78014)},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>e.A(11938)},{id:"latex",name:"LaTeX",import:()=>e.A(82697)},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>e.A(6774)},{id:"less",name:"Less",import:()=>e.A(57069)},{id:"liquid",name:"Liquid",import:()=>e.A(33954)},{id:"llvm",name:"LLVM IR",import:()=>e.A(69445)},{id:"log",name:"Log file",import:()=>e.A(32210)},{id:"logo",name:"Logo",import:()=>e.A(17136)},{id:"lua",name:"Lua",import:()=>e.A(47287)},{id:"luau",name:"Luau",import:()=>e.A(98173)},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>e.A(18877)},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>e.A(59142)},{id:"marko",name:"Marko",import:()=>e.A(44609)},{id:"matlab",name:"MATLAB",import:()=>e.A(23845)},{id:"mdc",name:"MDC",import:()=>e.A(67535)},{id:"mdx",name:"MDX",import:()=>e.A(59189)},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>e.A(57619)},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>e.A(1626)},{id:"mojo",name:"Mojo",import:()=>e.A(24176)},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>e.A(5353)},{id:"move",name:"Move",import:()=>e.A(47969)},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>e.A(55902)},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>e.A(57638)},{id:"nextflow-groovy",name:"nextflow-groovy",import:()=>e.A(72194)},{id:"nginx",name:"Nginx",import:()=>e.A(47723)},{id:"nim",name:"Nim",import:()=>e.A(46820)},{id:"nix",name:"Nix",import:()=>e.A(65220)},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>e.A(21908)},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>e.A(98543)},{id:"objective-cpp",name:"Objective-C++",import:()=>e.A(53213)},{id:"ocaml",name:"OCaml",import:()=>e.A(57016)},{id:"odin",name:"Odin",import:()=>e.A(144)},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>e.A(89188)},{id:"pascal",name:"Pascal",import:()=>e.A(94584)},{id:"perl",name:"Perl",import:()=>e.A(90087)},{id:"php",name:"PHP",import:()=>e.A(53525)},{id:"pkl",name:"Pkl",import:()=>e.A(6695)},{id:"plsql",name:"PL/SQL",import:()=>e.A(85641)},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>e.A(15520)},{id:"polar",name:"Polar",import:()=>e.A(79736)},{id:"postcss",name:"PostCSS",import:()=>e.A(44743)},{id:"powerquery",name:"PowerQuery",import:()=>e.A(69901)},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>e.A(49765)},{id:"prisma",name:"Prisma",import:()=>e.A(25840)},{id:"prolog",name:"Prolog",import:()=>e.A(78110)},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>e.A(10002)},{id:"pug",name:"Pug",aliases:["jade"],import:()=>e.A(53456)},{id:"puppet",name:"Puppet",import:()=>e.A(28116)},{id:"purescript",name:"PureScript",import:()=>e.A(62792)},{id:"python",name:"Python",aliases:["py"],import:()=>e.A(48436)},{id:"qml",name:"QML",import:()=>e.A(85774)},{id:"qmldir",name:"QML Directory",import:()=>e.A(22682)},{id:"qss",name:"Qt Style Sheets",import:()=>e.A(29273)},{id:"r",name:"R",import:()=>e.A(17431)},{id:"racket",name:"Racket",import:()=>e.A(27184)},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>e.A(2999)},{id:"razor",name:"ASP.NET Razor",import:()=>e.A(22510)},{id:"reg",name:"Windows Registry Script",import:()=>e.A(92914)},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>e.A(64980)},{id:"rel",name:"Rel",import:()=>e.A(62249)},{id:"riscv",name:"RISC-V",import:()=>e.A(19686)},{id:"ron",name:"RON",import:()=>e.A(23169)},{id:"rosmsg",name:"ROS Interface",import:()=>e.A(66973)},{id:"rst",name:"reStructuredText",import:()=>e.A(80357)},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>e.A(60137)},{id:"rust",name:"Rust",aliases:["rs"],import:()=>e.A(25837)},{id:"sas",name:"SAS",import:()=>e.A(59154)},{id:"sass",name:"Sass",import:()=>e.A(28160)},{id:"scala",name:"Scala",import:()=>e.A(79226)},{id:"scheme",name:"Scheme",import:()=>e.A(95554)},{id:"scss",name:"SCSS",import:()=>e.A(56229)},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>e.A(57294)},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>e.A(87646)},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>e.A(77876)},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>e.A(2789)},{id:"smalltalk",name:"Smalltalk",import:()=>e.A(5404)},{id:"solidity",name:"Solidity",import:()=>e.A(64050)},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>e.A(23766)},{id:"sparql",name:"SPARQL",import:()=>e.A(71095)},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>e.A(13125)},{id:"sql",name:"SQL",import:()=>e.A(47760)},{id:"ssh-config",name:"SSH Config",import:()=>e.A(25380)},{id:"stata",name:"Stata",import:()=>e.A(27772)},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>e.A(31592)},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>e.A(42509)},{id:"svelte",name:"Svelte",import:()=>e.A(9551)},{id:"swift",name:"Swift",import:()=>e.A(74099)},{id:"system-verilog",name:"SystemVerilog",import:()=>e.A(1250)},{id:"systemd",name:"Systemd Units",import:()=>e.A(44475)},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>e.A(538)},{id:"tasl",name:"Tasl",import:()=>e.A(36651)},{id:"tcl",name:"Tcl",import:()=>e.A(9948)},{id:"templ",name:"Templ",import:()=>e.A(40336)},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>e.A(8436)},{id:"tex",name:"TeX",import:()=>e.A(55636)},{id:"toml",name:"TOML",import:()=>e.A(51979)},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>e.A(65678)},{id:"tsv",name:"TSV",import:()=>e.A(41727)},{id:"tsx",name:"TSX",import:()=>e.A(57754)},{id:"turtle",name:"Turtle",import:()=>e.A(70454)},{id:"twig",name:"Twig",import:()=>e.A(24586)},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>e.A(48460)},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>e.A(44538)},{id:"typst",name:"Typst",aliases:["typ"],import:()=>e.A(63321)},{id:"v",name:"V",import:()=>e.A(43837)},{id:"vala",name:"Vala",import:()=>e.A(30536)},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>e.A(85051)},{id:"verilog",name:"Verilog",import:()=>e.A(86017)},{id:"vhdl",name:"VHDL",import:()=>e.A(95694)},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>e.A(4547)},{id:"vue",name:"Vue",import:()=>e.A(34329)},{id:"vue-html",name:"Vue HTML",import:()=>e.A(60550)},{id:"vue-vine",name:"Vue Vine",import:()=>e.A(109)},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>e.A(34235)},{id:"wasm",name:"WebAssembly",import:()=>e.A(79931)},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>e.A(38463)},{id:"wgsl",name:"WGSL",import:()=>e.A(64547)},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>e.A(74196)},{id:"wit",name:"WebAssembly Interface Types",import:()=>e.A(26245)},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>e.A(98654)},{id:"xml",name:"XML",import:()=>e.A(60115)},{id:"xsl",name:"XSL",import:()=>e.A(56841)},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>e.A(91412)},{id:"zenscript",name:"ZenScript",import:()=>e.A(41270)},{id:"zig",name:"Zig",import:()=>e.A(32344)}],r=Object.fromEntries(i.map(e=>[e.id,e.import])),o=Object.fromEntries(i.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),a={...r,...o};async function s(e){if(n())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let i=t.ResolvingLanguages.get(e);if(null!=i)return i;try{let n=t.RegisteredCustomLanguages.get(e);if(null==n&&Object.prototype.hasOwnProperty.call(a,e)&&(n=a[e]),null==n)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let i=n().then(({default:n})=>{let i={name:e,data:n};return t.ResolvedLanguages.has(e)||t.ResolvedLanguages.set(e,i),i});return t.ResolvingLanguages.set(e,i),await i}finally{t.ResolvingLanguages.delete(e)}}e.s(["bundledLanguages",0,a],85892),e.s(["resolveLanguage",0,s],6501),e.s(["getResolvedOrResolveLanguage",0,function(e){return t.ResolvedLanguages.get(e)??s(e)}],68806)},69046,61838,45546,91966,e=>{"use strict";var t,n,i=e.i(86309);e.s(["cleanUpResolvedThemes",0,function(){i.ResolvedThemes.clear(),i.AttachedThemes.clear()}],69046);let r=Object.fromEntries([{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>e.A(52913)},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>e.A(95208)},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>e.A(52844)},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>e.A(76488)},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>e.A(36002)},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>e.A(72934)},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>e.A(31036)},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>e.A(23803)},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>e.A(86330)},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>e.A(81001)},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>e.A(95735)},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>e.A(2100)},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>e.A(58172)},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>e.A(75274)},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>e.A(57811)},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>e.A(14214)},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>e.A(48353)},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>e.A(40920)},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>e.A(79755)},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>e.A(5550)},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>e.A(60233)},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>e.A(80721)},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>e.A(27266)},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>e.A(31214)},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>e.A(81110)},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>e.A(37683)},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>e.A(28130)},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>e.A(70579)},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:()=>e.A(87165)},{id:"houston",displayName:"Houston",type:"dark",import:()=>e.A(77856)},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>e.A(94363)},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>e.A(48953)},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>e.A(11812)},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>e.A(9732)},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>e.A(30788)},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>e.A(11374)},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>e.A(69460)},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>e.A(74478)},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>e.A(49008)},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>e.A(77952)},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>e.A(20463)},{id:"min-light",displayName:"Min Light",type:"light",import:()=>e.A(30169)},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>e.A(77035)},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>e.A(61439)},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>e.A(28589)},{id:"nord",displayName:"Nord",type:"dark",import:()=>e.A(67304)},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>e.A(94497)},{id:"one-light",displayName:"One Light",type:"light",import:()=>e.A(53619)},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>e.A(41717)},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>e.A(3232)},{id:"red",displayName:"Red",type:"dark",import:()=>e.A(69411)},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>e.A(53065)},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>e.A(81356)},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>e.A(91336)},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>e.A(58732)},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>e.A(5358)},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>e.A(53493)},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>e.A(67374)},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>e.A(61630)},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>e.A(35353)},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>e.A(29817)},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>e.A(66144)},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>e.A(96740)},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>e.A(96290)},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>e.A(61379)}].map(e=>[e.id,e.import]));e.s(["bundledThemes",0,r],61838),e.s(["ShikiError",0,class extends Error{constructor(e){super(e),this.name="ShikiError"}}],45546);var o=e.i(24062);function a(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}var s=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,l=class{static hasCaptures(e){return null!==e&&(s.lastIndex=0,s.test(e))}static replaceCaptures(e,t,n){return e.replace(s,(e,i,r,o)=>{let a=n[parseInt(i||r,10)];if(!a)return e;{let e=t.substring(a.start,a.end);for(;"."===e[0];)e=e.substring(1);switch(o){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}})}};function d(e,t){if(null===e&&null===t)return 0;if(!e)return -1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let i=0;i<n;i++){var r,o;let n=(r=e[i],r<(o=t[i])?-1:+(r>o));if(0!==n)return n}return 0}return n-i}function u(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function h(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var c=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},f=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let e=0,r=t.length;e<r;e++){let r,o=t[e];if(!o.settings)continue;if("string"==typeof o.scope){let e=o.scope;r=(e=(e=e.replace(/^[,]+/,"")).replace(/[,]+$/,"")).split(",")}else r=Array.isArray(o.scope)?o.scope:[""];let a=-1;if("string"==typeof o.settings.fontStyle){a=0;let e=o.settings.fontStyle.split(" ");for(let t=0,n=e.length;t<n;t++)switch(e[t]){case"italic":a|=1;break;case"bold":a|=2;break;case"underline":a|=4;break;case"strikethrough":a|=8}}let s=null;"string"==typeof o.settings.foreground&&u(o.settings.foreground)&&(s=o.settings.foreground);let l=null;"string"==typeof o.settings.background&&u(o.settings.background)&&(l=o.settings.background);for(let t=0,o=r.length;t<o;t++){let o=r[t].trim().split(" "),d=o[o.length-1],u=null;o.length>1&&(u=o.slice(0,o.length-1)).reverse(),n[i++]=new m(d,u,e,a,s,l)}}return n}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort((e,t)=>{var n,i;let r=(n=e.scope,n<(i=t.scope)?-1:+(n>i));return 0!==r||0!==(r=d(e.parentScopes,t.parentScopes))?r:e.index-t.index});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(i=t.foreground),null!==t.background&&(r=t.background)}let o=new v(t),a=new g(n,o.getId(i),o.getId(r)),s=new k(new C(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,o.getId(n.foreground),o.getId(n.background))}return new f(o,a,s)}(e,t)}_cachedMatchRoot=new c(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(null===e)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>(function(e,t){if(0===t.length)return!0;for(let r=0;r<t.length;r++){var n,i;let o=t[r],a=!1;if(">"===o){if(r===t.length-1)return!1;o=t[++r],a=!0}for(;e&&(n=e.scopeName,!((i=o)===n||n.startsWith(i)&&"."===n[i.length]));){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0})(e.parent,t.parentScopes));return n?new g(n.fontStyle,n.foreground,n.background):null}},p=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let i of n)t=new e(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new e(n,t[i]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(" ")}extends(e){return this===e||null!==this.parent&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}},g=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}},m=class{constructor(e,t,n,i,r,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=o}},b=((t=b||{})[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t),v=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(null===e)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},y=Object.freeze([]),C=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,i,r){this.scopeDepth=e,this.parentScopes=t||y,this.fontStyle=n,this.foreground=i,this.background=r}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==i&&(this.background=i)}},k=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,i=0;for(;">"===e.parentScopes[n]&&n++,">"===t.parentScopes[i]&&i++,!(n>=e.parentScopes.length)&&!(i>=t.parentScopes.length);){let r=t.parentScopes[i].length-e.parentScopes[n].length;if(0!==r)return r;n++,i++}return t.parentScopes.length-e.parentScopes.length}match(t){if(""!==t){let e,n,i=t.indexOf(".");if(-1===i?(e=t,n=""):(e=t.substring(0,i),n=t.substring(i+1)),this._children.hasOwnProperty(e))return this._children[e].match(n)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,i,r,o,a){let s,l,d;if(""===n)return void this._doInsertHere(t,i,r,o,a);let u=n.indexOf(".");-1===u?(s=n,l=""):(s=n.substring(0,u),l=n.substring(u+1)),this._children.hasOwnProperty(s)?d=this._children[s]:(d=new e(this._mainRule.clone(),C.cloneArr(this._rulesWithParentScopes)),this._children[s]=d),d.insert(t+1,l,i,r,o,a)}_doInsertHere(e,t,n,i,r){if(null===t)return void this._mainRule.acceptOverwrite(e,n,i,r);for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let a=this._rulesWithParentScopes[o];if(0===d(a.parentScopes,t))return void a.acceptOverwrite(e,n,i,r)}-1===n&&(n=this._mainRule.fontStyle),0===i&&(i=this._mainRule.foreground),0===r&&(r=this._mainRule.background),this._rulesWithParentScopes.push(new C(e,t,n,i,r))}},S=class e{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(t){let n=e.getLanguageId(t),i=e.getTokenType(t),r=e.getFontStyle(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:e.getForeground(t),background:e.getBackground(t)})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return(1024&e)!=0}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(0xff8000&e)>>>15}static getBackground(e){return(0xff000000&e)>>>24}static set(t,n,i,r,o,a,s){let l=e.getLanguageId(t),d=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),h=e.getFontStyle(t),c=e.getForeground(t),f=e.getBackground(t);return 0!==n&&(l=n),8!==i&&(d=i),null!==r&&(u=+!!r),-1!==o&&(h=o),0!==a&&(c=a),0!==s&&(f=s),(l|d<<8|u<<10|h<<11|c<<15|f<<24)>>>0}};function x(e,t){var n;let i,r,o=[],a=(n=e,r=(i=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(n),{next:()=>{if(!r)return null;let e=r[0];return r=i.exec(n),e}}),s=a.next();for(;null!==s;){let e=0;if(2===s.length&&":"===s.charAt(1)){switch(s.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=a.next()}let t=d();if(o.push({matcher:t,priority:e}),","!==s)break;s=a.next()}return o;function l(){if("-"===s){s=a.next();let e=l();return t=>!!e&&!e(t)}if("("===s){s=a.next();let e=function(){let e=[],t=d();for(;t&&(e.push(t),"|"===s||","===s);){do s=a.next();while("|"===s||","===s)t=d()}return t=>e.some(e=>e(t))}();return")"===s&&(s=a.next()),e}if(w(s)){let e=[];do e.push(s),s=a.next();while(w(s))return n=>t(e,n)}return null}function d(){let e=[],t=l();for(;t;)e.push(t),t=l();return t=>e.every(e=>e(t))}}function w(e){return!!e&&!!e.match(/[\w\.:]+/)}var A=((n=A||{})[n.None=0]="None",n[n.NotBeginString=1]="NotBeginString",n[n.NotEndString=2]="NotEndString",n[n.NotBeginPosition=4]="NotBeginPosition",n[n.DebugCall=8]="DebugCall",n);function L(e){"function"==typeof e.dispose&&e.dispose()}var E=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},T=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},I=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},R=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new E(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new I;for(let n of e)!function(e,t,n,i){let r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let o=n.lookup(t);e instanceof E?M({baseGrammar:o,selfGrammar:r},i):_(e.ruleName,{baseGrammar:o,selfGrammar:r,repository:r.repository},i);let a=n.injections(e.scopeName);if(a)for(let e of a)i.add(new E(e))}(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof E){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function _(e,t,n){t.repository&&t.repository[e]&&N([t.repository[e]],t,n)}function M(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&N(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&N(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function N(e,t,n){for(let i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);let e=i.repository?a({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&N(i.patterns,{...t,repository:e},n);let r=i.include;if(!r)continue;let o=B(r);switch(o.kind){case 0:M({...t,selfGrammar:t.baseGrammar},n);break;case 1:M(t,n);break;case 2:_(o.ruleName,{...t,repository:e},n);break;case 3:case 4:let s=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){let i={baseGrammar:t.baseGrammar,selfGrammar:s,repository:e};4===o.kind?_(o.ruleName,i,n):M(i,n)}else 4===o.kind?n.add(new T(o.scopeName,o.ruleName)):n.add(new E(o.scopeName))}}}var D=class{kind=0},P=class{kind=1},O=class{constructor(e){this.ruleName=e}kind=2},H=class{constructor(e){this.scopeName=e}kind=3},F=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function B(e){if("$base"===e)return new D;if("$self"===e)return new P;let t=e.indexOf("#");return -1===t?new H(e):0===t?new O(e.substring(1)):new F(e.substring(0,t),e.substring(t+1))}var U=/\\(\d+)/,$=/\\(\d+)/g;Symbol("RuleId");var G=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=l.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=l.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${function e(t){let n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(~n+1)}(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?l.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?l.replaceCaptures(this._contentName,e,t):this._contentName}},z=class extends G{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw Error("Not supported!")}compile(e,t){throw Error("Not supported!")}compileAG(e,t,n,i){throw Error("Not supported!")}},j=class extends G{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new K(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Q,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},W=class extends G{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Q,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},q=class extends G{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,o,a,s,l,d){super(e,t,n,i),this._begin=new K(r,this.id),this.beginCaptures=o,this._end=new K(a||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=l||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){for(let t of(this._cachedCompiledPatterns=new Q,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},V=class extends G{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,o,a,s,l){super(e,t,n,i),this._begin=new K(r,this.id),this.beginCaptures=o,this.whileCaptures=s,this._while=new K(a,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns)for(let t of(this._cachedCompiledPatterns=new Q,this.patterns))e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Q,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},X=class e{static createCaptureRule(e,t,n,i,r){return e.registerRule(e=>new z(t,e,n,i,r))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new j(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,i));if(void 0===t.begin){t.repository&&(i=a({},i,t.repository));let r=t.patterns;return void 0===r&&t.include&&(r=[{include:t.include}]),new W(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(r,n,i))}return t.while?new V(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,i),e._compilePatterns(t.patterns,n,i)):new q(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,e._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let o=0;for(let e in t){if("$vscodeTextmateLocation"===e)continue;let t=parseInt(e,10);t>o&&(o=t)}for(let e=0;e<=o;e++)r[e]=null;for(let o in t){if("$vscodeTextmateLocation"===o)continue;let a=parseInt(o,10),s=0;t[o].patterns&&(s=e.getCompiledRuleId(t[o],n,i)),r[a]=e.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,s)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let o=0,a=t.length;o<a;o++){let a=t[o],s=-1;if(a.include){let t=B(a.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(i[a.include],n,i);break;case 2:let r=i[t.ruleName];r&&(s=e.getCompiledRuleId(r,n,i));break;case 3:case 4:let o=t.scopeName,l=4===t.kind?t.ruleName:null,d=n.getExternalGrammar(o,i);if(d)if(l){let t=d.repository[l];t&&(s=e.getCompiledRuleId(t,n,d.repository))}else s=e.getCompiledRuleId(d.repository.$self,n,d.repository)}}else s=e.getCompiledRuleId(a,n,i);if(-1!==s){let e=n.getRule(s),t=!1;if((e instanceof W||e instanceof q||e instanceof V)&&e.hasMissingPatterns&&0===e.patterns.length&&(t=!0),t)continue;r.push(s)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},K=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&"string"==typeof e){const t=e.length;let n=0,i=[],r=!1;for(let o=0;o<t;o++)if("\\"===e.charAt(o)&&o+1<t){const t=e.charAt(o+1);"z"===t?(i.push(e.substring(n,o)),i.push("$(?!\\n)(?<!\\n)"),n=o+2):("A"===t||"G"===t)&&(r=!0),o++}this.hasAnchor=r,0===n?this.source=e:(i.push(e.substring(n,t)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,"string"==typeof this.source?this.hasBackReferences=U.test(this.source):this.hasBackReferences=!1}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let n=t.map(t=>e.substring(t.start,t.end));return $.lastIndex=0,this.source.replace($,(e,t)=>h(n[parseInt(t,10)]||""))}_buildAnchorCache(){let e,t,n,i;if("string"!=typeof this.source)throw Error("This method should only be called if the source is a string");let r=[],o=[],a=[],s=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),r[e]=n,o[e]=n,a[e]=n,s[e]=n,"\\"===n&&e+1<t&&("A"===(i=this.source.charAt(e+1))?(r[e+1]="￿",o[e+1]="￿",a[e+1]="A",s[e+1]="A"):"G"===i?(r[e+1]="￿",o[e+1]="G",a[e+1]="￿",s[e+1]="G"):(r[e+1]=i,o[e+1]=i,a[e+1]=i,s[e+1]=i),e++);return{A0_G0:r.join(""),A0_G1:o.join(""),A1_G0:a.join(""),A1_G1:s.join("")}}resolveAnchors(e,t){if(!this.hasAnchor||!this._anchorCache||"string"!=typeof this.source)return this.source;if(e)if(t)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;return t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Q=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Y(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){if(!this._hasAnchors)return this.compile(e);if(t)if(n)return this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1;else return this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0;return n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0)}_resolveAnchors(e,t,n){return new Y(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Y=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join("\n")}findNextMatchSync(e,t,n){let i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},J=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Z=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new J(e,8),this._embeddedLanguagesMatcher=new ee(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return null===t?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new J(0,0);_getBasicScopeAttributes=new c(e=>new J(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},ee=class{values;scopesRegExp;constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([e,t])=>h(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};void 0!==o.default&&o.default.env.VSCODE_TEXTMATE_DEBUG;var et=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function en(e,t,n,i,r,o,a,s){let l=t.content.length,d=!1,u=-1;if(a){let a=function(e,t,n,i,r,o){let a=r.beginRuleCapturedEOL?0:-1,s=[];for(let t=r;t;t=t.pop()){let n=t.getRule(e);n instanceof V&&s.push({rule:n,stack:t})}for(let f=s.pop();f;f=s.pop()){var l,d,u,h,c;let{ruleScanner:s,findOptions:p}=(l=f.rule,d=e,u=f.stack.endRule,h=n,c=i===a,{ruleScanner:l.compileWhileAG(d,u,h,c),findOptions:0}),g=s.findNextMatchSync(t,i,p);if(g){if(-2!==g.ruleId){r=f.stack.pop();break}g.captureIndices&&g.captureIndices.length&&(o.produce(f.stack,g.captureIndices[0].start),er(e,t,n,f.stack,o,f.rule.whileCaptures,g.captureIndices),o.produce(f.stack,g.captureIndices[0].end),a=g.captureIndices[0].end,g.captureIndices[0].end>i&&(i=g.captureIndices[0].end,n=!1))}else{r=f.stack.pop();break}}return{stack:r,linePos:i,anchorPosition:a,isFirstLine:n}}(e,t,n,i,r,o);r=a.stack,i=a.linePos,n=a.isFirstLine,u=a.anchorPosition}let h=Date.now();for(;!d;){if(0!==s&&Date.now()-h>s)return new et(r,!0);!function(){let a=function(e,t,n,i,r,o){let a=function(e,t,n,i,r,o){let{ruleScanner:a,findOptions:s}=ei(r.getRule(e),e,r.endRule,n,i===o),l=a.findNextMatchSync(t,i,s);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}(e,t,n,i,r,o),s=e.getInjections();if(0===s.length)return a;let l=function(e,t,n,i,r,o,a){let s,l=Number.MAX_VALUE,d=null,u=0,h=o.contentNameScopesList.getScopeNames();for(let o=0,c=e.length;o<c;o++){let c=e[o];if(!c.matcher(h))continue;let{ruleScanner:f,findOptions:p}=ei(t.getRule(c.ruleId),t,null,i,r===a),g=f.findNextMatchSync(n,r,p);if(!g)continue;let m=g.captureIndices[0].start;if(!(m>=l)&&(l=m,d=g.captureIndices,s=g.ruleId,u=c.priority,l===r))break}return d?{priorityMatch:-1===u,captureIndices:d,matchedRuleId:s}:null}(s,e,t,n,i,r,o);if(!l)return a;if(!a)return l;let d=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<d||l.priorityMatch&&u===d?l:a}(e,t,n,i,r,u);if(!a){o.produce(r,l),d=!0;return}let s=a.captureIndices,h=a.matchedRuleId,c=!!s&&s.length>0&&s[0].end>i;if(-1===h){let a=r.getRule(e);o.produce(r,s[0].start),r=r.withContentNameScopesList(r.nameScopesList),er(e,t,n,r,o,a.endCaptures,s),o.produce(r,s[0].end);let h=r;if(r=r.parent,u=h.getAnchorPos(),!c&&h.getEnterPos()===i){r=h,o.produce(r,l),d=!0;return}}else{let a=e.getRule(h);o.produce(r,s[0].start);let f=r,p=a.getName(t.content,s),g=r.contentNameScopesList.pushAttributed(p,e);if(r=r.push(h,i,u,s[0].end===l,null,g,g),a instanceof q){er(e,t,n,r,o,a.beginCaptures,s),o.produce(r,s[0].end),u=s[0].end;let i=a.getContentName(t.content,s),h=g.pushAttributed(i,e);if(r=r.withContentNameScopesList(h),a.endHasBackReferences&&(r=r.withEndRule(a.getEndWithResolvedBackReferences(t.content,s))),!c&&f.hasSameRuleAs(r)){r=r.pop(),o.produce(r,l),d=!0;return}}else if(a instanceof V){er(e,t,n,r,o,a.beginCaptures,s),o.produce(r,s[0].end),u=s[0].end;let i=a.getContentName(t.content,s),h=g.pushAttributed(i,e);if(r=r.withContentNameScopesList(h),a.whileHasBackReferences&&(r=r.withEndRule(a.getWhileWithResolvedBackReferences(t.content,s))),!c&&f.hasSameRuleAs(r)){r=r.pop(),o.produce(r,l),d=!0;return}}else if(er(e,t,n,r,o,a.captures,s),o.produce(r,s[0].end),r=r.pop(),!c){r=r.safePop(),o.produce(r,l),d=!0;return}}s[0].end>i&&(i=s[0].end,n=!1)}()}return new et(r,!1)}function ei(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function er(e,t,n,i,r,o,a){if(0===o.length)return;let s=t.content,l=Math.min(o.length,a.length),d=[],u=a[0].end;for(let t=0;t<l;t++){let l=o[t];if(null===l)continue;let h=a[t];if(0===h.length)continue;if(h.start>u)break;for(;d.length>0&&d[d.length-1].endPos<=h.start;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?r.produceFromScopes(d[d.length-1].scopes,h.start):r.produce(i,h.start),l.retokenizeCapturedWithRuleId){let t=l.getName(s,a),o=i.contentNameScopesList.pushAttributed(t,e),d=l.getContentName(s,a),u=o.pushAttributed(d,e),c=i.push(l.retokenizeCapturedWithRuleId,h.start,-1,!1,null,o,u),f=e.createOnigString(s.substring(0,h.end));en(e,f,n&&0===h.start,h.start,c,r,!1,0),L(f);continue}let c=l.getName(s,a);if(null!==c){let t=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(c,e);d.push(new eo(t,h.end))}}for(;d.length>0;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var eo=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ea(e,t,n,i,r){let o=x(t,es),a=X.getCompiledRuleId(n,i,r.repository);for(let n of o)e.push({debugSelector:t,matcher:n.matcher,ruleId:a,grammar:r,priority:n.priority})}function es(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let i=n;i<t.length;i++)if(function(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}(t[i],e))return n=i+1,!0;return!1})}var el=class{constructor(e,t,n,i,r,o,a,s){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=s,this._basicScopeAttributesProvider=new Z(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=ed(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const e of Object.keys(r))for(const t of x(e,es))this._tokenTypeMatchers.push({matcher:t.matcher,type:r[e]})}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e=[],t=this._rootScopeName,n=({lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)}).lookup(t);if(n){let i=n.injections;if(i)for(let t in i)ea(e,t,i[t],this,n);let r=this._grammarRepository.injections(t);r&&r.forEach(t=>{let n=this.getExternalGrammar(t);if(n){let t=n.injectionSelector;t&&ea(e,t,n,this,n)}})}return e.sort((e,t)=>e.priority-t.priority),e}getInjections(){return null===this._injections&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=ed(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){let i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){let r;if(-1===this._rootId&&(this._rootId=X.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==eh.NULL)r=!1,t.reset();else{let e;r=!0;let n=this._basicScopeAttributesProvider.getDefaultAttributes(),i=this.themeProvider.getDefaults(),o=S.set(0,n.languageId,n.tokenType,null,i.fontStyle,i.foregroundId,i.backgroundId),a=this.getRule(this._rootId).getName(null,null);e=a?eu.createRootAndLookUpScopeName(a,o,this):eu.createRoot("unknown",o),t=new eh(null,this._rootId,-1,-1,!1,null,e,e)}e+="\n";let o=this.createOnigString(e),a=o.content.length,s=new ef(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=en(this,o,r,0,t,s,!0,i);return L(o),{lineLength:a,lineTokens:s,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function ed(e,t){return(e=function e(t){return Array.isArray(t)?function(t){let n=[];for(let i=0,r=t.length;i<r;i++)n[i]=e(t[i]);return n}(t):t instanceof RegExp?t:"object"==typeof t?function(t){let n={};for(let i in t)n[i]=e(t[i]);return n}(t):t}(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var eu=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(let t of n)i=new e(i,r=p.push(r,t.scopeNames),t.encodedTokenAttributes);return i}static createRoot(t,n){return new e(null,new p(null,t),n)}static createRootAndLookUpScopeName(t,n,i){let r=i.getMetadataForScope(t),o=new p(null,t),a=i.themeProvider.themeMatch(o),s=e.mergeAttributes(n,r,a);return new e(null,o,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return e.equals(this,t)}static equals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let i=-1,r=0,o=0;return null!==n&&(i=n.fontStyle,r=n.foregroundId,o=n.backgroundId),S.set(e,t.languageId,t.tokenType,null,i,r,o)}pushAttributed(t,n){if(null===t)return this;if(-1===t.indexOf(" "))return e._pushAttributed(this,t,n);let i=t.split(/ /g),r=this;for(let t of i)r=e._pushAttributed(r,t,n);return r}static _pushAttributed(t,n,i){let r=i.getMetadataForScope(n),o=t.scopePath.push(n),a=i.themeProvider.themeMatch(o),s=e.mergeAttributes(t.tokenAttributes,r,a);return new e(t,o,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},eh=class e{constructor(e,t,n,i,r,o,a,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=r,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return null!==t&&e._equals(this,t)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&eu.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,o,a,s){return new e(this,t,n,i,r,o,a,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let i=eu.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,eu.fromExtension(i,n.contentNameScopesList))}},ec=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>"*"===e?(this.allowAny=!0,[]):x(e,es).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>x(e,es).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ef=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=S.set(n,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}if(i&&(n=S.set(n,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},ep=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,new el(e,o,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},eg=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new ep(f.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(f.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ec(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,i,r){let o=new R(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(e=>this._loadSingleGrammar(e.scopeName)),o.processQueue();return this._grammarForScopeName(e,t,n,i,r)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,i=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,i)}_grammarForScopeName(e,t=0,n=null,i=null,r=null){return this._syncRegistry.grammarForScopeName(e,t,n,i,r)}},em=eh.NULL;e.s(["EncodedTokenMetadata",0,S,"FontStyle",0,b,"INITIAL",0,em,"Registry",0,eg,"Theme",0,f],91966)},27118,e=>{"use strict";let t,n=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class i{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function r(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new i(n,r,t)}function o(e){return e.toLowerCase()}i.prototype.normal={},i.prototype.property={},i.prototype.space=void 0;class a{constructor(e,t){this.attribute=t,this.property=e}}a.prototype.attribute="",a.prototype.booleanish=!1,a.prototype.boolean=!1,a.prototype.commaOrSpaceSeparated=!1,a.prototype.commaSeparated=!1,a.prototype.defined=!1,a.prototype.mustUseProperty=!1,a.prototype.number=!1,a.prototype.overloadedBoolean=!1,a.prototype.property="",a.prototype.spaceSeparated=!1,a.prototype.space=void 0;let s=0,l=g(),d=g(),u=g(),h=g(),c=g(),f=g(),p=g();function g(){return 2**++s}e.s(["boolean",0,l,"booleanish",0,d,"commaOrSpaceSeparated",0,p,"commaSeparated",0,f,"number",0,h,"overloadedBoolean",0,u,"spaceSeparated",0,c],744);var m=e.i(744);let b=Object.keys(m);class v extends a{constructor(e,t,n,i){let r=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",i),"number"==typeof n)for(;++r<b.length;){const e=b[r];!function(e,t,n){n&&(e[t]=n)}(this,b[r],(n&m[e])===m[e])}}}function y(e){let t={},n={};for(let[i,r]of Object.entries(e.properties)){let a=new v(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[o(i)]=i,n[o(a.attribute)]=i}return new i(t,n,e.space)}v.prototype.defined=!0;let C=y({properties:{ariaActiveDescendant:null,ariaAtomic:d,ariaAutoComplete:null,ariaBusy:d,ariaChecked:d,ariaColCount:h,ariaColIndex:h,ariaColSpan:h,ariaControls:c,ariaCurrent:null,ariaDescribedBy:c,ariaDetails:null,ariaDisabled:d,ariaDropEffect:c,ariaErrorMessage:null,ariaExpanded:d,ariaFlowTo:c,ariaGrabbed:d,ariaHasPopup:null,ariaHidden:d,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:c,ariaLevel:h,ariaLive:null,ariaModal:d,ariaMultiLine:d,ariaMultiSelectable:d,ariaOrientation:null,ariaOwns:c,ariaPlaceholder:null,ariaPosInSet:h,ariaPressed:d,ariaReadOnly:d,ariaRelevant:null,ariaRequired:d,ariaRoleDescription:c,ariaRowCount:h,ariaRowIndex:h,ariaRowSpan:h,ariaSelected:d,ariaSetSize:h,ariaSort:null,ariaValueMax:h,ariaValueMin:h,ariaValueNow:h,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function k(e,t){return t in e?e[t]:t}function S(e,t){return k(e,t.toLowerCase())}let x=y({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f,acceptCharset:c,accessKey:c,action:null,allow:null,allowFullScreen:l,allowPaymentRequest:l,allowUserMedia:l,alt:null,as:null,async:l,autoCapitalize:null,autoComplete:c,autoFocus:l,autoPlay:l,blocking:c,capture:null,charSet:null,checked:l,cite:null,className:c,cols:h,colSpan:null,content:null,contentEditable:d,controls:l,controlsList:c,coords:h|f,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l,defer:l,dir:null,dirName:null,disabled:l,download:u,draggable:d,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l,formTarget:null,headers:c,height:h,hidden:u,high:h,href:null,hrefLang:null,htmlFor:c,httpEquiv:c,id:null,imageSizes:null,imageSrcSet:null,inert:l,inputMode:null,integrity:null,is:null,isMap:l,itemId:null,itemProp:c,itemRef:c,itemScope:l,itemType:c,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l,low:h,manifest:null,max:null,maxLength:h,media:null,method:null,min:null,minLength:h,multiple:l,muted:l,name:null,nonce:null,noModule:l,noValidate:l,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:l,optimum:h,pattern:null,ping:c,placeholder:null,playsInline:l,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l,referrerPolicy:null,rel:c,required:l,reversed:l,rows:h,rowSpan:h,sandbox:c,scope:null,scoped:l,seamless:l,selected:l,shadowRootClonable:l,shadowRootDelegatesFocus:l,shadowRootMode:null,shape:null,size:h,sizes:null,slot:null,span:h,spellCheck:d,src:null,srcDoc:null,srcLang:null,srcSet:null,start:h,step:null,style:null,tabIndex:h,target:null,title:null,translate:null,type:null,typeMustMatch:l,useMap:null,value:d,width:h,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:c,axis:null,background:null,bgColor:null,border:h,borderColor:null,bottomMargin:h,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l,declare:l,event:null,face:null,frame:null,frameBorder:null,hSpace:h,leftMargin:h,link:null,longDesc:null,lowSrc:null,marginHeight:h,marginWidth:h,noResize:l,noHref:l,noShade:l,noWrap:l,object:null,profile:null,prompt:null,rev:null,rightMargin:h,rules:null,scheme:null,scrolling:d,standby:null,summary:null,text:null,topMargin:h,valueType:null,version:null,vAlign:null,vLink:null,vSpace:h,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l,disableRemotePlayback:l,prefix:null,property:null,results:h,security:null,unselectable:null},space:"html",transform:S}),w=y({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:p,accentHeight:h,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:h,amplitude:h,arabicForm:null,ascent:h,attributeName:null,attributeType:null,azimuth:h,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:h,by:null,calcMode:null,capHeight:h,className:c,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:h,diffuseConstant:h,direction:null,display:null,dur:null,divisor:h,dominantBaseline:null,download:l,dx:null,dy:null,edgeMode:null,editable:null,elevation:h,enableBackground:null,end:null,event:null,exponent:h,externalResourcesRequired:null,fill:null,fillOpacity:h,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:f,g2:f,glyphName:f,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:h,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:h,horizOriginX:h,horizOriginY:h,id:null,ideographic:h,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:h,k:h,k1:h,k2:h,k3:h,k4:h,kernelMatrix:p,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:h,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:h,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:h,overlineThickness:h,paintOrder:null,panose1:null,path:null,pathLength:h,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:c,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:h,pointsAtY:h,pointsAtZ:h,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:p,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:p,rev:p,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:p,requiredFeatures:p,requiredFonts:p,requiredFormats:p,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:h,specularExponent:h,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:h,strikethroughThickness:h,string:null,stroke:null,strokeDashArray:p,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:h,strokeOpacity:h,strokeWidth:null,style:null,surfaceScale:h,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:p,tabIndex:h,tableValues:null,target:null,targetX:h,targetY:h,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:p,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:h,underlineThickness:h,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:h,values:null,vAlphabetic:h,vMathematical:h,vectorEffect:null,vHanging:h,vIdeographic:h,version:null,vertAdvY:h,vertOriginX:h,vertOriginY:h,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:h,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:k}),A=y({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),L=y({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S}),E=y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),T=r([C,x,A,L,E],"html"),I=r([C,w,A,L,E],"svg"),R={}.hasOwnProperty,_=/["&'<>`]/g,M=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,N=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,D=/[|\\{}()[\]^$+*?.]/g,P=new WeakMap,O=/[\dA-Fa-f]/,H=/\d/,F=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],B={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},U=["cent","copy","divide","gt","lt","not","para","times"],$={}.hasOwnProperty,G={};for(t in B)$.call(B,t)&&(G[B[t]]=t);let z=/[^\dA-Za-z]/;function j(e,t,n){var i,r;let o,a,s=(i=n.omitOptionalSemicolons,o="&#x"+e.toString(16).toUpperCase(),i&&t&&!O.test(String.fromCharCode(t))?o:o+";");if((n.useNamedReferences||n.useShortestReferences)&&(a=function(e,t,n,i){let r=String.fromCharCode(e);if($.call(G,r)){let e=G[r],o="&"+e;return n&&F.includes(e)&&!U.includes(e)&&(!i||t&&61!==t&&z.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let i,o=(r=n.omitOptionalSemicolons,i="&#"+String(e),r&&t&&!H.test(String.fromCharCode(t))?i:i+";");o.length<s.length&&(s=o)}return a&&(!n.useShortestReferences||a.length<s.length)?a:s}function W(e,t){let n;var i,r=e,o=Object.assign({format:j},t);if(r=r.replace(o.subset?(i=o.subset,(n=P.get(i))||(n=function(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(D,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}(i),P.set(i,n)),n):_,a),o.subset||o.escapeOnly)return r;return r.replace(M,function(e,t,n){return o.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,n.charCodeAt(t+2),o)}).replace(N,a);function a(e,t,n){return o.format(e.charCodeAt(0),n.charCodeAt(t+1),o)}}let q=/^>|^->|<!--|-->|--!>|<!-$/g,V=[">"],X=["<",">"];function K(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let i=0,r=n.indexOf(t);for(;-1!==r;)i++,r=n.indexOf(t,r+t.length);return i}let Q=/[A-Z]/g,Y=/-[a-z]/g,J=/^data[-\w.:]+$/i;function Z(e){return"-"+e.toLowerCase()}function ee(e){return e.charAt(1).toUpperCase()}let et=/[ \t\n\f\r]/g;function en(e){return"object"==typeof e?"text"===e.type&&ei(e.value):ei(e)}function ei(e){return""===e.replace(et,"")}let er=es(1),eo=es(-1),ea=[];function es(e){return function(t,n,i){let r=t?t.children:ea,o=(n||0)+e,a=r[o];if(!i)for(;a&&en(a);)o+=e,a=r[o];return a}}let el={}.hasOwnProperty;function ed(e){return function(t,n,i){return el.call(e,t.tagName)&&e[t.tagName](t,n,i)}}let eu=ed({body:function(e,t,n){let i=er(n,t);return!i||"comment"!==i.type},caption:eh,colgroup:eh,dd:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName)},dt:function(e,t,n){let i=er(n,t);return!!(i&&"element"===i.type&&("dt"===i.tagName||"dd"===i.tagName))},head:eh,html:function(e,t,n){let i=er(n,t);return!i||"comment"!==i.type},li:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&"li"===i.tagName},optgroup:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&"optgroup"===i.tagName},option:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&("option"===i.tagName||"optgroup"===i.tagName)},p:function(e,t,n){let i=er(n,t);return i?"element"===i.type&&("address"===i.tagName||"article"===i.tagName||"aside"===i.tagName||"blockquote"===i.tagName||"details"===i.tagName||"div"===i.tagName||"dl"===i.tagName||"fieldset"===i.tagName||"figcaption"===i.tagName||"figure"===i.tagName||"footer"===i.tagName||"form"===i.tagName||"h1"===i.tagName||"h2"===i.tagName||"h3"===i.tagName||"h4"===i.tagName||"h5"===i.tagName||"h6"===i.tagName||"header"===i.tagName||"hgroup"===i.tagName||"hr"===i.tagName||"main"===i.tagName||"menu"===i.tagName||"nav"===i.tagName||"ol"===i.tagName||"p"===i.tagName||"pre"===i.tagName||"section"===i.tagName||"table"===i.tagName||"ul"===i.tagName):!n||"element"!==n.type||"a"!==n.tagName&&"audio"!==n.tagName&&"del"!==n.tagName&&"ins"!==n.tagName&&"map"!==n.tagName&&"noscript"!==n.tagName&&"video"!==n.tagName},rp:ec,rt:ec,tbody:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName)},td:ef,tfoot:function(e,t,n){return!er(n,t)},th:ef,thead:function(e,t,n){let i=er(n,t);return!!(i&&"element"===i.type&&("tbody"===i.tagName||"tfoot"===i.tagName))},tr:function(e,t,n){let i=er(n,t);return!i||"element"===i.type&&"tr"===i.tagName}});function eh(e,t,n){let i=er(n,t,!0);return!i||"comment"!==i.type&&!("text"===i.type&&en(i.value.charAt(0)))}function ec(e,t,n){let i=er(n,t);return!i||"element"===i.type&&("rp"===i.tagName||"rt"===i.tagName)}function ef(e,t,n){let i=er(n,t);return!i||"element"===i.type&&("td"===i.tagName||"th"===i.tagName)}let ep=ed({body:function(e){let t=er(e,-1,!0);return!t||"comment"!==t.type&&!("text"===t.type&&en(t.value.charAt(0)))&&("element"!==t.type||"meta"!==t.tagName&&"link"!==t.tagName&&"script"!==t.tagName&&"style"!==t.tagName&&"template"!==t.tagName)},colgroup:function(e,t,n){let i=eo(n,t),r=er(e,-1,!0);return!(n&&i&&"element"===i.type&&"colgroup"===i.tagName&&eu(i,n.children.indexOf(i),n))&&!!(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){let t=new Set;for(let n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||"element"===n.type},html:function(e){let t=er(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){let i=eo(n,t),r=er(e,-1);return!(n&&i&&"element"===i.type&&("thead"===i.tagName||"tbody"===i.tagName)&&eu(i,n.children.indexOf(i),n))&&!!(r&&"element"===r.type&&"tr"===r.tagName)}}),eg={name:[[" \n\f\r &/=>".split("")," \n\f\r \"&'/=>`".split("")],["\0 \n\f\r \"&'/<=>".split(""),"\0 \n\f\r \"&'/<=>`".split("")]],unquoted:[[" \n\f\r &>".split(""),"\0 \n\f\r \"&'<=>`".split("")],["\0 \n\f\r \"&'<=>`".split(""),"\0 \n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},em=["<","&"];function eb(e,t,n,i){return n&&"element"===n.type&&("script"===n.tagName||"style"===n.tagName)?e.value:W(e.value,Object.assign({},i.settings.characterReferences,{subset:em}))}let ev=function(e,t){let n=t||{};function i(t,...n){let r=i.invalid,o=i.handlers;if(t&&R.call(t,e)){let n=String(t[e]);r=R.call(o,n)?o[n]:i.unknown}if(r)return r.call(this,t,...n)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}("type",{invalid:function(e){throw Error("Expected node, not `"+e+"`")},unknown:function(e){throw Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,i){return i.settings.bogusComments?"<?"+W(e.value,Object.assign({},i.settings.characterReferences,{subset:V}))+">":"<!--"+e.value.replace(q,function(e){return W(e,Object.assign({},i.settings.characterReferences,{subset:X}))})+"-->"},doctype:function(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,i){let r,s=i.schema,l="svg"!==s.space&&i.settings.omitOptionalTags,d="svg"===s.space?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase()),u=[];"html"===s.space&&"svg"===e.tagName&&(i.schema=I);let h=function(e,t){let n,i=[],r=-1;if(t){for(n in t)if(null!==t[n]&&void 0!==t[n]){let r=function(e,t,n){let i,r=function(e,t){let n=o(t),i=t,r=a;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&J.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(Y,ee);i="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Y.test(e)){let n=e.replace(Q,Z);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}r=v}return new r(i,t)}(e.schema,t),s=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,l=+!e.settings.allowDangerousCharacters,d=e.quote;if(r.overloadedBoolean&&(n===r.attribute||""===n)?n=!0:(r.boolean||r.overloadedBoolean)&&("string"!=typeof n||n===r.attribute||""===n)&&(n=!!n),null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";let u=W(r.attribute,Object.assign({},e.settings.characterReferences,{subset:eg.name[s][l]}));return!0===n||(n=Array.isArray(n)?(r.commaSeparated?function(e,t){let n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}:function(e){return e.join(" ").trim()})(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?u:(e.settings.preferUnquoted&&(i=W(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:eg.unquoted[s][l]}))),i!==n&&(e.settings.quoteSmart&&K(n,d)>K(n,e.alternative)&&(d=e.alternative),i=d+W(n,Object.assign({},e.settings.characterReferences,{subset:("'"===d?eg.single:eg.double)[s][l],attribute:!0}))+d),u+(i?"="+i:i))}(e,n,t[n]);r&&i.push(r)}}for(;++r<i.length;){let t=e.settings.tightAttributes?i[r].charAt(i[r].length-1):void 0;r!==i.length-1&&'"'!==t&&"'"!==t&&(i[r]+=" ")}return i.join("")}(i,e.properties),c=i.all("html"===s.space&&"template"===e.tagName?e.content:e);return i.schema=s,c&&(d=!1),!h&&l&&ep(e,t,n)||(u.push("<",e.tagName,h?" "+h:""),d&&("svg"===s.space||i.settings.closeSelfClosing)&&(r=h.charAt(h.length-1),(!i.settings.tightSelfClosing||"/"===r||r&&'"'!==r&&"'"!==r)&&u.push(" "),u.push("/")),u.push(">")),u.push(c),d||l&&eu(e,t,n)||u.push("</"+e.tagName+">"),u.join("")},raw:function(e,t,n,i){return i.settings.allowDangerousHtml?e.value:eb(e,t,n,i)},root:function(e,t,n,i){return i.all(e)},text:eb}}),ey={},eC={},ek=[];function eS(e,t,n){return ev(e,t,n,this)}function ex(e){let t=[],n=e&&e.children||ek,i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}e.s(["toHtml",0,function(e,t){let i=t||ey,r=i.quote||'"';if('"'!==r&&"'"!==r)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return({one:eS,all:ex,settings:{omitOptionalTags:i.omitOptionalTags||!1,allowParseErrors:i.allowParseErrors||!1,allowDangerousCharacters:i.allowDangerousCharacters||!1,quoteSmart:i.quoteSmart||!1,preferUnquoted:i.preferUnquoted||!1,tightAttributes:i.tightAttributes||!1,upperDoctype:i.upperDoctype||!1,tightDoctype:i.tightDoctype||!1,bogusComments:i.bogusComments||!1,tightCommaSeparatedLists:i.tightCommaSeparatedLists||!1,tightSelfClosing:i.tightSelfClosing||!1,collapseEmptyAttributes:i.collapseEmptyAttributes||!1,allowDangerousHtml:i.allowDangerousHtml||!1,voids:i.voids||n,characterReferences:i.characterReferences||eC,closeSelfClosing:i.closeSelfClosing||!1,closeEmptyElements:i.closeEmptyElements||!1},schema:"svg"===i.space?I:T,quote:r,alternative:'"'===r?"'":'"'}).one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}],27118)},94197,(e,t,n)=>{var i={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return(n+i)*3/4-i},t.toByteArray=function(e){var t,n,o=l(e),a=o[0],s=o[1],d=new r((a+s)*3/4-s),u=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],d[u++]=t>>16&255,d[u++]=t>>8&255,d[u++]=255&t;return 2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,d[u++]=255&t),1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,d[u++]=t>>8&255,d[u++]=255&t),d},t.fromByteArray=function(e){for(var t,i=e.length,r=i%3,o=[],a=0,s=i-r;a<s;a+=16383)o.push(function(e,t,i){for(var r,o=[],a=t;a<i;a+=3)r=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===r?o.push(n[(t=e[i-1])>>2]+n[t<<4&63]+"=="):2===r&&o.push(n[(t=(e[i-2]<<8)+e[i-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),o.join("")};for(var n=[],i=[],r="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var i=n===t?0:4-n%4;return[n,i]}i[45]=62,i[95]=63},72:function(e,t,n){"use strict";var i=n(675),r=n(783),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e){var i=e,r=t;if(("string"!=typeof r||""===r)&&(r="utf8"),!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);var o=0|f(i,r),l=a(o),d=l.write(i,r);return d!==o&&(l=l.slice(0,d)),l}if(ArrayBuffer.isView(e))return h(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(I(e,ArrayBuffer)||e&&I(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(I(e,SharedArrayBuffer)||e&&I(e.buffer,SharedArrayBuffer)))return function(e,t,n){var i;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),s.prototype),i}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return s.from(u,t,n);var p=function(e){if(s.isBuffer(e)){var t=0|c(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return d(e),a(e<0?0:0|c(e))}function h(e){for(var t=e.length<0?0:0|c(e.length),n=a(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!s.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,n){return(d(e),e<=0)?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)};function c(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||I(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return E(e).length;default:if(r)return i?-1:A(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var r,o,a,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=t;o<n;++o)r+=R[e[o]];return r}(this,t,n);case"utf8":case"utf-8":return v(this,t,n);case"ascii":return function(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}(this,t,n);case"latin1":case"binary":return function(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}(this,t,n);case"base64":return r=this,o=t,a=n,0===o&&a===r.length?i.fromByteArray(r):i.fromByteArray(r.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var i=e.slice(t,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+256*i[o+1]);return r}(this,t,n);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,r){var o;if(0===e.length)return -1;if("string"==typeof n?(i=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),(o=n*=1)!=o&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length)if(r)return -1;else n=e.length-1;else if(n<0)if(!r)return -1;else n=0;if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(r)return Uint8Array.prototype.indexOf.call(e,t,n);else return Uint8Array.prototype.lastIndexOf.call(e,t,n);return b(e,[t],n,i,r)}throw TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,n/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(o=n;o<s;o++)if(d(e,o)===d(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else -1!==u&&(o-=o-u),u=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var h=!0,c=0;c<l;c++)if(d(e,o+c)!==d(t,c)){h=!1;break}if(h)return o}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(I(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),I(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,r=0,o=Math.min(n,i);r<o;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:+(i<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,i=s.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var o=e[n];if(I(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(i,r),r+=o.length}return i},s.byteLength=f,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,n,i,r){if(I(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,r>>>=0,this===e)return 0;for(var o=r-i,a=n-t,l=Math.min(o,a),d=this.slice(i,r),u=e.slice(t,n),h=0;h<l;++h)if(d[h]!==u[h]){o=d[h],a=u[h];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)};function v(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var o,a,s,l,d=e[r],u=null,h=d>239?4:d>223?3:d>191?2:1;if(r+h<=n)switch(h){case 1:d<128&&(u=d);break;case 2:(192&(o=e[r+1]))==128&&(l=(31&d)<<6|63&o)>127&&(u=l);break;case 3:o=e[r+1],a=e[r+2],(192&o)==128&&(192&a)==128&&(l=(15&d)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&d)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=h}var c=i,f=c.length;if(f<=4096)return String.fromCharCode.apply(String,c);for(var p="",g=0;g<f;)p+=String.fromCharCode.apply(String,c.slice(g,g+=4096));return p}function y(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function C(e,t,n,i,r,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw RangeError('"value" argument is out of bounds');if(n+i>e.length)throw RangeError("Index out of range")}function k(e,t,n,i,r,o){if(n+i>e.length||n<0)throw RangeError("Index out of range")}function S(e,t,n,i,o){return t*=1,n>>>=0,o||k(e,t,n,4,34028234663852886e22,-34028234663852886e22),r.write(e,t,n,i,23,4),n+4}function x(e,t,n,i,o){return t*=1,n>>>=0,o||k(e,t,n,8,17976931348623157e292,-17976931348623157e292),r.write(e,t,n,i,52,8),n+8}s.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var r,o,a,s,l,d,u,h,c=this.length-t;if((void 0===n||n>c)&&(n=c),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var f=!1;;)switch(i){case"hex":return function(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var o=t.length;i>o/2&&(i=o/2);for(var a=0;a<i;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[n+a]=l}return a}(this,e,t,n);case"utf8":case"utf-8":return r=t,o=n,T(A(e,this.length-r),this,r,o);case"ascii":return a=t,s=n,T(L(e),this,a,s);case"latin1":case"binary":return function(e,t,n,i){return T(L(t),e,n,i)}(this,e,t,n);case"base64":return l=t,d=n,T(E(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,h=n,T(function(e,t){for(var n,i,r=[],o=0;o<e.length&&!((t-=2)<0);++o)i=(n=e.charCodeAt(o))>>8,r.push(n%256),r.push(i);return r}(e,this.length-u),this,u,h);default:if(f)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,s.prototype),i},s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i},s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},s.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?0xffff0000|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?0xffff0000|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),r.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),r.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),r.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),r.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,i){if(e*=1,t>>>=0,n>>>=0,!i){var r=Math.pow(2,8*n)-1;C(this,e,t,n,r,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,i){if(e*=1,t>>>=0,n>>>=0,!i){var r=Math.pow(2,8*n)-1;C(this,e,t,n,r,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,i){if(e*=1,t>>>=0,!i){var r=Math.pow(2,8*n-1);C(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e*=1,t>>>=0,!i){var r=Math.pow(2,8*n-1);C(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e*=1,t>>>=0,n||C(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return S(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return S(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return x(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return x(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r=i-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,i);else if(this===e&&n<t&&t<i)for(var o=r-1;o>=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return r},s.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);if(1===e.length){var r,o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{var a=s.isBuffer(e)?e:s.from(e,i),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=a[r%l]}return this};var w=/[^+/0-9A-Za-z-_]/g;function A(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],a=0;a<i;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!r){if(n>56319||a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function L(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function E(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(w,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length)&&!(r>=e.length);++r)t[r+n]=e[r];return r}function I(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var R=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var i=16*n,r=0;r<16;++r)t[i+r]=e[n]+e[r];return t}()},783:function(e,t){t.read=function(e,t,n,i,r){var o,a,s=8*r-i-1,l=(1<<s)-1,d=l>>1,u=-7,h=n?r-1:0,c=n?-1:1,f=e[t+h];for(h+=c,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=c,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+e[t+h],h+=c,u-=8);if(0===o)o=1-d;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=d}return(f?-1:1)*a*Math.pow(2,o-i)},t.write=function(e,t,n,i,r,o){var a,s,l,d=8*o-r-1,u=(1<<d)-1,h=u>>1,c=5960464477539062e-23*(23===r),f=i?0:o-1,p=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=c/l:t+=c*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,r),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[n+f]=255&s,f+=p,s/=256,r-=8);for(a=a<<r|s,d+=r;d>0;e[n+f]=255&a,f+=p,a/=256,d-=8);e[n+f-p]|=128*g}}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}},a=!0;try{i[e](n,n.exports,o),a=!1}finally{a&&delete r[e]}return n.exports}o.ab="/ROOT/apps/web/node_modules/next/dist/compiled/buffer/",t.exports=o(72)},30891,77313,53257,20187,28834,85395,51045,e=>{"use strict";let t,n;var i=e.i(64516),r=e.i(36304),o=e.i(68806),a=e.i(39229),s=e.i(69046),l=e.i(86309),d=e.i(49349),u=e.i(61838),h=e.i(45546),c=e.i(91966),f=e.i(27118);function p(e,t){let n="string"==typeof e?{}:{...e.colorReplacements},i="string"==typeof e?e:e.name;for(let[e,r]of Object.entries(t?.colorReplacements||{}))"string"==typeof r?n[e]=r:e===i&&Object.assign(n,r);return n}function g(e,t){return e&&t?.[e?.toLowerCase()]||e}async function m(e){return Promise.resolve("function"==typeof e?e():e).then(e=>e.default||e)}function b(e){return!e||["plaintext","txt","text","plain"].includes(e)}function v(e){return"ansi"===e||b(e)}function y(e){return"none"===e}function C(e,t){if(!t)return e;for(let n of(e.properties||={},e.properties.class||=[],"string"==typeof e.properties.class&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]),Array.isArray(t)?t:t.split(/\s+/g)))n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}function k(e,t=!1){if(0===e.length)return[["",0]];let n=e.split(/(\r?\n)/g),i=0,r=[];for(let e=0;e<n.length;e+=2){let o=t?n[e]+(n[e+1]||""):n[e];r.push([o,i]),i+=n[e].length,i+=n[e+1]?.length||0}return r}function S(e,t,n){let i=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&i.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&i.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&i.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes("/")?e.split("/").pop():e;n&&i.add(n)}if(!n)return Array.from(i);let r=n.getBundledLanguages();return Array.from(i).filter(e=>e&&r[e])}let x="light-dark()",w=["color","background-color"];function A(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&c.FontStyle.Italic&&(t["font-style"]="italic"),e.fontStyle&c.FontStyle.Bold&&(t["font-weight"]="bold");let n=[];e.fontStyle&c.FontStyle.Underline&&n.push("underline"),e.fontStyle&c.FontStyle.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function L(e){return"string"==typeof e?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}let E=new WeakMap;function T(e,t){E.set(e,t)}function I(e){return E.get(e)}class R{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,t){return new R(Object.fromEntries((Array.isArray(t)?t:[t]).map(e=>[e,c.INITIAL])),e)}constructor(...e){if(2===e.length){const[t,n]=e;this.lang=n,this._stacks=t}else{const[t,n,i]=e;this.lang=n,this._stacks={[i]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){var t;let n,i;return t=this._stacks[e],n=[],i=new Set,!function e(t){if(i.has(t))return;i.add(t);let r=t?.nameScopesList?.scopeName;r&&n.push(r),t.parent&&e(t.parent)}(t),n}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}let _=[function(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){var n;let i,r=function(e){if("number"==typeof e){if(e<0||e>t.source.length)throw new h.ShikiError(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...o.indexToPos(e),offset:e}}{let t=o.lines[e.line];if(void 0===t)throw new h.ShikiError(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${o.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new h.ShikiError(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:o.posToIndex(e.line,n)}}},o={lines:i=k(n=t.source,!0).map(([e])=>e),indexToPos:function(e){if(e===n.length)return{line:i.length-1,character:i[i.length-1].length};let t=e,r=0;for(let e of i){if(t<e.length)break;t-=e.length,r++}return{line:r,character:t}},posToIndex:function(e,t){let n=0;for(let t=0;t<e;t++)n+=i[t].length;return n+t}},a=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));(function(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new h.ShikiError(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){let t=e[i],r=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,o=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,a=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(r||o||a||s){if(r&&o||a&&s||a&&n.start.offset===n.end.offset||o&&t.start.offset===t.end.offset)continue;throw new h.ShikiError(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}})(a),e.set(t.meta,{decorations:a,converter:o,source:t.source})}return e.get(t.meta)}return{name:"shiki:decorations",tokens(e){let n;if(!this.options.decorations?.length)return;let i=t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]);return(n=Array.from(i instanceof Set?i:new Set(i)).sort((e,t)=>e-t)).length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);if(!t.length)return e;let i=0,r=[];for(let n of t)n>i&&r.push({...e,content:e.content.slice(i,n),offset:e.offset+i}),i=n;return i<e.content.length&&r.push({...e,content:e.content.slice(i),offset:e.offset+i}),r})):e},code(e){if(!this.options.decorations?.length)return;let n=t(this),i=Array.from(e.children).filter(e=>"element"===e.type&&"span"===e.tagName);if(i.length!==n.converter.lines.length)throw new h.ShikiError(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function r(e,t,n,r){let a=i[e],s="",l=-1,d=-1;if(0===t&&(l=0),0===n&&(d=0),n===1/0&&(d=a.children.length),-1===l||-1===d)for(let e=0;e<a.children.length;e++)s+=function e(t){return"text"===t.type?t.value:"element"===t.type?t.children.map(e).join(""):""}(a.children[e]),-1===l&&s.length===t&&(l=e+1),-1===d&&s.length===n&&(d=e+1);if(-1===l)throw new h.ShikiError(`Failed to find start index for decoration ${JSON.stringify(r.start)}`);if(-1===d)throw new h.ShikiError(`Failed to find end index for decoration ${JSON.stringify(r.end)}`);let u=a.children.slice(l,d);if(r.alwaysWrap||u.length!==a.children.length)if(r.alwaysWrap||1!==u.length||"element"!==u[0].type){let e={type:"element",tagName:"span",properties:{},children:u};o(e,r,"wrapper"),a.children.splice(l,u.length,e)}else o(u[0],r,"token");else o(a,r,"line")}function o(e,t,n){let i=t.properties||{},r=t.transform||(e=>e);return e.tagName=t.tagName||"span",e.properties={...e.properties,...i,class:e.properties.class},t.properties?.class&&C(e,t.properties.class),e=r(e,n)||e}let a=[];for(let e of n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset)){let{start:t,end:n}=e;if(t.line===n.line)r(t.line,t.character,n.character,e);else if(t.line<n.line){r(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)a.unshift(()=>{var t;i[t=r]=o(i[t],e,"line")});r(n.line,0,n.character,e)}}a.forEach(e=>e())}}}()];function M(e){let t=function(e){let t=[],n=[],i=[];for(let r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._]}var N=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],D={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function P(e){let t=e.shift();if("2"===t){let t=e.splice(0,3).map(e=>Number.parseInt(e));if(3!==t.length||t.some(e=>Number.isNaN(e)))return;return{type:"rgb",rgb:t}}if("5"===t){let t=e.shift();if(t)return{type:"table",index:Number(t)}}}var O={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};let H={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function F(e,t,n={}){var i,r;let o,a,{theme:s=e.getLoadedThemes()[0]}=n,l=e.resolveLangAlias(n.lang||"text");if(b(l)||y(s))return k(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:d,colorMap:u}=e.setTheme(s);if("ansi"===l){let e,i,r,o,a,s,l;return e=p(d,n),i=k(t),r=function(e=O){let t;function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0")).join("")}`}return{value:function(i){switch(i.type){case"named":return e[i.name];case"rgb":return n(i.rgb);case"table":var r;return r=i.index,function(){if(t)return t;t=[];for(let n=0;n<N.length;n++)t.push(e[N[n]]);let i=[0,95,135,175,215,255];for(let e=0;e<6;e++)for(let r=0;r<6;r++)for(let o=0;o<6;o++)t.push(n([i[e],i[r],i[o]]));let r=8;for(let e=0;e<24;e++,r+=10)t.push(n([r,r,r]));return t}()[r]}}}}(Object.fromEntries(N.map(e=>{let t=`terminal.ansi${e[0].toUpperCase()}${e.substring(1)}`;return[e,d.colors?.[t]||H[e]]}))),o=null,a=null,s=new Set,l={parse(e){let t=[],n=0;do{let i=function(e,t){let n=e.indexOf("\x1b",t);if(-1!==n&&"["===e[n+1]){let t=e.indexOf("m",n);if(-1!==t)return{sequence:e.substring(n+2,t).split(";"),startPosition:n,position:t+1}}return{position:e.length}}(e,n),r=i.sequence?e.substring(n,i.startPosition):e.substring(n);if(r.length>0&&t.push({value:r,foreground:o,background:a,decorations:new Set(s)}),i.sequence){let e=function(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let i=Number.parseInt(n);if(!Number.isNaN(i))if(0===i)t.push({type:"resetAll"});else if(i<=9)D[i]&&t.push({type:"setDecoration",value:D[i]});else if(i<=29){let e=D[i-20];e&&(t.push({type:"resetDecoration",value:e}),"dim"===e&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:N[i-30]}});else if(38===i){let n=P(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===i)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:N[i-40]}});else if(48===i){let n=P(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===i?t.push({type:"resetBackgroundColor"}):53===i?t.push({type:"setDecoration",value:"overline"}):55===i?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:N[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:N[i-100+8]}})}return t}(i.sequence);for(let t of e)"resetAll"===t.type?(o=null,a=null,s.clear()):"resetForegroundColor"===t.type?o=null:"resetBackgroundColor"===t.type?a=null:"resetDecoration"===t.type&&s.delete(t.value);for(let t of e)"setForegroundColor"===t.type?o=t.value:"setBackgroundColor"===t.type?a=t.value:"setDecoration"===t.type&&s.add(t.value)}n=i.position}while(n<e.length)return t}},i.map(t=>l.parse(t[0]).map(n=>{let i,o;n.decorations.has("reverse")?(i=n.background?r.value(n.background):d.bg,o=n.foreground?r.value(n.foreground):d.fg):(i=n.foreground?r.value(n.foreground):d.fg,o=n.background?r.value(n.background):void 0),i=g(i,e),o=g(o,e),n.decorations.has("dim")&&(i=function(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(8===e.length){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${e.slice(0,6)}${t}`}if(6===e.length)return`#${e}80`;if(4===e.length){let t=e[0],n=e[1],i=e[2],r=e[3],o=Math.round(Number.parseInt(`${r}${r}`,16)/2).toString(16).padStart(2,"0");return`#${t}${t}${n}${n}${i}${i}${o}`}else if(3===e.length){let t=e[0],n=e[1],i=e[2];return`#${t}${t}${n}${n}${i}${i}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}(i));let a=c.FontStyle.None;return n.decorations.has("bold")&&(a|=c.FontStyle.Bold),n.decorations.has("italic")&&(a|=c.FontStyle.Italic),n.decorations.has("underline")&&(a|=c.FontStyle.Underline),n.decorations.has("strikethrough")&&(a|=c.FontStyle.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:a}}))}let f=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==f.name)throw new h.ShikiError(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${f.name}"`);if(!n.grammarState.themes.includes(d.name))throw new h.ShikiError(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${d.name}"`)}return a=new R((o=B(t,i=f,r=d,u,n)).stateStack,i.name,r.name),T(o.tokens,a),o.tokens}function B(e,t,n,i,r){let o=p(n,r),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:s=500}=r,l=k(e),d=r.grammarState?function(e,t){if(!(e instanceof R))throw new h.ShikiError("Invalid grammar state");return e.getInternalStack(t)}(r.grammarState,n.name)??c.INITIAL:null!=r.grammarContextCode?B(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:c.INITIAL,u=[],f=[];for(let e=0,h=l.length;e<h;e++){let h,p,[m,b]=l[e];if(""===m){u=[],f.push([]);continue}if(a>0&&m.length>=a){u=[],f.push([{content:m,offset:b,color:"",fontStyle:0}]);continue}r.includeExplanation&&(h=t.tokenizeLine(m,d,s).tokens,p=0);let v=t.tokenizeLine2(m,d,s),y=v.tokens.length/2;for(let e=0;e<y;e++){let t=v.tokens[2*e],a=e+1<y?v.tokens[2*e+2]:m.length;if(t===a)continue;let s=v.tokens[2*e+1],l=g(i[c.EncodedTokenMetadata.getForeground(s)],o),d=c.EncodedTokenMetadata.getFontStyle(s),f={content:m.substring(t,a),offset:b+t,color:l,fontStyle:d};if(r.includeExplanation){let e=[];if("scopeName"!==r.includeExplanation)for(let t of n.settings){let n;switch(typeof t.scope){case"string":n=t.scope.split(/,/).map(e=>e.trim());break;case"object":n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}f.explanation=[];let i=0;for(;t+i<a;){let t=h[p],n=m.substring(t.startIndex,t.endIndex);i+=n.length,f.explanation.push({content:n,scopes:"scopeName"===r.includeExplanation?t.scopes.map(e=>({scopeName:e})):function(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let r=t[i];n[i]={scopeName:r,themeMatches:function(e,t,n){let i=[];for(let{selectors:r,settings:o}of e)for(let e of r)if(function(e,t,n){if(!U(e[e.length-1],t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)U(e[i],n[r])&&(i-=1),r-=1;return -1===i}(e,t,n)){i.push(o);break}return i}(e,r,t.slice(0,i))}}return n}(e,t.scopes)}),p+=1}}u.push(f)}f.push(u),u=[],d=v.ruleStack}return{tokens:f,stateStack:d}}function U(e,t){return e===t||t.substring(0,e.length)===e&&"."===t[e.length]}function $(e,t,n){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),r=i.map(i=>{let r=F(e,t,{...n,theme:i.theme}),o=I(r);return{tokens:r,state:o,theme:"string"==typeof i.theme?i.theme:i.theme.name}}),o=function(...e){let t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){let r=e.map(e=>e[i]),o=t.map(()=>[]);t.forEach((e,t)=>e.push(o[t]));let a=r.map(()=>0),s=r.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(o[t].push(n),a[t]+=1,s[t]=r[t][a[t]]):(o[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}(...r.map(e=>e.tokens)),a=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return"includeExplanation"in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:l,...d}=e[t][r];a.variants[i[n].color]=d}),a})),s=r[0].state?new R(Object.fromEntries(r.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),r[0].state.lang):void 0;return s&&T(a,s),a}function G(e,t,n){let i,r,o,a,s,l;if("themes"in n){let{defaultColor:d="light",cssVariablePrefix:u="--shiki-",colorsRendering:c="css-vars"}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===d?-1:+(t.color===d));if(0===f.length)throw new h.ShikiError("`themes` option must not be empty");let g=$(e,t,n);if(l=I(g),d&&x!==d&&!f.find(e=>e.color===d))throw new h.ShikiError(`\`themes\` option must contain the defaultColor key \`${d}\``);let m=f.map(t=>e.getTheme(t.theme)),b=f.map(e=>e.color);o=g.map(e=>e.map(e=>(function(e,t,n,i,r="css-vars"){let o={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(t=>A(e.variants[t])),s=new Set(a.flatMap(e=>Object.keys(e))),l={},d=(e,i)=>{let r="color"===i?"":"background-color"===i?"-bg":`-${i}`;return n+t[e]+("color"===i?"":r)};return a.forEach((e,n)=>{for(let o of s){let s=e[o]||"inherit";if(0===n&&i&&w.includes(o))if(i===x&&a.length>1){let e=t.findIndex(e=>"light"===e),i=t.findIndex(e=>"dark"===e);if(-1===e||-1===i)throw new h.ShikiError('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=a[e][o]||"inherit",c=a[i][o]||"inherit";l[o]=`light-dark(${u}, ${c})`,"css-vars"===r&&(l[d(n,o)]=s)}else l[o]=s;else"css-vars"===r&&(l[d(n,o)]=s)}}),o.htmlStyle=l,o})(e,b,u,d,c))),l&&T(o,l);let v=f.map(e=>p(e.theme,n));r=z(f,m,v,u,d,"fg",c),i=z(f,m,v,u,d,"bg",c),a=`shiki-themes ${m.map(e=>e.name).join(" ")}`,s=d?void 0:[r,i].join(";")}else if("theme"in n){let s=p(n.theme,n);o=F(e,t,n);let d=e.getTheme(n.theme);i=g(d.bg,s),r=g(d.fg,s),a=d.name,l=I(o)}else throw new h.ShikiError("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:i,themeName:a,rootStyle:s,grammarState:l}}function z(e,t,n,i,r,o,a){return e.map((s,l)=>{let d=g(t[l][o],n[l])||"inherit",u=`${i+s.color}${"bg"===o?"-bg":""}:${d}`;if(0===l&&r){if(r===x&&e.length>1){let i=e.findIndex(e=>"light"===e.color),r=e.findIndex(e=>"dark"===e.color);if(-1===i||-1===r)throw new h.ShikiError('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let a=g(t[i][o],n[i])||"inherit",s=g(t[r][o],n[r])||"inherit";return`light-dark(${a}, ${s});${u}`}return d}return"css-vars"===a?u:null}).filter(e=>!!e).join(";")}function j(e,t,n,i={meta:{},options:n,codeToHast:(t,n)=>j(e,t,n),codeToTokens:(t,n)=>G(e,t,n)}){let r=t;for(let e of M(n))r=e.preprocess?.call(i,r,n)||r;let{tokens:o,fg:a,bg:s,themeName:l,rootStyle:d,grammarState:u}=G(e,r,n),{mergeWhitespaces:h=!0,mergeSameStyleTokens:f=!1}=n;!0===h?o=o.map(e=>{let t,n=[],i="";return e.forEach((r,o)=>{let a=!(r.fontStyle&&(r.fontStyle&c.FontStyle.Underline||r.fontStyle&c.FontStyle.Strikethrough));a&&r.content.match(/^\s+$/)&&e[o+1]?(void 0===t&&(t=r.offset),i+=r.content):i?(a?n.push({...r,offset:t,content:i+r.content}):n.push({content:i,offset:t},r),t=void 0,i=""):n.push(r)}),n}):"never"===h&&(o=o.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,i,r]=t;if(!n&&!r)return e;let o=[{...e,offset:e.offset+n.length,content:i}];return n&&o.unshift({content:n,offset:e.offset}),r&&o.push({content:r,offset:e.offset+n.length+i.length}),o}))),f&&(o=o.map(e=>{let t=[];for(let n of e){if(0===t.length){t.push({...n});continue}let e=t[t.length-1],i=L(e.htmlStyle||A(e)),r=L(n.htmlStyle||A(n)),o=e.fontStyle&&(e.fontStyle&c.FontStyle.Underline||e.fontStyle&c.FontStyle.Strikethrough),a=n.fontStyle&&(n.fontStyle&c.FontStyle.Underline||n.fontStyle&c.FontStyle.Strikethrough);o||a||i!==r?t.push({...n}):e.content+=n.content}return t}));let p={...i,get source(){return r}};for(let e of M(n))o=e.tokens?.call(p,o)||o;return function(e,t,n,i=I(e)){let r=M(t),o=[],a={type:"root",children:[]},{structure:s="classic",tabindex:l="0"}=t,d={class:`shiki ${t.themeName||""}`};for(let[e,n]of(!1!==t.rootStyle&&(null!=t.rootStyle?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),!1!==l&&null!=l&&(d.tabindex=l.toString()),Object.entries(t.meta||{})))e.startsWith("_")||(d[e]=n);let u={type:"element",tagName:"pre",properties:d,children:[],data:t.data},h={type:"element",tagName:"code",properties:{},children:o},c=[],f={...n,structure:s,addClassToHast:C,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return h},get lines(){return c}};if(e.forEach((e,t)=>{t&&("inline"===s?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):"classic"===s&&o.push({type:"text",value:"\n"}));let n={type:"element",tagName:"span",properties:{class:"line"},children:[]},i=0;for(let o of e){let e={type:"element",tagName:"span",properties:{...o.htmlAttrs},children:[{type:"text",value:o.content}]},l=L(o.htmlStyle||A(o));for(let a of(l&&(e.properties.style=l),r))e=a?.span?.call(f,e,t+1,i,n,o)||e;"inline"===s?a.children.push(e):"classic"===s&&n.children.push(e),i+=o.content.length}if("classic"===s){for(let e of r)n=e?.line?.call(f,n,t+1)||n;c.push(n),o.push(n)}else"inline"===s&&c.push(n)}),"classic"===s){for(let e of r)h=e?.code?.call(f,h)||h;for(let e of(u.children.push(h),r))u=e?.pre?.call(f,u)||u;a.children.push(u)}else if("inline"===s){let e=[],t={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let n of a.children)"element"===n.type&&"br"===n.tagName?(e.push(t),t={type:"element",tagName:"span",properties:{class:"line"},children:[]}):("element"===n.type||"text"===n.type)&&t.children.push(n);e.push(t);let n={type:"element",tagName:"code",properties:{},children:e};for(let e of r)n=e?.code?.call(f,n)||n;a.children=[];for(let e=0;e<n.children.length;e++){e>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});let t=n.children[e];"element"===t.type&&a.children.push(...t.children)}}let p=a;for(let e of r)p=e?.root?.call(f,p)||p;return i&&T(p,i),p}(o,{...n,fg:a,bg:s,themeName:l,rootStyle:!1!==n.rootStyle&&(n.rootStyle??d)},p,u)}let W=f.toHtml,q="__shiki_resolved";function V(e){if(e?.[q])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(i=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i="light"===t.type?"#333333":"#bbbbbb"),n||(n="light"===t.type?"#fffffe":"#1e1e1e"),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0,o=new Map;function a(e){if(o.has(e))return o.get(e);r+=1;let n=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?a(e):(o.set(e,n),n)}for(let e of(t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith("#"),i=e.settings?.background&&!e.settings.background.startsWith("#");if(!n&&!i)return e;let r={...e,settings:{...e.settings}};if(n){let n=a(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,r.settings.foreground=n}if(i){let n=a(e.settings.background);t.colorReplacements[n]=e.settings.background,r.settings.background=n}return r}),Object.keys(t.colors||{})))if(("editor.foreground"===e||"editor.background"===e||e.startsWith("terminal.ansi"))&&!t.colors[e]?.startsWith("#")){let n=a(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,q,{enumerable:!1,writable:!1,value:!0}),t}async function X(e){return Array.from(new Set((await Promise.all(e.filter(e=>!v(e)).map(async e=>await m(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function K(e){return(await Promise.all(e.map(async e=>y(e)?null:V(await m(e))))).filter(e=>!!e)}class Q extends Error{constructor(e){super(e),this.name="ShikiError"}}function Y(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Q(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}class J extends c.Registry{constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return"string"==typeof e?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=V(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=c.Theme.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Y(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>{if(!t)return!1;let i=t.embeddedLanguages||t.embeddedLangs;return i?.some(e=>n.map(([e])=>e).includes(e))}).filter(e=>!n.includes(e));throw new Q(`Missing languages ${n.map(([e])=>`\`${e}\``).join(", ")}, required by ${e.map(([e])=>`\`${e}\``).join(", ")}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}}class Z{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let e=1;e<=t.length;e++){let i=t.slice(0,e).join(".");n=[...n,...this._injections.get(i)||[]]}return n}}let ee=0;async function et(e){e.engine||function(e,t=3){if(!(t>3))if(1)console.trace(`[SHIKI DEPRECATE]: ${e}`);else throw Error(`[SHIKI DEPRECATE]: ${e}`)}("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,i]=await Promise.all([K(e.themes||[]),X(e.langs||[]),e.engine]);return function(e){let t;ee+=1,!1!==e.warnings&&ee>=10&&ee%10==0&&console.warn(`[Shiki] ${ee} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let n=!1;if(!e.engine)throw new Q("`engine` option is required for synchronous mode");let i=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(V),o=new J(new Z(e.engine,i),r,i,e.langAlias);function a(e){if("none"===e)return{bg:"",fg:"",name:"none",settings:[],type:"dark"};d();let t=o.getTheme(e);if(!t)throw new Q(`Theme \`${e}\` not found, you may need to load it first`);return t}function s(...e){d(),o.loadLanguages(e.flat(1))}function l(...e){for(let t of(d(),e.flat(1)))o.loadTheme(t)}function d(){if(n)throw new Q("Shiki instance has been disposed")}function u(){n||(n=!0,o.dispose(),ee-=1)}return{setTheme:function(e){d();let n=a(e);return t!==e&&(o.setTheme(n),t=e),{theme:n,colorMap:o.getColorMap()}},getTheme:a,getLanguage:function(e){d();let t=o.getGrammar("string"==typeof e?e:e.name);if(!t)throw new Q(`Language \`${e}\` not found, you may need to load it first`);return t},getLoadedThemes:function(){return d(),o.getLoadedThemes()},getLoadedLanguages:function(){return d(),o.getLoadedLanguages()},resolveLangAlias:function(t){return Y(t,e.langAlias)},loadLanguage:async function(...e){return s(await X(e))},loadLanguageSync:s,loadTheme:async function(...e){return d(),l(await K(e))},loadThemeSync:l,dispose:u,[Symbol.dispose]:u}}({...e,themes:t,langs:n,engine:i})}async function en(e){let t=await et(e);return{getLastGrammarState:(...e)=>(function(...e){if(2===e.length)return I(e[1]);let[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(b(r)||y(o))throw new h.ShikiError("Plain language does not have grammar state");if("ansi"===r)throw new h.ShikiError("ANSI language does not have grammar state");let{theme:a,colorMap:s}=t.setTheme(o),l=t.getLanguage(r);return new R(B(n,l,a,s,i).stateStack,l.name,a.name)})(t,...e),codeToTokensBase:(e,n)=>F(t,e,n),codeToTokensWithThemes:(e,n)=>$(t,e,n),codeToTokens:(e,n)=>G(t,e,n),codeToHast:(e,n)=>j(t,e,n),codeToHtml:(e,n)=>(function(e,t,n){let i={meta:{},options:n,codeToHast:(t,n)=>j(e,t,n),codeToTokens:(t,n)=>G(e,t,n)},r=W(j(e,t,n,i));for(let e of M(n))r=e.postprocess?.call(i,r,n)||r;return r})(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ei(e){let t=e.langs,n=e.themes,i=e.engine;return async function(e){function r(n){if("string"==typeof n){if(v(n=e.langAlias?.[n]||n))return[];let i=t[n];if(!i)throw new h.ShikiError(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return i}return n}function o(e){if(y(e))return"none";if("string"==typeof e){let t=n[e];if(!t)throw new h.ShikiError(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let a=(e.themes??[]).map(e=>o(e)),s=(e.langs??[]).map(e=>r(e)),l=await en({engine:e.engine??i(),...e,themes:a,langs:s});return{...l,loadLanguage:(...e)=>l.loadLanguage(...e.map(r)),loadTheme:(...e)=>l.loadTheme(...e.map(o)),getBundledLanguages:()=>t,getBundledThemes:()=>n}}}function er(e,t){let n,i=async function(t={}){if(n){let e=await n;return await Promise.all([e.loadTheme(...t.themes||[]),e.loadLanguage(...t.langs||[])]),e}{n=e({...t,themes:[],langs:[]});let i=await n;return await Promise.all([i.loadTheme(...t.themes||[]),i.loadLanguage(...t.langs||[])]),i}};async function r(e,n){let r=await i({langs:[n.lang],themes:"theme"in n?[n.theme]:Object.values(n.themes)}),o=await t?.guessEmbeddedLanguages?.(e,n.lang,r);return o&&await r.loadLanguage(...o),r}return{getSingletonHighlighter:e=>i(e),codeToHtml:async(e,t)=>(await r(e,t)).codeToHtml(e,t),codeToHast:async(e,t)=>(await r(e,t)).codeToHast(e,t),codeToTokens:async(e,t)=>(await r(e,t)).codeToTokens(e,t),codeToTokensBase:async(e,t)=>(await r(e,t)).codeToTokensBase(e,t),codeToTokensWithThemes:async(e,t)=>(await r(e,t)).codeToTokensWithThemes(e,t),getLastGrammarState:async(e,t)=>(await i({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}async function eo(e){if((0,d.isWorkerContext)())throw Error(`resolveTheme("${e}") cannot be called from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=l.ResolvingThemes.get(e);if(null!=t)return t;try{let t=l.RegisteredCustomThemes.get(e)??u.bundledThemes[e];if(null==t)throw Error(`resolveTheme: No valid loader for ${e}`);let n=t().then(t=>{var n,i;let r;return n=e,i="default"in t?t.default:t,r=l.ResolvedThemes.get(n),null!=r?r:(i=V(i),l.ResolvedThemes.set(n,i),i)});l.ResolvingThemes.set(e,n);let i=await n;if(i.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${i.name}`);return l.ResolvedThemes.set(i.name,i),i}finally{l.ResolvingThemes.delete(e)}}function ea(e){return l.ResolvedThemes.get(e)??eo(e)}function es(e,t){l.RegisteredCustomThemes.has(e)?console.error("SharedHighlight.registerCustomTheme: theme name already registered",e):l.RegisteredCustomThemes.set(e,t)}e.s(["createBundledHighlighter",0,ei,"createCssVariablesTheme",0,function(e={}){let{name:t="css-variables",variablePrefix:n="--shiki-",fontStyle:i=!0}=e,r=t=>e.variableDefaults?.[t]?`var(${n}${t}, ${e.variableDefaults[t]})`:`var(${n}${t})`,o={name:t,type:"dark",colors:{"editor.foreground":r("foreground"),"editor.background":r("background"),"terminal.ansiBlack":r("ansi-black"),"terminal.ansiRed":r("ansi-red"),"terminal.ansiGreen":r("ansi-green"),"terminal.ansiYellow":r("ansi-yellow"),"terminal.ansiBlue":r("ansi-blue"),"terminal.ansiMagenta":r("ansi-magenta"),"terminal.ansiCyan":r("ansi-cyan"),"terminal.ansiWhite":r("ansi-white"),"terminal.ansiBrightBlack":r("ansi-bright-black"),"terminal.ansiBrightRed":r("ansi-bright-red"),"terminal.ansiBrightGreen":r("ansi-bright-green"),"terminal.ansiBrightYellow":r("ansi-bright-yellow"),"terminal.ansiBrightBlue":r("ansi-bright-blue"),"terminal.ansiBrightMagenta":r("ansi-bright-magenta"),"terminal.ansiBrightCyan":r("ansi-bright-cyan"),"terminal.ansiBrightWhite":r("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:r("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:r("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:r("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:r("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.object","variable.other.class","variable.other.constant","meta.property-name","meta.property-value","support"],settings:{foreground:r("token-constant")}},{scope:["keyword","storage.modifier","storage.type","storage.control.clojure","entity.name.function.clojure","entity.name.tag.yaml","support.function.node","support.type.property-name.json","punctuation.separator.key-value","punctuation.definition.template-expression"],settings:{foreground:r("token-keyword")}},{scope:"variable.parameter.function",settings:{foreground:r("token-parameter")}},{scope:["support.function","entity.name.type","entity.other.inherited-class","meta.function-call","meta.instance.constructor","entity.other.attribute-name","entity.name.function","constant.keyword.clojure"],settings:{foreground:r("token-function")}},{scope:["entity.name.tag","string.quoted","string.regexp","string.interpolated","string.template","string.unquoted.plain.out.yaml","keyword.other.template"],settings:{foreground:r("token-string-expression")}},{scope:["punctuation.definition.arguments","punctuation.definition.dict","punctuation.separator","meta.function-call.arguments"],settings:{foreground:r("token-punctuation")}},{scope:["markup.underline.link","punctuation.definition.metadata.markdown"],settings:{foreground:r("token-link")}},{scope:["beginning.punctuation.definition.list.markdown"],settings:{foreground:r("token-string")}},{scope:["punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown","string.other.link.title.markdown","string.other.link.description.markdown"],settings:{foreground:r("token-keyword")}},{scope:["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],settings:{foreground:r("token-inserted")}},{scope:["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],settings:{foreground:r("token-deleted")}},{scope:["markup.changed","punctuation.definition.changed"],settings:{foreground:r("token-changed")}}]};return i||(o.tokenColors=o.tokenColors?.map(e=>(e.settings?.fontStyle&&delete e.settings.fontStyle,e))),o},"createSingletonShorthands",0,er,"getTokenStyleObject",0,A,"guessEmbeddedLanguages",0,S,"normalizeTheme",0,V,"stringifyTokenStyle",0,L],77313),e.s(["resolveTheme",0,eo],53257),e.s(["getResolvedOrResolveTheme",0,ea],20187),e.s(["registerCustomTheme",0,es],28834);var el=e.i(85892),ed=e.i(94197);class eu extends Error{constructor(e){super(e),this.name="ShikiError"}}function eh(){return"u">typeof performance?performance.now():Date.now()}let ec=(e,t)=>e+(t-e%t)%t;async function ef(e){let t,n,i={};function r(e){n=e,i.HEAPU8=new Uint8Array(e),i.HEAPU32=new Uint32Array(e)}let o="u">typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(e,t){return e?function(e,t,n=1024){let i=t+n,r=t;for(;e[r]&&!(r>=i);)++r;if(r-t>16&&e.buffer&&o)return o.decode(e.subarray(t,r));let a="";for(;t<r;){let n=e[t++];if(!(128&n)){a+=String.fromCharCode(n);continue}let i=63&e[t++];if((224&n)==192){a+=String.fromCharCode((31&n)<<6|i);continue}let r=63&e[t++];if((n=(240&n)==224?(15&n)<<12|i<<6|r:(7&n)<<18|i<<12|r<<6|63&e[t++])<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|1023&e)}}return a}(i.HEAPU8,e,t):""}let s={emscripten_get_now:eh,emscripten_memcpy_big:function(e,t,n){i.HEAPU8.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){let o=i.HEAPU8.length;if((e>>>=0)>0x80000000)return!1;for(let i=1;i<=4;i*=2){let a=o*(1+.2/i);if(a=Math.min(a,e+0x6000000),function(e){try{return t.grow(e-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}(Math.min(0x80000000,ec(Math.max(e,a),65536))))return!0}return!1},fd_write:()=>0};async function l(){let n=await e({env:s,wasi_snapshot_preview1:s});r((t=n.memory).buffer),Object.assign(i,n),i.UTF8ToString=a}return await l(),i}var ep=Object.defineProperty,eg=(e,t,n)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?ep(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n};let em=null;class eb{constructor(e){eg(this,"utf16Length"),eg(this,"utf8Length"),eg(this,"utf16Value"),eg(this,"utf8Value"),eg(this,"utf16OffsetToUtf8"),eg(this,"utf8OffsetToUtf16");const t=e.length,n=eb._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;i&&(r[t]=n);const o=i?new Uint32Array(n+1):null;i&&(o[n]=t);const a=new Uint8Array(n);let s=0;for(let n=0;n<t;n++){const l=e.charCodeAt(n);let d=l,u=!1;if(l>=55296&&l<=56319&&n+1<t){const t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(d=(l-55296<<10)+65536|t-56320,u=!0)}i&&(r[n]=s,u&&(r[n+1]=s),d<=127?o[s+0]=n:d<=2047?(o[s+0]=n,o[s+1]=n):d<=65535?(o[s+0]=n,o[s+1]=n,o[s+2]=n):(o[s+0]=n,o[s+1]=n,o[s+2]=n,o[s+3]=n)),d<=127?a[s++]=d:(d<=2047?a[s++]=192|(1984&d)>>>6:(d<=65535?a[s++]=224|(61440&d)>>>12:(a[s++]=240|(1835008&d)>>>18,a[s++]=128|(258048&d)>>>12),a[s++]=128|(4032&d)>>>6),a[s++]=128|(63&d)>>>0),u&&n++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=a,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){let r=e.charCodeAt(n),o=r,a=!1;if(r>=55296&&r<=56319&&n+1<i){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(o=(r-55296<<10)+65536|t-56320,a=!0)}o<=127?t+=1:o<=2047?t+=2:o<=65535?t+=3:t+=4,a&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}let ev=class e{constructor(t){if(eg(this,"id",++e.LAST_ID),eg(this,"_onigBinding"),eg(this,"content"),eg(this,"utf16Length"),eg(this,"utf8Length"),eg(this,"utf16OffsetToUtf8"),eg(this,"utf8OffsetToUtf16"),eg(this,"ptr"),!em)throw new eu("Must invoke loadWasm first.");this._onigBinding=em,this.content=t;const n=new eb(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||(e._sharedPtr=em.omalloc(1e4)),e._sharedPtrInUse=!0,em.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(em)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};eg(ev,"LAST_ID",0),eg(ev,"_sharedPtr",0),eg(ev,"_sharedPtrInUse",!1);class ey{constructor(e){if(eg(this,"_onigBinding"),eg(this,"_ptr"),!em)throw new eu("Must invoke loadWasm first.");const t=[],n=[];for(let i=0,r=e.length;i<r;i++){const r=new eb(e[i]);t[i]=r.createString(em),n[i]=r.utf8Length}const i=em.omalloc(4*e.length);em.HEAPU32.set(t,i/4);const r=em.omalloc(4*e.length);em.HEAPU32.set(n,r/4);const o=em.createOnigScanner(i,r,e.length);for(let n=0,i=e.length;n<i;n++)em.ofree(t[n]);em.ofree(r),em.ofree(i),0===o&&function(e){throw new eu(e.UTF8ToString(e.getLastOnigError()))}(em),this._onigBinding=em,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if("number"==typeof n&&(i=n),"string"==typeof e){e=new ev(e);let n=this._findNextMatchSync(e,t,!1,i);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){let r=this._onigBinding,o=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(0===o)return null;let a=r.HEAPU32,s=o/4,l=a[s++],d=a[s++],u=[];for(let t=0;t<d;t++){let n=e.convertUtf8OffsetToUtf16(a[s++]),i=e.convertUtf8OffsetToUtf16(a[s++]);u[t]={start:n,end:i,length:i-n}}return{index:l,captureIndices:u}}}function eC(e){return t=>WebAssembly.instantiate(e,t)}async function ek(e){return e&&await (t||(t=async function(){em=await ef(async t=>{let n=e;if("function"==typeof(n=await n)&&(n=await n(t)),"function"==typeof n&&(n=await n(t)),"function"==typeof n.instantiator)n=await n.instantiator(t);else if("function"==typeof n.default)n=await n.default(t);else{var i,r,o,a;if(void 0!==n.data&&(n=n.data),i=n,"u">typeof Response&&i instanceof Response){n="function"==typeof WebAssembly.instantiateStreaming?await (o=n,e=>WebAssembly.instantiateStreaming(o,e))(t):await (a=n,async e=>{let t=await a.arrayBuffer();return WebAssembly.instantiate(t,e)})(t)}else(r=n,"u">typeof ArrayBuffer&&(r instanceof ArrayBuffer||ArrayBuffer.isView(r))||void 0!==ed.Buffer&&ed.Buffer.isBuffer?.(r)||"u">typeof SharedArrayBuffer&&r instanceof SharedArrayBuffer||"u">typeof Uint32Array&&r instanceof Uint32Array||n instanceof WebAssembly.Module)?n=await eC(n)(t):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await eC(n.default)(t))}return"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}())),{createScanner:e=>new ey(e.map(e=>"string"==typeof e?e:e.source)),createString:e=>new ev(e)}}let eS=ei({langs:el.bundledLanguages,themes:u.bundledThemes,engine:()=>ek(e.A(14467))}),{codeToHtml:ex}=er(eS,{guessEmbeddedLanguages:S});function ew(e){if(1!=[...e].length)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}e.s(["codeToHtml",0,ex,"createHighlighter",0,eS],85395);let eA=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),eL=String.raw;function eE(e,t){if(null==e)throw Error(t??"Value expected");return e}let eT=eL`\[\^?`,eI=`c.? | C(?:-.?)?|${eL`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${eL`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${eL`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${eL`o\{[^\}]*\}?`}|${eL`\d{1,3}`}`,eR=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,e_=RegExp(eL`
2
- \\ (?:
3
- ${eI}
4
- | [gk]<[^>]*>?
5
- | [gk]'[^']*'?
6
- | .
7
- )
8
- | \( (?:
9
- \? (?:
10
- [:=!>({]
11
- | <[=!]
12
- | <[^>]*>
13
- | '[^']*'
14
- | ~\|?
15
- | #(?:[^)\\]|\\.?)*
16
- | [^:)]*[:)]
17
- )?
18
- | \*[^\)]*\)?
19
- )?
20
- | (?:${eR.source})+
21
- | ${eT}
22
- | .
23
- `.replace(/\s+/g,""),"gsu"),eM=RegExp(eL`
24
- \\ (?:
25
- ${eI}
26
- | .
27
- )
28
- | \[:(?:\^?\p{Alpha}+|\^):\]
29
- | ${eT}
30
- | &&
31
- | .
32
- `.replace(/\s+/g,""),"gsu");function eN(e,{inCharClass:t}){let n=e[1];if("c"===n||"C"===n){var i,r=e;let t="c"===r[1]?r[2]:r[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${r}"`);return eO(ew(t.toUpperCase())-64,r)}if("dDhHsSwW".includes(n)){let t;return eF({d:"digit",h:"hex",s:"space",w:"word"}[t=(i=e)[1].toLowerCase()],i,{negate:i[1]!==t})}if(e.startsWith(eL`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(3===e.length)throw Error(`Incomplete or invalid Unicode property "${e}"`);return function(e){let{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return eF("property",e,{value:i,negate:"P"===t&&!n||"p"===t&&!!n})}(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),i=new TextEncoder;return[...n].map(e=>{let t=[...i.encode(e)].map(e=>`\\x${e.toString(16)}`).join("");return eO(ew(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if("u"===n||"x"===n)return eO(function(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);return parseInt("{"===e[2]?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2),16)}(e),e);if(eG.has(n))return eO(eG.get(n),e);if(/\d/.test(n))return{type:"EscapedNumber",inCharClass:t,raw:e};if("\\"===e)throw Error(eL`Incomplete escape "\"`);if("M"===n)throw Error(`Unsupported meta "${e}"`);if(2==[...e].length)return eO(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function eD(e,t){return{type:"Assertion",kind:e,raw:t}}function eP(e){return{type:"Backreference",raw:e}}function eO(e,t){return{type:"Character",value:e,raw:t}}function eH(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function eF(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function eB(e,t,n={}){return"keep"===e?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:eE(n.flags),raw:t}}function eU(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}let e$=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),eG=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function ez(e){let t=null,n,i;if("{"===e[0]){let{minStr:r,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups;if(+r>1e5||o&&+o>1e5)throw Error("Quantifier value unsupported in Oniguruma");if((n=+r)>(i=void 0===o?+r:""===o?1/0:+o)&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if("possessive"===t)throw Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=+("+"===e[0]),i="?"===e[0]?1:1/0,t="+"===e[1]?"possessive":"?"===e[1]?"lazy":"greedy";return{type:"Quantifier",kind:t,min:n,max:i,raw:e}}function ej(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function eW(e,t){if(!Array.isArray(e.body))throw Error("Expected node with body array");if(1!==e.body.length)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}let eq=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function eV(e,t={}){var n;let i={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=function(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if("string"!=typeof e)throw Error("String expected as pattern");let i=function(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let i=e[n];if(!"imxDPSWy".includes(i))throw Error(`Invalid flag "${i}"`);if("y"===i){if(!/^y{[gw]}/.test(e.slice(n)))throw Error('Invalid or unspecified flag "y" mode');t.textSegmentMode="g"===e[n+2]?"grapheme":"word",n+=3;continue}t[({i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"})[i]]=!0}return t}(n.flags),r=[i.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX:()=>r.at(-1),numOpenGroups:0,popModX(){r.pop()},pushModX(e){r.push(e)},replaceCurrentModX(e){r[r.length-1]=e},singleline:n.rules.singleline},a=[],s;for(e_.lastIndex=0;s=e_.exec(e);){let t=function(e,t,n,i){let[r,o]=n;if("["===n||"[^"===n){let e=function(e,t,n){let i=[eH("^"===t[1],t)],r=1,o;for(eM.lastIndex=n;o=eM.exec(e);){let e=o[0];if("["===e[0]&&":"!==e[1])r++,i.push(eH("^"===e[1],e));else if("]"===e){if("CharacterClassOpen"===i.at(-1).type)i.push(eO(93,e));else if(r--,i.push({type:"CharacterClassClose",raw:e}),!r)break}else{let t=function(e){if("\\"===e[0])return eN(e,{inCharClass:!0});if("["===e[0]){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!eA.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return eF("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return"-"===e?{type:"CharacterClassHyphen",raw:e}:"&&"===e?{type:"CharacterClassIntersector",raw:e}:eO(ew(e),e)}(e);Array.isArray(t)?i.push(...t):i.push(t)}}return{tokens:i,lastIndex:eM.lastIndex||e.length}}(t,n,i);return{tokens:e.tokens,lastIndex:e.lastIndex}}if("\\"===r){if("AbBGyYzZ".includes(o))return{token:eD(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:{type:"Subroutine",raw:n}}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:eP(n)}}if("K"===o)return{token:eB("keep",n)};if("N"===o||"R"===o)return{token:eF("newline",n,{negate:"N"===o})};if("O"===o)return{token:eF("any",n)};if("X"===o)return{token:eF("text_segment",n)};let e=eN(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if("("===r){if("*"===o)return{token:function(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:i,args:r}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(""===i)throw Error(`Named callout tag with empty value not allowed "${e}"`);let o=r?r.split(",").filter(e=>""!==e).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[a,s,l]=o,d=e$.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(o.length>0)throw Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if("string"==typeof a)throw Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!o.length||o.length>2)throw Error(`Named callout must have one or two arguments "${o}"`);if("string"==typeof a&&!/^[A-Za-z_]\w*$/.test(a))throw Error(`Named callout argument one must be a tag or number "${a}"`);if(2===o.length&&("number"==typeof s||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case"count":case"total_count":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if(1===o.length&&("number"==typeof a||!/^[<>X]$/.test(a)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(3!==o.length)throw Error(`Named callout must have three arguments "${o}"`);if("string"==typeof a&&!/^[A-Za-z_]\w*$/.test(a))throw Error(`Named callout argument one must be a tag or number "${a}"`);if("number"==typeof s||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if("string"==typeof l&&!/^[A-Za-z_]\w*$/.test(l))throw Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${d}"`)}return{type:"NamedCallout",kind:d,tag:i??null,arguments:r?.split(",")??null,raw:e}}(n)};if("(?{"===n)throw Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(")"!==t[i])throw Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:function(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";let r=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),o=ej(n),a=ej(i),s={};if(o&&(s.enable=o),a&&(s.disable=a),e.endsWith(")"))return t.replaceCurrentModX(r),eB("flags",e,{flags:s});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,eU("group",e,{...(o||a)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,"("===n&&!e.captureGroup||"(?:"===n)return{token:eU("group",n)};if("(?>"===n)return{token:eU("atomic",n)};if("(?="===n||"(?!"===n||"(?<="===n||"(?<!"===n)return{token:eU("<"===n[2]?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if("("===n&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:eU("capturing",n,{..."("!==n&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if("(?~|"===n)throw Error(`Unsupported absence function kind "${n}"`);return{token:eU("absence_repeater",n)}}throw"(?("===n?Error(`Unsupported conditional "${n}"`):Error(`Invalid or unsupported group option "${n}"`)}if(")"===n){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error('Unmatched ")"');return{token:{type:"GroupClose",raw:n}}}if(e.getCurrentModX()){if("#"===n){let e=t.indexOf(`
33
- `,i);return{lastIndex:-1===e?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=i,{lastIndex:e.exec(t)?e.lastIndex:i}}}return"."===n?{token:eF("dot",n)}:"^"===n||"$"===n?{token:eD(e.singleline?({"^":eL`\A`,$:eL`\Z`})[n]:n,n)}:"|"===n?{token:{type:"Alternator",raw:n}}:eR.test(n)?{tokens:function(e){let t,n=[],i=RegExp(eR,"gy");for(;t=i.exec(e);){let e=t[0];if("{"===e[0]){let t=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(t){let{min:r,max:o}=t.groups;if(+r>+o&&e.endsWith("?")){i.lastIndex--,n.push(ez(e.slice(0,-1)));continue}}}n.push(ez(e))}return n}(n)}:{token:eO(ew(n),n)}}(o,e,s[0],e_.lastIndex);t.tokens?a.push(...t.tokens):t.token&&a.push(t.token),void 0!==t.lastIndex&&(e_.lastIndex=t.lastIndex)}let l=[],d=0;a.filter(e=>"GroupOpen"===e.type).forEach(e=>{"capturing"===e.kind?e.number=++d:"("===e.raw&&l.push(e)}),d||l.forEach((e,t)=>{e.kind="capturing",e.number=t+1});let u=d||l.length;return{tokens:a.map(e=>"EscapedNumber"===e.type?function(e,t){let{raw:n,inCharClass:i}=e,r=n.slice(1);if(!i&&("0"!==r&&1===r.length||"0"!==r[0]&&+r<=t))return[eP(n)];let o=[],a=r.match(/^[0-7]+|\d/g);for(let e=0;e<a.length;e++){let t,i=a[e];if(0===e&&"8"!==i&&"9"!==i){if((t=parseInt(i,8))>127)throw Error(eL`Octal encoded byte above 177 unsupported "${n}"`)}else t=ew(i);o.push(eO(t,(0===e?"\\":"")+i))}return o}(e,u):e).flat(),flags:i}}(e,{flags:i.flags,rules:{captureGroup:i.rules.captureGroup,singleline:i.rules.singleline}}),o=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case"Alternator":return eX();case"Assertion":return function({kind:e}){return eK(eE({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===eL`\B`||e===eL`\Y`})}(n);case"Backreference":return function({raw:e},t){let n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),r=(n,i=!1)=>{let r=t.capturingGroups.length,o=!1;if(n>r)if(t.skipBackrefValidation)o=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,eQ(i?r+1-n:n,{orphan:o})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(n)return r(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(i))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw Error(`Group name not defined to the left "${e}"`);return eQ(i)}return r(+i)}(n,a);case"Character":return eJ(n.value,{useLastValid:!!t.isCheckingRangeEnd});case"CharacterClassHyphen":return function(e,t){let{tokens:n,walk:i}=e,r=e.parent,o=r.body.at(-1),a=n[e.nextIndex];if(!t.isCheckingRangeEnd&&o&&"CharacterClass"!==o.type&&"CharacterClassRange"!==o.type&&a&&"CharacterClassOpen"!==a.type&&"CharacterClassClose"!==a.type&&"CharacterClassIntersector"!==a.type){let e=i(r,{...t,isCheckingRangeEnd:!0});if("Character"===o.type&&"Character"===e.type)return r.body.pop(),function(e,t){if(t.value<e.value)throw Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}(o,e);throw Error("Invalid character class range")}return eJ(ew("-"))}(a,t);case"CharacterClassOpen":return function({negate:e},t,n){let{tokens:i,walk:r}=t,o=i[t.nextIndex],a=[eZ()],s=tt(o);for(;"CharacterClassClose"!==s.type;){if("CharacterClassIntersector"===s.type)a.push(eZ()),t.nextIndex++;else{let e=a.at(-1);e.body.push(r(e,n))}s=tt(i[t.nextIndex],o)}let l=eZ({negate:e});return 1===a.length?l.body=a[0].body:(l.kind="intersection",l.body=a.map(e=>1===e.body.length?e.body[0]:e)),t.nextIndex++,l}(n,a,t);case"CharacterSet":return function({kind:e,negate:t,value:n},i){let{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:a}=i;if("property"===e){let i=te(n);if(!eA.has(i)||a?.has(i))return e6(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:a});e="posix",n=i}return"posix"===e?function(e,t){let n=!!t?.negate;if(!eA.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}(n,{negate:t}):e0(e,{negate:t})}(n,a);case"Directive":return function(e,t={}){if("keep"===e)return{type:"Directive",kind:e};if("flags"===e)return{type:"Directive",kind:e,flags:eE(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}(n.kind,{flags:n.flags});case"GroupOpen":return function(e,t,n){var i,r;let{tokens:o,capturingGroups:a,namedGroupsByName:s,skipLookbehindValidation:l,walk:d}=t,u=function({flags:e,kind:t,name:n,negate:i,number:r}){switch(t){case"absence_repeater":var o="repeater";!1;return{type:"AbsenceFunction",kind:o,body:e4(void 0)};case"atomic":return e1({atomic:!0});case"capturing":return eY(r,{name:n});case"group":return e1({flags:e});case"lookahead":case"lookbehind":return e2({behind:"lookbehind"===t,negate:i});default:throw Error(`Unexpected group kind "${t}"`)}}(e),h="AbsenceFunction"===u.type,c=e9(u),f=c&&u.negate;if("CapturingGroup"===u.type&&(a.push(u),u.name&&(i=u.name,r=[],s.has(i)||s.set(i,r),s.get(i)).push(u)),h&&n.isInAbsenceFunction)throw Error("Nested absence function not supported by Oniguruma");let p=tn(o[t.nextIndex]);for(;"GroupClose"!==p.type;){if("Alternator"===p.type)u.body.push(eX()),t.nextIndex++;else{let e=u.body.at(-1),t=d(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||h,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||f});if(e.body.push(t),(c||n.isInLookbehind)&&!l){let e="Lookbehind includes a pattern not allowed by Oniguruma";if(f||n.isInNegLookbehind){if(e7(t)||"CapturingGroup"===t.type)throw Error(e)}else if(e7(t)||e9(t)&&t.negate)throw Error(e)}}p=tn(o[t.nextIndex])}return t.nextIndex++,u}(n,a,t);case"NamedCallout":var i,o;return i=n.kind,o=n.tag,{type:"NamedCallout",kind:i,tag:o,arguments:n.arguments};case"Quantifier":return function({kind:e,min:t,max:n},i){let r=i.parent,o=r.body.at(-1);if(!o||!eq.has(o.type))throw Error("Quantifier requires a repeatable token");let a=e8(e,t,n,o);return r.body.pop(),a}(n,a);case"Subroutine":return function({raw:e},t){let{capturingGroups:n,subroutines:i}=t,r=e.slice(3,-1),o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(o){let e=+o.groups.num,i=n.length;if(t.hasNumberedRef=!0,(r=({"":e,"+":i+e,"-":i+1-e})[o.groups.sign])<1)throw Error("Invalid subroutine number")}else"0"===r&&(r=0);let a=e5(r);return i.push(a),a}(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:i.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:i.skipBackrefValidation,skipLookbehindValidation:i.skipLookbehindValidation,skipPropertyNameValidation:i.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:i.unicodePropertyMap,walk:o},s=(n={type:"Flags",...r.flags},{type:"Regex",body:e4(void 0),flags:n}),l=s.body[0];for(;a.nextIndex<r.tokens.length;){let e=o(l,{});"Alternative"===e.type?(s.body.push(e),l=e):l.body.push(e)}let{capturingGroups:d,hasNumberedRef:u,namedGroupsByName:h,subroutines:c}=a;if(u&&h.size&&!i.rules.captureGroup)throw Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:e}of c)if("number"==typeof e){if(e>d.length)throw Error("Subroutine uses a group number that's not defined");e&&(d[e-1].isSubroutined=!0)}else if(h.has(e)){if(h.get(e).length>1)throw Error(eL`Subroutine uses a duplicate group name "\g<${e}>"`);h.get(e)[0].isSubroutined=!0}else throw Error(eL`Subroutine uses a group name that's not defined "\g<${e}>"`);return s}function eX(e){return{type:"Alternative",body:e3(e?.body)}}function eK(e,t){let n={type:"Assertion",kind:e};return("word_boundary"===e||"text_segment_boundary"===e)&&(n.negate=!!t?.negate),n}function eQ(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function eY(e,t){var n;let i={name:void 0,isSubroutined:!1,...t};if(void 0!==i.name&&(n=i.name,!/^[\p{Alpha}\p{Pc}][^)]*$/u.test(n)))throw Error(`Group name "${i.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...i.name&&{name:i.name},...i.isSubroutined&&{isSubroutined:i.isSubroutined},body:e4(t?.body)}}function eJ(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${t}}"`):Error(`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:"Character",value:e}}function eZ(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:e3(e?.body)}}function e0(e,t){let n=!!t?.negate,i={type:"CharacterSet",kind:e};return("digit"===e||"hex"===e||"newline"===e||"space"===e||"word"===e)&&(i.negate=n),"text_segment"!==e&&("newline"!==e||n)||(i.variableLength=!0),i}function e1(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:e4(e?.body)}}function e2(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:e4(e?.body)}}function e8(e,t,n,i){if(t>n)throw Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function e5(e){return{type:"Subroutine",ref:e}}function e6(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},i=n.unicodePropertyMap?.get(te(e));if(!i){if(n.normalizeUnknownPropertyNames)i=e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase());else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(eL`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function e4(e){if(void 0===e)e=[eX()];else if(!Array.isArray(e)||!e.length||!e.every(e=>"Alternative"===e.type))throw Error("Invalid body; expected array of one or more Alternative nodes");return e}function e3(e){if(void 0===e)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error("Invalid body; expected array of nodes");return e}function e7(e){return"LookaroundAssertion"===e.type&&"lookahead"===e.kind}function e9(e){return"LookaroundAssertion"===e.type&&"lookbehind"===e.kind}function te(e){return e.replace(/[- _]+/g,"").toLowerCase()}function tt(e,t){return eE(e,`${t?.type==="Character"&&93===t.value?"Empty":"Unclosed"} character class`)}function tn(e){return eE(e,"Unclosed group")}function ti(e,t,n=null){function i(e,t){for(let n=0;n<e.length;n++){let i=r(e[n],t,n,e);n=Math.max(-1,n+i)}}function r(o,a=null,s=null,l=null){let d=0,u=!1,h={node:o,parent:a,key:s,container:l,root:e,remove(){tr(l).splice(Math.max(0,to(s)+d),1),d--,u=!0},removeAllNextSiblings:()=>tr(l).splice(to(s)+1),removeAllPrevSiblings(){let e=to(s)+d;return d-=e,tr(l).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;l?l[Math.max(0,to(s)+d)]=e:eE(a,"Can't replace root node")[s]=e,n&&r(e,a,s,l),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(tr(l).splice(Math.max(0,to(s)+d),1,...e),d+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=r(e[n],a,to(s)+n+t,l)}u=!0},skip(){u=!0}},{type:c}=o,f=t["*"],p=t[c],g="function"==typeof f?f:f?.enter,m="function"==typeof p?p:p?.enter;if(g?.(h,n),m?.(h,n),!u)switch(c){case"AbsenceFunction":case"CapturingGroup":case"Group":case"Alternative":case"CharacterClass":case"LookaroundAssertion":i(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(o.min,o,"min"),r(o.max,o,"max");break;case"Quantifier":r(o.body,o,"body");break;case"Regex":i(o.body,o),r(o.flags,o,"flags");break;default:throw Error(`Unexpected node type "${c}"`)}return p?.exit?.(h,n),f?.exit?.(h,n),d}return r(e),e}function tr(e){if(!Array.isArray(e))throw Error("Container expected");return e}function to(e){if("number"!=typeof e)throw Error("Numeric key expected");return e}let ta=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`,ts=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function tl(e,t,n,i){let r=RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1],a=0,s="";for(let t of e.matchAll(r)){let{0:e,groups:{$skip:r}}=t;if(!r&&(!i||i===ts.DEFAULT==!a)){n instanceof Function?s+=n(t,{context:a?ts.CHAR_CLASS:ts.DEFAULT,negated:o[o.length-1]}):s+=n;continue}"["===e[0]?(a++,o.push("^"===e[1])):"]"===e&&a&&(a--,o.pop()),s+=e}return s}function td(e,t,n){return!!function(e,t,n=0,i){let r;if(!RegExp(t,"su").test(e))return null;let o=RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let a=0;for(;r=o.exec(e);){let{0:e,groups:{$skip:t}}=r;if(!t&&(!i||i===ts.DEFAULT==!a))return r;"["===e?a++:"]"===e&&a&&a--,o.lastIndex==r.index&&o.lastIndex++}return null}(e,t,0,n)}let tu=RegExp(String.raw`(?<noncapturingStart>${ta})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu"),th=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,tc=RegExp(String.raw`
34
- \\(?: \d+
35
- | c[A-Za-z]
36
- | [gk]<[^>]+>
37
- | [pPu]\{[^\}]+\}
38
- | u[A-Fa-f\d]{4}
39
- | x[A-Fa-f\d]{2}
40
- )
41
- | \((?: \? (?: [:=!>]
42
- | <(?:[=!]|[^>]+>)
43
- | [A-Za-z\-]+:
44
- | \(DEFINE\)
45
- ))?
46
- | (?<qBase>${th})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
47
- | \\?.
48
- `.replace(/\s+/g,""),"gsu"),tf=String.raw,tp=tf`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,tg=tf`\(\?R=(?<rDepth>[^\)]+)\)|${tp}`,tm=tf`\(\?<(?![=!])(?<captureName>[^>]+)>`,tb=tf`${tm}|(?<unnamed>\()(?!\?)`,tv=RegExp(tf`${tm}|${tg}|\(\?|\\?.`,"gsu"),ty="Cannot use multiple overlapping recursions";function tC(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e*=1)<2||e>100)throw Error(t)}function tk(e,t,n,i,r,o,a){let s=new Set;i&&tl(e+t,tm,({groups:{captureName:e}})=>{s.add(e)},ts.DEFAULT);let l=[n,i?s:null,r,o,a];return`${e}${tS(`(?:${e}`,"forward",...l)}(?:)${tS(`${t})`,"backward",...l)}${t}`}function tS(e,t,n,i,r,o,a){let s=e=>"forward"===t?e+2:n-e+2-1,l="";for(let t=0;t<n;t++){let n=s(t);l+=tl(e,tf`${tb}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:l}})=>{if(l&&i&&!i.has(l))return e;let d=`_$${n}`;if(s||t){let n=a+o.length+1;return o.push(n),function(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}(r,n),s?e:`(?<${t}${d}>`}return tf`\k<${l}${d}>`},ts.DEFAULT)}return l}function tx(e,t,n,i,r,o){if(e.size&&i){let a=0;tl(t,tb,()=>a++,ts.DEFAULT);let s=o-a+r,l=new Map;return e.forEach((e,t)=>{let r=(i-a*n)/n,o=a*n,d=t>s+a?t+i:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+a+r)u.push(t+i);else if(t<=s+a)for(let e=0;e<=n;e++)u.push(t+a*e);else for(let e=0;e<=n;e++)u.push(t+o+r*e);l.set(d,u)}),l}return e}var tw=String.fromCodePoint,tA=String.raw,tL={},tE=globalThis.RegExp;function tT(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function tI(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}tL.flagGroups=(()=>{try{new tE("(?i:)")}catch{return!1}return!0})(),tL.unicodeSets=(()=>{try{new tE("[[]]","v")}catch{return!1}return!0})(),tL.bugFlagVLiteralHyphenIsRange=!!tL.unicodeSets&&(()=>{try{new tE(tA`[\d\-a]`,"v")}catch{return!0}return!1})(),tL.bugNestedClassIgnoresNegation=tL.unicodeSets&&new tE("[[^a]]","v").test("a");var tR={ES2025:2025,ES2024:2024,ES2018:2018},t_={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function tM(e={}){if("[object Object]"!==({}).toString.call(e))throw Error("Unexpected options");if(void 0!==e.target&&!t_[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return"auto"===t.target&&(t.target=tL.flagGroups?"ES2025":tL.unicodeSets?"ES2024":"ES2018"),t}var tN=new Set([tw(304),tw(305)]),tD=tA`[\p{L}\p{M}\p{N}\p{Pc}]`;function tP(e){if(tN.has(e))return[e];let t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),r=tB.get(n),o=tH.get(n),a=tF.get(n);return 1==[...i].length&&t.add(i),a&&t.add(a),r&&t.add(r),t.add(n),o&&t.add(o),[...t]}var tO=new Map(`C Other
49
- Cc Control cntrl
50
- Cf Format
51
- Cn Unassigned
52
- Co Private_Use
53
- Cs Surrogate
54
- L Letter
55
- LC Cased_Letter
56
- Ll Lowercase_Letter
57
- Lm Modifier_Letter
58
- Lo Other_Letter
59
- Lt Titlecase_Letter
60
- Lu Uppercase_Letter
61
- M Mark Combining_Mark
62
- Mc Spacing_Mark
63
- Me Enclosing_Mark
64
- Mn Nonspacing_Mark
65
- N Number
66
- Nd Decimal_Number digit
67
- Nl Letter_Number
68
- No Other_Number
69
- P Punctuation punct
70
- Pc Connector_Punctuation
71
- Pd Dash_Punctuation
72
- Pe Close_Punctuation
73
- Pf Final_Punctuation
74
- Pi Initial_Punctuation
75
- Po Other_Punctuation
76
- Ps Open_Punctuation
77
- S Symbol
78
- Sc Currency_Symbol
79
- Sk Modifier_Symbol
80
- Sm Math_Symbol
81
- So Other_Symbol
82
- Z Separator
83
- Zl Line_Separator
84
- Zp Paragraph_Separator
85
- Zs Space_Separator
86
- ASCII
87
- ASCII_Hex_Digit AHex
88
- Alphabetic Alpha
89
- Any
90
- Assigned
91
- Bidi_Control Bidi_C
92
- Bidi_Mirrored Bidi_M
93
- Case_Ignorable CI
94
- Cased
95
- Changes_When_Casefolded CWCF
96
- Changes_When_Casemapped CWCM
97
- Changes_When_Lowercased CWL
98
- Changes_When_NFKC_Casefolded CWKCF
99
- Changes_When_Titlecased CWT
100
- Changes_When_Uppercased CWU
101
- Dash
102
- Default_Ignorable_Code_Point DI
103
- Deprecated Dep
104
- Diacritic Dia
105
- Emoji
106
- Emoji_Component EComp
107
- Emoji_Modifier EMod
108
- Emoji_Modifier_Base EBase
109
- Emoji_Presentation EPres
110
- Extended_Pictographic ExtPict
111
- Extender Ext
112
- Grapheme_Base Gr_Base
113
- Grapheme_Extend Gr_Ext
114
- Hex_Digit Hex
115
- IDS_Binary_Operator IDSB
116
- IDS_Trinary_Operator IDST
117
- ID_Continue IDC
118
- ID_Start IDS
119
- Ideographic Ideo
120
- Join_Control Join_C
121
- Logical_Order_Exception LOE
122
- Lowercase Lower
123
- Math
124
- Noncharacter_Code_Point NChar
125
- Pattern_Syntax Pat_Syn
126
- Pattern_White_Space Pat_WS
127
- Quotation_Mark QMark
128
- Radical
129
- Regional_Indicator RI
130
- Sentence_Terminal STerm
131
- Soft_Dotted SD
132
- Terminal_Punctuation Term
133
- Unified_Ideograph UIdeo
134
- Uppercase Upper
135
- Variation_Selector VS
136
- White_Space space
137
- XID_Continue XIDC
138
- XID_Start XIDS`.split(/\s/).map(e=>[te(e),e])),tH=new Map([["s",tw(383)],[tw(383),"s"]]),tF=new Map([[tw(223),tw(7838)],[tw(107),tw(8490)],[tw(229),tw(8491)],[tw(969),tw(8486)]]),tB=new Map([t$(453),t$(456),t$(459),t$(498),...tG(8072,8079),...tG(8088,8095),...tG(8104,8111),t$(8124),t$(8140),t$(8188)]),tU=new Map([["alnum",tA`[\p{Alpha}\p{Nd}]`],["alpha",tA`\p{Alpha}`],["ascii",tA`\p{ASCII}`],["blank",tA`[\p{Zs}\t]`],["cntrl",tA`\p{Cc}`],["digit",tA`\p{Nd}`],["graph",tA`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",tA`\p{Lower}`],["print",tA`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",tA`[\p{P}\p{S}]`],["space",tA`\p{space}`],["upper",tA`\p{Upper}`],["word",tA`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",tA`\p{AHex}`]]);function t$(e){let t=tw(e);return[t.toLowerCase(),t]}function tG(e,t){return(function(e,t){let n=[];for(let i=e;i<=t;i++)n.push(i);return n})(e,t).map(e=>t$(e))}var tz=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]),tj={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:i,kind:r}=e;if("repeater"===r){let e=e1();e.body[0].body.push(e2({negate:!0,body:i}),e6("Any"));let r=e1();r.body[0].body.push(e8("greedy",0,1/0,e)),n(t2(r,t),{traverse:!0})}else throw Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){let r=e.body.filter(e=>"flags"===e.kind);for(let e=n+1;e<t.body.length;e++)tI(i,t.body[e],[]).push(...r)},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=tQ(t.get(e));if(n){let t=e1({flags:n});t.body[0].body=e.body,e.body=[t2(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:r,remove:o,replaceWith:a},s){let{kind:l,negate:d}=e,{asciiWordBoundaries:u,avoidSubclass:h,supportedGNodes:c,wordIsAscii:f}=s;if("text_segment_boundary"===l)throw Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if("line_end"===l)a(t2(e2({body:[eX({body:[eK("string_end")]}),eX({body:[eJ(10)]})]}),t));else if("line_start"===l)a(t2(tZ(tA`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if("search_start"===l)if(c.has(e))r.flags.sticky=!0,o();else{var p;let e,r=i[n-1];if(r&&((e=["Character","CharacterClass","CharacterSet"]).includes((p=r).type)||"Quantifier"===p.type&&p.min&&e.includes(p.body.type)))a(t2(e2({negate:!0}),t));else if(h)throw Error(tA`Uses "\G" in a way that requires a subclass`);else a(t1(eK("string_start"),t)),s.strategy="clip_search"}else if("string_end"===l||"string_start"===l);else if("string_end_newline"===l)a(t2(tZ(tA`(?=\n?\z)`),t));else if("word_boundary"===l){if(!f&&!u){let e=`(?:(?<=${tD})(?!${tD})|(?<!${tD})(?=${tD}))`,n=`(?:(?<=${tD})(?=${tD})|(?<!${tD})(?!${tD}))`;a(t2(tZ(d?n:e),t))}}else throw Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"!=typeof n||tJ(n)||(e.ref=n=tK(n,t))},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!tJ(i)&&(e.name=i=tK(i,t)),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){"intersection"===t.kind&&n(t2(eZ({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:a,wordIsAscii:s}){let{kind:l,negate:d,value:u}=e;if(o&&("digit"===l||"digit"===u))return void n(t1(e0("digit",{negate:d}),t));if(a&&("space"===l||"space"===u))return void n(t2(t0(tZ("[ -\r ]"),d),t));if(s&&("word"===l||"word"===u))return void n(t1(e0("word",{negate:d}),t));if("any"===l)n(t1(e6("Any"),t));else if("digit"===l)n(t1(e6("Nd",{negate:d}),t));else if("dot"===l);else if("text_segment"===l){if("strict"===i)throw Error(tA`Use of "\X" requires non-strict accuracy`);let e="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",o=tA`\p{RI}{2}|${e}(?:\u200D${e})*`;n(t2(tZ(tA`(?>\r\n|${r?tA`\p{RGI_Emoji}`:o}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if("hex"===l)n(t1(e6("AHex",{negate:d}),t));else if("newline"===l)n(t2(tZ(d?"[^\n]":"(?>\r\n?|[\n\v\f…\u2028\u2029])"),t));else if("posix"===l)if(r||"graph"!==u&&"print"!==u)n(t2(t0(tZ(tU.get(u)),d),t));else{if("strict"===i)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:"!-~",print:" -~"}[u];d&&(e=`\0-${tw(e.codePointAt(0)-1)}${tw(e.codePointAt(2)+1)}-\u{10FFFF}`),n(t2(tZ(`[${e}]`),t))}else if("property"===l)tO.has(te(u))||(e.key="sc");else if("space"===l)n(t1(e6("space",{negate:d}),t));else if("word"===l)n(t2(t0(tZ(tD),d),t));else throw Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:a}){let{kind:s,flags:l}=e;if("flags"===s)if(l.enable||l.disable){let e=e1({flags:l});e.body[0].body=a(),r(t2(e,t),{traverse:!0})}else i();else if("keep"===s){let e=n.body[0],i=1===n.body.length&&eW(e,{type:"Group"})&&1===e.body[0].body.length?e.body[0]:n;if(t.parent!==i||i.body.length>1)throw Error(tA`Uses "\K" in a way that's unsupported`);let a=e2({behind:!0});a.body[0].body=o(),r(t2(a,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error('Unsupported flag "P"');if("word"===e.textSegmentMode)throw Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,e.flags.enable||e.flags.disable||delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;"lookbehind"===n&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:i}=e;if("fail"===i)n(t2(e2({negate:!0}),t));else throw Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if("Quantifier"===e.body.type){let t=e1();t.body[0].body.push(e.body),e.body=t2(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],i=!1,r=!1;for(let t of e.body)if(1===t.body.length&&"search_start"===t.body[0].kind)t.body.pop();else{let e=function e(t){let n=t.find(e=>"search_start"===e.kind||function(e,t){let n={negate:null,...t};return"LookaroundAssertion"===e.type&&(null===n.negate||e.negate===n.negate)&&1===e.body.length&&eW(e.body[0],{type:"Assertion",kind:"search_start"})}(e,{negate:!1})||!function({type:e}){return"Assertion"===e||"Directive"===e||"LookaroundAssertion"===e}(e));if(!n)return null;if("search_start"===n.kind)return n;if("LookaroundAssertion"===n.type)return n.body[0].body[0];if("CapturingGroup"===n.type||"Group"===n.type){let t=[];for(let i of n.body){let n=e(i.body);if(!n)return null;Array.isArray(n)?t.push(...n):t.push(n)}return t}return null}(t.body);e?(i=!0,Array.isArray(e)?n.push(...e):n.push(e)):r=!0}i&&!r&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if("strict"===t&&n&&i)throw Error(tA`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;"string"!=typeof n||tJ(n)||(e.ref=n=tK(n,t))}},tW={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:i,ref:r}=e;i||n.set(e,[...t.get(r).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:a,openRefs:s,reffedNodesByReferencer:l}){let d=r.get(e);if(d&&s.has(e.number)){let i=t1(tX(e.number),t);l.set(i,s.get(e.number)),n(i);return}s.set(e.number,e),a.set(e.number,[]),e.name&&tI(a,e.name,[]);let u=a.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(d===n.node||d&&d===n.origin||e===n.origin){u.splice(t,1);break}}if(a.get(e.number).push({node:e,origin:d}),e.name&&a.get(e.name).push({node:e,origin:d}),e.name){let t=tI(o,e.name,new Map),n=!1;if(d)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=tT(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){let{isRecursive:r,ref:o}=e;if(r){let n=t;for(;(n=n.parent)&&("CapturingGroup"!==n.type||n.name!==o&&n.number!==o););i.reffedNodesByReferencer.set(e,n);return}let a=i.subroutineRefMap.get(o),s=0===o,l=s?tX(0):function e(t,n,i,r){let o=Array.isArray(t)?[]:{};for(let[a,s]of Object.entries(t))"parent"===a?o.parent=Array.isArray(i)?r:i:s&&"object"==typeof s?o[a]=e(s,n,o,i):("type"===a&&"CapturingGroup"===s&&n.set(o,n.get(t)??t),o[a]=s);return o}(a,i.groupOriginByCopy,null),d=l;if(!s){var u,h;let e=tQ(function(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}(a,e=>"Group"===e.type&&!!e.flags)),t=e?tT(i.globalFlags,e):i.globalFlags;u=t,h=i.currentFlags,(u.dotAll!==h.dotAll||u.ignoreCase!==h.ignoreCase)&&(d=e1({flags:function({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),e&&t||(n.disable={},e||(n.disable.dotAll=!0),t||(n.disable.ignoreCase=!0)),n}(t)})).body[0].body.push(l)}n(t2(d,t),{traverse:!s})}},tq={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}let r=i.reffedNodesByReferencer.get(e).filter(t=>(function(e,t){let n=t;do{if("Regex"===n.type)return!1;if("Alternative"===n.type)continue;if(n===e)return!1;for(let t of tY(n.parent)){if(t===n)break;if(t===e||function e(t,n){for(let i of tY(t)??[])if(i===n||e(i,n))return!0;return!1}(t,e))return!0}}while(n=n.parent)throw Error("Unexpected path")})(t,e));r.length?r.length>1?n(t2(e1({atomic:!0,body:r.reverse().map(e=>eX({body:[eQ(e.number)]}))}),t)):e.ref=r[0].number:n(t2(e2({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=eY();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&0!==e.ref&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function tV(e){ti(e,{"*"({node:e,parent:t}){e.parent=t}})}function tX(e){let t=e5(e);return t.isRecursive=!0,t}function tK(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function tQ(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return(e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable)?n:null}function tY(e){if(!e)throw Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function tJ(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function tZ(e,t){let n=eV(e,{...t,unicodePropertyMap:tO}).body;return n.length>1||n[0].body.length>1?e1({body:n}):n[0].body[0]}function t0(e,t){return e.negate=t,e}function t1(e,t){return e.parent=t,e}function t2(e,t){return tV(e),e.parent=t,e}var t8={"*":{enter({node:e},t){if(ni(e)){let n=t.getCurrentModI();t.pushModI(e.flags?tT({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){ni(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){ne(tw(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),nt(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){"property"===e.kind&&tz.has(e.value)&&t.setHasCasedChar()}},t5={Alternative:({body:e},t,n)=>e.map(n).join(""),Assertion({kind:e,negate:t}){if("string_end"===e)return"$";if("string_start"===e)return"^";if("word_boundary"===e)return t?tA`\B`:tA`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if("number"!=typeof e)throw Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&"strict"===t.accuracy&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:i,name:r,number:o}=e,a={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(a.hidden=!0,o>s.number&&(a.transferTo=s.number)),t.captureMap.set(o,a),`(${r?`?<${r}>`:""}${i.map(n).join("|")})`},Character({value:e},t){let n=tw(e),i=nn(e,{escDigit:"Backreference"===t.lastNode.type,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&ne(n)){let e=tP(n);return t.inCharClass?e.join(""):e.length>1?`[${e.join("")}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:i,negate:r,parent:o}=e,{body:a}=e;if("intersection"===i&&!t.useFlagV)throw Error("Use of character class intersection requires min target ES2024");tL.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(nr)&&(a=[eJ(45),...a.filter(e=>!nr(e))]);let s=()=>`[${r?"^":""}${a.map(n).join("intersection"===i?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||tL.bugNestedClassIgnoresNegation)&&!r){let t=a.filter(e=>"CharacterClass"===e.type&&"union"===e.kind&&e.negate);if(t.length){let i=e1(),r=i.body[0];return i.parent=o,r.parent=i,e.body=a=a.filter(e=>!t.includes(e)),a.length?(e.parent=r,r.body.push(e)):i.body.pop(),t.forEach(e=>{let t=eX({body:[e]});e.parent=t,t.parent=i,i.body.push(t)}),n(i)}}t.inCharClass=!0;let i=s();return t.inCharClass=!1,i}let l=a[0];if("union"===i&&!r&&l&&((!t.useFlagV||!t.verbose)&&"union"===o.kind&&!(tL.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&"intersection"===o.kind&&1===a.length&&"CharacterClassRange"!==l.type))return a.map(n).join("");if(!t.useFlagV&&"CharacterClass"===o.type)throw Error("Uses nested character class in a way that requires min target ES2024");return s()},CharacterClassRange(e,t){let n=e.min.value,i=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=nn(n,r),a=nn(i,r),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&(function(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],i=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?i??=t[e]:null===i?n.push(t[e]):(n.push([i,t[e]]),i=null);return n})(nt(e)).forEach(e=>{s.add(Array.isArray(e)?`${nn(e[0],r)}-${nn(e[1],r)}`:nn(e,r))}),`${o}-${a}${[...s].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},r){if("dot"===e)return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":tA`[^\n]`;if("digit"===e)return t?tA`\D`:tA`\d`;if("property"===e){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&tz.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?tA`\P`:tA`\p`}{${i?`${i}=`:""}${n}}`}if("word"===e)return t?tA`\W`:tA`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags:(e,t)=>(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":""),Group({atomic:e,body:t,flags:n,parent:i},r,o){let a=r.currentFlags;n&&(r.currentFlags=tT(a,n));let s=t.map(o).join("|"),l=r.verbose||1!==t.length||"Quantifier"===i.type||e||r.useFlagMods&&n?`(?${function(e,t,n){if(e)return">";let i="";if(t&&n){let{enable:e,disable:n}=t;i=(e?.ignoreCase?"i":"")+(e?.dotAll?"s":"")+(n?"-":"")+(n?.ignoreCase?"i":"")+(n?.dotAll?"s":"")}return`${i}:`}(e,n,r.useFlagMods)}${s})`:s;return r.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:n},i,r){let o=`${"lookahead"===t?"":"<"}${n?"!":"="}`;return`(?${o}${e.map(r).join("|")})`},Quantifier:(e,t,n)=>n(e.body)+function({kind:e,max:t,min:n}){return(n||1!==t?n||t!==1/0?1===n&&t===1/0?"+":n===t?`{${n}}`:`{${n},${t===1/0?"":t}}`:"*":"?")+({greedy:"",lazy:"?",possessive:"+"})[e]}(e),Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error("Unexpected non-recursive subroutine in transformed AST");let i=n.recursionLimit;return 0===t?`(?R=${i})`:tA`\g<${t}&R=${i}>`}},t6=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),t4=new Set(["-","\\","]","^","["]),t3=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),t7=new Map([[9,tA`\t`],[10,tA`\n`],[11,tA`\v`],[12,tA`\f`],[13,tA`\r`],[8232,tA`\u2028`],[8233,tA`\u2029`],[65279,tA`\uFEFF`]]),t9=/^\p{Cased}$/u;function ne(e){return t9.test(e)}function nt(e,t){let n=!!t?.firstOnly,i=e.min.value,r=e.max.value,o=[];if(i<65&&(65535===r||r>=131071)||65536===i&&r>=131071)return o;for(let e=i;e<=r;e++){let t=tw(e);if(!ne(t))continue;let a=tP(t).filter(e=>{let t=e.codePointAt(0);return t<i||t>r});if(a.length&&(o.push(...a),n))break}return o}function nn(e,{escDigit:t,inCharClass:n,useFlagV:i}){var r;if(t7.has(e))return t7.get(e);if(e<32||e>126&&e<160||e>262143||t&&(r=e)>47&&r<58)return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=tw(e);return((n?i?t3:t4:t6).has(o)?"\\":"")+o}function ni({type:e}){return"CapturingGroup"===e||"Group"===e||"LookaroundAssertion"===e}function nr({type:e,value:t}){return"Character"===e&&45===t}var no=class e extends RegExp{#e=new Map;#t=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,n,i){const r=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw Error("Cannot provide options when copying a regexp");super(t,n),this.#n=t.source,t instanceof e&&(this.#e=t.#e,this.#i=t.#i,this.#r=t.#r,this.rawOptions=t.rawOptions)}else{const e={hiddenCaptures:[],strategy:null,transfers:[],...i};super(r?"":t,n),this.#n=t,this.#e=function(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,i]of t)for(let t of i)tI(n,t,{}).transferTo=e;return n}(e.hiddenCaptures,e.transfers),this.#r=e.strategy,this.rawOptions=i??{}}r||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,i=this.lastIndex;if("clip_search"===this.#r&&n&&i){this.lastIndex=0;let e=this.#o(t.slice(i));return e&&(function(e,t,n,i){if(e.index+=t,e.input=n,i){let n=e.indices;for(let e=0;e<n.length;e++){let i=n[e];i&&(n[e]=[i[0]+t,i[1]+t])}let i=n.groups;i&&Object.keys(i).forEach(e=>{let n=i[e];n&&(i[e]=[n[0]+t,n[1]+t])})}}(e,i,t,this.hasIndices),this.lastIndex+=i),e}return this.#o(t)}#o(e){let t;this.#t.lastIndex=this.lastIndex;let n=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!n||!this.#e.size)return n;let i=[...n];n.length=1,this.hasIndices&&(t=[...n.indices],n.indices.length=1);let r=[0];for(let e=1;e<i.length;e++){let{hidden:o,transferTo:a}=this.#e.get(e)??{};if(o?r.push(null):(r.push(n.length),n.push(i[e]),this.hasIndices&&n.indices.push(t[e])),a&&void 0!==i[e]){let o=r[a];if(!o)throw Error(`Invalid capture transfer to "${o}"`);if(n[o]=i[e],this.hasIndices&&(n.indices[o]=t[e]),n.groups){this.#i||(this.#i=function(e){let t,n=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,i=new Map,r=0,o=0;for(;t=n.exec(e);){let{0:e,groups:{capture:n,name:a}}=t;"["===e?r++:r?"]"===e&&r--:n&&(o++,a&&i.set(o,a))}return i}(this.source));let r=this.#i.get(a);r&&(n.groups[r]=i[e],this.hasIndices&&(n.indices.groups[r]=t[e]))}}}return n}};class na{constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:r}=t;if(!r)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if("string"!=typeof e)return e;let t=i?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=r(e);return i?.set(e,t),t}catch(t){if(i?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let i="string"==typeof e?e:e.content,r=[];function o(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>null==e?{start:0xffffffff,end:0xffffffff,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let a=n.exec(i);if(!a)continue;if(a.index===t)return o(e,a,0);r.push([e,a,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(r.length){let e=Math.min(...r.map(e=>e[1].index));for(let[t,n,i]of r)if(n.index===e)return o(t,n,i)}return null}}async function ns({themes:t,langs:r,preferredHighlighter:s="shiki-js"}){let l=nl(n??=eS({themes:[],langs:["text"],engine:"shiki-wasm"===s?ek(e.A(14467)):function(e={}){let t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=e=>{let n;return(n=function(e,t){var n;let i,r,o,a,s=tM(t),l=(n=eV(e,{flags:s.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:s.rules.captureGroup,singleline:s.rules.singleline},skipBackrefValidation:s.rules.allowOrphanBackrefs,unicodePropertyMap:tO}),i={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...{accuracy:s.accuracy,asciiWordBoundaries:s.rules.asciiWordBoundaries,avoidSubclass:s.avoidSubclass,bestEffortTarget:s.target}},tV(n),r={accuracy:i.accuracy,asciiWordBoundaries:i.asciiWordBoundaries,avoidSubclass:i.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:tR[i.bestEffortTarget]>=tR.ES2024,passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:n.flags.digitIsAscii,spaceIsAscii:n.flags.spaceIsAscii,wordIsAscii:n.flags.wordIsAscii},ti(n,tj,r),a={currentFlags:o={dotAll:n.flags.dotAll,ignoreCase:n.flags.ignoreCase},prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap},ti(n,tW,a),ti(n,tq,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),n._originMap=a.groupOriginByCopy,n._strategy=r.strategy,n),d=function(e,t){let n=tM(t),i=tR[n.target]>=tR.ES2024,r=tR[n.target]>=tR.ES2025,o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw Error("Invalid recursionLimit; use 2-20");let a=null,s=null;if(!r){let t=[e.flags.ignoreCase];ti(e,t8,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?a=!0:s=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!s)},d=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!r&&a&&s),useFlagMods:r,useFlagV:i,verbose:n.verbose};function h(e){return u.lastNode=d,d=e,(function(e,t){if(null==e)throw Error(t??"Value expected");return e})(t5[e.type],`Unexpected node type "${e.type}"`)(e,u,h)}let c={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return i||(delete c.options.force.v,c.options.disable.v=!0,c.options.unicodeSetsPlugin=null),c._captureTransfers=new Map,c._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&c._hiddenCaptures.push(t),e.transferTo&&tI(c._captureTransfers,e.transferTo,[]).push(t)}),c}(l,s),u=function(e,t){let n,{hiddenCaptures:i,mode:r}={hiddenCaptures:[],mode:"plugin",...t},o=t?.captureTransfers??new Map;if(!RegExp(tg,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:i};if("plugin"===r&&td(e,tf`\(\?\(DEFINE\)`,ts.DEFAULT))throw Error("DEFINE groups cannot be used with recursion");let a=[],s=td(e,tf`\\[1-9]`,ts.DEFAULT),l=new Map,d=[],u=!1,h=0,c=0;for(tv.lastIndex=0;n=tv.exec(e);){let{0:t,groups:{captureName:f,rDepth:p,gRNameOrNum:g,gRDepth:m}}=n;if("["===t)h++;else if(h)"]"===t&&h--;else if(p){if(tC(p),u)throw Error(ty);if(s)throw Error(`${"external"===r?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let t=e.slice(0,n.index),l=e.slice(tv.lastIndex);if(td(l,tg,ts.DEFAULT))throw Error(ty);let d=p-1;e=tk(t,l,d,!1,i,a,c),o=tx(o,t,d,a.length,0,c);break}else if(g){tC(m);let h=!1;for(let e of d)if(e.name===g||e.num===+g){if(h=!0,e.hasRecursedWithin)throw Error(ty);break}if(!h)throw Error(tf`Recursive \g cannot be used outside the referenced group "${"external"===r?g:tf`\g<${g}&R=${m}>`}"`);let f=l.get(g),p=function(e,t){let n,i=/\\?./gsu;i.lastIndex=t;let r=e.length,o=0,a=1;for(;n=i.exec(e);){let[e]=n;if("["===e)o++;else if(o)"]"===e&&o--;else if("("===e)a++;else if(")"===e&&!--a){r=n.index;break}}return e.slice(t,r)}(e,f);if(s&&td(p,tf`${tm}|\((?!\?)`,ts.DEFAULT))throw Error(`${"external"===r?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let b=e.slice(f,n.index),v=p.slice(b.length+t.length),y=a.length,C=m-1,k=tk(b,v,C,!0,i,a,c);o=tx(o,b,C,a.length-y,y,c);let S=e.slice(0,f),x=e.slice(f+p.length);e=`${S}${k}${x}`,tv.lastIndex+=k.length-t.length-b.length-v.length,d.forEach(e=>e.hasRecursedWithin=!0),u=!0}else if(f)c++,l.set(String(c),tv.lastIndex),l.set(f,tv.lastIndex),d.push({num:c,name:f});else if("("===t[0]){let e="("===t;e&&(c++,l.set(String(c),tv.lastIndex)),d.push(e?{num:c}:{})}else")"===t&&d.pop()}return i.push(...a),{pattern:e,captureTransfers:o,hiddenCaptures:i}}(d.pattern,{captureTransfers:d._captureTransfers,hiddenCaptures:d._hiddenCaptures,mode:"external"}),h=function(e,t){let n,i=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:i};let o="(?:(?=(",a=[0],s=[],l=0,d=0,u=NaN;do{let t;n=!1;let h=0,c=0,f=!1;for(tu.lastIndex=Number.isNaN(u)?0:u+o.length;t=tu.exec(e);){let{0:p,index:g,groups:{capturingStart:m,noncapturingStart:b}}=t;if("["===p)h++;else if(h)"]"===p&&h--;else if("(?>"!==p||f){if(f&&b)c++;else if(m)f?c++:(l++,a.push(l+d));else if(")"===p&&f){if(!c){let t=l+ ++d;e=`${e.slice(0,u)}${o}${e.slice(u+3,g)}))<$$${t}>)${e.slice(g+1)}`,n=!0,s.push(t);for(let e=0;e<i.length;e++)i[e]>=t&&i[e]++;if(r.size){let e=new Map;r.forEach((n,i)=>{e.set(i>=t?i+1:i,n.map(e=>e>=t?e+1:e))}),r=e}break}c--}}else u=g,f=!0}}while(n)return i.push(...s),{pattern:e=tl(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>a.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${a[n]}`}return`\\${n}`},ts.DEFAULT),captureTransfers:r,hiddenCaptures:i}}(function(e){let t;if(!RegExp(`${th}\\+`).test(e))return{pattern:e};let n=[],i=null,r=null,o="",a=0;for(tc.lastIndex=0;t=tc.exec(e);){let{0:d,index:u,groups:{qBase:h,qMod:c,invalidQ:f}}=t;if("["===d)a||(r=u),a++;else if("]"===d)a?a--:r=null;else if(!a)if("+"===c&&o&&!o.startsWith("(")){if(f)throw Error(`Invalid quantifier "${d}"`);let t=-1;if(/^\{\d+\}$/.test(h)){var s,l;s=e,l=u+h.length,e=s.slice(0,l)+""+s.slice(l+c.length)}else{if(")"===o||"]"===o){let t=")"===o?i:r;if(null===t)throw Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,t)}(?>${e.slice(t,u)}${h})${e.slice(u+d.length)}`}else e=`${e.slice(0,u-o.length)}(?>${o}${h})${e.slice(u+d.length)}`;t+=4}tc.lastIndex+=t}else"("===d[0]?n.push(u):")"===d&&(i=n.length?n.pop():null);o=d}return{pattern:e}}(u.pattern).pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),c={pattern:h.pattern,flags:`${s.hasIndices?"d":""}${s.global?"g":""}${d.flags}${d.options.disable.v?"u":"v"}`};if(s.avoidSubclass){if(s.lazyCompileLength!==1/0)throw Error("Lazy compilation requires subclass")}else{let e=h.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(h.captureTransfers),n=l._strategy,i=c.pattern.length>=s.lazyCompileLength;(e.length||t.length||n||i)&&(c.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...n&&{strategy:n},...i&&{lazyCompile:i}})}return c}(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...{target:t.target}})).options?new no(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)},{createScanner:e=>new na(e,t),createString:e=>({content:e})}}()}))?await n:n;n=l;let d=[];for(let e of r){if("text"===e||"ansi"===e)continue;let t=(0,o.getResolvedOrResolveLanguage)(e);"then"in t?d.push(t):(0,i.attachResolvedLanguages)(t,l)}let u=[];for(let e of t){let t=ea(e);"then"in t?u.push(t):(0,a.attachResolvedThemes)(t,n)}return(d.length>0||u.length>0)&&await Promise.all([Promise.all(d).then(e=>{(0,i.attachResolvedLanguages)(e,l)}),Promise.all(u).then(e=>{(0,a.attachResolvedThemes)(e,l)})]),l}function nl(e=n){return null!=e&&"then"in e}async function nd(e){await ns(e)}async function nu(){null!=n&&((await n).dispose(),(0,r.cleanUpResolvedLanguages)(),(0,s.cleanUpResolvedThemes)(),n=void 0)}es("pierre-dark",async()=>{let{default:t}=await e.A(2414);return{...t,name:"pierre-dark"}}),es("pierre-light",async()=>{let{default:t}=await e.A(88273);return{...t,name:"pierre-light"}}),e.s(["disposeHighlighter",0,nu,"getHighlighterIfLoaded",0,function(){if(null!=n&&!("then"in n))return n},"getSharedHighlighter",0,ns,"isHighlighterLoaded",0,function(e=n){return null!=e&&!("then"in e)},"isHighlighterLoading",0,nl,"isHighlighterNull",0,function(e=n){return null==e},"preloadHighlighter",0,nd],30891);var nh=e.i(27101);e.s(["getThemes",0,function(e=nh.DEFAULT_THEMES){let t=[];return"string"==typeof e?t.push(e):(t.push(e.dark),t.push(e.light)),t}],51045)},16049,e=>{"use strict";var t=e.i(86309);e.s(["hasResolvedThemes",0,function(e){for(let n of e)if(!t.ResolvedThemes.has(n))return!1;return!0}])},8456,e=>{"use strict";e.s(["areThemesEqual",0,function(e,t){return null==e||null==t||"string"==typeof e||"string"==typeof t?e===t:e.dark===t.dark&&e.light===t.light}])},35864,e=>{"use strict";let t=new Map,n=0,i={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};e.s(["EXTENSION_TO_FILE_FORMAT",0,i,"getCustomExtensionsMap",0,function(){return Object.fromEntries(t)},"getCustomExtensionsVersion",0,function(){return n},"getFiletypeFromFileName",0,function(e){if(t.has(e))return t.get(e)??"text";if(null!=i[e])return i[e];let n=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(null!=n){if(t.has(n[1]))return t.get(n[1])??"text";if(null!=i[n[1]])return i[n[1]]??"text"}let r=e.match(/\.([^.]+)$/)?.[1]??"";return t.has(r)?t.get(r)??"text":i[r]??"text"},"replaceCustomExtensions",0,function(e,i){if(e<=n)return!1;for(let e in t.clear(),i){let n=i[e];null!=n&&t.set(e,n)}return n=e,!0},"setCustomExtension",0,function(e,i){let r=t.get(e);return r!==i&&(null!=r&&console.warn(`setCustomExtension: overriding custom mapping for "${e}" from "${r}" to "${i}"`),t.set(e,i),n++,!0)}])},82189,e=>{"use strict";var t=e.i(35864);e.s(["isFilePlainText",0,function(e){return(e.lang??(0,t.getFiletypeFromFileName)(e.name))==="text"}])},6609,e=>{"use strict";e.s(["iterateOverFile",0,function({lines:e,startingLine:t=0,totalLines:n=1/0,callback:i}){let r,o=Math.min(t+n,e.length),a=""===(r=e.at(-1))||"\n"===r||"\r\n"===r||"\r"===r?Math.max(0,e.length-2):e.length-1;for(let n=t;n<o;n++){let t=n===a;if(!0===i({lineIndex:n,lineNumber:n+1,content:e[n],isLastLine:t})||t)break}}])},17443,e=>{"use strict";e.s(["cleanLastNewline",0,function(e){return e.replace(/\n$|\r\n$/,"")}])},6104,e=>{"use strict";function t(e){return{type:"text",value:e}}function n({tagName:e,children:t=[],properties:i={}}){return{type:"element",tagName:e,properties:i,children:t}}e.s(["createGutterGap",0,function(e,t,i){return n({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":i,"data-line-type":"annotation"===t?void 0:e,style:"annotation"===t?`grid-row: span ${i};`:`grid-row: span ${i};min-height:calc(${i} * 1lh);`}})},"createGutterItem",0,function(e,i,r,o={}){return n({tagName:"div",properties:{"data-line-type":e,"data-column-number":i,"data-line-index":r,...o},children:null!=i?[n({tagName:"span",properties:{"data-line-number-content":""},children:[t(`${i}`)]})]:void 0})},"createGutterWrapper",0,function(e){return n({tagName:"div",properties:{"data-gutter":""},children:e})},"createHastElement",0,n,"createIconElement",0,function({name:e,width:t=16,height:i=16,properties:r}){return n({tagName:"svg",properties:{width:t,height:i,viewBox:"0 0 16 16",...r},children:[n({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})},"createTextNodeElement",0,t,"findCodeElement",0,function(e){let t=e.children[0];for(;null!=t;){if("element"===t.type&&"code"===t.tagName)return t;t="children"in t?t.children[0]:null}}])},54718,29918,49831,57604,43219,e=>{"use strict";var t=e.i(6104);function n(e,n,i){let r="function"==typeof i.lineInfo?i.lineInfo(n):i.lineInfo[n-1];if(null==r){let t=`processLine: line ${n}, contains no state.lineInfo`;throw console.error(t,{node:e,line:n,state:i}),Error(t)}return e.tagName="div",e.properties["data-line"]=r.lineNumber,e.properties["data-alt-line"]=r.altLineNumber,e.properties["data-line-type"]=r.type,e.properties["data-line-index"]=r.lineIndex,0===e.children.length&&e.children.push((0,t.createTextNodeElement)("\n")),e}e.s(["processLine",0,n],29918);let i=Symbol("no-token"),r=Symbol("multiple-tokens");function o(e){if("element"===e.type)for(let t of(e.properties["data-char"]=void 0,e.children))o(t)}let a=function(e={}){let{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=e=>e}=e,r=new Map;function o(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(";")}function a(e){let a=t+function(e,t=0){let n=0xdeadbeef^t,i=0x41c6ce57^t;for(let t=0,r;t<e.length;t++)n=Math.imul(n^(r=e.charCodeAt(t)),0x9e3779b1),i=Math.imul(i^r,0x5f356495);return n=Math.imul(n^n>>>16,0x85ebca6b)^Math.imul(i^i>>>13,0xc2b2ae35),(0x100000000*(2097151&(i=Math.imul(i^i>>>16,0x85ebca6b)^Math.imul(n^n>>>13,0xc2b2ae35)))+(n>>>0)).toString(36).slice(0,6)}("string"==typeof e?e:o(e))+n;return a=i(a),r.has(a)||r.set(a,"string"==typeof e?e:{...e}),a}return{name:"@shikijs/transformers:style-to-class",pre(e){if(!e.properties.style)return;let t=a(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=a(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry:()=>r,getCSS(){let e="";for(let[t,n]of r.entries())e+=`.${t}{${"string"==typeof n?n:o(n)}}`;return e},clearRegistry(){r.clear()}}}({classPrefix:"hl-"}),s={name:"token-style-normalizer",tokens(e){for(let t of e)for(let e of t){if(null!=e.htmlStyle)continue;let t={};null!=e.color&&(t.color=e.color),null!=e.bgColor&&(t["background-color"]=e.bgColor),null!=e.fontStyle&&0!==e.fontStyle&&((1&e.fontStyle)!=0&&(t["font-style"]="italic"),(2&e.fontStyle)!=0&&(t["font-weight"]="bold"),(4&e.fontStyle)!=0&&(t["text-decoration"]="underline")),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function l(e){return`--${"token"===e?"diffs-token":"diffs"}-`}e.s(["createTransformerWithState",0,function(e=!1,l=!1){let d={lineInfo:[]},u=[{line:e=>(delete e.properties.class,e),pre(a){let s=(0,t.findCodeElement)(a),l=[];if(null!=s){let a=1;for(let u of s.children)"element"===u.type&&(e&&function e(n){let a,s=function(e){let t=e.properties["data-char"];if("number"==typeof t)return t}(n);if(null!=s)return s;let l=i,d=[],u=[],h=()=>{if(0===u.length||null==a){u=[],a=void 0;return}if(1===u.length){let t=u[0];if(t?.type==="element"){var e,n;for(let i of(e=t,n=a,e.properties["data-char"]=n,t.children))o(i)}else o(t);d.push(t),u=[],a=void 0;return}for(let e of u)o(e);d.push((0,t.createHastElement)({tagName:"span",properties:{"data-char":a},children:u})),u=[],a=void 0},c=e=>{if(e!==i){if(e===r){l=r;return}if(l===i){l=e;return}l!==e&&(l=r)}};for(let t of n.children){let n="element"===t.type?e(t):i;if(c(n),"number"!=typeof n){h(),d.push(t);continue}null!=a&&a!==n&&h(),a??=n,u.push(t)}return h(),n.children=d,l}(u),l.push(n(u,a,d)),a++);s.children=l}return a},...e?{tokens(e){for(let t of e){let e=0;for(let n of t)n.__lineChar??=e,e+=n.content.length}},preprocess(e,t){t.mergeWhitespaces="never"},span(e,t,n,i,r){if(r?.offset!=null&&null!=r.content){let t=r.__lineChar;null!=t&&(e.properties["data-char"]=t)}return e}}:null}];return l&&u.push(s,a),{state:d,transformers:u,toClass:a}}],54718),e.s(["formatCSSVariablePrefix",0,l],49831);var d=e.i(27101);function u(e,t){t=null!=t?`${t}-`:"";let n="",i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];null!=i&&(n+=`${l("global")}${t}addition-color:${i};`);let r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];null!=r&&(n+=`${l("global")}${t}deletion-color:${r};`);let o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return null!=o&&(n+=`${l("global")}${t}modified-color:${o};`),n}e.s(["getHighlighterThemeStyles",0,function({theme:e=d.DEFAULT_THEMES,highlighter:t,prefix:n}){let i="";if("string"==typeof e){let r=t.getTheme(e);i+=`color:${r.fg};`,i+=`background-color:${r.bg};`,i+=`${l("global")}fg:${r.fg};`,i+=`${l("global")}bg:${r.bg};`,i+=u(r,n)}else{let n=t.getTheme(e.dark);i+=`${l("global")}dark:${n.fg};`,i+=`${l("global")}dark-bg:${n.bg};`,i+=u(n,"dark"),n=t.getTheme(e.light),i+=`${l("global")}light:${n.fg};`,i+=`${l("global")}light-bg:${n.bg};`,i+=u(n,"light")}return i}],57604),e.s(["getLineNodes",0,function(e){let t=e.children[0];for(;null!=t;){if("element"===t.type&&"code"===t.tagName)return t.children;t="children"in t?t.children[0]:null}throw console.error(e),Error("getLineNodes: Unable to find children")}],43219)},16876,59390,e=>{"use strict";var t=e.i(27101),n=e.i(35864),i=e.i(6609),r=e.i(17443),o=e.i(54718),a=e.i(49831),s=e.i(57604),l=e.i(43219);function d(e){return""!==e?e.split(t.SPLIT_WITH_NEWLINES):[]}e.s(["splitFileContents",0,d],59390);let u={forcePlainText:!1};e.s(["renderFileWithHighlighter",0,function(e,h,{theme:c=t.DEFAULT_THEMES,tokenizeMaxLineLength:f,useTokenTransformer:p},{forcePlainText:g,startingLine:m,totalLines:b,lines:v}=u){var y,C,k;let S;g?(m??=0,b??=1/0):(m=0,b=1/0);let x=m>0||b<1/0,{state:w,transformers:A}=(0,o.createTransformerWithState)(p),L=g?"text":e.lang??(0,n.getFiletypeFromFileName)(e.name),E="string"==typeof c?h.getTheme(c).type:void 0,T=(0,s.getHighlighterThemeStyles)({theme:c,highlighter:h});w.lineInfo=e=>({type:"context",lineIndex:e-1+m,lineNumber:e+m});let I="string"==typeof c?{lang:L,theme:c,transformers:A,defaultColor:!1,cssVariablePrefix:(0,a.formatCSSVariablePrefix)("token"),tokenizeMaxLineLength:f}:{lang:L,themes:c,transformers:A,defaultColor:!1,cssVariablePrefix:(0,a.formatCSSVariablePrefix)("token"),tokenizeMaxLineLength:f},R=(0,l.getLineNodes)(h.codeToHast(x?(y=v??d(e.contents),C=m,k=b,S="",(0,i.iterateOverFile)({lines:y,startingLine:C,totalLines:k,callback({content:e}){S+=e}}),S):(0,r.cleanLastNewline)(e.contents),I)),_=x?Array(m):R;return x&&_.push(...R),{code:_,themeStyles:T,baseThemeType:E}}],16876)},60166,e=>{"use strict";e.s(["areFilesEqual",0,function(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}])},19013,e=>{"use strict";var t=e.i(8456);e.s(["areDiffRenderOptionsEqual",0,function(e,n){return(0,t.areThemesEqual)(e.theme,n.theme)&&e.useTokenTransformer===n.useTokenTransformer&&e.tokenizeMaxLineLength===n.tokenizeMaxLineLength&&e.lineDiffType===n.lineDiffType&&e.maxLineDiffLength===n.maxLineDiffLength}])},84036,e=>{"use strict";var t=e.i(35864);e.s(["isDiffPlainText",0,function(e){let n=e.lang??(0,t.getFiletypeFromFileName)(e.name),i=e.lang??(null!=e.prevName?(0,t.getFiletypeFromFileName)(e.prevName):"text");return"text"===n&&"text"===i}])},89107,e=>{"use strict";var t=e.i(27101);function n(e,t,n,i,r){if(0===(t=Math.max(t,0))||e)return{fromStart:0,fromEnd:0,rangeSize:t,collapsedLines:Math.max(t,0)};if(!0===n||t<=r)return{fromStart:t,fromEnd:0,rangeSize:t,collapsedLines:0};let o=n?.get(i),a=Math.min(Math.max(o?.fromStart??0,0),t),s=Math.min(Math.max(o?.fromEnd??0,0),t),l=a+s,d=l>=t;return{fromStart:d?t:a,fromEnd:d?0:s,rangeSize:t,collapsedLines:Math.max(t-l,0)}}e.s(["iterateOverDiff",0,function({diff:e,diffStyle:i,startingLine:r=0,totalLines:o=1/0,expandedHunks:a,collapsedContextThreshold:s=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,callback:l}){let d={finalHunk:e.hunks.at(-1),viewportStart:r,viewportEnd:r+o,isWindowedHighlight:r>0||o<1/0,splitCount:0,unifiedCount:0,shouldBreak(){if(!d.isWindowedHighlight)return!1;let e=d.unifiedCount>=r+o,t=d.splitCount>=r+o;return"unified"===i?e:"split"===i?t:e&&t},shouldSkip(e,t){if(!d.isWindowedHighlight)return!1;let n=d.unifiedCount+e<r,o=d.splitCount+t<r;return"unified"===i?n:"split"===i?o:n&&o},incrementCounts(e,t){("unified"===i||"both"===i)&&(d.unifiedCount+=e),("split"===i||"both"===i)&&(d.splitCount+=t)},isInWindow(e,t){if(!d.isWindowedHighlight)return!0;let n=d.isInUnifiedWindow(e),r=d.isInSplitWindow(t);return"unified"===i?n:"split"===i?r:n||r},isInUnifiedWindow:e=>!d.isWindowedHighlight||d.unifiedCount>=r-e&&d.unifiedCount<r+o,isInSplitWindow:e=>!d.isWindowedHighlight||d.splitCount>=r-e&&d.splitCount<r+o,emit:(e,t=!1)=>(t||("unified"===i?d.incrementCounts(1,0):"split"===i?d.incrementCounts(0,1):d.incrementCounts(1,1)),l(e)??!1)};e:for(let[t,r]of e.hunks.entries()){if(d.shouldBreak())break;let o=n(e.isPartial,r.collapsedBefore,a,t,s),l=(()=>{if(r!==d.finalHunk||!function(e){let t=e.hunks.at(-1);return null!=t&&!e.isPartial&&0!==e.additionLines.length&&0!==e.deletionLines.length&&(t.additionLineIndex+t.additionCount<e.additionLines.length||t.deletionLineIndex+t.deletionCount<e.deletionLines.length)}(e))return;let t=e.additionLines.length-(r.additionLineIndex+r.additionCount),i=e.deletionLines.length-(r.deletionLineIndex+r.deletionCount);if(t!==i)throw Error(`iterateOverDiff: trailing context mismatch (additions=${t}, deletions=${i}) for ${e.name}`);let o=Math.min(t,i);return n(e.isPartial,o,a,e.hunks.length,s)})(),c=o.fromStart+o.fromEnd;function u(e,t){return null==l||l.collapsedLines<=0||l.fromStart+l.fromEnd>0?0:"unified"===i?e===r.unifiedLineStart+r.unifiedLineCount-1?l.collapsedLines:0:t===r.splitLineStart+r.splitLineCount-1?l.collapsedLines:0}function h(){if(0===o.collapsedLines)return 0;let e=o.collapsedLines;return o.collapsedLines=0,e}if(d.shouldSkip(c,c))d.incrementCounts(c,c),h();else{let e=r.unifiedLineStart-o.rangeSize,n=r.splitLineStart-o.rangeSize,i=r.deletionLineIndex-o.rangeSize,a=r.additionLineIndex-o.rangeSize,s=r.deletionStart-o.rangeSize,l=r.additionStart-o.rangeSize,u=0;for(;u<o.fromStart;){if(d.isInWindow(0,0)){if(d.emit({hunkIndex:t,hunk:r,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:s+u,lineIndex:i+u,noEOFCR:!1,unifiedLineIndex:e+u,splitLineIndex:n+u},additionLine:{unifiedLineIndex:e+u,splitLineIndex:n+u,lineIndex:a+u,lineNumber:l+u,noEOFCR:!1}}))break e}else d.incrementCounts(1,1);u++}for(e=r.unifiedLineStart-o.fromEnd,n=r.splitLineStart-o.fromEnd,i=r.deletionLineIndex-o.fromEnd,a=r.additionLineIndex-o.fromEnd,s=r.deletionStart-o.fromEnd,l=r.additionStart-o.fromEnd,u=0;u<o.fromEnd;){if(d.isInWindow(0,0)){if(d.emit({hunkIndex:t,hunk:r,collapsedBefore:h(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:s+u,lineIndex:i+u,noEOFCR:!1,unifiedLineIndex:e+u,splitLineIndex:n+u},additionLine:{unifiedLineIndex:e+u,splitLineIndex:n+u,lineIndex:a+u,lineNumber:l+u,noEOFCR:!1}}))break e}else d.incrementCounts(1,1);u++}}let f=r.unifiedLineStart,p=r.splitLineStart,g=r.deletionLineIndex,m=r.additionLineIndex,b=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(d.shouldBreak())break e;let n=e===y;if("context"===e.type){if(d.shouldSkip(e.lines,e.lines))d.incrementCounts(e.lines,e.lines),h();else{let i=0;for(;i<e.lines;){if(d.isInWindow(0,0)){let o=n&&i===e.lines-1,a=f+i,s=p+i;if(d.emit({hunkIndex:t,hunk:r,collapsedBefore:h(),collapsedAfter:u(a,s),type:"context",deletionLine:{lineNumber:b+i,lineIndex:g+i,noEOFCR:o&&r.noEOFCRDeletions,unifiedLineIndex:a,splitLineIndex:s},additionLine:{unifiedLineIndex:a,splitLineIndex:s,lineIndex:m+i,lineNumber:v+i,noEOFCR:o&&r.noEOFCRAdditions}}))break e}else d.incrementCounts(1,1);i++}}f+=e.lines,p+=e.lines,g+=e.lines,m+=e.lines,b+=e.lines,v+=e.lines}else{let o=Math.max(e.deletions,e.additions),a=e.deletions+e.additions;if(!d.shouldSkip(a,o))for(let[s,l]of function(e,t,n){if(!e.isWindowedHighlight)return[[0,"unified"===n?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let i="unified"===n?"unified":"split",r=[];function o(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let i=Math.max(0,e.viewportStart-t),r=Math.min(n,e.viewportEnd-t);return r>i?[i,r]:void 0}function a(e,n){if(null==e)return;let[o,a]="split"===i?e:"additions"===n?[e[0]+t.deletions,e[1]+t.deletions]:e;a>o&&r.push([o,a])}if("split"!==n&&(a(o(e.unifiedCount,t.deletions),"deletions"),a(o(e.unifiedCount+t.deletions,t.additions),"additions")),"unified"!==n&&(a(o(e.splitCount,t.deletions),"deletions"),a(o(e.splitCount,t.additions),"additions")),0===r.length)return r;r.sort((e,t)=>e[0]-t[0]);let s=[r[0]];for(let[e,t]of r.slice(1)){let n=s[s.length-1];e<=n[1]?n[1]=Math.max(n[1],t):s.push([e,t])}return s}(d,e,i))for(let c=s;c<l;c++){let s=u(f+c,"unified"===i?p+(c<e.deletions?c:c-e.deletions):p+c);if(d.emit(function({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:a,splitLineIndex:s,additionLineIndex:l,deletionLineIndex:d,additionLineNumber:u,deletionLineNumber:h,content:c,isLastContent:f,unifiedCount:p,splitCount:g}){let m=o<c.deletions?a+o:void 0,b="unified"===r?o>=c.deletions?a+o:void 0:o<c.additions?a+c.deletions+o:void 0,v="unified"===r?s+(o<c.deletions?o:o-c.deletions):s+o,y=o<c.deletions?d+o:void 0,C=o<c.deletions?h+o:void 0,k="unified"===r?o>=c.deletions?l+(o-c.deletions):void 0:o<c.additions?l+o:void 0,S="unified"===r?o>=c.deletions?u+(o-c.deletions):void 0:o<c.additions?u+o:void 0,x="unified"===r?f&&o===c.deletions-1&&t.noEOFCRDeletions:f&&o===g-1&&t.noEOFCRDeletions,w="unified"===r?f&&o===p-1&&t.noEOFCRAdditions:f&&o===g-1&&t.noEOFCRAdditions,A=null!=y&&null!=C&&null!=m?{lineNumber:C,lineIndex:y,noEOFCR:x,unifiedLineIndex:m,splitLineIndex:v}:void 0,L=null!=k&&null!=S&&null!=b?{unifiedLineIndex:b,splitLineIndex:v,lineIndex:k,lineNumber:S,noEOFCR:w}:void 0;if(null==A&&null!=L)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:L};if(null!=A&&null==L)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:A,additionLine:void 0};if(null==A||null==L)throw Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:A,additionLine:L}}({hunkIndex:t,hunk:r,collapsedBefore:h(),collapsedAfter:s,diffStyle:i,index:c,unifiedLineIndex:f,splitLineIndex:p,additionLineIndex:m,deletionLineIndex:g,additionLineNumber:v,deletionLineNumber:b,content:e,isLastContent:n,unifiedCount:a,splitCount:o}),!0))break e}h(),d.incrementCounts(a,o),f+=a,p+=o,g+=e.deletions,m+=e.additions,b+=e.deletions,v+=e.additions}}if(null!=l){let{collapsedLines:t,fromStart:n,fromEnd:i}=l,r=n+i,o=0;for(;o<r;){if(d.shouldBreak())break e;if(d.isInWindow(0,0)){let n=o===r-1;if(d.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:n?t:0,type:"context-expanded",deletionLine:{lineNumber:b+o,lineIndex:g+o,noEOFCR:!1,unifiedLineIndex:f+o,splitLineIndex:p+o},additionLine:{unifiedLineIndex:f+o,splitLineIndex:p+o,lineIndex:m+o,lineNumber:v+o,noEOFCR:!1}}))break e}else d.incrementCounts(1,1);o++}}}}])},39659,e=>{"use strict";e.s(["createDiffSpanDecoration",0,function({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}},"pushOrJoinSpan",0,function({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){let o=t[t.length-1];if(null==o||r||!n)return void t.push([+!i,e.value]);let a=0===o[0];if(i===a||i&&1===e.value.length&&!a){o[1]+=e.value;return}t.push([+!i,e.value])}])},10906,24315,e=>{"use strict";var t=e.i(27101),n=e.i(35864),i=e.i(17443),r=e.i(54718),o=e.i(49831),a=e.i(57604),s=e.i(43219),l=e.i(89107),d=e.i(39659);class u{diff(e,t,n={}){let i;"function"==typeof n?(i=n,n={}):"callback"in n&&(i=n.callback);let r=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(r,n)),s=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,s,n,i)}diffWithOptionsObj(e,t,n,i){var r;let o=e=>(e=this.postProcess(e,n),i)?void setTimeout(function(){i(e)},0):e,a=t.length,s=e.length,l=1,d=a+s;null!=n.maxEditLength&&(d=Math.min(d,n.maxEditLength));let u=null!=(r=n.timeout)?r:1/0,h=Date.now()+u,c=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(c[0],t,e,0,n);if(c[0].oldPos+1>=s&&f+1>=a)return o(this.buildValues(c[0].lastComponent,t,e));let p=-1/0,g=1/0,m=()=>{for(let i=Math.max(p,-l);i<=Math.min(g,l);i+=2){let r,l=c[i-1],d=c[i+1];l&&(c[i-1]=void 0);let u=!1;if(d){let e=d.oldPos-i;u=d&&0<=e&&e<a}let h=l&&l.oldPos+1<s;if(!u&&!h){c[i]=void 0;continue}if(r=!h||u&&l.oldPos<d.oldPos?this.addToPath(d,!0,!1,0,n):this.addToPath(l,!1,!0,1,n),f=this.extractCommon(r,t,e,i,n),r.oldPos+1>=s&&f+1>=a)return o(this.buildValues(r.lastComponent,t,e))||!0;c[i]=r,r.oldPos+1>=s&&(g=Math.min(g,i-1)),f+1>=a&&(p=Math.max(p,i+1))}l++};if(i)!function e(){setTimeout(function(){if(l>d||Date.now()>h)return i(void 0);m()||e()},0)}();else for(;l<=d&&Date.now()<=h;){let e=m();if(e)return e}}addToPath(e,t,n,i,r){let o=e.lastComponent;return o&&!r.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,i,r){let o=t.length,a=n.length,s=e.oldPos,l=s-i,d=0;for(;l+1<o&&s+1<a&&this.equals(n[s+1],t[l+1],r);)l++,s++,d++,r.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!r.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,l}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i,r=[];for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let o=r.length,a=0,s=0,l=0;for(;a<o;a++){let e=r[a];if(e.removed)e.value=this.join(n.slice(l,l+e.count)),l+=e.count;else{if(!e.added&&this.useLongestToken){let i=t.slice(s,s+e.count);i=i.map(function(e,t){let i=n[l+t];return i.length>e.length?i:e}),e.value=this.join(i)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(l+=e.count)}}return r}}e.s(["default",()=>u],24315);let h=new class extends u{};function c(e,t){let n;for(n=0;n<e.length&&n<t.length&&e[n]==t[n];n++);return e.slice(0,n)}function f(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return"";for(n=0;n<e.length&&n<t.length&&e[e.length-(n+1)]==t[t.length-(n+1)];n++);return e.slice(-n)}function p(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function g(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function m(e,t){return p(e,t,"")}function b(e,t){return t.slice(0,function(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let i=t.length;e.length<t.length&&(i=e.length);let r=Array(i),o=0;r[0]=0;for(let e=1;e<i;e++){for(t[e]==t[o]?r[e]=r[o]:r[e]=o;o>0&&t[e]!=t[o];)o=r[o];t[e]==t[o]&&o++}o=0;for(let i=n;i<e.length;i++){for(;o>0&&e[i]!=t[o];)o=r[o];e[i]==t[o]&&o++}return o}(e,t))}function v(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function y(e){let t=e.match(/^\s*/);return t?t[0]:""}let C="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",k=RegExp(`[${C}]+|\\s+|[^${C}]`,"ug");function S(e,t,n,i){var r,o,a,s;if(t&&n){let a=y(t.value),s=v(t.value),l=y(n.value),d=v(n.value);if(e){let i=c(a,l);e.value=g(e.value,l,i),t.value=m(t.value,i),n.value=m(n.value,i)}if(i){let e=f(s,d);i.value=p(i.value,d,e),r=t.value,t.value=g(r,e,""),o=n.value,n.value=g(o,e,"")}}else if(n){if(e){let e=y(n.value);n.value=n.value.substring(e.length)}if(i){let e=y(i.value);i.value=i.value.substring(e.length)}}else if(e&&i){let n=y(i.value),r=y(t.value),o=v(t.value),s=c(n,r);t.value=m(t.value,s);let l=f(m(n,s),o);a=t.value,t.value=g(a,l,""),i.value=p(i.value,n,l),e.value=g(e.value,n,n.slice(0,n.length-l.length))}else if(i){let e=y(i.value),n=b(v(t.value),e);s=t.value,t.value=g(s,n,"")}else if(e){let n=b(v(e.value),y(t.value));t.value=m(t.value,n)}}new class extends u{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let i=t.intlSegmenter;if("word"!=i.resolvedOptions().granularity)throw Error('The segmenter passed must have a granularity of "word"');for(let t of(n=[],Array.from(i.segment(e)))){let e=t.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}}else n=e.match(k)||[];let i=[],r=null;return n.forEach(e=>{/\s/.test(e)?null==r?i.push(e):i.push(i.pop()+e):null!=r&&/\s/.test(r)?i[i.length-1]==r?i.push(i.pop()+e):i.push(r+e):i.push(e),r=e}),i}join(e){return e.map((e,t)=>0==t?e:e.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,i=null,r=null;return e.forEach(e=>{e.added?i=e:e.removed?r=e:((i||r)&&S(n,r,i,e),n=e,i=null,r=null)}),(i||r)&&S(n,r,i,null),e}};let x=new class extends u{tokenize(e){let t=RegExp(`(\\r?\\n)|[${C}]+|[^\\S\\n\\r]+|[^${C}]`,"ug");return e.match(t)||[]}},w={forcePlainText:!1};e.s(["renderDiffWithHighlighter",0,function(e,u,c,{forcePlainText:f,startingLine:p,totalLines:g,expandedHunks:m,collapsedContextThreshold:b=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD}=w){f?(p??=0,g??=1/0):(p=0,g=1/0);let v=p>0||g<1/0,y="string"==typeof c.theme?u.getTheme(c.theme).type:void 0,C=(0,a.getHighlighterThemeStyles)({theme:c.theme,highlighter:u}),k=f&&!v&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":c.lineDiffType,S={deletionLines:[],additionLines:[]},{maxLineDiffLength:A}=c,L=!f&&!e.isPartial,E=new Map;function T(e,t,n,i){if(v){let e=n.at(-1);(null==e||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:i.length,count:0},n.push(e)),e.count++}i.push(e)}for(let a of((0,l.iterateOverDiff)({diff:e,diffStyle:"both",startingLine:p,totalLines:g,expandedHunks:!v||(f?m:void 0),collapsedContextThreshold:b,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:o})=>{let a,s,l=(a=L?0:t,s=E.get(a)??{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]},E.set(a,s),s),u=null!=n?n.splitLineIndex:r.splitLineIndex;"change"===o&&null!=n&&null!=r&&function({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:o,additionDecorations:a,lineDiffType:s,maxLineDiffLength:l}){var u,c,f,p;if(null==e||null==t||"none"===s||(e=(0,i.cleanLastNewline)(e),t=(0,i.cleanLastNewline)(t),e.length>l||t.length>l))return;let g="char"===s?(u=e,c=t,h.diff(u,c,void 0)):(f=e,p=t,x.diff(f,p,void 0)),m=[],b=[],v="word-alt"===s,y=g.at(-1);for(let e of g){let t=e===y;e.added||e.removed?e.removed?(0,d.pushOrJoinSpan)({item:e,arr:m,enableJoin:v,isLastItem:t}):(0,d.pushOrJoinSpan)({item:e,arr:b,enableJoin:v,isLastItem:t}):((0,d.pushOrJoinSpan)({item:e,arr:m,enableJoin:v,isNeutral:!0,isLastItem:t}),(0,d.pushOrJoinSpan)({item:e,arr:b,enableJoin:v,isNeutral:!0,isLastItem:t}))}let C=0;for(let e of m)1===e[0]&&o.push((0,d.createDiffSpanDecoration)({line:n,spanStart:C,spanLength:e[1].length})),C+=e[1].length;for(let e of(C=0,b))1===e[0]&&a.push((0,d.createDiffSpanDecoration)({line:r,spanStart:C,spanLength:e[1].length})),C+=e[1].length}({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:l.deletionContent.length,additionLineIndex:l.additionContent.length,deletionDecorations:l.deletionDecorations,additionDecorations:l.additionDecorations,lineDiffType:k,maxLineDiffLength:A}),null!=r&&(T(e.deletionLines[r.lineIndex],r.lineIndex,l.deletionSegments,l.deletionContent),l.deletionInfo.push({type:"change"===o?"change-deletion":o,lineNumber:r.lineNumber,altLineNumber:"change"===o?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${u}`})),null!=n&&(T(e.additionLines[n.lineIndex],n.lineIndex,l.additionSegments,l.additionContent),l.additionInfo.push({type:"change"===o?"change-addition":o,lineNumber:n.lineNumber,altLineNumber:"change"===o?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${u}`}))}}),E.values())){if(0===a.deletionContent.length&&0===a.additionContent.length)continue;let l={name:e.prevName??e.name,contents:a.deletionContent.value},d={name:e.name,contents:a.additionContent.value},{deletionLines:h,additionLines:p}=function({deletionFile:e,additionFile:a,deletionInfo:l,additionInfo:d,highlighter:u,deletionDecorations:h,additionDecorations:c,languageOverride:f,options:{theme:p=t.DEFAULT_THEMES,...g}}){let m=f??(0,n.getFiletypeFromFileName)(e.name),b=f??(0,n.getFiletypeFromFileName)(a.name),{state:v,transformers:y}=(0,r.createTransformerWithState)(g.useTokenTransformer),C="string"==typeof p?{...g,lang:"text",theme:p,transformers:y,decorations:void 0,defaultColor:!1,cssVariablePrefix:(0,o.formatCSSVariablePrefix)("token")}:{...g,lang:"text",themes:p,transformers:y,decorations:void 0,defaultColor:!1,cssVariablePrefix:(0,o.formatCSSVariablePrefix)("token")};return{deletionLines:""===e.contents?[]:(C.lang=m,v.lineInfo=l,C.decorations=h,(0,s.getLineNodes)(u.codeToHast((0,i.cleanLastNewline)(e.contents),C))),additionLines:""===a.contents?[]:(C.lang=b,C.decorations=c,v.lineInfo=d,(0,s.getLineNodes)(u.codeToHast((0,i.cleanLastNewline)(a.contents),C)))}}({deletionFile:l,deletionInfo:a.deletionInfo,deletionDecorations:a.deletionDecorations,additionFile:d,additionInfo:a.additionInfo,additionDecorations:a.additionDecorations,highlighter:u,options:c,languageOverride:f?"text":e.lang});if(L){S.deletionLines=h,S.additionLines=p;continue}if(a.deletionSegments.length>0)for(let e of a.deletionSegments)for(let t=0;t<e.count;t++)S.deletionLines[e.targetIndex+t]=h[e.originalOffset+t];else S.deletionLines.push(...h);if(a.additionSegments.length>0)for(let e of a.additionSegments)for(let t=0;t<e.count;t++)S.additionLines[e.targetIndex+t]=p[e.originalOffset+t];else S.additionLines.push(...p)}return{code:S,themeStyles:C,baseThemeType:y}}],10906)},59241,46118,95102,90133,94662,e=>{"use strict";var t=e.i(22256);e.s(["getResolvedLanguages",0,function(e){let n=[];for(let i of e){let e=t.ResolvedLanguages.get(i);if(null==e)throw Error(`getResolvedLanguages: ${i} is not resolved. Please resolve languages before calling getResolvedLanguages`);n.push(e)}return n}],59241),e.s(["hasResolvedLanguages",0,function(e){for(let n of Array.isArray(e)?e:[e])if(!t.ResolvedLanguages.has(n))return!1;return!0}],46118);var n=e.i(6501),i=e.i(68806);async function r(e){let t=[],r=[];for(let o of e){if("text"===o||"ansi"===o)continue;let e=(0,i.getResolvedOrResolveLanguage)(o)??(0,n.resolveLanguage)(o);"then"in e?r.push(e):t.push(e)}return r.length>0&&await Promise.all(r).then(e=>{for(let n of e){if(null==n)throw Error("resolvedLanguages: unable to resolve language");t.push(n)}}),t}e.s(["resolveLanguages",0,r],95102);var o=e.i(86309);e.s(["getResolvedThemes",0,function(e){let t=[];for(let n of e){let e=o.ResolvedThemes.get(n);if(null==e)throw Error(`getAllResolvedThemes: ${n} is unresolved, you must resolve all necessary themes before calling this function`);t.push(e)}return t}],90133);var a=e.i(53257),s=e.i(20187);async function l(e){let t=[],n=[];for(let i of e){let e=(0,s.getResolvedOrResolveTheme)(i)??(0,a.resolveTheme)(i);"then"in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e)null!=n&&t.push(n)}),t}e.s(["resolveThemes",0,l],94662)},76474,e=>{"use strict";e.s(["areSelectionPointsEqual",0,function(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}])},44011,e=>{"use strict";e.s(["areSelectionsEqual",0,function(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}])},34053,e=>{"use strict";var t=e.i(6104);e.s(["createGutterUtilityElement",0,function(){return(0,t.createHastElement)({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[(0,t.createIconElement)({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}])},22671,51756,e=>{"use strict";var t=e.i(76474),n=e.i(44011),i=e.i(34053),r=e.i(27118),o=class{hoveredLine;hoveredToken;pre;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):null!=this.gutterUtilityContainer&&(this.gutterUtilityContainer.remove(),this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,"gutterSelecting"===this.pointerSession.mode&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return null===this.renderedSelectionRange}setSelection(e){let t=!(e===this.selectedRange||(0,n.areSelectionsEqual)(e??void 0,this.selectedRange??void 0));(this.isSelectionDirty()||t)&&(this.selectedRange=e,this.renderSelection(),t&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{if(null!=this.hoveredLine){if("diff"===this.mode&&"diff-line"===this.hoveredLine.type)return{lineNumber:this.hoveredLine.lineNumber,side:this.hoveredLine.annotationSide};if("file"===this.mode&&"line"===this.hoveredLine.type)return{lineNumber:this.hoveredLine.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;null==t&&null==n&&null==i&&null==o&&null==r||null!=this.options.onGutterUtilityClick&&c(e.composedPath())||(f(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{let{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;("disabled"!==t||a||null!=n||null!=i||null!=r||null!=o)&&(f(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;(f(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),null==this.hoveredLine&&null==this.hoveredToken)?f(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token"):(this.gutterUtilityContainer?.remove(),null!=this.hoveredToken&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),null!=this.hoveredLine&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()))};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,i=t.composedPath();f(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});let r=this.resolvePointerTarget(i);f(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);let{onLineClick:o,onLineNumberClick:a,onLineEnter:d,onLineLeave:u,onTokenClick:h,onTokenEnter:c,onTokenLeave:p,onHunkExpand:g,onMergeConflictActionClick:m}=this.options;switch(e){case"move":{let e=l(r)&&this.hoveredLine?.lineElement===r.lineElement;!(s(r)&&this.hoveredToken?.tokenElement===r.tokenElement)&&(null!=this.hoveredToken&&(p?.(this.hoveredToken,t),this.clearHoveredToken()),s(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),c?.(this.hoveredToken,t))),!e&&(null!=this.hoveredLine&&(this.gutterUtilityContainer?.remove(),u?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),l(r)&&(this.setHoveredLine(this.toEventBaseProps(r)),null!=this.gutterUtilityContainer&&r.numberElement.appendChild(this.gutterUtilityContainer),d?.({...this.hoveredLine,event:t})));break}case"click":{var b,v;if(null==r)break;if("kind"in(b=r)&&"merge-conflict-action"===b.kind&&null!=m){m(r);break}if("type"in(v=r)&&"line-info"===v.type&&null!=g){g(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?1/0:void 0);break}if(!l(r))break;s(r)&&null!=h&&h(this.toTokenEventBaseProps(r),t);let e=this.toEventBaseProps(r);null!=a&&r.numberColumn?a({...e,event:t}):null!=o&&o({...e,event:t})}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:a,onTokenClick:s,onTokenEnter:l,onTokenLeave:d,onHunkExpand:u,onMergeConflictActionClick:h,enableGutterUtility:c=!1,enableLineSelection:p=!1,onGutterUtilityClick:g}=this.options,m=null!=g,b="disabled"!==n||null!=i||null!=r||null!=o||null!=a||null!=s||null!=l||null!=d||null!=u||null!=h||c||p||m;if(b&&!this.hasPointerListeners){let n;e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,f(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(n=[],("both"===t||"click"===t)&&(null!=i&&n.push("onLineClick"),null!=r&&n.push("onLineNumberClick"),null!=u&&n.push("expandable hunk separators"),null!=h&&n.push("merge conflict actions")),n)),f(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),f(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")}else!b&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);let v="selecting"===this.pointerSession.mode||"pendingSingleLineUnselect"===this.pointerSession.mode,y="gutterSelecting"===this.pointerSession.mode;(!p&&v||!m&&y)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(null==this.pre)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=null!=e,r=null!=t||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if("mouse"===e.pointerType&&0!==e.button||null==this.pre||"idle"!==this.pointerSession.mode)return;let t=e.composedPath();c(t)&&null!=this.options.onGutterUtilityClick?this.startGutterSelectionFromPointerDown(e,t):this.startLineSelectionFromPointerDown(e,t)};startLineSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1}=this.options;if(!n)return;let i=this.getSelectionPointerInfo(t,!0);if(null==i)return;let{pre:r}=this;if(null==r)return;e.preventDefault();let{lineNumber:o,eventSide:a,lineIndex:s}=i;if(e.shiftKey&&null!=this.selectedRange){let t=this.getIndexesFromSelection(this.selectedRange,"split"===r.getAttribute("data-diff-type"));if(null==t)return;let n=t.start<=t.end?s>=t.start:s<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(o,a,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===o&&this.selectedRange?.end===o){let t={lineNumber:o,side:a};this.selectionAnchor=t,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.selectedRange=null,this.selectionAnchor={lineNumber:o,side:a},this.updateSelection(o,a,!1),this.notifySelectionStart(this.selectedRange),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e,t){let{enableLineSelection:n=!1,onGutterUtilityClick:i}=this.options;if(null==i)return;let r=this.getSelectionPointFromPath(t);null!=r&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:r},n&&(this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.selectedRange)),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:n=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointFromPath(e.composedPath());if(null==t)return;this.pointerSession.current=t,!0===n&&this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let t=this.getSelectionPointerInfo(e.composedPath(),!1);if(null==t||null==this.selectionAnchor)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;let n=this.getSelectionPointerInfo(e.composedPath(),!1);if(null==n||null==this.selectionAnchor)return;let i={lineNumber:n.lineNumber,side:n.eventSide};if((0,t.areSelectionPointsEqual)(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.selectedRange),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;let i=this.getSelectionPointFromPath(e.composedPath());null!=i&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.selectedRange),this.notifySelectionCommitted()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){null!=this.hoveredLine&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t="disabled"}=this.options;null!=this.hoveredLine&&this.clearHoveredLine(),this.hoveredLine=e,"disabled"!==t&&(("both"===t||"line"===t)&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),("both"===t||"number"===t)&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){null!=this.hoveredToken&&(this.hoveredToken=void 0)}setHoveredToken(e){null!=this.hoveredToken&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(null==this.gutterUtilityContainer&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)null!=this.gutterUtilityButton&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),null==this.gutterUtilitySlot&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,null==this.gutterUtilityButton){let e=document.createElement("div");e.innerHTML=(0,r.toHtml)((0,i.createGutterUtilityElement)());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){"pendingSingleLineUnselect"===this.pointerSession.mode&&(this.pointerSession={mode:"idle"})}getSelectionPointerInfo(e,t){let n=this.resolvePointerTarget(e);if(a(n)&&(!t||n.numberColumn)&&null!=n.splitLineIndex)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:"diff"===this.mode?n.side:void 0}}getSelectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(a(t))return{lineNumber:t.lineNumber,side:"diff"===this.mode?t.side:void 0}}getLineIndex(e,t){let{getLineIndex:n}=this.options;return null!=n?n(e,t):[e-1,e-1]}updateSelection(e,t,i=!0){let r,{selectedRange:o}=this;if(null==e)r=null;else{let n=this.selectionAnchor?.side??t,i=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(i,e,n,t)}(0,n.areSelectionsEqual)(o??void 0,r??void 0)||(this.selectedRange=r,i&&this.notifySelectionChangeDelta(),this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection))}getIndexesFromSelection(e,t){if(null==this.pre)return;let n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return null!=n&&null!=i?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),null==this.pre||this.renderedSelectionRange===this.selectedRange)return;for(let e of this.pre.querySelectorAll("[data-selected-line]"))e.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,null==this.selectedRange)return;let{children:e}=this.pre;if(0===e.length)return;if(e.length>2)throw console.error(e),Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");let t="split"===this.pre.getAttribute("data-diff-type"),n=this.getIndexesFromSelection(this.selectedRange,t);if(null==n)throw console.error({rowRange:n,selectedRange:this.selectedRange}),Error("InteractionManager.renderSelection: No valid rowRange");let i=n.start===n.end,r=Math.min(n.start,n.end),o=Math.max(n.start,n.end);for(let n of e){let[e,a]=n.children,s=a.children.length;if(s!==e.children.length)throw Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let n=0;n<s;n++){let s=a.children[n],l=e.children[n];if(!(s instanceof HTMLElement)||!(l instanceof HTMLElement))continue;let d=this.parseLineIndex(s,t);if((d??0)>o)break;if(null==d||d<r)continue;let u=i?"single":d===r?"first":d===o?"last":"";s.setAttribute("data-selected-line",u),l.setAttribute("data-selected-line",u),l.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute("data-line-annotation")||s.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(i?(u="last",s.setAttribute("data-selected-line","first")):d===r?u="":d===o&&s.setAttribute("data-selected-line",""),s.nextSibling.setAttribute("data-selected-line",u),l.nextSibling.setAttribute("data-selected-line",u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.selectedRange??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.selectedRange??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return"file"===this.mode?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}){return"file"===this.mode?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...null!=n?{side:n}:{},...n!==i&&null!=i?{endSide:i}:{}}}resolvePointerTarget(e){let t,n,i,r,o,a,s,l,c,f,p=!1;for(let d of e){if(!(d instanceof HTMLElement))continue;if(null==f&&d.hasAttribute("data-merge-conflict-action")){var g;let e=d.getAttribute("data-merge-conflict-action")??void 0,t=d.getAttribute("data-merge-conflict-conflict-index")??void 0,n=null!=t?Number.parseInt(t,10):NaN;("current"===(g=e)||"incoming"===g||"both"===g)&&Number.isFinite(n)&&(f={kind:"merge-conflict-action",resolution:e,conflictIndex:n})}if(null==a&&d.hasAttribute("data-char")){a=d;let e=d.getAttribute("data-char");if(null!=e){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=d.textContent??"",n=t+e.length;(""!==e.trim()||!0===this.options.enableTokenInteractionsOnWhitespace)&&(s={tokenElement:a,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=null==o?d.getAttribute("data-column-number")??void 0:void 0;if(null!=e){o=d,c=Number.parseInt(e,10),p=!0,t=h(d),r=d.getAttribute("data-line-index")??void 0;continue}let u=null==i?d.getAttribute("data-line")??void 0:void 0;if(null!=u){i=d,c=Number.parseInt(u,10),t=h(d),r=d.getAttribute("data-line-index")??void 0;continue}if(null==l&&(d.hasAttribute("data-expand-button")||d.hasAttribute("data-unmodified-lines"))){l={hunkIndex:void 0,direction:d.hasAttribute("data-expand-up")?"up":d.hasAttribute("data-expand-down")?"down":"both",all:d.hasAttribute("data-expand-all-button")};continue}let m=null!=l?d.getAttribute("data-expand-index")??void 0:void 0;if(null!=l&&null!=m){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(null==n&&d.hasAttribute("data-code")){n=d;break}}if(null!=f)return f;if(l?.hunkIndex!=null)return{type:"line-info",hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=null!=r?d(n,`[data-line][data-line-index="${r}"]`):void 0,o??=null!=r?d(n,`[data-column-number][data-line-index="${r}"]`):void 0,null==n||null==i||null==o||null==t||null==c||Number.isNaN(c))return;let m=this.parseLineIndex(i,this.isSplitDiff());return null!=s?"file"===this.mode?{kind:"token",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:void 0,splitLineIndex:m,...s}:{kind:"token",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:u(t,n),splitLineIndex:m,...s}:"file"===this.mode?{kind:"line",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:void 0,splitLineIndex:m}:{kind:"line",lineType:t,lineElement:i,lineNumber:c,numberColumn:p,numberElement:o,side:u(t,n),splitLineIndex:m}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){let n=(e.getAttribute("data-line-index")??"").split(",").map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));return t&&2===n.length?n[1]:t?void 0:n[0]}};function a(e){return null!=e&&"kind"in e&&"line"===e.kind}function s(e){return null!=e&&"kind"in e&&"token"===e.kind}function l(e){return a(e)||s(e)}function d(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function u(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function h(e){let t=e.getAttribute("data-line-type");if(null!=t)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function c(e){for(let t of e)if(t instanceof HTMLElement&&t.hasAttribute("data-utility-button"))return!0;return!1}function f(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if("click"!==t)return;break;case"move":if("move"!==t)return}console.log(...n)}e.s(["InteractionManager",0,o,"pluckInteractionOptions",0,function({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,enableHoverUtility:n,lineHoverHighlight:i,onGutterUtilityClick:r,onLineClick:o,onLineEnter:a,onLineLeave:s,onLineNumberClick:l,onTokenClick:d,onTokenEnter:u,onTokenLeave:h,renderGutterUtility:c,renderHoverUtility:f,__debugPointerEvents:p,enableLineSelection:g,onLineSelected:m,onLineSelectionStart:b,onLineSelectionChange:v,onLineSelectionEnd:y},C,k,S){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:function({enableGutterUtility:e,enableHoverUtility:t,renderGutterUtility:n,renderHoverUtility:i,onGutterUtilityClick:r}){if(void 0!==e&&void 0!==t)throw Error("Cannot use both 'enableGutterUtility' and deprecated 'enableHoverUtility'. Use only 'enableGutterUtility'.");if(null!=n&&null!=i)throw Error("Cannot use both 'renderGutterUtility' and deprecated 'renderHoverUtility'. Use only 'renderGutterUtility'.");if(null!=r&&(null!=n||null!=i))throw Error("Cannot use both 'onGutterUtilityClick' and render utility callbacks ('renderGutterUtility'/'renderHoverUtility'). Use only one gutter utility API.");return e??t??!1}({enableGutterUtility:t,enableHoverUtility:n,renderGutterUtility:c,renderHoverUtility:f,onGutterUtilityClick:r}),usesCustomGutterUtility:null!=c||null!=f,lineHoverHighlight:i,onGutterUtilityClick:r,onHunkExpand:C,onMergeConflictActionClick:S,onLineClick:o,onLineEnter:a,onLineLeave:s,onLineNumberClick:l,onTokenClick:d,onTokenEnter:u,onTokenLeave:h,__debugPointerEvents:p,enableLineSelection:g,onLineSelected:m,onLineSelectionStart:b,onLineSelectionChange:v,onLineSelectionEnd:y,getLineIndex:k}}],22671);var p=class{observedNodes=new Map;queuedUpdates=new Map;cleanUp(){this.resizeObserver?.disconnect(),this.observedNodes.clear(),this.queuedUpdates.clear()}resizeObserver;setup(e,t){this.resizeObserver??=new ResizeObserver(this.handleResizeObserver);let n=e.querySelectorAll("code"),i=new Map(this.observedNodes);for(let e of(this.observedNodes.clear(),n)){let t=i.get(e);if(null!=t&&"code"!==t.type)throw Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let n=e.firstElementChild;n instanceof HTMLElement||(n=null),null!=t?(this.observedNodes.set(e,t),i.delete(e),t.numberElement!==n?(null!=t.numberElement&&this.resizeObserver.unobserve(t.numberElement),null!=n&&(this.resizeObserver.observe(n),i.delete(n),this.observedNodes.set(n,t)),t.numberElement=n):null!=t.numberElement&&(i.delete(t.numberElement),this.observedNodes.set(t.numberElement,t))):(t={type:"code",codeElement:e,numberElement:n,codeWidth:"auto",numberWidth:0},this.observedNodes.set(e,t),this.resizeObserver.observe(e),null!=n&&(this.observedNodes.set(n,t),this.resizeObserver.observe(n)))}if(n.length>1&&!t){let t=e.querySelectorAll('[data-line-annotation*=","]'),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let{lineAnnotation:t=""}=e.dataset;if(!/^\d+,\d+$/.test(t)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:t,element:e});continue}let i=n.get(t);null==i&&(i=[],n.set(t,i)),i.push(e)}for(let[e,t]of n){if(2!==t.length){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",e,t);continue}let[n,r]=t,o=n.firstElementChild,a=r.firstElementChild;if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement)||!(o instanceof HTMLElement)||!(a instanceof HTMLElement))continue;let s=i.get(o);if(null!=s){this.observedNodes.set(o,s),this.observedNodes.set(a,s),i.delete(o),i.delete(a);continue}let l=Math.max((s={type:"annotations",column1:{container:n,child:o,childHeight:o.getBoundingClientRect().height},column2:{container:r,child:a,childHeight:a.getBoundingClientRect().height},currentHeight:"auto"}).column1.childHeight,s.column2.childHeight);this.applyNewHeight(s,l),this.observedNodes.set(o,s),this.observedNodes.set(a,s),this.resizeObserver.observe(o),this.resizeObserver.observe(a)}}for(let e of i.keys())e.isConnected&&(e.style.removeProperty("--diffs-column-content-width"),e.style.removeProperty("--diffs-column-number-width"),e.style.removeProperty("--diffs-column-width"),e.parentElement instanceof HTMLElement&&e.parentElement.style.removeProperty("--diffs-annotation-min-height")),this.resizeObserver.unobserve(e);i.clear()}handleResizeObserver=e=>{for(let t of e){let{target:e,borderBoxSize:n}=t;if(!(e instanceof HTMLElement)){console.error("FileDiff.handleResizeObserver: Invalid element for ResizeObserver",t);continue}let i=this.observedNodes.get(e);if(null==i){console.error("FileDiff.handleResizeObserver: Not a valid observed node",t);continue}let r=n[0];if("annotations"===i.type){let t=e===i.column1.child?i.column1:e===i.column2.child?i.column2:void 0;if(null==t){console.error("FileDiff.handleResizeObserver: Couldn't find a column for",{item:i,target:e});continue}t.childHeight=r.blockSize;let n=Math.max(i.column1.childHeight,i.column2.childHeight);this.applyNewHeight(i,n)}else if("code"===i.type){let t=[e,r.inlineSize],n=this.queuedUpdates.get(i)??[];n.push(t),this.queuedUpdates.set(i,n)}}this.handleColumnChange()};handleColumnChange=()=>{for(let[e,t]of this.queuedUpdates)for(let[n,i]of t)if(n===e.codeElement){let n=Math.max(Math.floor(i),0);if(n!==e.codeWidth){let t=Math.max(n-e.numberWidth,0);e.codeWidth=0===n?"auto":n,e.codeElement.style.setProperty("--diffs-column-content-width",`${t>0?`${t}px`:"auto"}`),e.codeElement.style.setProperty("--diffs-column-width",`${"number"==typeof e.codeWidth?`${e.codeWidth}px`:"auto"}`)}null!=e.numberElement&&"number"==typeof e.codeWidth&&0===e.numberWidth&&t.push([e.numberElement,e.numberElement.getBoundingClientRect().width])}else if(n===e.numberElement){let t=Math.max(Math.ceil(i),0);if(t!==e.numberWidth&&(e.numberWidth=t,e.codeElement.style.setProperty("--diffs-column-number-width",`${0===e.numberWidth?"auto":`${e.numberWidth}px`}`),"auto"!==e.codeWidth)){let t=Math.max(e.codeWidth-e.numberWidth,0);e.codeElement.style.setProperty("--diffs-column-content-width",`${0===t?"auto":`${t}px`}`)}}this.queuedUpdates.clear()};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`),e.column2.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`))}};e.s(["ResizeManager",0,p],51756)},25106,e=>{"use strict";e.s(["areRenderRangesEqual",0,function(e,t){return null==e||null==t?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}])},84324,e=>{"use strict";var t=e.i(22256);e.s(["areLanguagesAttached",0,function(e){for(let n of Array.isArray(e)?e:[e])if(!t.AttachedLanguages.has(n))return!1;return!0}])},82994,e=>{"use strict";var t=e.i(86309),n=e.i(51045);e.s(["areThemesAttached",0,function(e){for(let i of(0,n.getThemes)(e))if(!t.AttachedThemes.has(i))return!1;return!0}])},24183,e=>{"use strict";var t=e.i(6104);e.s(["createAnnotationElement",0,function(e){return(0,t.createHastElement)({tagName:"div",children:[(0,t.createHastElement)({tagName:"div",children:e.annotations?.map(e=>(0,t.createHastElement)({tagName:"slot",properties:{name:e}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}])},41914,e=>{"use strict";var t=e.i(6104);e.s(["createContentColumn",0,function(e,n){return(0,t.createHastElement)({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${n}`}})}])},34481,78641,45786,e=>{"use strict";var t=e.i(27101),n=e.i(6104);function i(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function r({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:o,totalLines:a,type:s,customProperties:l}){return{...l,"data-diff":"diff"===s?"":void 0,"data-file":"file"===s?"":void 0,"data-diff-type":"diff"===s?o?"split":"single":void 0,"data-overflow":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":"bars"===e||"classic"===e?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}e.s(["getIconForType",0,i],78641),e.s(["createFileHeaderElement",0,function({fileOrDiff:e,mode:r}){let o="type"in e?e:void 0,a={"data-diffs-header":r,"data-change-type":o?.type};return(0,n.createHastElement)({tagName:"div",children:["custom"===r?(0,n.createHastElement)({tagName:"slot",properties:{name:t.CUSTOM_HEADER_SLOT_ID}}):function({name:e,prevName:r,iconType:o}){let a=[(0,n.createHastElement)({tagName:"slot",properties:{name:t.HEADER_PREFIX_SLOT_ID}}),(0,n.createIconElement)({name:i(o),properties:{"data-change-icon":o}})];return null!=r&&(a.push((0,n.createHastElement)({tagName:"div",children:[(0,n.createHastElement)({tagName:"bdi",children:[(0,n.createTextNodeElement)(r)]})],properties:{"data-prev-name":""}})),a.push((0,n.createIconElement)({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),a.push((0,n.createHastElement)({tagName:"div",children:[(0,n.createHastElement)({tagName:"bdi",children:[(0,n.createTextNodeElement)(e)]})],properties:{"data-title":""}})),(0,n.createHastElement)({tagName:"div",children:a,properties:{"data-header-content":""}})}({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:o?.type??"file"}),..."custom"===r?[]:[function(e){let i=[];if(null!=e){let t=0,r=0;for(let n of e.hunks)t+=n.additionLines,r+=n.deletionLines;(r>0||0===t)&&i.push((0,n.createHastElement)({tagName:"span",children:[(0,n.createTextNodeElement)(`-${r}`)],properties:{"data-deletions-count":""}})),(t>0||0===r)&&i.push((0,n.createHastElement)({tagName:"span",children:[(0,n.createTextNodeElement)(`+${t}`)],properties:{"data-additions-count":""}}))}return i.push((0,n.createHastElement)({tagName:"slot",properties:{name:t.HEADER_METADATA_SLOT_ID}})),(0,n.createHastElement)({tagName:"div",children:i,properties:{"data-metadata":""}})}(o)]],properties:a})}],34481),e.s(["createPreElement",0,function(e){return(0,n.createHastElement)({tagName:"pre",properties:r(e)})},"createPreWrapperProperties",0,r],45786)},82856,e=>{"use strict";var t=e.i(51045);e.s(["getHighlighterOptions",0,function(e,{theme:n,preferredHighlighter:i="shiki-js"}){return{langs:[e??"text"],themes:(0,t.getThemes)(n),preferredHighlighter:i}}])},47535,83981,44477,e=>{"use strict";var t=e.i(27101),n=e.i(6104),i=e.i(84324),r=e.i(30891),o=e.i(51045),a=e.i(82994),s=e.i(16049),l=e.i(25106),d=e.i(8456),u=e.i(24183),h=e.i(41914),c=e.i(34481),f=e.i(45786),p=e.i(35864),g=e.i(82856),m=e.i(2612),b=e.i(82189),v=e.i(6609),y=e.i(59390),C=e.i(16876);function k(e){return!0===e.useTokenTransformer||null!=e.onTokenClick||null!=e.onTokenEnter||null!=e.onTokenLeave}e.s(["shouldUseTokenTransformer",0,k],83981);var S=e.i(27118);let x=-1;var w=class{__id=`file-renderer:${++x}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:t.DEFAULT_THEMES},n,i){this.options=e,this.onRenderUpdate=n,this.workerManager=i,i?.isWorkingPool()!==!0&&(this.highlighter=(0,a.areThemesAttached)(e.theme??t.DEFAULT_THEMES)?(0,r.getHighlighterIfLoaded)():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){for(let t of(this.lineAnnotations={},e)){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.renderCache=void 0,this.highlighter=void 0,this.workerManager=void 0,this.onRenderUpdate=void 0,this.lineCache=void 0}hydrate(e){let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getFileResultCache(e);null==n||A(t,n.options)||(n=void 0),this.renderCache??={file:e,options:t,highlighted:!(0,b.isFilePlainText)(e),result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?null==this.renderCache.result&&this.workerManager.highlightFileAST(this,e):null==this.highlighter&&(this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name),this.initializeHighlighter())}getRenderOptions(e){let n=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();let{theme:e=t.DEFAULT_THEMES,tokenizeMaxLineLength:n=1e3}=this.options;return{theme:e,useTokenTransformer:k(this.options),tokenizeMaxLineLength:n}})(),{renderCache:i}=this;return i?.result!=null&&e===i.file&&A(n,i.options)?{options:n,forceRender:!1}:{options:n,forceRender:!0}}getOrCreateLineCache(e){if(null==e.cacheKey)return this.lineCache=void 0,(0,y.splitFileContents)(e.contents);let{lineCache:t}=this;return(null==t||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:(0,y.splitFileContents)(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,n=t.DEFAULT_RENDER_RANGE){if(null==e)return;let r=this.workerManager?.getFileResultCache(e);null!=r&&null==this.renderCache&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r});let{options:o,forceRender:s}=this.getRenderOptions(e);if(this.renderCache??={file:e,highlighted:!1,options:o,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)null!=this.renderCache.result&&(this.renderCache.highlighted||e===this.renderCache.file&&(0,l.areRenderRangesEqual)(this.renderCache.renderRange,n))||(this.renderCache.file=e,this.renderCache.result=this.workerManager.getPlainFileAST(e,n.startingLine,n.totalLines,this.getOrCreateLineCache(e)),this.renderCache.renderRange=n),n.totalLines>0&&(!this.renderCache.highlighted||s)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,a.areThemesAttached)(o.theme),n=null!=this.highlighter&&(0,i.areLanguagesAttached)(this.computedLang);if(null!=this.highlighter&&t&&(s||!this.renderCache.highlighted&&n||null==this.renderCache.result)){let{result:t,options:i}=this.renderFileWithHighlighter(e,this.highlighter,!n);this.renderCache={file:e,options:i,highlighted:n,result:t,renderRange:void 0}}t&&n||this.asyncHighlight(e).then(({result:t,options:n})=>{null!=this.renderCache&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n)})}return null!=this.renderCache.result?this.processFileResult(this.renderCache.file,n,this.renderCache.result):void 0}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){let{result:i}=await this.asyncHighlight(e);return this.processFileResult(e,n,i)}async asyncHighlight(e){this.computedLang=e.lang??(0,p.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,s.hasResolvedThemes)((0,o.getThemes)(this.options.theme)),n=null!=this.highlighter&&(0,i.areLanguagesAttached)(this.computedLang);return null!=this.highlighter&&t&&n||(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter)}renderFileWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e);return{result:(0,C.renderFileWithHighlighter)(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:i,themeStyles:r,baseThemeType:o}){let{disableFileHeader:a=!1}=this.options,s=[],l=(0,n.createGutterWrapper)(),d=this.getOrCreateLineCache(e),h=0;return(0,v.iterateOverFile)({lines:d,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:t,lineNumber:r})=>{let o=i[t];if(null==o){let n="FileRenderer.processFileResult: Line doesnt exist";throw console.error(n,{name:e.name,lineIndex:t,lineNumber:r,lines:d}),Error(n)}if(null!=o){l.children.push((0,n.createGutterItem)("context",r,`${t}`)),s.push(o),h++;let e=this.lineAnnotations[r];null!=e&&(l.children.push((0,n.createGutterGap)("context","annotation",1)),s.push((0,u.createAnnotationElement)({type:"annotation",hunkIndex:0,lineIndex:r,annotations:e.map(e=>(0,m.getLineAnnotationName)(e))})),h++)}}}),l.properties.style=`grid-row: span ${h}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(d.length),headerAST:a?void 0:this.renderHeader(e),totalLines:d.length,rowCount:h,themeStyles:r,baseThemeType:o,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){let{headerRenderMode:t="default"}=this.options;return(0,c.createFileHeaderElement)({fileOrDiff:e,mode:t})}renderFullHTML(e){return(0,S.toHtml)(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push((0,n.createHastElement)({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){let t=(0,n.createGutterWrapper)();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,(0,h.createContentColumn)(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return t?(0,S.toHtml)((0,n.createHastElement)({tagName:"code",children:e,properties:{"data-code":""}})):(0,S.toHtml)(e)}async initializeHighlighter(){return this.highlighter=await (0,r.getSharedHighlighter)((0,g.getHighlighterOptions)(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n){if(null==this.renderCache)return;let i=this.renderCache.file!==e||!this.renderCache.highlighted||!A(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:!0,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return(0,f.createPreElement)({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function A(e,t){return(0,d.areThemesEqual)(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}e.s(["FileRenderer",0,w],47535);let L=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
139
- <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
140
- <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
141
- </symbol>
142
- <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
143
- <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
144
- </symbol>
145
- <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
146
- <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
147
- </symbol>
148
- <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
149
- <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
150
- </symbol>
151
- <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
152
- <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
153
- </symbol>
154
- <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
155
- <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
156
- </symbol>
157
- <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
158
- <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
159
- </symbol>
160
- <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
161
- <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
162
- </symbol>
163
- <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
164
- <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
165
- </symbol>
166
- <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
167
- <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
168
- </symbol>
169
- <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
170
- <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
171
- </symbol>
172
- <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
173
- <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
174
- </symbol>
175
- <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
176
- <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
177
- </symbol>
178
- <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
179
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
180
- </symbol>
181
- <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
182
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
183
- </symbol>
184
- <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
185
- <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
186
- </symbol>
187
- <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
188
- <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
189
- </symbol>
190
- </svg>`;e.s(["SVGSpriteSheet",0,L],44477)},32547,61647,93946,36635,45705,50925,116,60654,e=>{"use strict";e.s(["areLineAnnotationsEqual",0,function(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}],32547);let t={};e.s(["arePrePropertiesEqual",0,function(e,n){return null==e||null==n?e===n:function(e=t,n=t){if(e===n)return!0;let i=Object.keys(e),r=Object.keys(n);if(i.length!==r.length)return!1;for(let t of i)if(e[t]!==n[t])return!1;return!0}(e.customProperties,n.customProperties)&&e.type===n.type&&e.diffIndicators===n.diffIndicators&&e.disableBackground===n.disableBackground&&e.disableLineNumbers===n.disableLineNumbers&&e.overflow===n.overflow&&e.split===n.split&&e.totalLines===n.totalLines}],61647),e.s(["createAnnotationWrapperNode",0,function(e){let t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}],93946),e.s(["createGutterUtilityContentNode",0,function(){let e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e}],36635);var n=e.i(27101);e.s(["createUnsafeCSSStyleNode",0,function(){let e=document.createElement("style");return e.setAttribute(n.UNSAFE_CSS_ATTRIBUTE,""),e}],45705);var i="@layer base, theme, rendered, unsafe;\n\n@layer base {\n :host {\n --diffs-font-fallback:\n 'SF Mono', Monaco, Consolas, 'Ubuntu Mono', 'Liberation Mono',\n 'Courier New', monospace;\n --diffs-header-font-fallback:\n system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue',\n 'Noto Sans', 'Liberation Sans', Arial, sans-serif;\n\n --diffs-mixer: light-dark(black, white);\n --diffs-gap-fallback: 8px;\n\n --diffs-added-light: #0dbe4e;\n --diffs-added-dark: #5ecc71;\n --diffs-modified-light: #009fff;\n --diffs-modified-dark: #69b1ff;\n --diffs-deleted-light: #ff2e3f;\n --diffs-deleted-dark: #ff6762;\n\n /*\n // Available CSS Color Overrides\n --diffs-bg-buffer-override\n --diffs-bg-hover-override\n --diffs-bg-context-override\n --diffs-bg-separator-override\n\n --diffs-fg-number-override\n --diffs-fg-number-addition-override\n --diffs-fg-number-deletion-override\n --diffs-fg-conflict-marker-override\n\n --diffs-deletion-color-override\n --diffs-addition-color-override\n --diffs-modified-color-override\n\n --diffs-bg-deletion-override\n --diffs-bg-deletion-number-override\n --diffs-bg-deletion-hover-override\n --diffs-bg-deletion-emphasis-override\n\n --diffs-bg-addition-override\n --diffs-bg-addition-number-override\n --diffs-bg-addition-hover-override\n --diffs-bg-addition-emphasis-override\n\n // Line Selection Color Overrides (for enableLineSelection)\n --diffs-selection-color-override\n --diffs-bg-selection-override\n --diffs-bg-selection-number-override\n --diffs-bg-selection-background-override\n --diffs-bg-selection-number-background-override\n\n // Available CSS Layout Overrides\n --diffs-gap-inline\n --diffs-gap-block\n --diffs-gap-style\n --diffs-tab-size\n */\n\n color-scheme: light dark;\n display: block;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n font-feature-settings: var(--diffs-font-features);\n\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n --diffs-bg: light-dark(\n var(--diffs-light-bg, #fff),\n var(--diffs-dark-bg, #000)\n );\n --diffs-bg-buffer: var(\n --diffs-bg-buffer-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))\n )\n );\n --diffs-bg-hover: var(\n --diffs-bg-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 97%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-mixer))\n )\n );\n\n --diffs-bg-context: var(\n --diffs-bg-context-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))\n )\n );\n --diffs-bg-context-number: var(\n --diffs-bg-context-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-context) 80%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-context) 60%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-marker: var(\n --diffs-bg-conflict-marker-override,\n light-dark(\n color-mix(\n in lab,\n var(--diffs-bg-context) 88%,\n var(--diffs-modified-base)\n ),\n color-mix(\n in lab,\n var(--diffs-bg-context) 80%,\n var(--diffs-modified-base)\n )\n )\n );\n --diffs-bg-conflict-current: var(\n --diffs-bg-conflict-current-override,\n light-dark(#e5f8ea, #274432)\n );\n --diffs-bg-conflict-base: var(\n --diffs-bg-conflict-base-override,\n light-dark(\n color-mix(\n in lab,\n var(--diffs-bg-context) 90%,\n var(--diffs-modified-base)\n ),\n color-mix(\n in lab,\n var(--diffs-bg-context) 82%,\n var(--diffs-modified-base)\n )\n )\n );\n --diffs-bg-conflict-incoming: var(\n --diffs-bg-conflict-incoming-override,\n light-dark(#e6f1ff, #253b5a)\n );\n --diffs-bg-conflict-marker-number: var(\n --diffs-bg-conflict-marker-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-conflict-marker) 72%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-conflict-marker) 54%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-current-number: var(\n --diffs-bg-conflict-current-number-override,\n light-dark(#d7f1de, #30533d)\n );\n --diffs-bg-conflict-base-number: var(\n --diffs-bg-conflict-base-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg-conflict-base) 72%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-bg-conflict-base) 54%, var(--diffs-bg))\n )\n );\n --diffs-bg-conflict-incoming-number: var(\n --diffs-bg-conflict-incoming-number-override,\n light-dark(#d8e8ff, #2f4b73)\n );\n --conflict-bg-current: var(\n --conflict-bg-current-override,\n var(--diffs-bg-addition)\n );\n --conflict-bg-incoming: var(\n --conflict-bg-incoming-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-number: var(\n --conflict-bg-current-number-override,\n var(--diffs-bg-addition-number)\n );\n --conflict-bg-incoming-number: var(\n --conflict-bg-incoming-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-header: var(\n --conflict-bg-current-header-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 78%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 68%, var(--diffs-addition-base))\n )\n );\n --conflict-bg-incoming-header: var(\n --conflict-bg-incoming-header-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 78%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 68%, var(--diffs-modified-base))\n )\n );\n --conflict-bg-current-header-number: var(\n --conflict-bg-current-header-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 72%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 62%, var(--diffs-addition-base))\n )\n );\n --conflict-bg-incoming-header-number: var(\n --conflict-bg-incoming-header-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 72%, var(--diffs-modified-base)),\n color-mix(in lab, var(--diffs-bg) 62%, var(--diffs-modified-base))\n )\n );\n\n --diffs-bg-separator: var(\n --diffs-bg-separator-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))\n )\n );\n\n --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));\n --diffs-fg-number: var(\n --diffs-fg-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),\n color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))\n )\n );\n --diffs-fg-conflict-marker: var(\n --diffs-fg-conflict-marker-override,\n var(--diffs-fg-number)\n );\n\n --diffs-deletion-base: var(\n --diffs-deletion-color-override,\n light-dark(\n var(\n --diffs-light-deletion-color,\n var(--diffs-deletion-color, var(--diffs-deleted-light))\n ),\n var(\n --diffs-dark-deletion-color,\n var(--diffs-deletion-color, var(--diffs-deleted-dark))\n )\n )\n );\n --diffs-addition-base: var(\n --diffs-addition-color-override,\n light-dark(\n var(\n --diffs-light-addition-color,\n var(--diffs-addition-color, var(--diffs-added-light))\n ),\n var(\n --diffs-dark-addition-color,\n var(--diffs-addition-color, var(--diffs-added-dark))\n )\n )\n );\n --diffs-modified-base: var(\n --diffs-modified-color-override,\n light-dark(\n var(\n --diffs-light-modified-color,\n var(--diffs-modified-color, var(--diffs-modified-light))\n ),\n var(\n --diffs-dark-modified-color,\n var(--diffs-modified-color, var(--diffs-modified-dark))\n )\n )\n );\n\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n --diffs-bg-deletion: var(\n --diffs-bg-deletion-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-number: var(\n --diffs-bg-deletion-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-hover: var(\n --diffs-bg-deletion-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base)),\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-deletion-base))\n )\n );\n --diffs-bg-deletion-emphasis: var(\n --diffs-bg-deletion-emphasis-override,\n light-dark(\n rgb(from var(--diffs-deletion-base) r g b / 0.15),\n rgb(from var(--diffs-deletion-base) r g b / 0.2)\n )\n );\n\n --diffs-bg-addition: var(\n --diffs-bg-addition-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-number: var(\n --diffs-bg-addition-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 91%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-hover: var(\n --diffs-bg-addition-hover-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base)),\n color-mix(in lab, var(--diffs-bg) 70%, var(--diffs-addition-base))\n )\n );\n --diffs-bg-addition-emphasis: var(\n --diffs-bg-addition-emphasis-override,\n light-dark(\n rgb(from var(--diffs-addition-base) r g b / 0.15),\n rgb(from var(--diffs-addition-base) r g b / 0.2)\n )\n );\n\n --diffs-selection-base: var(--diffs-modified-base);\n --diffs-selection-number-fg: light-dark(\n color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),\n color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer))\n );\n --diffs-bg-selection: var(\n --diffs-bg-selection-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 82%, var(--diffs-selection-base)),\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base))\n )\n );\n --diffs-bg-selection-number: var(\n --diffs-bg-selection-number-override,\n light-dark(\n color-mix(in lab, var(--diffs-bg) 75%, var(--diffs-selection-base)),\n color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-selection-base))\n )\n );\n\n background-color: var(--diffs-bg);\n color: var(--diffs-fg);\n }\n\n /* NOTE(mdo): Some semantic HTML elements (e.g. `pre`, `code`) have default\n * user-agent styles. These must be overridden to use our custom styles. */\n pre,\n code,\n [data-error-wrapper] {\n isolation: isolate;\n margin: 0;\n padding: 0;\n display: block;\n outline: none;\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n }\n\n pre,\n code {\n background-color: var(--diffs-bg);\n }\n\n code {\n contain: content;\n }\n\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n [data-icon-sprite] {\n display: none;\n }\n\n /* NOTE(mdo): Headers and separators are within pre/code, so we need to reset\n * their font-family explicitly. */\n [data-diffs-header],\n [data-separator] {\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n }\n\n [data-file-info] {\n padding: 10px;\n font-weight: 700;\n color: var(--fg);\n /* NOTE(amadeus): we cannot use 'in oklch' because current versions of cursor\n * and vscode use an older build of chrome that appears to have a bug with\n * color-mix and 'in oklch', so use 'in lab' instead */\n background-color: color-mix(in lab, var(--bg) 98%, var(--fg));\n border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));\n }\n\n [data-diff],\n [data-file] {\n /* This feels a bit crazy to me... so I need to think about it a bit more... */\n --diffs-grid-number-column-width: minmax(min-content, max-content);\n --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;\n\n &[data-dehydrated] {\n --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);\n }\n\n &:hover [data-code]::-webkit-scrollbar-thumb {\n background-color: var(--diffs-bg-context);\n }\n }\n\n [data-line] span {\n color: light-dark(\n var(--diffs-token-light, var(--diffs-light)),\n var(--diffs-token-dark, var(--diffs-dark))\n );\n background-color: light-dark(\n var(--diffs-token-light-bg, inherit),\n var(--diffs-token-dark-bg, inherit)\n );\n font-weight: light-dark(\n var(--diffs-token-light-font-weight, inherit),\n var(--diffs-token-dark-font-weight, inherit)\n );\n font-style: light-dark(\n var(--diffs-token-light-font-style, inherit),\n var(--diffs-token-dark-font-style, inherit)\n );\n -webkit-text-decoration: light-dark(\n var(--diffs-token-light-text-decoration, inherit),\n var(--diffs-token-dark-text-decoration, inherit)\n );\n text-decoration: light-dark(\n var(--diffs-token-light-text-decoration, inherit),\n var(--diffs-token-dark-text-decoration, inherit)\n );\n }\n\n [data-line],\n [data-gutter-buffer],\n [data-line-annotation],\n [data-no-newline] {\n color: var(--diffs-fg);\n background-color: var(--diffs-line-bg, var(--diffs-bg));\n }\n\n [data-no-newline] {\n -webkit-user-select: none;\n user-select: none;\n\n span {\n opacity: 0.6;\n }\n }\n\n [data-diff-type='split'][data-overflow='scroll'] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n\n [data-additions] {\n border-left: 1px solid var(--diffs-bg);\n }\n\n [data-deletions] {\n border-right: 1px solid var(--diffs-bg);\n }\n }\n\n [data-code] {\n display: grid;\n grid-auto-flow: dense;\n grid-template-columns: var(--diffs-code-grid);\n overflow: scroll clip;\n overscroll-behavior-x: none;\n tab-size: var(--diffs-tab-size, 2);\n align-self: flex-start;\n padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));\n padding-bottom: max(\n 0px,\n calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) - 6px)\n );\n }\n\n [data-container-size] {\n container-type: inline-size;\n }\n\n [data-code]::-webkit-scrollbar {\n width: 0;\n height: 6px;\n }\n\n [data-code]::-webkit-scrollbar-track {\n background: transparent;\n }\n\n [data-code]::-webkit-scrollbar-thumb {\n background-color: transparent;\n border: 1px solid transparent;\n background-clip: content-box;\n border-radius: 3px;\n }\n\n [data-code]::-webkit-scrollbar-corner {\n background-color: transparent;\n }\n\n /*\n * If we apply these rules globally it will mean that webkit will opt into the\n * standards compliant version of custom css scrollbars, which we do not want\n * because the custom stuff will look better\n */\n @supports (-moz-appearance: none) {\n [data-code] {\n scrollbar-width: thin;\n scrollbar-color: var(--diffs-bg-context) transparent;\n padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));\n }\n }\n\n [data-diffs-header] ~ [data-diff],\n [data-diffs-header] ~ [data-file] {\n [data-code],\n &[data-overflow='wrap'] {\n padding-top: 0;\n }\n }\n\n [data-gutter] {\n display: grid;\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n grid-column: 1;\n z-index: 3;\n position: relative;\n background-color: var(--diffs-bg);\n\n [data-gutter-buffer],\n [data-column-number] {\n border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));\n }\n }\n\n [data-content] {\n display: grid;\n grid-template-rows: subgrid;\n grid-template-columns: subgrid;\n grid-column: 2;\n min-width: 0;\n }\n\n [data-diff-type='split'][data-overflow='wrap'] {\n display: grid;\n grid-auto-flow: dense;\n grid-template-columns: repeat(2, var(--diffs-code-grid));\n padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n\n [data-deletions] {\n display: contents;\n\n [data-gutter] {\n grid-column: 1;\n }\n\n [data-content] {\n grid-column: 2;\n border-right: 1px solid var(--diffs-bg);\n }\n }\n\n [data-additions] {\n display: contents;\n\n [data-gutter] {\n grid-column: 3;\n border-left: 1px solid var(--diffs-bg);\n }\n\n [data-content] {\n grid-column: 4;\n }\n }\n }\n\n [data-overflow='scroll'] [data-gutter] {\n position: sticky;\n left: 0;\n }\n\n [data-line-annotation][data-selected-line] {\n background-color: unset;\n\n &::before {\n content: '';\n /* FIXME(amadeus): This needs to be audited ... */\n position: sticky;\n top: 0;\n left: 0;\n display: block;\n border-right: var(--diffs-gap-style, 1px solid var(--diffs-bg));\n background-color: var(--diffs-bg-selection-number);\n }\n\n [data-annotation-content] {\n background-color: var(--diffs-bg-selection);\n }\n }\n\n [data-interactive-lines] [data-line] {\n cursor: pointer;\n }\n\n [data-content-buffer],\n [data-gutter-buffer] {\n position: relative;\n -webkit-user-select: none;\n user-select: none;\n min-height: 1lh;\n }\n\n [data-gutter-buffer='annotation'] {\n min-height: 0;\n }\n\n [data-gutter-buffer='buffer'] {\n background-size: 8px 8px;\n background-position: 0 0;\n background-origin: border-box;\n background-color: var(--diffs-bg);\n /* This is incredibley expensive... */\n background-image: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent calc(3px * 1.414),\n rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(3px * 1.414),\n rgb(from var(--diffs-bg-buffer) r g b / 0.8) calc(4px * 1.414)\n );\n }\n\n [data-content-buffer] {\n grid-column: 1;\n /* We multiply by 1.414 (√2) to better approximate the diagonal repeat distance */\n background-size: 8px 8px;\n background-position: 5px 0;\n background-origin: border-box;\n background-color: var(--diffs-bg);\n /* This is incredibley expensive... */\n background-image: repeating-linear-gradient(\n -45deg,\n transparent,\n transparent calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(3px * 1.414),\n var(--diffs-bg-buffer) calc(4px * 1.414)\n );\n }\n\n [data-separator] {\n box-sizing: content-box;\n background-color: var(--diffs-bg);\n }\n\n [data-separator='simple'] {\n min-height: 4px;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'],\n [data-separator='metadata'],\n [data-separator='simple'] {\n background-color: var(--diffs-bg-separator);\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'],\n [data-separator='metadata'] {\n height: 32px;\n position: relative;\n }\n\n [data-separator-wrapper] {\n -webkit-user-select: none;\n user-select: none;\n fill: currentColor;\n position: absolute;\n inset-inline: 0;\n display: flex;\n align-items: center;\n background-color: var(--diffs-bg);\n height: 100%;\n }\n\n [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-separator='metadata'] [data-separator-wrapper] {\n inset-inline: 100% auto;\n padding-inline: 1ch;\n height: 100%;\n background-color: var(--diffs-bg-separator);\n color: var(--diffs-fg-number);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: min-content;\n }\n\n [data-separator='line-info'] {\n margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));\n }\n\n [data-separator='line-info-basic'],\n [data-separator='metadata'] {\n margin-block: 0;\n }\n\n [data-separator='line-info'][data-separator-first] {\n margin-top: 0;\n }\n\n [data-separator='line-info'][data-separator-last] {\n margin-bottom: 0;\n }\n\n [data-expand-index] [data-separator-wrapper] {\n display: grid;\n grid-template-columns: 32px auto;\n }\n\n [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 32px 32px auto;\n }\n\n [data-expand-button],\n [data-separator-content] {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n background-color: var(--diffs-bg-separator);\n }\n\n [data-expand-index] [data-separator-content]:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n\n [data-expand-button] {\n justify-content: center;\n flex-shrink: 0;\n cursor: pointer;\n min-width: 32px;\n align-self: stretch;\n color: var(--diffs-fg-number);\n border-right: 2px solid var(--diffs-bg);\n\n &:hover {\n color: var(--diffs-fg);\n }\n\n &[data-expand-all-button] {\n display: none;\n }\n }\n\n [data-expand-down] [data-icon] {\n transform: scaleY(-1);\n }\n\n [data-separator-content] {\n flex: 1 1 auto;\n padding: 0 1ch;\n height: 100%;\n color: var(--diffs-fg-number);\n\n overflow: hidden;\n justify-content: flex-start;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'] {\n [data-separator-content] {\n height: 100%;\n -webkit-user-select: none;\n user-select: none;\n overflow: clip;\n }\n }\n\n @supports (width: 1cqi) {\n [data-unified] {\n [data-separator='line-info'] [data-separator-wrapper] {\n padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n width: 100cqi;\n\n [data-separator-content] {\n border-radius: 6px;\n }\n }\n\n [data-separator='line-info'][data-expand-index]\n [data-separator-wrapper]\n [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-gutter] {\n [data-separator='line-info'] [data-separator-wrapper] {\n padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n }\n\n [data-separator='line-info'] [data-separator-content] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n [data-separator='line-info'][data-expand-index] [data-separator-content] {\n border-top-left-radius: unset;\n border-bottom-left-radius: unset;\n }\n }\n\n [data-additions] {\n [data-content] [data-separator='line-info'] {\n background-color: var(--diffs-bg);\n\n [data-separator-wrapper] {\n display: none;\n }\n }\n\n [data-gutter] [data-separator='line-info'] [data-separator-wrapper] {\n display: block;\n height: 100%;\n background-color: var(--diffs-bg-separator);\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n\n [data-separator-content],\n [data-expand-button] {\n display: none;\n }\n }\n }\n\n [data-overflow='scroll']\n [data-additions]\n [data-gutter]\n [data-separator='line-info']\n [data-separator-wrapper] {\n width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));\n }\n\n [data-overflow='wrap']\n [data-additions]\n [data-content]\n [data-separator='line-info']\n [data-separator-wrapper] {\n background-color: var(--diffs-bg-separator);\n display: block;\n height: 100%;\n margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n\n [data-separator-content],\n [data-expand-button] {\n display: none;\n }\n }\n\n [data-separator='line-info'] [data-separator-wrapper] {\n [data-expand-both],\n [data-expand-down],\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n }\n\n @media (pointer: fine) {\n [data-separator='line-info'] [data-separator-wrapper] {\n &[data-separator-multi-button] {\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: unset;\n }\n\n [data-expand-down] {\n border-bottom-left-radius: 6px;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: coarse) {\n [data-separator='line-info-basic']\n [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px 34px auto;\n\n [data-separator-content] {\n grid-column: unset;\n grid-row: unset;\n }\n }\n\n @supports (width: 1cqi) {\n [data-separator='line-info'] [data-separator-wrapper] {\n [data-expand-both],\n [data-expand-down],\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n &[data-separator-multi-button] {\n [data-expand-up] {\n border-top-left-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n [data-expand-down] {\n border-bottom-left-radius: unset;\n border-top-left-radius: unset;\n }\n }\n }\n }\n }\n\n @media (pointer: fine) {\n [data-separator-wrapper][data-separator-multi-button] {\n display: grid;\n grid-template-rows: 50% 50%;\n\n [data-separator-content] {\n grid-column: 2;\n grid-row: 1 / -1;\n min-width: min-content;\n }\n\n [data-expand-button] {\n grid-column: 1;\n }\n }\n\n [data-separator='line-info'] [data-separator-wrapper],\n [data-separator='line-info']\n [data-separator-wrapper][data-separator-multi-button] {\n grid-template-columns: 34px auto;\n }\n\n [data-separator='line-info-basic'][data-expand-index]\n [data-separator-wrapper] {\n grid-template-columns: 100% auto;\n }\n\n [data-separator='line-info'],\n [data-separator='line-info-basic'] {\n [data-separator-multi-button] {\n [data-expand-up] {\n border-bottom: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n [data-expand-down] {\n border-top: 1px solid var(--diffs-bg);\n border-right: 2px solid var(--diffs-bg);\n }\n }\n }\n }\n\n [data-additions] [data-gutter] [data-separator-wrapper],\n [data-additions] [data-separator='line-info-basic'] [data-separator-wrapper],\n [data-content] [data-separator-wrapper] {\n display: none;\n }\n\n [data-line-annotation],\n [data-gutter-buffer='annotation'] {\n --diffs-line-bg: var(--diffs-bg-context);\n }\n\n [data-merge-conflict-actions],\n [data-gutter-buffer='merge-conflict-action'] {\n --diffs-line-bg: var(--diffs-bg-context);\n }\n\n [data-has-merge-conflict] [data-line-annotation],\n [data-has-merge-conflict] [data-gutter-buffer='annotation'] {\n --diffs-line-bg: var(--diffs-bg);\n }\n\n [data-has-merge-conflict] [data-gutter-buffer='merge-conflict-action'] {\n --diffs-line-bg: var(--diffs-bg);\n }\n\n [data-line-annotation] {\n min-height: var(--diffs-annotation-min-height, 0);\n z-index: 2;\n }\n\n [data-merge-conflict-actions] {\n z-index: 2;\n }\n\n [data-separator='custom'] {\n display: grid;\n grid-template-columns: subgrid;\n }\n\n [data-line],\n [data-column-number],\n [data-no-newline] {\n position: relative;\n padding-inline: 1ch;\n }\n\n [data-indicators='classic'] [data-line] {\n padding-inline-start: 2ch;\n }\n\n [data-indicators='classic'] {\n [data-line-type='change-addition'],\n [data-line-type='change-deletion'] {\n &[data-no-newline],\n &[data-line] {\n &::before {\n display: inline-block;\n width: 1ch;\n height: 1lh;\n position: absolute;\n top: 0;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n }\n }\n }\n\n [data-line-type='change-addition'] {\n &[data-line],\n &[data-no-newline] {\n &::before {\n content: '+';\n color: var(--diffs-addition-base);\n }\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-line],\n &[data-no-newline] {\n &::before {\n content: '-';\n color: var(--diffs-deletion-base);\n }\n }\n }\n }\n\n [data-indicators='bars'] {\n [data-line-type='change-deletion'],\n [data-line-type='change-addition'] {\n &[data-column-number] {\n &::before {\n content: '';\n display: block;\n width: 4px;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n -webkit-user-select: none;\n user-select: none;\n contain: strict;\n }\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-column-number] {\n &::before {\n background-image: linear-gradient(\n 0deg,\n var(--diffs-bg-deletion) 50%,\n var(--diffs-deletion-base) 50%\n );\n background-repeat: repeat;\n background-size: 2px 2px;\n background-size: calc(1lh / round(1lh / 2px))\n calc(1lh / round(1lh / 2px));\n }\n }\n }\n\n [data-line-type='change-addition'] {\n &[data-column-number] {\n &::before {\n background-color: var(--diffs-addition-base);\n }\n }\n }\n }\n\n [data-overflow='wrap'] {\n [data-line],\n [data-annotation-content] {\n white-space: pre-wrap;\n word-break: break-word;\n }\n }\n\n [data-overflow='scroll'] [data-line] {\n white-space: pre;\n min-height: 1lh;\n }\n\n [data-column-number] {\n box-sizing: content-box;\n text-align: right;\n -webkit-user-select: none;\n user-select: none;\n background-color: var(--diffs-bg);\n color: var(--diffs-fg-number);\n padding-left: 2ch;\n }\n\n [data-line-number-content] {\n display: inline-block;\n min-width: var(\n --diffs-min-number-column-width,\n var(--diffs-min-number-column-width-default, 3ch)\n );\n }\n\n [data-disable-line-numbers] {\n [data-column-number] {\n min-width: 4px;\n padding: 0;\n }\n\n [data-line-number-content] {\n display: none;\n }\n\n [data-gutter-utility-slot] {\n right: unset;\n left: 0;\n justify-content: flex-start;\n }\n\n &[data-indicators='bars'] [data-gutter-utility-slot] {\n /* Using 5px here because theres a 1px separator after the bar */\n left: 5px;\n }\n }\n\n [data-file][data-disable-line-numbers] {\n [data-gutter-buffer],\n [data-column-number] {\n min-width: 0;\n border-right: 0;\n }\n }\n\n [data-interactive-line-numbers] [data-column-number] {\n cursor: pointer;\n }\n\n [data-diff-span] {\n border-radius: 3px;\n -webkit-box-decoration-break: clone;\n box-decoration-break: clone;\n }\n\n [data-line-type='change-addition'] {\n &[data-column-number] {\n color: var(\n --diffs-fg-number-addition-override,\n var(--diffs-addition-base)\n );\n }\n\n [data-diff-span] {\n background-color: var(--diffs-bg-addition-emphasis);\n }\n }\n\n [data-line-type='change-deletion'] {\n &[data-column-number] {\n color: var(\n --diffs-fg-number-deletion-override,\n var(--diffs-deletion-base)\n );\n }\n\n [data-diff-span] {\n background-color: var(--diffs-bg-deletion-emphasis);\n }\n }\n\n [data-background] [data-line-type='change-addition'] {\n --diffs-line-bg: var(--diffs-bg-addition);\n\n &[data-column-number] {\n background-color: var(--diffs-bg-addition-number);\n }\n }\n\n [data-background] [data-line-type='change-deletion'] {\n --diffs-line-bg: var(--diffs-bg-deletion);\n\n &[data-column-number] {\n background-color: var(--diffs-bg-deletion-number);\n }\n }\n\n [data-merge-conflict='marker-start'],\n [data-merge-conflict='marker-base'],\n [data-merge-conflict='marker-separator'],\n [data-merge-conflict='marker-end'] {\n padding-left: 1ch;\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict='marker-start'],\n [data-merge-conflict='marker-end'] {\n display: flex;\n align-items: center;\n\n &::after {\n color: var(--diffs-fg-conflict-marker);\n font-style: normal;\n font-size: 0.75rem;\n line-height: 1.25rem;\n padding-left: 1ch;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n }\n }\n\n [data-merge-conflict='marker-start']::after {\n content: '(Current Change)';\n }\n\n [data-merge-conflict='marker-end']::after {\n content: '(Incoming Change)';\n }\n\n [data-merge-conflict='marker-base'],\n [data-merge-conflict='marker-end'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg-conflict-marker);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg-conflict-marker-number);\n color: var(--diffs-fg-conflict-marker);\n\n [data-line-number-content] {\n color: var(--diffs-fg-conflict-marker);\n }\n }\n }\n\n [data-merge-conflict='current'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--conflict-bg-current);\n }\n\n &[data-column-number] {\n background-color: var(--conflict-bg-current-number);\n color: var(--diffs-addition-base);\n }\n }\n\n [data-gutter-buffer='merge-conflict-marker-start'],\n [data-merge-conflict='marker-start'] {\n background-color: var(--conflict-bg-current-header);\n }\n\n [data-gutter-buffer='merge-conflict-marker-end'],\n [data-merge-conflict='marker-end'] {\n background-color: var(--conflict-bg-incoming-header);\n }\n\n [data-merge-conflict='marker-separator'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg);\n }\n }\n\n [data-merge-conflict='base'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--diffs-bg-conflict-base);\n }\n\n &[data-column-number] {\n background-color: var(--diffs-bg-conflict-base-number);\n color: var(--diffs-modified-base);\n }\n }\n\n [data-merge-conflict='incoming'] {\n &[data-line],\n &[data-no-newline] {\n background-color: var(--conflict-bg-incoming);\n }\n\n &[data-column-number] {\n background-color: var(--conflict-bg-incoming-number);\n color: var(--diffs-modified-base);\n }\n }\n\n @media (pointer: fine) {\n [data-column-number],\n [data-line] {\n &[data-hovered] {\n background-color: var(--diffs-bg-hover);\n }\n }\n\n [data-background] {\n [data-column-number],\n [data-line] {\n &[data-hovered] {\n &[data-line-type='change-deletion'] {\n background-color: var(--diffs-bg-deletion-hover);\n }\n\n &[data-line-type='change-addition'] {\n background-color: var(--diffs-bg-addition-hover);\n }\n }\n }\n }\n }\n\n [data-diffs-header='default'] {\n position: relative;\n background-color: var(--diffs-bg);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n min-height: calc(\n 1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3)\n );\n padding-inline: 16px;\n top: 0;\n z-index: 2;\n }\n\n [data-header-content] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));\n min-width: 0;\n white-space: nowrap;\n }\n\n [data-header-content] [data-prev-name],\n [data-header-content] [data-title] {\n direction: rtl;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n white-space: nowrap;\n }\n\n [data-prev-name] {\n opacity: 0.7;\n }\n\n [data-rename-icon] {\n fill: currentColor;\n flex-shrink: 0;\n flex-grow: 0;\n }\n\n [data-diffs-header='default'] [data-metadata] {\n display: flex;\n align-items: center;\n gap: 1ch;\n white-space: nowrap;\n }\n\n [data-diffs-header='default'] [data-additions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-addition-base);\n }\n\n [data-diffs-header='default'] [data-deletions-count] {\n font-family: var(--diffs-font-family, var(--diffs-font-fallback));\n color: var(--diffs-deletion-base);\n }\n\n [data-annotation-content] {\n position: relative;\n display: flow-root;\n align-self: flex-start;\n z-index: 2;\n min-width: 0;\n isolation: isolate;\n }\n\n [data-merge-conflict-actions-content] {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n padding-inline: 0.5rem;\n min-height: 1.75rem;\n font-family: var(\n --diffs-header-font-family,\n var(--diffs-header-font-fallback)\n );\n font-size: 0.75rem;\n line-height: 1.2;\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict-action] {\n appearance: none;\n border: 0;\n background: transparent;\n color: var(--diffs-fg-number);\n font: inherit;\n font-style: normal;\n cursor: pointer;\n padding: 0;\n }\n\n [data-merge-conflict-action]:hover {\n color: var(--diffs-fg);\n }\n\n [data-merge-conflict-action='current']:hover {\n color: var(--diffs-addition-base);\n }\n\n [data-merge-conflict-action='incoming']:hover {\n color: var(--diffs-modified-base);\n }\n\n [data-merge-conflict-action-separator] {\n color: var(--diffs-fg-number);\n opacity: 0.6;\n -webkit-user-select: none;\n user-select: none;\n }\n\n /* Sticky positioning has a composite costs, so we should _only_ pay it if we\n * need to */\n [data-overflow='scroll'] [data-annotation-content] {\n position: sticky;\n width: var(--diffs-column-content-width, auto);\n left: var(--diffs-column-number-width, 0);\n }\n\n [data-overflow='scroll'] [data-merge-conflict-actions-content] {\n position: sticky;\n width: var(--diffs-column-content-width, auto);\n left: var(--diffs-column-number-width, 0);\n }\n\n /* Undo some of the stuff that the 'pre' tag does */\n [data-annotation-slot] {\n text-wrap-mode: wrap;\n word-break: normal;\n white-space-collapse: collapse;\n }\n\n [data-change-icon] {\n fill: currentColor;\n flex-shrink: 0;\n }\n\n [data-change-icon='change'],\n [data-change-icon='rename-pure'],\n [data-change-icon='rename-changed'] {\n color: var(--diffs-modified-base);\n }\n\n [data-change-icon='new'] {\n color: var(--diffs-addition-base);\n }\n\n [data-change-icon='deleted'] {\n color: var(--diffs-deletion-base);\n }\n\n [data-change-icon='file'] {\n opacity: 0.6;\n }\n\n /* Line selection highlighting */\n [data-selected-line] {\n &[data-gutter-buffer='annotation'],\n &[data-column-number] {\n color: var(--diffs-selection-number-fg);\n background-color: var(--diffs-bg-selection-number);\n }\n\n &[data-line] {\n background-color: var(--diffs-bg-selection);\n }\n }\n\n [data-line-type='change-addition'],\n [data-line-type='change-deletion'] {\n &[data-selected-line] {\n &[data-line],\n &[data-line][data-hovered] {\n background-color: light-dark(\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 82%,\n var(--diffs-selection-base)\n ),\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 75%,\n var(--diffs-selection-base)\n )\n );\n }\n\n &[data-column-number],\n &[data-column-number][data-hovered] {\n color: var(--diffs-selection-number-fg);\n background-color: light-dark(\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 75%,\n var(--diffs-selection-base)\n ),\n color-mix(\n in lab,\n var(--diffs-line-bg, var(--diffs-bg)) 60%,\n var(--diffs-selection-base)\n )\n );\n }\n }\n }\n\n [data-gutter-utility-slot] {\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n display: flex;\n justify-content: flex-end;\n }\n\n [data-unmodified-lines] {\n display: block;\n overflow: hidden;\n min-width: 0;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex: 0 1 auto;\n }\n\n [data-error-wrapper] {\n overflow: auto;\n padding: var(--diffs-gap-block, var(--diffs-gap-fallback))\n var(--diffs-gap-inline, var(--diffs-gap-fallback));\n max-height: 400px;\n scrollbar-width: none;\n\n [data-error-message] {\n font-weight: bold;\n font-size: 18px;\n color: var(--diffs-deletion-base);\n }\n\n [data-error-stack] {\n color: var(--diffs-fg-number);\n }\n }\n\n [data-placeholder] {\n contain: strict;\n }\n\n [data-utility-button] {\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n appearance: none;\n width: 1lh;\n height: 1lh;\n margin-right: calc((1lh - 1ch) * -1);\n padding: 0;\n cursor: pointer;\n font-size: var(--diffs-font-size, 13px);\n line-height: var(--diffs-line-height, 20px);\n border-radius: 4px;\n background-color: var(--diffs-modified-base);\n color: var(--diffs-bg);\n fill: currentColor;\n position: relative;\n z-index: 4;\n }\n}\n";e.s(["default",0,i],50925);let r="@layer base, theme, rendered, unsafe;";e.s(["wrapCoreCSS",0,function(e){return`${r}
191
- ${i}
192
- @layer theme {
193
- ${e}
194
- }`},"wrapThemeCSS",0,function(e,t="system"){return`${r}
195
- @layer rendered {
196
- :host {${"system"===t?"":`
197
- color-scheme: ${t};`}
198
- ${e}
199
- }
200
- }`},"wrapUnsafeCSS",0,function(e){return`${r}
201
- @layer unsafe {
202
- ${e}
203
- }`}],116),e.s(["getOrCreateCodeNode",0,function({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return null==e&&((e=document.createElement("code")).setAttribute("data-code",""),null!=n&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),null!=i?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}],60654)},41645,e=>{"use strict";var t=e.i(27101);e.s(["upsertHostThemeStyle",0,function({shadowRoot:e,currentNode:n,themeCSS:i}){let r;return""===i.trim()?void n?.remove():((n??=((r=document.createElement("style")).setAttribute(t.THEME_CSS_ATTRIBUTE,""),r)).textContent=i,n.parentNode!==e&&e.appendChild(n),n)}])},51598,47391,e=>{"use strict";e.s(["prerenderHTMLIfNecessary",0,function(e,t){if(null==t)return;let n=e.shadowRoot??e.attachShadow({mode:"open"});""===n.innerHTML&&(n.innerHTML=t)}],51598),e.s(["setPreNodeProperties",0,function(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:a,totalLines:s,customProperties:l}){if(null!=l)for(let t in l){let n=l[t];null!=n&&e.setAttribute(t,`${n}`)}switch("diff"===t?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators")}return r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?e.removeAttribute("data-background"):e.setAttribute("data-background",""),"diff"===t?e.setAttribute("data-diff-type",a?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.tabIndex=0,e.style.setProperty("--diffs-min-number-column-width-default",`${`${s}`.length}ch`),e}],47391)},81604,91301,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(51756),r=e.i(25106),o=e.i(2612),a=e.i(47535),s=e.i(44477),l=e.i(60166),d=e.i(32547),u=e.i(61647),h=e.i(93946),c=e.i(36635),f=e.i(45705),p=e.i(116),g=e.i(60654),m=e.i(41645),b=e.i(51598),v=e.i(47391),y=e.i(50925);if("u">typeof HTMLElement&&null==customElements.get(t.DIFFS_TAG_NAME)){let e;class n extends HTMLElement{constructor(){if(super(),null!=this.shadowRoot)return;const t=this.attachShadow({mode:"open"});null==e&&(e=new CSSStyleSheet).replaceSync(y.default),t.adoptedStyleSheets=[e]}}customElements.define(t.DIFFS_TAG_NAME,n)}e.s(["DiffsContainerLoaded",0,!0],91301);var C=e.i(27118);let k=[],S=-1;var x=class{static LoadedCustomComponent=!0;__id=`file:${++S}`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;appliedPreAttributes;lastRowCount;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];file;renderRange;constructor(e={theme:t.DEFAULT_THEMES},r,o=!1){this.options=e,this.workerManager=r,this.isContainerManaged=o,this.fileRenderer=new a.FileRenderer(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new i.ResizeManager,this.interactionManager=new n.InteractionManager("file",(0,n.pluckInteractionOptions)(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){null!=this.file&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}setOptions(e){null!=e&&(this.options=e,this.interactionManager.setOptions((0,n.pluckInteractionOptions)(e)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")===e||(this.mergeOptions({themeType:e}),"string"!=typeof this.options.theme&&null!=this.fileContainer&&null!=this.appliedThemeCSS&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(){this.fileRenderer.cleanUp(),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.workerManager=void 0,this.renderRange=void 0,this.file=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:r,lineAnnotations:o}=e;this.hydrateElements(t,n),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:r,lineAnnotations:o}),i||this.emitPostRender()}hydrateElements(e,n){for(let i of((0,b.prerenderHTMLIfNecessary)(e,n),Array.from(e.shadowRoot?.children??[]))){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}null!=this.pre&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),(null!=this.pre||null!=this.headerElement)&&(this.fileContainer=e)}hydrationSetup({file:e,lineAnnotations:t}){let{overflow:n="scroll"}=this.options;this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions({...this.options,headerRenderMode:null!=this.options.renderCustomHeader?"custom":"default"}),null!=this.pre&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,"wrap"===n))}getOrCreateLineCache(e=this.file){return null!=e?this.fileRenderer.getOrCreateLineCache(e):k}render({file:e,fileContainer:n,forceRender:i=!1,preventEmit:o=!1,containerWrapper:a,lineAnnotations:s,renderRange:d}){let{collapsed:u=!1,themeType:h="system"}=this.options,c=u?void 0:d,f=this.renderRange,p=null!=s&&(s.length>0||this.lineAnnotations.length>0)&&s!==this.lineAnnotations,g=!(0,l.areFilesEqual)(this.file,e);if(!u&&!i&&(0,r.areRenderRangesEqual)(c,this.renderRange)&&!g&&!p)return!1;this.renderRange=c,this.file=e,this.fileRenderer.setOptions({...this.options,headerRenderMode:null!=this.options.renderCustomHeader?"custom":"default"}),null!=s&&this.setLineAnnotations(s),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:m=!1,disableFileHeader:b=!1,overflow:v="scroll"}=this.options;if(b&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,a),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let i=this.fileRenderer.renderFile(e,t.EMPTY_RENDER_RANGE);null!=i&&this.applyThemeState(n,i.themeStyles,h,i.baseThemeType),i?.headerAST!=null&&this.applyHeaderToDOM(i.headerAST,n),this.injectUnsafeCSS()}catch(e){if(m)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,n)}return o||this.emitPostRender(),!0}try{let t=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(i,p,g)||!this.applyPartialRender(f,c)){let i=this.fileRenderer.renderFile(e,c);if(null==i)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,i.themeStyles,h,i.baseThemeType),null!=i.headerAST&&this.applyHeaderToDOM(i.headerAST,n),this.applyFullRender(i,t)}this.applyBuffers(t,c),this.injectUnsafeCSS(),this.interactionManager.setup(t),this.resizeManager.setup(t,"wrap"===v),this.renderAnnotations(),this.renderGutterUtility()}catch(e){if(m)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,n)}return o||this.emitPostRender(),!0}emitPostRender(){null!=this.fileContainer&&this.options.onPostRender?.(this.fileContainer,this)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!e&&!t&&!n}renderPlaceholder(e){if(null==this.fileContainer)return!1;if(this.cleanChildNodes(),null==this.placeHolder){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderAnnotations(){if(this.isContainerManaged||null==this.fileContainer){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(null!=t&&this.lineAnnotations.length>0)for(let[n,i]of this.lineAnnotations.entries()){let r=`${n}-${(0,o.getLineAnnotationName)(i)}`,a=this.annotationCache.get(r);if(null==a||!(0,d.areLineAnnotationsEqual)(i,a.annotation)){a?.element.remove();let e=t(i);if(null==e)continue;(a={element:(0,h.createAnnotationWrapperNode)((0,o.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(r,a)}e.delete(r)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(null==this.fileContainer||null==e){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(null!=t&&null!=this.gutterUtilityContent)return;if(null==t){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=(0,c.createGutterUtilityContentNode)();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(null!=t){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,f.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,p.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==t||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,m.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,p.wrapThemeCSS)(t,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:t,themeType:o,baseThemeType:i}:void 0)}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=(0,g.getOrCreateCodeNode)({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(null==e||null==t)return!1;let{file:n,code:i}=this,r=null!=i?this.getColumns(i):void 0;if(null==n||null==i||null==r)return!1;let o=e.startingLine,a=t.startingLine,s=e.totalLines===1/0?1/0:o+e.totalLines,l=t.totalLines===1/0?1/0:a+t.totalLines,d=Math.max(o,a),u=Math.min(s,l);if(u<=d||!this.trimDOMToOverlap(r.gutter,d,u)||!this.trimDOMToOverlap(r.content,d,u))return!1;let{length:h}=r.content.children,c=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},f=a<d?c(a,d-a):void 0;if(void 0===f&&a<d)return!1;let p=l===1/0?1/0:Math.max(0,l-u),g=l>u?c(u,p):void 0;return(void 0!==g||!(l>u))&&(this.cleanupErrorWrapper(),null!=f&&(r.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.gutterAST)),r.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.contentAST)),h+=f.rowCount),null!=g&&(r.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.gutterAST)),r.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(g.contentAST)),h+=g.rowCount),this.lastRowCount!==h&&(r.gutter.style.setProperty("grid-row",`span ${h}`),r.content.style.setProperty("grid-row",`span ${h}`),this.lastRowCount=h),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let i=this.getDOMBoundaryIndices(e,[t,n]),r=i.get(t)??e.children.length,o=i.get(n)??e.children.length;if(r>o)return!1;for(let t=e.children.length-1;t>=o;t-=1)e.children[t]?.remove();for(let t=r-1;t>=0;t-=1)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),i=new Map;if(0===n.length)return i;let r=0,o=n[0],{children:a}=e;for(let e=0;e<a.length;e+=1){let t=a[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(null!=s){for(;null!=o&&s>=o;)i.set(o,e),r+=1,o=n[r];if(r>=n.length)break}}for(let e of n)i.has(e)||i.set(e,a.length);return i}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(null==t)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||null==t){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyHeaderToDOM(e,n){let{file:i}=this;if(null==i)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=(0,C.toHtml)(e);if(r!==this.lastRenderedHeaderHTML){let e=document.createElement("div");e.innerHTML=r;let t=e.firstElementChild;if(!(t instanceof HTMLElement))return;null!=this.headerElement?n.shadowRoot?.replaceChild(t,this.headerElement):n.shadowRoot?.prepend(t),this.headerElement=t,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:o,renderCustomHeader:a,renderCustomMetadata:s}=this.options;if(null!=a){let e=a(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,t.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{let e=o?.(i)??void 0,r=s?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,t.HEADER_PREFIX_SLOT_ID,e),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,t.HEADER_METADATA_SLOT_ID,r),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(null==i)return void t?.remove();let r=t??this.createHeaderSlotElement(n);return null==t&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement("div");return t.slot=e,t}getOrCreateFileContainerNode(e,n){let i=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(t.DIFFS_TAG_NAME),null!=i&&i!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),null!=n&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),null==this.spriteSVG){let e=document.createElement("div");e.innerHTML=s.SVGSpriteSheet;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return null==this.pre?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){for(let t of(this.code=void 0,Array.from(e.children)))if(t instanceof HTMLElement&&t.hasAttribute("data-code")){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,r={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};(0,u.arePrePropertiesEqual)(r,this.appliedPreAttributes)||((0,v.setPreNodeProperties)(e,r),this.appliedPreAttributes=r)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML="",n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};e.s(["File",0,x],81604)},10495,e=>{"use strict";var t=e.i(27101),n=e.i(6609),i=e.i(81604);let r=-1;var o=class extends i.File{__id=`virtualized-file:${++r}`;top;height=0;heightCache=new Map;isVisible=!1;constructor(e,n,i=t.DEFAULT_VIRTUAL_FILE_METRICS,r,o=!1){super(e,r,o),this.virtualizer=n,this.metrics=i}getLineHeight(e,t=!1){let n=this.heightCache.get(e);return null!=n?n:this.metrics.lineHeight*(t?2:1)}setOptions(e){if(null==e)return;let t=this.options.overflow,n=this.options.collapsed;super.setOptions(e),(t!==this.options.overflow||n!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){if(null==this.fileContainer||null==this.file){this.height=0;return}let{overflow:e="scroll"}=this.options;if(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),"scroll"===e&&0===this.lineAnnotations.length&&!this.virtualizer.config.resizeDebugging)return;let t=!1;if(null==this.code)return;let n=this.code.children[1];if(n instanceof HTMLElement){for(let e of n.children){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(null==n)continue;let i=Number(n),r=e.getBoundingClientRect().height,o=!1;e.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in e.nextElementSibling.dataset||"noNewline"in e.nextElementSibling.dataset)&&("noNewline"in e.nextElementSibling.dataset&&(o=!0),r+=e.nextElementSibling.getBoundingClientRect().height),r!==this.getLineHeight(i,o)&&(t=!0,r===this.metrics.lineHeight*(o?2:1)?this.heightCache.delete(i):this.heightCache.set(i,r))}(t||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}}onRender=e=>null!=this.fileContainer&&null!=this.file&&(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render({file:this.file}));cleanUp(){null!=this.fileContainer&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}computeApproximateSize(){let e=0===this.height;if(this.height=0,null==this.file)return;let{disableFileHeader:t=!1,collapsed:i=!1,overflow:r="scroll"}=this.options,{diffHeaderHeight:o,fileGap:a,lineHeight:s}=this.metrics,l=this.getOrCreateLineCache(this.file);if(t?this.height+=a:this.height+=o,!i&&("scroll"===r&&0===this.lineAnnotations.length?this.height+=this.getOrCreateLineCache(this.file).length*s:(0,n.iterateOverFile)({lines:l,callback:({lineIndex:e})=>{this.height+=this.getLineHeight(e,!1)}}),l.length>0&&(this.height+=a),null!=this.fileContainer&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}}setVisibility(e){null!=this.fileContainer&&(e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}render({fileContainer:e,file:t,...n}){let i=null==this.fileContainer;if(this.file??=t,e=this.getOrCreateFileContainerNode(e),null==this.file)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(i?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(this.file,this.top,r);return super.render({file:this.file,fileContainer:e,renderRange:o,...n})}computeRenderRangeFromWindow(e,t,{top:i,bottom:r}){let o,a,s,{disableFileHeader:l=!1,overflow:d="scroll"}=this.options,{diffHeaderHeight:u,fileGap:h,hunkLineCount:c,lineHeight:f}=this.metrics,p=this.getOrCreateLineCache(e),g=p.length,m=this.height,b=l?h:u;if(t<i-m||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-b-h};if(g<=c)return{startingLine:0,totalLines:c,bufferBefore:0,bufferAfter:0};let v=Math.ceil(Math.ceil(Math.max(r-i,0)/f)/c)*c+2*c,y=v/c,C=(i+r)/2;if("scroll"===d&&0===this.lineAnnotations.length){let e=Math.floor(Math.floor((C-(t+b))/f)/c)-Math.floor(y/2),n=Math.max(0,Math.min(e,Math.ceil(g/c)))*c,i=e<0?v+e*c:v,r=Math.min(i,g-n);return{startingLine:n,totalLines:i,bufferBefore:n*f,bufferAfter:Math.max(0,(g-n-r)*f)}}let k=[],S=t+b,x=0;if((0,n.iterateOverFile)({lines:p,callback:({lineIndex:e})=>{let n=x%c==0;if(n&&(k.push(S-(t+b)),null!=s)){if(s<=0)return!0;s--}let l=this.getLineHeight(e,!1),d=Math.floor(x/c);return S>i-l&&S<r&&(o??=d),S+l>C&&(a??=d),null==s&&S>=r&&n&&(s=y),x++,S+=l,!1}}),null==o)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:m-b-h};let w=k.length,A=Math.round((a??=o)-y/2),L=Math.max(0,Math.min(A,Math.max(0,w-y))),E=A<0?v+A*c:v,T=k[L]??0,I=L+E/c;return{startingLine:L*c,totalLines:E,bufferBefore:T,bufferAfter:I<k.length?m-b-k[I]-h:m-(S-t)-h}}};e.s(["VirtualizedFile",0,o])},87439,3467,e=>{"use strict";var t=e.i(27101),n=e.i(8456);function i(e,t,n){if(e===t||null==e||null==t)return e===t;let i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(let n of r)if(o.delete(n),!i.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(o))if(!i.has(e))return!1;return!0}function r(e){if(null!=e&&"parseDiffOptions"in e)return e.parseDiffOptions}e.s(["areObjectsEqual",0,i],3467),e.s(["areOptionsEqual",0,function(e,o){let a=e?.theme??t.DEFAULT_THEMES,s=o?.theme??t.DEFAULT_THEMES,l=r(e),d=r(o);return(0,n.areThemesEqual)(a,s)&&i(e,o,["theme","parseDiffOptions"])&&i(l,d)}],87439)},1376,22151,e=>{"use strict";function t(e,t,n){let i=e.conflictStack[e.conflictStack.length-1];if(null==i)return t.length>=7&&60===t.charCodeAt(0)&&"start"===h(t)?void l(e,t,n):void a(e,t);let r=h(t);if("start"===r)return void l(e,t,n);if("base"===r){i.stage="base",i.baseMarkerLineIndex=n,i.markerLines.base=t;return}if("separator"===r){i.stage="incoming",i.separatorLineIndex=n,i.markerLines.separator=t;return}if("end"===r){let i=e.conflictStack.pop();if(null==i)throw Error("parseMergeConflictDiffFromFile: encountered end marker before start marker");var o=e,d=i,u=n,c=t;if(null==d.separatorLineIndex||null==d.markerLines.separator)throw Error(`parseMergeConflictDiffFromFile: conflict ${d.conflictIndex} is missing a separator marker`);let r=o.conflictBuilders[d.conflictIndex];if(null==r)throw Error(`parseMergeConflictDiffFromFile: failed to finalize conflict ${d.conflictIndex}`);let a=r.action;a.markerLines.separator=d.markerLines.separator,a.markerLines.end=c,null!=d.markerLines.base&&(a.markerLines.base=d.markerLines.base),a.conflict={conflictIndex:d.conflictIndex,startLineIndex:d.startLineIndex,startLineNumber:d.startLineIndex+1,separatorLineIndex:d.separatorLineIndex,separatorLineNumber:d.separatorLineIndex+1,endLineIndex:u,endLineNumber:u+1,baseMarkerLineIndex:d.baseMarkerLineIndex,baseMarkerLineNumber:null!=d.baseMarkerLineIndex?d.baseMarkerLineIndex+1:void 0};let s=a.currentContentIndex??a.incomingContentIndex;if(a.currentContentIndex??=s,a.incomingContentIndex??=s,a.startContentIndex<0&&null!=s&&(a.startContentIndex=s),a.endContentIndex<0&&null!=s&&(a.endContentIndex=s),a.endMarkerContentIndex<0&&null!=s&&(a.endMarkerContentIndex=s),a.hunkIndex<0||a.startContentIndex<0||a.endContentIndex<0||a.endMarkerContentIndex<0)throw Error(`parseMergeConflictDiffFromFile: failed to anchor merge conflict ${d.conflictIndex}`);o.actions[a.conflictIndex]=a,r.completed=!0;return}"current"===i.stage?s(e,"deletion",t,i.conflictIndex,"current"):"base"===i.stage?a(e,t,i.conflictIndex):s(e,"addition",t,i.conflictIndex,"incoming")}function n(e){return e.activeHunk??=d(e.additionLines.length+1,e.deletionLines.length+1),e.activeHunk}function i(e,t,n,i){let r=e.conflictBuilders[t];if(null==r)throw Error(`parseMergeConflictDiffFromFile: failed to locate conflict action ${t}`);let o=r.action,a=e.hunks.length;if(o.hunkIndex<0)o.hunkIndex=a;else if(o.hunkIndex!==a)throw Error(`parseMergeConflictDiffFromFile: conflict ${t} spans multiple hunks and cannot be anchored`);if(o.startContentIndex<0&&(o.startContentIndex=i),o.endContentIndex=i,o.endMarkerContentIndex=i,"current"===n){o.currentContentIndex??=i;return}if("base"===n){o.baseContentIndex??=i;return}o.incomingContentIndex=i}function r(e,t,n){let r,o=t.contextBufferCount,a=t.contextBufferAdditionStart,s=t.contextBufferDeletionStart;if("leading"===n&&o>e.maxContextLines){let n=o-e.maxContextLines;a+=n,s+=n,o=e.maxContextLines,t.additionStart+=n,t.deletionStart+=n,t.additionLineIndex+=n,t.deletionLineIndex+=n}if("trailing"===n&&o>e.maxContextLines&&(o=e.maxContextLines),0===o){t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0;return}let l=t.hunkContent,d=l[l.length-1];d?.type==="context"?d.lines+=o:l.push({type:"context",lines:o,additionLineIndex:a,deletionLineIndex:s}),r=l.length-1,t.additionCount+=o,t.deletionCount+=o;let u=t.contextBufferBaseConflicts;if(null!=u){let n=a-t.contextBufferAdditionStart;for(let[t,a]of u)t>=n&&t<n+o&&i(e,a,"base",r)}t.contextBufferCount=0,t.contextBufferBaseConflicts=void 0}function o(e){if(null==e.activeHunk)return;let t=e.activeHunk;if(e.activeHunk=void 0,0===t.hunkContent.length)return;let n=0,i=0;for(let e of t.hunkContent)"context"===e.type?(n+=e.lines,i+=e.lines):(n+=Math.max(e.additions,e.deletions),i+=e.additions+e.deletions);let r=Math.max(t.additionStart-1-e.lastHunkEnd,0),o={collapsedBefore:r,additionStart:t.additionStart,additionCount:t.additionCount,additionLines:t.additionLines,additionLineIndex:t.additionLineIndex,deletionStart:t.deletionStart,deletionCount:t.deletionCount,deletionLines:t.deletionLines,deletionLineIndex:t.deletionLineIndex,hunkContent:t.hunkContent,hunkContext:void 0,hunkSpecs:`@@ -${u(t.deletionStart,t.deletionCount)} +${u(t.additionStart,t.additionCount)} @@
204
- `,splitLineStart:e.splitLineCount+r,splitLineCount:n,unifiedLineStart:e.unifiedLineCount+r,unifiedLineCount:i,noEOFCRAdditions:!1,noEOFCRDeletions:!1};e.hunks.push(o),e.splitLineCount+=r+n,e.unifiedLineCount+=r+i,e.lastHunkEnd=t.additionStart+t.additionCount-1}function a(e,t,i=-1){let r=n(e);0===r.contextBufferCount&&(r.contextBufferAdditionStart=e.additionLines.length,r.contextBufferDeletionStart=e.deletionLines.length),e.additionLines.push(t),e.deletionLines.push(t),i>=0&&(r.contextBufferBaseConflicts??=new Map,r.contextBufferBaseConflicts.set(r.contextBufferCount,i)),r.contextBufferCount++}function s(e,t,a,s,l){let u,h,c=n(e);c.hunkContent.length>0&&c.contextBufferCount>e.maxContextLines2&&(!function(e){let t;if(null==e.activeHunk)return;let n=e.activeHunk,i=n.contextBufferCount,a=i-e.maxContextLines2,s=n.contextBufferAdditionStart+i-e.maxContextLines,l=n.contextBufferDeletionStart+i-e.maxContextLines;if(null!=n.contextBufferBaseConflicts){let r=i-e.maxContextLines;for(let[e,i]of n.contextBufferBaseConflicts)e>=r&&(t??=new Map).set(e-r,i)}r(e,n,"trailing");let u=n.additionCount,h=n.deletionCount;o(e),e.activeHunk=d(n.additionStart+u+a,n.deletionStart+h+a),e.activeHunk.contextBufferAdditionStart=s,e.activeHunk.contextBufferDeletionStart=l,e.activeHunk.contextBufferCount=e.maxContextLines,e.activeHunk.contextBufferBaseConflicts=t}(e),c=e.activeHunk),r(e,c,0===c.hunkContent.length?"leading":"before-change");let f=e.additionLines.length,p=e.deletionLines.length;"addition"===t?e.additionLines.push(a):e.deletionLines.push(a);let g=(h=(u=c.hunkContent)[u.length-1],h?.type==="change"?"addition"===t?h.additions++:h.deletions++:u.push({type:"change",additions:+("addition"===t),deletions:+("deletion"===t),additionLineIndex:f,deletionLineIndex:p}),u.length-1);"addition"===t?(c.additionCount++,c.additionLines++):(c.deletionCount++,c.deletionLines++),i(e,s,l,g)}function l(e,t,n){let i=e.nextConflictIndex;e.nextConflictIndex++,e.conflictStack.push({conflictIndex:i,stage:"current",startLineIndex:n,markerLines:{start:t}}),e.conflictBuilders[i]={completed:!1,action:{conflict:{conflictIndex:i,startLineIndex:n,startLineNumber:n+1,separatorLineIndex:n,separatorLineNumber:n+1,endLineIndex:n,endLineNumber:n+1,baseMarkerLineIndex:void 0,baseMarkerLineNumber:void 0},conflictIndex:i,hunkIndex:-1,startContentIndex:-1,endContentIndex:-1,endMarkerContentIndex:-1,markerLines:{start:t,separator:"",end:""}}}}function d(e,t){return{additionStart:e,deletionStart:t,additionCount:0,deletionCount:0,additionLines:0,deletionLines:0,additionLineIndex:Math.max(e-1,0),deletionLineIndex:Math.max(t-1,0),hunkContent:[],contextBufferAdditionStart:Math.max(e-1,0),contextBufferDeletionStart:Math.max(t-1,0),contextBufferCount:0,contextBufferBaseConflicts:void 0}}function u(e,t){return 1===t?`${e}`:`${e},${t}`}function h(e){var t,n;let i;if(e.length<7)return;let r=e.charCodeAt(0);if(60!==r&&62!==r&&61!==r&&124!==r)return;let o=((i=(t=e).length)>0&&10===t.charCodeAt(i-1)&&i--,i>0&&13===t.charCodeAt(i-1)&&i--,i);if(o<7)return;let a=1;for(;a<o&&e.charCodeAt(a)===r;)a++;if(!(a<7)){if(61===r)return a===o?"separator":void 0;if(a===o||9===(n=e.charCodeAt(a))||10===n||11===n||12===n||13===n||32===n)return 60===r?"start":62===r?"end":"base"}}function c(e,t,n){return{...e,contents:n,cacheKey:null!=e.cacheKey?`${e.cacheKey}:merge-conflict-${t}`:void 0}}function f(e,t){let n=[],i=Array(e.hunks.length),r=(t,n)=>{let r=e.hunks[t];if(null==r)return 0;let o=i[t];if(null==o){o=Array(r.hunkContent.length+1);let e=r.unifiedLineStart;o[0]=e;for(let t=0;t<r.hunkContent.length;t++){let n=r.hunkContent[t];e+="context"===n.type?n.lines:n.deletions+n.additions,o[t+1]=e}i[t]=o}return o[Math.max(n,0)]??r.unifiedLineStart},o=(e,t)=>Math.max(r(e,t),(i[e]?.[Math.max(t+1,0)]??r(e,t+1))-1);for(let i of t){if(null==i)continue;let t=e.hunks[i.hunkIndex];if(null==t)continue;let a=r(i.hunkIndex,i.startContentIndex);if(n.push(p(i,"marker-start",i.startContentIndex,i.markerLines.start,a)),null!=i.baseContentIndex){let e=i.currentContentIndex,a=i.incomingContentIndex;if(null==e||null==a)continue;let s=i.markerLines.base;if(null==s)continue;let l=t.hunkContent[e],d=t.hunkContent[i.baseContentIndex],u=t.hunkContent[a];if(l?.type!=="change"||d?.type!=="context"||u?.type!=="change")continue;let h=r(i.hunkIndex,e),c=r(i.hunkIndex,a);n.push(p(i,"marker-base",i.baseContentIndex,s,h+l.deletions)),n.push(p(i,"marker-separator",i.baseContentIndex,i.markerLines.separator,c),p(i,"marker-end",i.endMarkerContentIndex,i.markerLines.end,o(i.hunkIndex,i.endMarkerContentIndex)));continue}let s=i.currentContentIndex;if(null==s)continue;let l=t.hunkContent[s];if(l?.type!=="change")continue;let d=r(i.hunkIndex,s),u=l.deletions>0?d+l.deletions:a;n.push(p(i,"marker-separator",s,i.markerLines.separator,u),p(i,"marker-end",i.endMarkerContentIndex,i.markerLines.end,o(i.hunkIndex,i.endMarkerContentIndex)))}return n}function p(e,t,n,i,r){return{type:t,hunkIndex:e.hunkIndex,contentIndex:n,conflictIndex:e.conflictIndex,lineText:i,lineIndex:r}}e.s(["getMergeConflictActionSlotName",0,function({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}],1376),e.s(["buildMergeConflictMarkerRows",0,f,"getMergeConflictActionAnchor",0,function(e,t){let n=t.hunks[e.hunkIndex];if(null!=n)return{hunkIndex:e.hunkIndex,lineIndex:function(e,t){let n=e.unifiedLineStart;for(let i=0;i<t;i++){let t=e.hunkContent[i];n+="context"===t.type?t.lines:t.deletions+t.additions}return n}(n,e.startContentIndex)}},"parseMergeConflictDiffFromFile",0,function(e,n=6){let i={deletionLines:[],additionLines:[],conflictStack:[],conflictBuilders:[],actions:[],hunks:[],nextConflictIndex:0,splitLineCount:0,unifiedLineCount:0,lastHunkEnd:0,activeHunk:void 0,maxContextLines:n=Math.max(n,1),maxContextLines2:2*n},a=e.contents,s=a.length;if(s>0){let e=0,n=0,r=a.indexOf("\n",e);for(;-1!==r;)t(i,a.slice(e,r+1),n),e=r+1,n++,r=a.indexOf("\n",e);e<s&&t(i,a.slice(e),n)}if(i.conflictStack.length>0)throw Error("parseMergeConflictDiffFromFile: unfinished merge conflict marker stack");null!=i.activeHunk&&i.activeHunk.hunkContent.length>0&&(r(i,i.activeHunk,"trailing"),o(i));for(let e=0;e<i.conflictBuilders.length;e++){let t=i.conflictBuilders[e];if(null==t||!t.completed)throw Error(`parseMergeConflictDiffFromFile: failed to build merge conflict action ${e}`)}if(i.hunks.length>0&&i.additionLines.length>0&&i.deletionLines.length>0){let e=i.hunks[i.hunks.length-1],t=Math.max(i.additionLines.length-(e.additionStart+e.additionCount-1),0);i.splitLineCount+=t,i.unifiedLineCount+=t}let l=i.deletionLines.join(""),d=i.additionLines.join(""),u=c(e,"current",l),h=c(e,"incoming",d),p="change";""===d?p="deleted":""===l&&(p="new");let g={name:e.name,prevName:void 0,type:p,hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,isPartial:!1,deletionLines:i.deletionLines,additionLines:i.additionLines,cacheKey:null!=e.cacheKey?`${e.cacheKey}:merge-conflict-diff`:void 0};return{fileDiff:g,currentFile:u,incomingFile:h,actions:i.actions,markerRows:f(g,i.actions)}}],22151)},40648,e=>{"use strict";var t=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,n){if(null==t||null==n)for(let i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));null==n||null==t?this.cleanUp():(this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0)}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};e.s(["ScrollSyncManager",0,t])},68456,62498,93608,32187,20181,50522,e=>{"use strict";var t=e.i(6104);function n(e){return(0,t.createHastElement)({tagName:"div",children:[(0,t.createIconElement)({name:"both"===e?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":"both"===e?"":void 0,"data-expand-up":"up"===e?"":void 0,"data-expand-down":"down"===e?"":void 0}})}e.s(["createEmptyRowBuffer",0,function(e){return(0,t.createHastElement)({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}],68456),e.s(["createNoNewlineElement",0,function(e){return(0,t.createHastElement)({tagName:"div",children:[(0,t.createHastElement)({tagName:"span",children:[(0,t.createTextNodeElement)("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}],62498),e.s(["createSeparator",0,function({type:e,content:i,expandIndex:r,chunked:o=!1,slotName:a,isFirstHunk:s,isLastHunk:l}){let d=0,u=[];if("metadata"===e&&null!=i&&u.push((0,t.createHastElement)({tagName:"div",children:[(0,t.createTextNodeElement)(i)],properties:{"data-separator-wrapper":""}})),("line-info"===e||"line-info-basic"===e)&&null!=i){let e=[];null!=r&&(o?(!s&&(e.push(n("up")),d++),!l&&(e.push(n("down")),d++)):(e.push(n(s||l?s?"down":"up":"both")),d++)),e.push((0,t.createHastElement)({tagName:"div",children:[(0,t.createHastElement)({tagName:"span",children:[(0,t.createTextNodeElement)(i)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),o&&null!=r&&e.push((0,t.createHastElement)({tagName:"div",children:[(0,t.createTextNodeElement)("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),u.push((0,t.createHastElement)({tagName:"div",children:e,properties:{"data-separator-wrapper":"","data-separator-multi-button":d>1?"":void 0}}))}return"custom"===e&&null!=a&&u.push((0,t.createHastElement)({tagName:"slot",properties:{name:a}})),(0,t.createHastElement)({tagName:"div",children:u,properties:{"data-separator":0===u.length?"simple":e,"data-expand-index":r,"data-separator-first":s?"":void 0,"data-separator-last":l?"":void 0}})}],93608),e.s(["getHunkSeparatorSlotName",0,function(e,t){return`hunk-separator-${e}-${t}`}],32187),e.s(["getTotalLineCountFromHunks",0,function(e){let t=e.at(-1);return null==t?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}],20181),e.s(["isDefaultRenderRange",0,function(e){return 0===e.startingLine&&e.totalLines===1/0&&0===e.bufferBefore&&0===e.bufferAfter}],50522)},18750,10923,61092,57192,10028,22300,92458,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(51756),r=e.i(25106),o=e.i(2612),a=e.i(44477),s=e.i(60166),l=e.i(61647),d=e.i(93946),u=e.i(36635),h=e.i(45705),c=e.i(116),f=e.i(60654),p=e.i(41645),g=e.i(51598),m=e.i(47391),b=e.i(91301),v=e.i(40648),y=e.i(6104),C=e.i(84324),k=e.i(30891),S=e.i(82994),x=e.i(24183),w=e.i(41914),A=e.i(34481),L=e.i(45786),E=e.i(35864),T=e.i(82856),I=e.i(83981),R=e.i(19013),_=e.i(68456),M=e.i(62498),N=e.i(93608),D=e.i(32187),P=e.i(20181),O=e.i(50522),H=e.i(84036),F=e.i(89107),B=e.i(10906),U=e.i(27118);let $=-1;var G=class{__id=`diff-hunks-renderer:${++$}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:t.DEFAULT_THEMES},n,i){this.options=e,this.onRenderUpdate=n,this.workerManager=i,i?.isWorkingPool()!==!0&&(this.highlighter=(0,S.areThemesAttached)(e.theme??t.DEFAULT_THEMES)?(0,k.getHighlighterIfLoaded)():void 0)}cleanUp(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.renderCache=void 0,this.workerManager?.cleanUpPendingTasks(this)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};("up"===t||"both"===t)&&(i.fromStart+=n),("down"===t||"both"===t)&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&(this.renderCache=void 0),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??t.DEFAULT_EXPANDED_REGION}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){for(let t of(this.additionAnnotations={},this.deletionAnnotations={},e)){let e=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return"change"!==t?{gutterLineType:t}:{gutterLineType:"deletions"===e?"change-deletion":"change-addition"}}createAnnotationElement(e){return(0,x.createAnnotationElement)(e)}getOptionsWithDefaults(){let{diffIndicators:e="bars",diffStyle:n="split",disableBackground:i=!1,disableFileHeader:r=!1,disableLineNumbers:o=!1,disableVirtualizationBuffers:a=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:d=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,expansionLineCount:u=100,hunkSeparators:h="line-info",lineDiffType:c="word-alt",maxLineDiffLength:f=1e3,overflow:p="scroll",theme:g=t.DEFAULT_THEMES,headerRenderMode:m="default",tokenizeMaxLineLength:b=1e3,useTokenTransformer:v=!1,useCSSClasses:y=!1}=this.options;return{diffIndicators:e,diffStyle:n,disableBackground:i,disableFileHeader:r,disableLineNumbers:o,disableVirtualizationBuffers:a,collapsed:s,expandUnchanged:l,collapsedContextThreshold:d,expansionLineCount:u,hunkSeparators:h,lineDiffType:c,maxLineDiffLength:f,overflow:p,theme:this.workerManager?.getDiffRenderOptions().theme??g,headerRenderMode:m,tokenizeMaxLineLength:b,useTokenTransformer:v,useCSSClasses:y}}async initializeHighlighter(){return this.highlighter=await (0,k.getSharedHighlighter)((0,T.getHighlighterOptions)(this.computedLang,this.options)),this.highlighter}hydrate(e){if(null==e)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=this.workerManager?.getDiffResultCache(e);null==n||(0,R.areDiffRenderOptionsEqual)(t,n.options)||(n=void 0),this.renderCache??={diff:e,highlighted:!(0,H.isDiffPlainText)(e),options:t,result:n?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?null==this.renderCache.result&&this.workerManager.highlightDiffAST(this,this.diff):null==this.highlighter&&(this.computedLang=e.lang??(0,E.getFiletypeFromFileName)(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:(0,I.shouldUseTokenTransformer)(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:i}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result!=null&&e===n.diff&&(0,R.areDiffRenderOptionsEqual)(t,n.options)?{options:t,forceRender:!1}:{options:t,forceRender:!0}}renderDiff(e=this.renderCache?.diff,n=t.DEFAULT_RENDER_RANGE){if(null==e)return;let{expandUnchanged:i=!1,collapsedContextThreshold:o}=this.getOptionsWithDefaults(),a=this.workerManager?.getDiffResultCache(e);null!=a&&null==this.renderCache&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...a});let{options:s,forceRender:l}=this.getRenderOptions(e);if(this.renderCache??={diff:e,highlighted:!1,options:s,result:void 0,renderRange:void 0},this.workerManager?.isWorkingPool()===!0)null!=this.renderCache.result&&(this.renderCache.highlighted||e===this.renderCache.diff&&(0,r.areRenderRangesEqual)(this.renderCache.renderRange,n))||(this.renderCache.diff=e,this.renderCache.result=this.workerManager.getPlainDiffAST(e,n.startingLine,n.totalLines,!!(0,O.isDefaultRenderRange)(n)||!!i||this.expandedHunks,o),this.renderCache.renderRange=n),n.totalLines>0&&(!this.renderCache.highlighted||l)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??(0,E.getFiletypeFromFileName)(e.name);let t=null!=this.highlighter&&(0,S.areThemesAttached)(s.theme),n=null!=this.highlighter&&(0,C.areLanguagesAttached)(this.computedLang);if(null!=this.highlighter&&t&&(l||!this.renderCache.highlighted&&n||null==this.renderCache.result)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,!n);this.renderCache={diff:e,options:i,highlighted:n,result:t,renderRange:void 0}}t&&n||this.asyncHighlight(e).then(({result:t,options:n})=>{null!=this.renderCache&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n)})}return null!=this.renderCache.result?this.processDiffResult(this.renderCache.diff,n,this.renderCache.result):void 0}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){let{result:i}=await this.asyncHighlight(e);return this.processDiffResult(e,n,i)}createPreElement(e,t,n){let{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a}=this.getOptionsWithDefaults();return(0,L.createPreElement)({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:a,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){this.computedLang=e.lang??(0,E.getFiletypeFromFileName)(e.name);let n=null!=this.highlighter&&(0,S.areThemesAttached)(this.options.theme??t.DEFAULT_THEMES),i=null!=this.highlighter&&(0,C.areLanguagesAttached)(this.computedLang);return null!=this.highlighter&&n&&i||(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter)}renderDiffWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults();return{result:(0,B.renderDiffWithHighlighter)(e,t,i,{forcePlainText:n,expandedHunks:!!n||void 0,collapsedContextThreshold:r}),options:i}}onHighlightSuccess(e,t,n){if(null==this.renderCache)return;let i=!this.renderCache.highlighted||!(0,R.areDiffRenderOptionsEqual)(this.renderCache.options,n)||this.renderCache.diff!==e;this.renderCache={diff:e,options:n,highlighted:!0,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}onHighlightError(e){console.error(e)}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){let{diffStyle:o,disableFileHeader:a,expandUnchanged:s,expansionLineCount:l,collapsedContextThreshold:d,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let h="unified"===o,c=[],f=[],p=[],g=[],{additionLines:m,deletionLines:b}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:c,deletionsContentAST:f,unifiedContentAST:p,unifiedGutterAST:(0,y.createGutterWrapper)(),deletionsGutterAST:(0,y.createGutterWrapper)(),additionsGutterAST:(0,y.createGutterWrapper)(),expansionLineCount:l,hunkData:g,incrementRowCount(e=1){v.rowCount+=e},pushToGutter(e,t){switch(e){case"unified":v.unifiedGutterAST.children.push(t);break;case"deletions":v.deletionsGutterAST.children.push(t);break;case"additions":v.additionsGutterAST.children.push(t)}}},C=function(e){let t=e.hunks.at(-1);if(null==t||e.isPartial||0===e.additionLines.length||0===e.deletionLines.length)return 0;let n=e.additionLines.length-(t.additionLineIndex+t.additionCount),i=e.deletionLines.length-(t.deletionLineIndex+t.deletionCount);if(n!==i)throw Error(`DiffHunksRenderer.processDiffResult: trailing context mismatch (additions=${n}, deletions=${i}) for ${e.name}`);return Math.min(n,i)}(e),k={size:0,side:void 0,increment(){this.size+=1},flush(){if("unified"!==o){if(this.size<=0||null==this.side){this.side=void 0,this.size=0;return}"additions"===this.side?(v.pushToGutter("additions",(0,y.createGutterGap)(void 0,"buffer",this.size)),c?.push((0,_.createEmptyRowBuffer)(this.size))):(v.pushToGutter("deletions",(0,y.createGutterGap)(void 0,"buffer",this.size)),f?.push((0,_.createEmptyRowBuffer)(this.size))),this.size=0,this.side=void 0}}},S=(e,t,n,i,r)=>{v.pushToGutter(e,(0,y.createGutterItem)(t,n,i,r))};function x(e){k.flush(),"unified"===o?V("unified",e,v):(V("deletions",e,v),V("additions",e,v))}(0,F.iterateOverDiff)({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:!!s||this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:t,hunk:n,collapsedBefore:i,collapsedAfter:r,additionLine:a,deletionLine:s,type:l})=>{let d=null!=s?s.splitLineIndex:a.splitLineIndex,h=null!=a?a.unifiedLineIndex:s.unifiedLineIndex;"split"===o&&"change"!==l&&k.flush(),i>0&&x({hunkIndex:t,collapsedLines:i,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:0===t,isLastHunk:!1,isExpandable:!e.isPartial});let c="unified"===o?h:d,f={type:l,hunkIndex:t,lineIndex:c,unifiedLineIndex:h,splitLineIndex:d,deletionLine:s,additionLine:a};if("unified"===o){let n=this.getUnifiedInjectedRowsForLine?.(f);n?.before!=null&&j(n.before,v);let i=null!=s?b[s.lineIndex]:void 0,r=null!=a?m[a.lineIndex]:void 0;if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let o="change"===l?null!=a?"change-addition":"change-deletion":l,u=this.getUnifiedLineDecoration({type:l,lineType:o,additionLineIndex:a?.lineIndex,deletionLineIndex:s?.lineIndex});S("unified",u.gutterLineType,null!=a?a.lineNumber:s.lineNumber,`${h},${d}`,u.gutterProperties),null!=r?r=X(r,u.contentProperties):null!=i&&(i=X(i,u.contentProperties)),q({diffStyle:"unified",type:l,deletionLine:i,additionLine:r,unifiedSpan:this.getAnnotations("unified",s?.lineNumber,a?.lineNumber,t,c),createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&j(n.after,v)}else{let n=this.getSplitInjectedRowsForLine?.(f);n?.before!=null&&W(n.before,v,k);let i=null!=s?b[s.lineIndex]:void 0,r=null!=a?m[a.lineIndex]:void 0,o=this.getSplitLineDecoration({side:"deletions",type:l,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:"additions",type:l,lineIndex:a?.lineIndex});if(null==i&&null==r){let t="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(t,{file:e.name}),Error(t)}let h=(()=>{if("change"===l){if(null==r)return"additions";else if(null==i)return"deletions"}})();if(null!=h){if(null!=k.side&&k.side!==h)throw Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");k.side=h,k.increment()}let p=this.getAnnotations("split",s?.lineNumber,a?.lineNumber,t,c);if(null!=p&&k.size>0&&k.flush(),null!=s){let e=X(i,o.contentProperties);S("deletions",o.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${d}`,o.gutterProperties),null!=e&&(i=e)}if(null!=a){let e=X(r,u.contentProperties);S("additions",u.gutterLineType,a.lineNumber,`${a.unifiedLineIndex},${d}`,u.gutterProperties),null!=e&&(r=e)}q({diffStyle:"split",type:l,additionLine:r,deletionLine:i,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&W(n.after,v,k)}let p=s?.noEOFCR??!1,g=a?.noEOFCR??!1;if(g||p){if(p){let e="context"===l||"context-expanded"===l?l:"change-deletion";"unified"===o?(v.unifiedContentAST.push((0,M.createNoNewlineElement)(e)),v.pushToGutter("unified",(0,y.createGutterGap)(e,"metadata",1))):(v.deletionsContentAST.push((0,M.createNoNewlineElement)(e)),v.pushToGutter("deletions",(0,y.createGutterGap)(e,"metadata",1)),g||(v.pushToGutter("additions",(0,y.createGutterGap)(void 0,"buffer",1)),v.additionsContentAST.push((0,_.createEmptyRowBuffer)(1))))}if(g){let e="context"===l||"context-expanded"===l?l:"change-addition";"unified"===o?(v.unifiedContentAST.push((0,M.createNoNewlineElement)(e)),v.pushToGutter("unified",(0,y.createGutterGap)(e,"metadata",1))):(v.additionsContentAST.push((0,M.createNoNewlineElement)(e)),v.pushToGutter("additions",(0,y.createGutterGap)(e,"metadata",1)),p||(v.pushToGutter("deletions",(0,y.createGutterGap)(void 0,"buffer",1)),v.deletionsContentAST.push((0,_.createEmptyRowBuffer)(1))))}v.incrementRowCount(1)}r>0&&"simple"!==u&&x({hunkIndex:"context-expanded"===l?t:t+1,collapsedLines:r,rangeSize:C,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),"split"===o&&k.flush();let w=Math.max((0,P.getTotalLineCountFromHunks)(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),A=t.bufferBefore>0||t.bufferAfter>0,L=!h&&"deleted"!==e.type,E=!h&&"new"!==e.type,T=v.rowCount>0||A;c=L&&T?c:void 0,f=E&&T?f:void 0,p=h&&T?p:void 0;let I=this.createPreElement(null!=f&&null!=c,w);return{unifiedGutterAST:h&&T?v.unifiedGutterAST.children:void 0,unifiedContentAST:p,deletionsGutterAST:E&&T?v.deletionsGutterAST.children:void 0,deletionsContentAST:f,additionsGutterAST:L&&T?v.additionsGutterAST.children:void 0,additionsContentAST:c,hunkData:g,preNode:I,themeStyles:i,baseThemeType:r,headerElement:a?void 0:this.renderHeader(this.diff),totalLines:w,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){let n="unified"===e?t.unifiedGutterAST:"deletions"===e?t.deletionsGutterAST:t.additionsGutterAST,i="unified"===e?t.unifiedContentAST:"deletions"===e?t.deletionsContentAST:t.additionsContentAST;if(null==n||null==i)return;let r=(0,y.createGutterWrapper)(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,(0,w.createContentColumn)(i,t.rowCount)]}renderFullAST(e,t=[]){let n="line-info"===this.getOptionsWithDefaults().hunkSeparators,i=this.renderCodeAST("unified",e);if(null!=i)return t.push((0,y.createHastElement)({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};let r=this.renderCodeAST("deletions",e);null!=r&&t.push((0,y.createHastElement)({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));let o=this.renderCodeAST("additions",e);return null!=o&&t.push((0,y.createHastElement)({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return(0,U.toHtml)(this.renderFullAST(e,t))}renderPartialHTML(e,t){return null==t?(0,U.toHtml)(e):(0,U.toHtml)((0,y.createHastElement)({tagName:"code",children:e,properties:{"data-code":"","data-container-size":"line-info"===this.getOptionsWithDefaults().hunkSeparators?"":void 0,[`data-${t}`]:""}}))}getAnnotations(e,t,n,i,r){let a={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=t)for(let e of this.deletionAnnotations[t]??[])a.annotations.push((0,o.getLineAnnotationName)(e));let s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(null!=n)for(let t of this.additionAnnotations[n]??[])("unified"===e?a:s).annotations.push((0,o.getLineAnnotationName)(t));return"unified"===e?a.annotations.length>0?a:void 0:0!==s.annotations.length||0!==a.annotations.length?{deletionSpan:a,additionSpan:s}:void 0}renderHeader(e){let{headerRenderMode:t}=this.getOptionsWithDefaults();return(0,A.createFileHeaderElement)({fileOrDiff:e,mode:t})}};function z(e){return`${e} unmodified line${e>1?"s":""}`}function j(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function W(e,t,n){for(let{deletion:i,addition:r}of e){if(null==i&&null==r)continue;let e=null!=i&&null!=r?void 0:null==i?"deletions":"additions";(null==e||n.side!==e)&&n.flush(),null!=i&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),null!=r&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),null!=e&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function q({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:a,createAnnotationElement:s,context:l}){let d=!1;"unified"===e?(null!=i?l.unifiedContentAST.push(i):null!=n&&l.unifiedContentAST.push(n),null!=r&&(l.unifiedContentAST.push(s(r)),l.pushToGutter("unified",(0,y.createGutterGap)("change"===t?null!=n?"change-deletion":"change-addition":t,"annotation",1)),d=!0)):"split"===e&&(null!=n&&l.deletionsContentAST.push(n),null!=i&&l.additionsContentAST.push(i),null!=o&&(l.deletionsContentAST.push(s(o)),l.pushToGutter("deletions",(0,y.createGutterGap)("change"===t?null!=n?"change-deletion":"context":t,"annotation",1)),d=!0),null!=a&&(l.additionsContentAST.push(s(a)),l.pushToGutter("additions",(0,y.createGutterGap)("change"===t?null!=i?"change-addition":"context":t,"annotation",1)),d=!0)),d&&l.incrementRowCount(1)}function V(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:a,isExpandable:s},l){if(n<=0)return;let d="unified"===e?l.unifiedContentAST:"deletions"===e?l.deletionsContentAST:l.additionsContentAST;if("metadata"===l.hunkSeparators){null!=r&&(l.pushToGutter(e,(0,N.createSeparator)({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),d.push((0,N.createSeparator)({type:"metadata",content:r,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&l.incrementRowCount(1));return}if("simple"===l.hunkSeparators){t>0&&(l.pushToGutter(e,(0,N.createSeparator)({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push((0,N.createSeparator)({type:"simple",isFirstHunk:o,isLastHunk:!1})),"additions"!==e&&l.incrementRowCount(1));return}let u=(0,D.getHunkSeparatorSlotName)(e,t),h=i>l.expansionLineCount,c=s?t:void 0;l.pushToGutter(e,(0,N.createSeparator)({type:l.hunkSeparators,content:z(n),expandIndex:c,chunked:h,slotName:u,isFirstHunk:o,isLastHunk:a})),d.push((0,N.createSeparator)({type:l.hunkSeparators,content:z(n),expandIndex:c,chunked:h,slotName:u,isFirstHunk:o,isLastHunk:a})),"additions"!==e&&l.incrementRowCount(1),l.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!o,down:!a,chunked:h}:void 0})}function X(e,t){return null==e||"element"!==e.type||null==t?e:{...e,properties:{...e.properties,...t}}}function K(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Q(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}e.s(["DiffHunksRenderer",0,G],10923),e.s(["areDiffLineAnnotationsEqual",0,K],61092),e.s(["areHunkDataEqual",0,Q],57192);var Y=e.i(17443);function J(e){let t=e[0];if("+"!==t&&"-"!==t&&" "!==t&&"\\"!==t)return void console.error(`parseLineType: Invalid firstChar: "${t}", full line: "${e}"`);let n=e.substring(1);return{line:""===n?"\n":n,type:" "===t?"context":"\\"===t?"metadata":"+"===t?"addition":"deletion"}}function Z(e,n,i=!1){let r,o=t.GIT_DIFF_FILE_BREAK_REGEX.test(e),a=e.split(o?t.GIT_DIFF_FILE_BREAK_REGEX:t.UNIFIED_DIFF_FILE_BREAK_REGEX),s=[];for(let e of a){if(o&&!t.GIT_DIFF_FILE_BREAK_REGEX.test(e)||!o&&!t.UNIFIED_DIFF_FILE_BREAK_REGEX.test(e)){if(null==r)r=e;else if(i)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}let a=ee(e,{cacheKey:null!=n?`${n}-${s.length}`:void 0,isGitDiff:o,throwOnError:i});null!=a&&s.push(a)}return{patchMetadata:r,files:s}}function ee(e,{cacheKey:n,isGitDiff:i=t.GIT_DIFF_FILE_BREAK_REGEX.test(e),oldFile:r,newFile:o,throwOnError:a=!1}={}){let s,l=0,d=e.split(t.FILE_CONTEXT_BLOB),u=null==r||null==o,h=0,c=0;for(let e of d){let d,f,p=e.split(t.SPLIT_WITH_NEWLINES),g=p.shift();if(null==g){if(a)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",e);continue}let m=g.match(t.HUNK_HEADER),b=0,v=0;if(null==m||null==s){if(null!=s){if(a)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",e);continue}for(let e of(1===(s={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:u,additionLines:u||null==r||null==o?[]:o.contents.split(t.SPLIT_WITH_NEWLINES),deletionLines:u||null==r||null==o?[]:r.contents.split(t.SPLIT_WITH_NEWLINES),cacheKey:n}).additionLines.length&&o?.contents===""&&(s.additionLines.length=0),1===s.deletionLines.length&&r?.contents===""&&(s.deletionLines.length=0),p.unshift(g),p)){let n=e.match(i?t.FILENAME_HEADER_REGEX_GIT:t.FILENAME_HEADER_REGEX);if(e.startsWith("diff --git")){let[,,n,,i]=e.trim().match(t.ALTERNATE_FILE_NAMES_GIT)??[];s.name=i.trim(),n!==i&&(s.prevName=n.trim())}else if(null!=n){let[,e,t]=n;"---"===e&&"/dev/null"!==t?(s.prevName=t.trim(),s.name=t.trim()):"+++"===e&&"/dev/null"!==t&&(s.name=t.trim())}else if(i){if(e.startsWith("new mode ")&&(s.mode=e.replace("new mode","").trim()),e.startsWith("old mode ")&&(s.prevMode=e.replace("old mode","").trim()),e.startsWith("new file mode")&&(s.type="new",s.mode=e.replace("new file mode","").trim()),e.startsWith("deleted file mode")&&(s.type="deleted",s.mode=e.replace("deleted file mode","").trim()),e.startsWith("similarity index")&&(e.startsWith("similarity index 100%")?s.type="rename-pure":s.type="rename-changed"),e.startsWith("index ")){let[,n,i,r]=e.trim().match(t.INDEX_LINE_METADATA)??[];null!=n&&(s.prevObjectId=n),null!=i&&(s.newObjectId=i),null!=r&&(s.mode=r)}e.startsWith("rename from ")&&(s.prevName=e.replace("rename from ","").trim()),e.startsWith("rename to ")&&(s.name=e.replace("rename to ","").trim())}}continue}for(;p.length>0&&("\n"===p[p.length-1]||"\r"===p[p.length-1]||"\r\n"===p[p.length-1]||""===p[p.length-1]);)p.pop();let y=parseInt(m[3]),C=parseInt(m[1]);h=u?h:C-1,c=u?c:y-1;let k={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:parseInt(m[4]??"1"),additionStart:y,additionLines:b,deletionCount:parseInt(m[2]??"1"),deletionStart:C,deletionLines:v,deletionLineIndex:h,additionLineIndex:c,hunkContent:[],hunkContext:m[5],hunkSpecs:g,noEOFCRAdditions:!1,noEOFCRDeletions:!1};if(isNaN(k.additionCount)||isNaN(k.deletionCount)||isNaN(k.additionStart)||isNaN(k.deletionStart)){if(a)throw Error("parsePatchContent: invalid hunk metadata");console.error("parsePatchContent: invalid hunk metadata",k);continue}for(let e of p){let t=J(e);if(null==t){console.error("processFile: invalid rawLine:",e);continue}let{type:n,line:i}=t;if("addition"===n)(null==d||"change"!==d.type)&&(d=et("change",h,c),k.hunkContent.push(d)),c++,u&&s.additionLines.push(i),d.additions++,b++,f="addition";else if("deletion"===n)(null==d||"change"!==d.type)&&(d=et("change",h,c),k.hunkContent.push(d)),h++,u&&s.deletionLines.push(i),d.deletions++,v++,f="deletion";else if("context"===n)(null==d||"context"!==d.type)&&(d=et("context",h,c),k.hunkContent.push(d)),c++,h++,u&&(s.deletionLines.push(i),s.additionLines.push(i)),d.lines++,f="context";else if("metadata"===n&&null!=d){if("context"===d.type?(k.noEOFCRAdditions=!0,k.noEOFCRDeletions=!0):"deletion"===f?k.noEOFCRDeletions=!0:"addition"===f&&(k.noEOFCRAdditions=!0),u&&("addition"===f||"context"===f)){let e=s.additionLines.length-1;e>=0&&(s.additionLines[e]=(0,Y.cleanLastNewline)(s.additionLines[e]))}if(u&&("deletion"===f||"context"===f)){let e=s.deletionLines.length-1;e>=0&&(s.deletionLines[e]=(0,Y.cleanLastNewline)(s.deletionLines[e]))}}}for(let e of(k.additionLines=b,k.deletionLines=v,k.collapsedBefore=Math.max(k.additionStart-1-l,0),s.hunks.push(k),l=k.additionStart+k.additionCount-1,k.hunkContent))"context"===e.type?(k.splitLineCount+=e.lines,k.unifiedLineCount+=e.lines):(k.splitLineCount+=Math.max(e.additions,e.deletions),k.unifiedLineCount+=e.deletions+e.additions);k.splitLineStart=s.splitLineCount+k.collapsedBefore,k.unifiedLineStart=s.unifiedLineCount+k.collapsedBefore,s.splitLineCount+=k.collapsedBefore+k.splitLineCount,s.unifiedLineCount+=k.collapsedBefore+k.unifiedLineCount}if(null!=s){if(s.hunks.length>0&&!u&&s.additionLines.length>0&&s.deletionLines.length>0){let e=s.hunks[s.hunks.length-1],t=e.additionStart+e.additionCount-1,n=Math.max(s.additionLines.length-t,0);s.splitLineCount+=n,s.unifiedLineCount+=n}return i||(null!=s.prevName&&s.name!==s.prevName?s.hunks.length>0?s.type="rename-changed":s.type="rename-pure":null!=o&&""===o.contents?s.type="deleted":null!=r&&""===r.contents&&(s.type="new")),"rename-pure"!==s.type&&"rename-changed"!==s.type&&(s.prevName=void 0),s}}function et(e,t,n){return"change"===e?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}e.s(["parseLineType",0,J],10028),e.s(["parsePatchFiles",0,function(e,n,i=!1){let r=[];for(let o of e.split(t.COMMIT_METADATA_SPLIT))try{r.push(Z(o,null!=n?`${n}-${r.length}`:void 0,i))}catch(e){if(i)throw e;console.error(e)}return r},"processFile",0,ee,"processPatch",0,Z],22300);var en=e.i(24315);class ei extends en.default{constructor(){super(...arguments),this.tokenize=eo}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes("\n")||(e=e.trim()),n.newlineIsToken&&t.includes("\n")||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith("\n")&&(e=e.slice(0,-1)),t.endsWith("\n")&&(t=t.slice(0,-1))),super.equals(e,t,n)}}let er=new ei;function eo(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,"\n"));let n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let e=0;e<i.length;e++){let r=i[e];e%2&&!t.newlineIsToken?n[n.length-1]+=r:n.push(r)}return n}let ea={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function es(e,t,n,i,r,o,a){var s;let l;void 0===(l=a?"function"==typeof a?{callback:a}:a:{}).context&&(l.context=4);let d=l.context;if(l.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!l.callback)return u(er.diff(n,i,l));{let{callback:e}=l;s=Object.assign(Object.assign({},l),{callback:t=>{e(u(t))}}),er.diff(n,i,s)}function u(n){if(!n)return;function i(e){return e.map(function(e){return" "+e})}n.push({value:"",lines:[]});let a=[],s=0,l=0,u=[],h=1,c=1;for(let e=0;e<n.length;e++){let t=n[e],r=t.lines||function(e){let t=e.endsWith("\n"),n=e.split("\n").map(e=>e+"\n");return t?n.pop():n.push(n.pop().slice(0,-1)),n}(t.value);if(t.lines=r,t.added||t.removed){if(!s){let t=n[e-1];s=h,l=c,t&&(s-=(u=d>0?i(t.lines.slice(-d)):[]).length,l-=u.length)}for(let e of r)u.push((t.added?"+":"-")+e);t.added?c+=r.length:h+=r.length}else{if(s)if(r.length<=2*d&&e<n.length-2)for(let e of i(r))u.push(e);else{let e=Math.min(r.length,d);for(let t of i(r.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:h-s+e,newStart:l,newLines:c-l+e,lines:u};a.push(t),s=0,l=0,u=[]}h+=r.length,c+=r.length}}for(let e of a)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith("\n")?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,"\"),t++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:a}}}function el(e,t){if(t||(t=ea),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(e=>el(e,t)).join("\n")}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(void 0===e.oldHeader?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(void 0===e.newHeader?"":" "+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let i=e.hunks[t];for(let e of(0===i.oldLines&&(i.oldStart-=1),0===i.newLines&&(i.newStart-=1),n.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@"),i.lines))n.push(e)}return n.join("\n")+"\n"}function ed(e,t,n,i=!1){let r=ee(function(e,t,n,i,r,o,a){if("function"==typeof a&&(a={callback:a}),null==a?void 0:a.callback){let{callback:s}=a;es(e,t,n,i,r,o,Object.assign(Object.assign({},a),{callback:e=>{e?s(el(e,a.headerOptions)):s(void 0)}}))}else{let s=es(e,t,n,i,r,o,a);if(!s)return;return el(s,null==a?void 0:a.headerOptions)}}(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(null!=e.cacheKey&&null!=t.cacheKey)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(null==r)throw Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return null!=t.lang&&(r.lang=t.lang),r}e.s(["parseDiffFromFile",0,ed],92458);let eu=-1;var eh=class{static LoadedCustomComponent=b.DiffsContainerLoaded;__id=`file-diff:${++eu}`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;lastRowCount;enabled=!0;constructor(e={theme:t.DEFAULT_THEMES},r,o=!1){this.options=e,this.workerManager=r,this.isContainerManaged=o,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new i.ResizeManager,this.scrollSyncManager=new v.ScrollSyncManager,this.interactionManager=new n.InteractionManager("diff",(0,n.pluckInteractionOptions)(e,"function"==typeof e.hunkSeparators||(e.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===e.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return{...e,headerRenderMode:null!=e.renderCustomHeader?"custom":"default",hunkSeparators:"function"==typeof e.hunkSeparators?"custom":e.hunkSeparators}}createHunksRenderer(e){return new G(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{let n,i;if(null==this.fileDiff)return;let r=this.fileDiff.hunks.at(-1);e:for(let o of this.fileDiff.hunks){let a="deletions"===t?o.deletionStart:o.additionStart,s="deletions"===t?o.deletionCount:o.additionCount,l=o.splitLineStart,d=o.unifiedLineStart;if(e<a){let t=a-e;n=Math.max(d-t,0),i=Math.max(l-t,0);break}if(e>=a+s){if(o===r){let t=e-(a+s);n=d+o.unifiedLineCount+t,i=l+o.splitLineCount+t;break}continue}for(let r of o.hunkContent)if("context"===r.type)if(e<a+r.lines){let t=e-a;i=l+t,n=d+t;break e}else a+=r.lines,l+=r.lines,d+=r.lines;else{let o="deletions"===t?r.deletions:r.additions;if(e<a+o){let o=e-a;n=d+("additions"===t?r.deletions:0)+o,i=l+o;break e}a+=o,l+=Math.max(r.deletions,r.additions),d+=r.deletions+r.additions}break}if(null!=n&&null!=i)return[n,i]};setOptions(e){null!=e&&(this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.interactionManager.setOptions((0,n.pluckInteractionOptions)(e,"function"==typeof e.hunkSeparators||(e.hunkSeparators??"line-info")==="line-info"||"line-info-basic"===e.hunkSeparators?this.handleExpandHunk:void 0,this.getLineIndex)))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")===e||(this.mergeOptions({themeType:e}),"string"!=typeof this.options.theme&&null!=this.fileContainer&&null!=this.appliedThemeCSS&&this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType))}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!e&&!t&&!n&&"function"!=typeof this.options.hunkSeparators}setSelectedLines(e){this.interactionManager.setSelection(e)}cleanUp(e=!1){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer?.shadowRoot!=null&&(this.fileContainer.shadowRoot.innerHTML=""),this.fileContainer=void 0,null!=this.pre&&(this.pre.innerHTML="",this.pre=void 0),this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:a,fileDiff:s}=e;this.hydrateElements(t,n),null==this.pre&&null==this.headerElement?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:o,newFile:a,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,n){for(let i of((0,g.prerenderHTMLIfNecessary)(e,n),e.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){for(let e of(this.pre=i,i.children))e instanceof HTMLElement&&"code"===e.tagName.toLowerCase()&&("deletions"in e.dataset&&(this.codeDeletions=e),"additions"in e.dataset&&(this.codeAdditions=e),"unified"in e.dataset&&(this.codeUnified=e));continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.THEME_CSS_ATTRIBUTE)){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(t.UNSAFE_CSS_ATTRIBUTE)){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}}}null!=this.pre&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),(null!=this.pre||null!=this.headerElement)&&(this.fileContainer=e)}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){let{diffStyle:r="split",overflow:o="scroll"}=this.options;this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(null!=t&&null!=n?ed(t,n,this.options.parseDiffOptions):void 0),null!=this.pre&&(this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,"wrap"===o),"scroll"===o&&"split"===r&&this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions))}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&this.render({forceRender:!0,renderRange:this.renderRange})}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:n,fileDiff:i,forceRender:o=!1,preventEmit:a=!1,lineAnnotations:l,fileContainer:d,containerWrapper:u,renderRange:h}){if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");let{collapsed:c=!1}=this.options,f=c?void 0:h,p=null!=e&&null!=n&&(!(0,s.areFilesEqual)(e,this.deletionFile)||!(0,s.areFilesEqual)(n,this.additionFile)),g=null!=i&&i!==this.fileDiff,m=null!=l&&(l.length>0||this.lineAnnotations.length>0)&&l!==this.lineAnnotations;if(!c&&(0,r.areRenderRangesEqual)(f,this.renderRange)&&!o&&!m&&(null!=i&&i===this.fileDiff||null==i&&!p))return!1;let{renderRange:b}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=n,null!=i?this.fileDiff=i:null!=e&&null!=n&&p&&(g=!0,this.fileDiff=ed(e,n,this.options.parseDiffOptions)),null!=l&&this.setLineAnnotations(l),null==this.fileDiff)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{diffStyle:v="split",disableErrorHandling:y=!1,disableFileHeader:C=!1,overflow:k="scroll",themeType:S="system"}=this.options;if(C&&(null!=this.headerElement&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),d=this.getOrCreateFileContainer(d,u),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,t.EMPTY_RENDER_RANGE);null!=e&&this.applyThemeState(d,e.themeStyles,S,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,d),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,d)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(d);if(!(this.canPartiallyRender(o,m,p||g)&&this.applyPartialRender({previousRenderRange:b,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(null==t)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(d,t.themeStyles,S,t.baseThemeType),null!=t.headerElement&&this.applyHeaderToDOM(t.headerElement,d),null!=t.additionsContentAST||null!=t.deletionsContentAST||null!=t.unifiedContentAST?this.applyHunksToDOM(e,t):null!=this.pre&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.interactionManager.setup(e),this.resizeManager.setup(e,"wrap"===k),"scroll"===k&&"split"===v?this.scrollSyncManager.setup(e,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp()}catch(e){if(y)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,d)}return a||this.emitPostRender(),!0}emitPostRender(){null!=this.fileContainer&&this.options.onPostRender?.(this.fileContainer,this)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();for(let{element:e}of(this.separatorCache.clear(),this.annotationCache.values()))e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(null==this.fileContainer)return!1;if(this.cleanChildNodes(),null==this.placeHolder){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof t){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let i of e){let e=i.slotName,r=this.separatorCache.get(e);if(null==r||!Q(i,r.hunkData)){r?.element.remove();let n=document.createElement("div");n.style.display="contents",n.slot=i.slotName;let o=t(i,this);null!=o&&n.appendChild(o),this.fileContainer.appendChild(n),r={element:n,hunkData:i},this.separatorCache.set(e,r)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||null==this.fileContainer){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(null!=t&&this.lineAnnotations.length>0)for(let[n,i]of this.lineAnnotations.entries()){let r=`${n}-${(0,o.getLineAnnotationName)(i)}`,a=this.annotationCache.get(r);if(null==a||!K(i,a.annotation)){a?.element.remove();let e=t(i);if(null==e)continue;(a={element:(0,d.createAnnotationWrapperNode)((0,o.getLineAnnotationName)(i)),annotation:i}).element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(r,a)}e.delete(r)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let e=this.options.renderGutterUtility??this.options.renderHoverUtility;if(null==this.fileContainer||null==e){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(null!=t&&null!=this.gutterUtilityContent)return;if(null==t){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=(0,u.createGutterUtilityContentNode)();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,n){let i=this.fileContainer;if(this.fileContainer=e??this.fileContainer??document.createElement(t.DIFFS_TAG_NAME),null!=i&&i!==this.fileContainer&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),null!=n&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),null==this.spriteSVG){let e=document.createElement("div");e.innerHTML=a.SVGSpriteSheet;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t,this.fileContainer.shadowRoot?.appendChild(this.spriteSVG))}return this.fileContainer}getFileContainer(){return this.fileContainer}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return null==this.pre?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){for(let t of(this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,Array.from(e.children)))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:i}=this,r=(0,U.toHtml)(e);if(r!==this.lastRenderedHeaderHTML){let e=document.createElement("div");e.innerHTML=r;let t=e.firstElementChild;if(!(t instanceof HTMLElement))return;null!=this.headerElement?n.shadowRoot?.replaceChild(t,this.headerElement):n.shadowRoot?.prepend(t),this.headerElement=t,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||null==i)return;let{renderCustomHeader:o,renderHeaderPrefix:a,renderHeaderMetadata:s}=this.options;if(null!=o){let e=o(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,t.CUSTOM_HEADER_SLOT_ID,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let l=a?.(i)??void 0,d=s?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,t.HEADER_PREFIX_SLOT_ID,l),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,t.HEADER_METADATA_SLOT_ID,d),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(null==i)return void t?.remove();let r=t??this.createHeaderSlotElement(n);return null==t&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(null!=t){if(null==e||""===e){null!=this.unsafeCSSStyle&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=(0,h.createUnsafeCSSStyleNode)(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=(0,c.wrapUnsafeCSS)(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n;(this.themeCSSStyle?.parentNode!==r||this.appliedThemeCSS?.themeStyles!==t||this.appliedThemeCSS.themeType!==o)&&(this.themeCSSStyle=(0,p.upsertHostThemeStyle)({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:(0,c.wrapThemeCSS)(t,o)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{themeStyles:t,themeType:o,baseThemeType:i}:void 0)}applyHunksToDOM(e,t){let{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r="wrap"===n?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],s=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);null!=s?(o=null==this.codeUnified||null!=this.codeAdditions||null!=this.codeDeletions,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=(0,f.getOrCreateCodeNode)({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),a.push(this.codeUnified)):null!=l||null!=d?(null!=l?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=(0,f.getOrCreateCodeNode)({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),null!=d?(o=o||null==this.codeAdditions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=(0,f.getOrCreateCodeNode)({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),0===a.length?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==n||null==e||null==t||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||null==this.lastRowCount)return!1;let s=this.getCodeColumns(a,i,o,r);if(null==s)return!1;let l=e.startingLine,d=t.startingLine,u=l+e.totalLines,h=d+t.totalLines,c=Math.max(l,d),f=Math.min(u,h);if(f<=c)return!1;let p=Math.max(0,c-l),g=Math.max(0,u-f),m=this.trimColumns({columns:s,trimStart:p,trimEnd:g,previousStart:l,overlapStart:c,overlapEnd:f,diffStyle:a});if(m<0)throw Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<m)throw Error("applyPartialRender: trimmed beyond DOM row count");let b=this.lastRowCount-m,v=(e,t)=>{if(!(t<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(d,Math.max(c-d,0));if(null==y&&d<c)return!1;let C=v(f,Math.max(h-f,0));if(null==C&&h>f)return!1;let k=(e,t)=>{if(null!=e){if("unified"!==a||Array.isArray(s))if("split"===a&&Array.isArray(s))this.insertPartialHTML(a,s,e,t);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,s,e,t);b+=e.rowCount}};return this.cleanupErrorWrapper(),k(y,"afterbegin"),k(C,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(a,s,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,i){if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST("deletions",n),r=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],e,i),this.renderPartialColumn(t[1],r,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,e,i)}}renderPartialColumn(e,t,n){if(null==e||null==t)return;let i=ec(t[0]),r=ec(t[1]);if(null==i||null==r)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);"beforeend"===n&&o?.type==="element"&&"number"==typeof o.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);let a=r.at(-1);"afterbegin"===n&&a?.type==="element"&&"number"==typeof a.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);null!=a&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let i=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${n}`),e.content.style.setProperty("grid-row",`span ${n}`))};if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t))i(t[0]),i(t[1]);else throw Error("dun fuuuuked up");else i(t)}trimColumnRows(e,t,n){let i=0,r=0,o=0,a=!1,s=n>=0;if(null==e)return 0;let l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<l.length&&(!(t<=0)||s||a);){let e=d[o],u=l[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),r++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(t>0||s&&i>=n)&&(e.remove(),u.remove(),t>0&&0==--t&&(a=!0),r++),i++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(t>0||s&&i>=n)&&(e.remove(),u.remove(),r++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let n=Math.min(t,o),i=o-n;i>0?(this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=n):(e.remove(),u.remove(),r+=o),t-=n}else if(s){let t=i,a=i+o-1;if(n<=t)e.remove(),u.remove(),r+=o;else if(n<=a){let t=a-n+1,i=o-t;this.updateBufferSize(e,i),this.updateBufferSize(u,i),r+=t}}i+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let s=Math.max(0,i-r),l=n-r;if(l<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let h=d?s:0,c=u?l:-1;if("unified"===t&&!Array.isArray(e))return this.trimColumnRows(e,h,c);if("split"===t&&Array.isArray(e)){let t=this.trimColumnRows(e[0],h,c),n=this.trimColumnRows(e[1],h,c);if(null!=e[0]&&null!=e[1]&&t!==n)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?t:n}throw console.error({diffStyle:t,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,i){function r(e){if(null==e)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}if("unified"===e)return r(t);{let e=r(n),t=r(i);return null!=e||null!=t?[e,t]:void 0}}applyBuffers(e,t){let{disableVirtualizationBuffers:n=!1}=this.options;if(n||null==t){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:s=!1,overflow:d="scroll",diffStyle:u="split"}=this.options,h={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:s,overflow:d,split:"unified"!==u&&null!=t&&null!=n,totalLines:i,customProperties:r};(0,l.arePrePropertiesEqual)(h,this.appliedPreAttributes)||((0,m.setPreNodeProperties)(e,h),this.appliedPreAttributes=h)}applyErrorToDOM(e,t){this.cleanupErrorWrapper();let n=this.getOrCreatePreNode(t);n.innerHTML="",n.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.innerHTML="",i.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let o=document.createElement("pre");o.dataset.errorStack="",o.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function ec(e){if(null!=e&&"element"===e.type)return e.children??[]}e.s(["FileDiff",0,eh],18750)},51404,e=>{"use strict";var t=e.i(27101),n=e.i(89107),i=e.i(92458),r=e.i(18750);let o=-1;var a=class extends r.FileDiff{__id=`little-virtualized-file-diff:${++o}`;top;height=0;metrics;heightCache=new Map;isVisible=!1;virtualizer;constructor(e,n,i,r,o=!1){super(e,r,o);const{hunkSeparators:a="line-info"}=this.options;this.virtualizer=n,this.metrics=function(e,n){let i={...t.DEFAULT_VIRTUAL_FILE_METRICS,...n};return i.hunkSeparatorHeight=function(e,t){if(null!=t)return t;switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}(e,n?.hunkSeparatorHeight),i}("function"==typeof a?"custom":a,i)}getLineHeight(e,t=!1){let n=this.heightCache.get(e);return null!=n?n:this.metrics.lineHeight*(t?2:1)}setOptions(e){if(null==e)return;let t=this.options.diffStyle,n=this.options.overflow,i=this.options.collapsed;super.setOptions(e),(t!==this.options.diffStyle||n!==this.options.overflow||i!==this.options.collapsed)&&(this.heightCache.clear(),this.computeApproximateSize(),this.renderRange=void 0),this.virtualizer.instanceChanged(this)}reconcileHeights(){let{overflow:e="scroll"}=this.options;if(null!=this.fileContainer&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),null==this.fileContainer||null==this.fileDiff){this.height=0;return}if("scroll"===e&&0===this.lineAnnotations.length&&!this.virtualizer.config.resizeDebugging)return;let t=this.getDiffStyle(),n=!1;for(let e of"split"===t?[this.codeDeletions,this.codeAdditions]:[this.codeUnified]){if(null==e)continue;let i=e.children[1];if(i instanceof HTMLElement)for(let e of i.children){if(!(e instanceof HTMLElement))continue;let i=e.dataset.lineIndex;if(null==i)continue;let r=function(e,t){let[n,i]=e.split(",").map(Number);return"split"===t?i:n}(i,t),o=e.getBoundingClientRect().height,a=!1;e.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in e.nextElementSibling.dataset||"noNewline"in e.nextElementSibling.dataset)&&("noNewline"in e.nextElementSibling.dataset&&(a=!0),o+=e.nextElementSibling.getBoundingClientRect().height),o!==this.getLineHeight(r,a)&&(n=!0,o===this.metrics.lineHeight*(a?2:1)?this.heightCache.delete(r):this.heightCache.set(r,o))}}(n||this.virtualizer.config.resizeDebugging)&&this.computeApproximateSize()}onRender=e=>null!=this.fileContainer&&(e&&(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer)),this.render());cleanUp(){null!=this.fileContainer&&this.virtualizer.disconnect(this.fileContainer),super.cleanUp()}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.computeApproximateSize(),this.renderRange=void 0,this.virtualizer.instanceChanged(this)};setVisibility(e){null!=this.fileContainer&&(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.virtualizer.getOffsetInScrollContainer(this.fileContainer),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}computeApproximateSize(){let e=0===this.height;if(this.height=0,null==this.fileDiff)return;let{disableFileHeader:i=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:a=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,hunkSeparators:s="line-info"}=this.options,{diffHeaderHeight:l,fileGap:d,hunkSeparatorHeight:u}=this.metrics,h=this.getDiffStyle(),c="simple"!==s&&"metadata"!==s&&"line-info-basic"!==s?d:0;if(i?"simple"!==s&&"metadata"!==s&&(this.height+=d):this.height+=l,!o&&((0,n.iterateOverDiff)({diff:this.fileDiff,diffStyle:h,expandedHunks:!!r||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:i,additionLine:r})=>{let o=null!=r?r.splitLineIndex:i.splitLineIndex,a=null!=r?r.unifiedLineIndex:i.unifiedLineIndex,l=(r?.noEOFCR??!1)||(i?.noEOFCR??!1);t>0&&(e>0&&(this.height+=c),this.height+=u+c),this.height+=this.getLineHeight("split"===h?o:a,l),n>0&&"simple"!==s&&(this.height+=c+u)}}),this.fileDiff.hunks.length>0&&(this.height+=d),null!=this.fileContainer&&this.virtualizer.config.resizeDebugging&&!e)){let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,...o}={}){let a=null==this.fileContainer;if(this.fileDiff??=r??(null!=t&&null!=n?(0,i.parseDiffFromFile)(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),null==this.fileDiff)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(a?(this.computeApproximateSize(),this.virtualizer.connect(e,this),this.top??=this.virtualizer.getOffsetInScrollContainer(e),this.isVisible=this.virtualizer.isInstanceVisible(this.top,this.height)):this.top??=this.virtualizer.getOffsetInScrollContainer(e),!this.isVisible)return this.renderPlaceholder(this.height);let s=this.virtualizer.getWindowSpecs(),l=this.computeRenderRangeFromWindow(this.fileDiff,this.top,s);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:l,oldFile:t,newFile:n,...o})}getDiffStyle(){return this.options.diffStyle??"split"}getExpandedRegion(e,n,i){if(i<=0||e)return{fromStart:0,fromEnd:0,collapsedLines:Math.max(i,0),renderAll:!1};let{expandUnchanged:r=!1,collapsedContextThreshold:o=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD}=this.options;if(r||i<=o)return{fromStart:i,fromEnd:0,collapsedLines:0,renderAll:!0};let a=this.hunksRenderer.getExpandedHunk(n),s=Math.min(Math.max(a.fromStart,0),i),l=Math.min(Math.max(a.fromEnd,0),i),d=s+l;return{fromStart:s,fromEnd:l,collapsedLines:Math.max(i-d,0),renderAll:d>=i}}getExpandedLineCount(e,t){var n;let i,r=0;if(e.isPartial){for(let n of e.hunks)r+="split"===t?n.splitLineCount:n.unifiedLineCount;return r}for(let[n,i]of e.hunks.entries()){r+="split"===t?i.splitLineCount:i.unifiedLineCount;let o=Math.max(i.collapsedBefore,0),{fromStart:a,fromEnd:s,renderAll:l}=this.getExpandedRegion(e.isPartial,n,o);o>0&&(r+=l?o:a+s)}let o=e.hunks.at(-1);if(null!=o&&null!=(i=(n=e).hunks.at(-1))&&!n.isPartial&&0!==n.additionLines.length&&0!==n.deletionLines.length&&(i.additionLineIndex+i.additionCount<n.additionLines.length||i.deletionLineIndex+i.deletionCount<n.deletionLines.length)){let t=e.additionLines.length-(o.additionLineIndex+o.additionCount),n=e.deletionLines.length-(o.deletionLineIndex+o.deletionCount);if(null!=o&&t!==n)throw Error(`VirtualizedFileDiff: trailing context mismatch (additions=${t}, deletions=${n}) for ${e.name}`);let i=Math.min(t,n);if(null!=o&&i>0){let{fromStart:t,renderAll:n}=this.getExpandedRegion(e.isPartial,e.hunks.length,i);r+=n?i:t}}return r}computeRenderRangeFromWindow(e,i,{top:r,bottom:o}){let a,s,l,{disableFileHeader:d=!1,expandUnchanged:u=!1,collapsedContextThreshold:h=t.DEFAULT_COLLAPSED_CONTEXT_THRESHOLD,hunkSeparators:c="line-info"}=this.options,{diffHeaderHeight:f,fileGap:p,hunkLineCount:g,hunkSeparatorHeight:m,lineHeight:b}=this.metrics,v=this.getDiffStyle(),y=this.height,C=this.getExpandedLineCount(e,v),k=d?p:f;if(i<r-y||i>o)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-k-p};if(C<=g||0===e.hunks.length)return{startingLine:0,totalLines:g,bufferBefore:0,bufferAfter:0};let S=Math.ceil(Math.ceil(Math.max(o-r,0)/b)/g)*g+g,x=S/g,w=[],A=(r+o)/2,L="simple"===c||"metadata"===c||"line-info-basic"===c?0:p,E=i+k,T=0;if((0,n.iterateOverDiff)({diff:e,diffStyle:v,expandedHunks:!!u||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:h,callback:({hunkIndex:e,collapsedBefore:t,collapsedAfter:n,deletionLine:d,additionLine:u})=>{let h=null!=u?u.splitLineIndex:d.splitLineIndex,f=null!=u?u.unifiedLineIndex:d.unifiedLineIndex,p=(u?.noEOFCR??!1)||(d?.noEOFCR??!1),b=t>0?m+L+(e>0?L:0):0;0===e&&"simple"===c&&(b=0),E+=b;let y=T%g==0;if(y&&(w.push(E-(i+k+b)),null!=l)){if(l<=0)return!0;l--}let C=this.getLineHeight("split"===v?h:f,p),S=Math.floor(T/g);return E>r-C&&E<o&&(a??=S),null==s&&E+C>A&&(s=S),null==l&&E>=o&&y&&(l=x),T++,E+=C,n>0&&"simple"!==c&&(E+=m+L),!1}}),null==a)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:y-k-p};let I=w.length,R=Math.round((s??=a)-x/2),_=Math.max(0,Math.min(R,Math.max(0,I-x))),M=R<0?S+R*g:S,N=w[_]??0,D=_+M/g;return{startingLine:_*g,totalLines:M,bufferBefore:N,bufferAfter:D<w.length?y-k-w[D]-p:y-(E-i)-p}}};e.s(["VirtualizedFileDiff",0,a],51404)},7871,e=>{"use strict";var t=e.i(22300);e.s(["getSingularPatch",0,function(e){let n=(0,t.parsePatchFiles)(e);if(1!==n.length)throw console.error(n),Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");let{files:i}=n[0];if(1!==i.length)throw console.error(i),Error("FileDiff: Provided patch must contain exactly 1 file diff");return i[0]}])},38401,73810,e=>{"use strict";var t=e.i(27101),n=e.i(6104),i=e.i(10923),r=e.i(1376),o=e.i(22151),a=class extends i.DiffHunksRenderer{pendingConflictActions=[];pendingMarkerRows=[];injectedRows=new Map;options;constructor(e={theme:t.DEFAULT_THEMES},n,i){super(void 0,n,i),this.options=e}setConflictState(e,t,n){this.pendingConflictActions=e,this.pendingMarkerRows=t,this.syncInjectedRows(e,t,n)}syncInjectedRows(e,t,n){for(let t of(this.injectedRows.clear(),e)){let e=null!=t?(0,o.getMergeConflictActionAnchor)(t,n):void 0;if(null==t||null==e)continue;let i={type:"actions",hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:t.conflictIndex};this.addInjectedRow(i)}for(let e of t)this.addInjectedRow(e)}addInjectedRow(e){let t=`${e.hunkIndex}:${e.lineIndex}`,n=this.injectedRows.get(t);null==n?this.injectedRows.set(t,[e]):n.push(e)}renderDiff(e,n=t.DEFAULT_RENDER_RANGE){return null!=e&&this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.renderDiff(e,n)}async asyncRender(e,n=t.DEFAULT_RENDER_RANGE){return this.syncInjectedRows(this.pendingConflictActions,this.pendingMarkerRows,e),super.asyncRender(e,n)}createPreElement(e,t){return super.createPreElement(e,t,{"data-has-merge-conflict":""})}getUnifiedLineDecoration({type:e,lineType:t}){let n="change"===e?"change-deletion"===t?"current":"incoming":void 0;return{gutterLineType:"change"===e?"context":t,gutterProperties:s(n),contentProperties:l(e,n)}}getSplitLineDecoration({side:e,type:t}){let n="change"===t?"deletions"===e?"current":"incoming":void 0;return{gutterLineType:"change"===t?"context":t,gutterProperties:s(n),contentProperties:l(t,n)}}getUnifiedInjectedRowsForLine=e=>{let t=this.injectedRows.get(`${e.hunkIndex}:${e.lineIndex}`);if(null==t||0===t.length)return;let{mergeConflictActionsType:i}=this.getOptionsWithDefaults(),o=[],a=[];for(let e of t){var s;if("actions"===e.type){o.push({content:function({row:e,includeDefaultActions:t,includeSlot:i}){var o;let a=t?[u({resolution:"current",label:"Accept current change",conflictIndex:o=e.conflictIndex}),h(),u({resolution:"incoming",label:"Accept incoming change",conflictIndex:o}),h(),u({resolution:"both",label:"Accept both",conflictIndex:o})]:[];return i&&a.push((0,n.createHastElement)({tagName:"slot",properties:{name:(0,r.getMergeConflictActionSlotName)({hunkIndex:e.hunkIndex,lineIndex:e.lineIndex,conflictIndex:e.conflictIndex}),"data-merge-conflict-action-slot":""}})),(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict-actions":""},children:[(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict-actions-content":""},children:a})]})}({row:e,includeDefaultActions:"default"===i,includeSlot:!0}),gutter:d("action")});continue}("marker-end"===e.type?a:o).push({content:(s=e,(0,n.createHastElement)({tagName:"div",properties:{"data-merge-conflict":s.type,"data-merge-conflict-marker-row":""},children:[(0,n.createTextNodeElement)(s.lineText.replace(/(?:\r\n|\n|\r)$/,""))]})),gutter:d("marker",e.type)})}return{before:o.length>0?o:void 0,after:a.length>0?a:void 0}};getOptionsWithDefaults(){let e=super.getOptionsWithDefaults();return e.diffStyle="unified",e.lineDiffType="none",e.mergeConflictActionsType=this.options.mergeConflictActionsType??"default",e}};function s(e){return null!=e?{"data-merge-conflict":e}:void 0}function l(e,t){if(null!=t){if("change"===e)return"current"===t||"incoming"===t?{"data-line-type":"context","data-merge-conflict":t}:void 0;if("marker-start"===t||"marker-base"===t||"marker-separator"===t||"marker-end"===t)return{"data-merge-conflict":t}}}function d(e,t){let i=(0,n.createGutterGap)(void 0,"annotation",1);return i.properties["data-gutter-buffer"]="action"===e?"merge-conflict-action":`merge-conflict-${t??"marker"}`,i}function u({resolution:e,label:t,conflictIndex:i}){return(0,n.createHastElement)({tagName:"button",properties:{type:"button","data-merge-conflict-action":e,"data-merge-conflict-conflict-index":`${i}`},children:[(0,n.createTextNodeElement)(t)]})}function h(){return(0,n.createHastElement)({tagName:"span",properties:{"data-merge-conflict-action-separator":""},children:[(0,n.createTextNodeElement)("|")]})}e.s(["UnresolvedFileHunksRenderer",0,a],38401),e.s(["areMergeConflictActionsEqual",0,function(e,t){var n,i;return e.hunkIndex===t.hunkIndex&&e.startContentIndex===t.startContentIndex&&e.endContentIndex===t.endContentIndex&&e.currentContentIndex===t.currentContentIndex&&e.baseContentIndex===t.baseContentIndex&&e.incomingContentIndex===t.incomingContentIndex&&e.endMarkerContentIndex===t.endMarkerContentIndex&&e.conflictIndex===t.conflictIndex&&(n=e.conflict,i=t.conflict,n.conflictIndex===i.conflictIndex&&n.startLineIndex===i.startLineIndex&&n.startLineNumber===i.startLineNumber&&n.separatorLineIndex===i.separatorLineIndex&&n.separatorLineNumber===i.separatorLineNumber&&n.endLineIndex===i.endLineIndex&&n.endLineNumber===i.endLineNumber&&n.baseMarkerLineIndex===i.baseMarkerLineIndex&&n.baseMarkerLineNumber===i.baseMarkerLineNumber)}],73810)},89221,e=>{"use strict";e.s(["normalizeDiffResolution",0,function(e){let t="string"==typeof e?e:e.type;return"accept"===t||"incoming"===t?"additions":"reject"===t||"current"===t?"deletions":"both"}])},52861,e=>{"use strict";function t(e,t,n,i,r,o){for(let a=0;a<o;a++){let o=t[i+a],s=n[r+a];if(null==o||null==s)throw Error("pushCollapsedContextLines: missing collapsed context line");e.deletionLines.push(o),e.additionLines.push(s)}}function n(e,t,n,i){if("context"===e.type)for(let n=0;n<e.lines;n++){let r=i[e.additionLineIndex+n];if(null==r)throw console.error({additionLines:i,content:e,i:n}),Error("pushContentLinesToDiff: Context line does not exist");t.deletionLines.push(r),t.additionLines.push(r)}else{let r=Math.max(e.deletions,e.additions);for(let o=0;o<r;o++){if(o<e.deletions){let i=n[e.deletionLineIndex+o];if(null==i)throw console.error({deletionLines:n,content:e,i:o}),Error("pushContentLinesToDiff: Deletion line does not exist");t.deletionLines.push(i)}if(o<e.additions){let n=i[e.additionLineIndex+o];if(null==n)throw console.error({additionLines:i,content:e,i:o}),Error("pushContentLinesToDiff: Addition line does not exist");t.additionLines.push(n)}}}}function i(e,t,n){"context"===e.type?(t.nextAdditionLineIndex+=e.lines,t.nextDeletionLineIndex+=e.lines,t.nextAdditionStart+=e.lines,t.nextDeletionStart+=e.lines,t.splitLineCount+=e.lines,t.unifiedLineCount+=e.lines,n.additionCount+=e.lines,n.deletionCount+=e.lines,n.splitLineCount+=e.lines,n.unifiedLineCount+=e.lines):(t.nextAdditionLineIndex+=e.additions,t.nextDeletionLineIndex+=e.deletions,t.nextAdditionStart+=e.additions,t.nextDeletionStart+=e.deletions,t.splitLineCount+=Math.max(e.deletions,e.additions),t.unifiedLineCount+=e.deletions+e.additions,n.deletionCount+=e.deletions,n.deletionLines+=e.deletions,n.additionCount+=e.additions,n.additionLines+=e.additions,n.splitLineCount+=Math.max(e.deletions,e.additions),n.unifiedLineCount+=e.deletions+e.additions)}e.s(["resolveRegion",0,function(e,r){let{resolution:o,hunkIndex:a,startContentIndex:s,endContentIndex:l,indexesToDelete:d=new Set}=r,u=e.hunks[a];if(null==u)throw console.error({diff:e,hunkIndex:a}),Error(`resolveRegion: Invalid hunk index: ${a}`);if(s<0||l>=u.hunkContent.length||s>l)throw Error(`resolveRegion: Invalid content range, ${s}, ${l}`);let{hunks:h,additionLines:c,deletionLines:f}=e,p={...e,hunks:[],deletionLines:[],additionLines:[],splitLineCount:0,unifiedLineCount:0,cacheKey:null!=e.cacheKey?`${e.cacheKey}:${o[0]}-${a}:${s}-${l}`:void 0},g={nextAdditionLineIndex:0,nextDeletionLineIndex:0,nextAdditionStart:1,nextDeletionStart:1,splitLineCount:0,unifiedLineCount:0},m=a===h.length-1&&l===u.hunkContent.length-1,b=!e.isPartial;for(let[r,u]of h.entries()){var v,y,C,k,S,x,w;v=e,y=p,C=g,k=u.deletionLineIndex-u.collapsedBefore,S=u.additionLineIndex-u.collapsedBefore,x=u.collapsedBefore,w=b,x<=0||(w&&(t(y,v.deletionLines,v.additionLines,k,S,x),C.nextAdditionLineIndex+=x,C.nextDeletionLineIndex+=x),C.nextAdditionStart+=x,C.nextDeletionStart+=x,C.splitLineCount+=x,C.unifiedLineCount+=x);let h={...u,hunkContent:[],additionStart:g.nextAdditionStart,deletionStart:g.nextDeletionStart,additionLineIndex:g.nextAdditionLineIndex,deletionLineIndex:g.nextDeletionLineIndex,additionCount:0,deletionCount:0,deletionLines:0,additionLines:0,splitLineStart:g.splitLineCount,unifiedLineStart:g.unifiedLineCount,splitLineCount:0,unifiedLineCount:0};for(let[e,t]of u.hunkContent.entries())if(r!==a||e<s||e>l){n(t,p,f,c);let e={...t,additionLineIndex:g.nextAdditionLineIndex,deletionLineIndex:g.nextDeletionLineIndex};h.hunkContent.push(e),i(e,g,h)}else if(d.has(e))h.hunkContent.push({type:"context",lines:0,deletionLineIndex:g.nextDeletionLineIndex,additionLineIndex:g.nextAdditionLineIndex});else if("context"===t.type){n(t,p,f,c);let e={...t,deletionLineIndex:g.nextDeletionLineIndex,additionLineIndex:g.nextAdditionLineIndex};h.hunkContent.push(e),i(e,g,h)}else{var A=o,L=t,E=p,T=f,I=c;if("deletions"===A||"both"===A)for(let e=0;e<L.deletions;e++){let t=T[L.deletionLineIndex+e];if(null==t)throw console.error({deletionLines:T,content:L,i:e}),Error("pushResolveLinesToDiff: Deletion line does not exist");E.deletionLines.push(t),E.additionLines.push(t)}if("additions"===A||"both"===A)for(let e=0;e<L.additions;e++){let t=I[L.additionLineIndex+e];if(null==t)throw console.error({additionLines:I,content:L,i:e}),Error("pushResolveLinesToDiff: Addition line does not exist");E.deletionLines.push(t),E.additionLines.push(t)}let e={type:"context",lines:"deletions"===o?t.deletions:"additions"===o?t.additions:t.deletions+t.additions,deletionLineIndex:g.nextDeletionLineIndex,additionLineIndex:g.nextAdditionLineIndex};h.hunkContent.push(e),i(e,g,h)}if(r===a&&m){let e="deletions"===o?u.noEOFCRDeletions:u.noEOFCRAdditions;h.noEOFCRAdditions=e,h.noEOFCRDeletions=e}p.hunks.push(h)}let R=h.at(-1);return null==R||e.isPartial||t(p,f,c,R.deletionLineIndex+R.deletionCount,R.additionLineIndex+R.additionCount,Math.min(f.length-(R.deletionLineIndex+R.deletionCount),c.length-(R.additionLineIndex+R.additionCount))),p.splitLineCount=g.splitLineCount,p.unifiedLineCount=g.unifiedLineCount,p}])},7256,e=>{"use strict";var t=e.i(89221),n=e.i(52861);e.s(["resolveConflict",0,function(e,i,r){var o;let a;return(0,n.resolveRegion)(e,{resolution:(0,t.normalizeDiffResolution)(r),hunkIndex:i.hunkIndex,startContentIndex:i.startContentIndex,endContentIndex:i.endContentIndex,indexesToDelete:(o=i,a=new Set,null!=o.baseContentIndex&&a.add(o.baseContentIndex),o.endMarkerContentIndex!==o.endContentIndex&&a.add(o.endMarkerContentIndex),a)})}])},84745,e=>{"use strict";var t=e.i(27101),n=e.i(22671),i=e.i(59390),r=e.i(60166),o=e.i(93946),a=e.i(18750),s=e.i(1376),l=e.i(22151),d=e.i(38401),u=e.i(73810),h=e.i(7256);let c=-1;var f=class extends a.FileDiff{__id=`unresolved-file:${++c}`;computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0};conflictActions=[];markerRows=[];conflictActionCache=new Map;constructor(e={theme:t.DEFAULT_THEMES},n,i=!1){super(void 0,n,i),this.options=e,this.setOptions(e)}setOptions(e){if(null==e)return;if(null!=e.onMergeConflictAction&&null!=e.onMergeConflictResolve)throw Error("UnresolvedFile: onMergeConflictAction and onMergeConflictResolve are mutually exclusive. Use only one callback.");this.options=e,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e));let t=this.options.hunkSeparators??"line-info";this.interactionManager.setOptions((0,n.pluckInteractionOptions)(this.options,"function"==typeof t||"line-info"===t||"line-info-basic"===t?this.expandHunk:void 0,this.getLineIndex,this.handleMergeConflictActionClick))}createHunksRenderer(e){return new d.UnresolvedFileHunksRenderer(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getHunksRendererOptions(e){return p(e,this.options)}applyPreNodeAttributes(e,t){super.applyPreNodeAttributes(e,t,{"data-has-merge-conflict":""})}cleanUp(){this.clearMergeConflictActionCache(),this.computedCache={file:void 0,fileDiff:void 0,actions:void 0,markerRows:void 0},this.conflictActions=[],super.cleanUp()}getOrComputeDiff({file:e,fileDiff:t,actions:n,markerRows:i}){let{maxContextLines:o,onMergeConflictAction:a}=this.options;t:if(null!=a){let a=null!=t;if(a!==(null!=n)||a!==(null!=i))throw Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows must be passed together");if(null!=t&&null!=n&&null!=i){this.computedCache={file:e??this.computedCache.file,fileDiff:t,actions:n,markerRows:i};break t}if(null!=e||null!=this.computedCache.file){if(null!=e&&null!=this.computedCache.file&&!(0,r.areFilesEqual)(e,this.computedCache.file)&&null!=this.computedCache.fileDiff&&null!=this.computedCache.actions)throw Error("UnresolvedFile.getOrComputeDiff: file can only be used to initialize unresolved state once. Pass fileDiff and actions for subsequent updates.");if(null==(e??=this.computedCache.file))throw Error("UnresolvedFile.getOrComputeDiff: file is null, should be impossible");if(!(0,r.areFilesEqual)(e,this.computedCache.file)||null==this.computedCache.fileDiff||null==this.computedCache.actions){let t=(0,l.parseMergeConflictDiffFromFile)(e,o);this.computedCache={file:e,fileDiff:t.fileDiff,actions:t.actions,markerRows:t.markerRows}}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}else{if(null!=t||null!=n||null!=i)throw Error("UnresolvedFile.getOrComputeDiff: fileDiff, actions, and markerRows are only usable in controlled mode, you must pass in `onMergeConflictAction`");if(null!=e&&null!=this.computedCache.file&&!(0,r.areFilesEqual)(e,this.computedCache.file))throw Error("UnresolvedFile.getOrComputeDiff: uncontrolled unresolved files parse the file only once. Later updates must come from the cached diff state.");if(this.computedCache.file??=e,null==this.computedCache.fileDiff&&null!=this.computedCache.file){let e=(0,l.parseMergeConflictDiffFromFile)(this.computedCache.file,o);this.computedCache.fileDiff=e.fileDiff,this.computedCache.actions=e.actions,this.computedCache.markerRows=e.markerRows}t=this.computedCache.fileDiff,n=this.computedCache.actions,i=this.computedCache.markerRows;break t}if(null!=t&&null!=n&&null!=i)return{fileDiff:t,actions:n,markerRows:i}}hydrate(e){let{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,fileContainer:a,prerenderedHTML:s,preventEmit:l=!1}=e,d=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});null!=d&&(this.hydrateElements(a,s),this.setActiveMergeConflictState(d.actions,d.markerRows),null==this.pre?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:d.fileDiff,lineAnnotations:o}),this.renderMergeConflictActionSlots(),l||this.emitPostRender())}rerender(){this.enabled&&null!=this.fileDiff&&this.render({forceRender:!0,renderRange:this.renderRange})}render(e={}){let{file:t,fileDiff:n,actions:i,markerRows:r,lineAnnotations:o,preventEmit:a=!1,...s}=e,l=this.getOrComputeDiff({file:t,fileDiff:n,actions:i,markerRows:r});if(null==l)return!1;this.setActiveMergeConflictState(l.actions,l.markerRows);let d=super.render({...s,fileDiff:l.fileDiff,lineAnnotations:o,preventEmit:!0});return d&&(this.renderMergeConflictActionSlots(),a||this.emitPostRender()),d}resolveConflict(e,t,n=this.computedCache.fileDiff){let r=this.conflictActions[e];if(null==n||null==r)return;if(r.conflictIndex!==e)throw console.error({conflictIndex:e,action:r}),Error("UnresolvedFile.resolveConflict: conflictIndex and conflictAction don't match");let o=(0,h.resolveConflict)(n,r,t),a=this.computedCache.file,{file:s,actions:d,markerRows:u}=function({fileDiff:e,previousActions:t,resolvedConflictIndex:n,previousFile:r,resolution:o}){var a,s,d,u,h,c;let f,p,g,m=t[n];if(null==m)throw Error("rebuildFileAndActions: missing resolved action for unresolved file rebuild");let b=(a=t,s=n,d=m,u=o,g=(h=d.conflict,c=u,f=(h.baseMarkerLineIndex??h.separatorLineIndex)-h.startLineIndex-1,p=h.endLineIndex-h.separatorLineIndex-1,("current"===c?f:"incoming"===c?p:f+p)-(h.endLineIndex-h.startLineIndex+1)),a.map((e,t)=>{if(t!==s&&null!=e){var n,i;return e.conflict.startLineIndex>d.conflict.endLineIndex?{...e,conflict:(n=e.conflict,i=g,{...n,startLineIndex:n.startLineIndex+i,startLineNumber:n.startLineNumber+i,separatorLineIndex:n.separatorLineIndex+i,separatorLineNumber:n.separatorLineNumber+i,endLineIndex:n.endLineIndex+i,endLineNumber:n.endLineNumber+i,baseMarkerLineIndex:null!=n.baseMarkerLineIndex?n.baseMarkerLineIndex+i:void 0,baseMarkerLineNumber:null!=n.baseMarkerLineNumber?n.baseMarkerLineNumber+i:void 0})}:e}})),v=(0,l.buildMergeConflictMarkerRows)(e,b);return{file:function({resolvedAction:e,resolvedConflictIndex:t,previousFile:n,fileDiff:r,resolution:o}){var a,s,l;let d,u,h=(0,i.splitFileContents)(n?.contents??""),{conflict:c}=e,f=(a=h,s=c,l=o,d=a.slice(s.startLineIndex+1,s.baseMarkerLineIndex??s.separatorLineIndex),u=a.slice(s.separatorLineIndex+1,s.endLineIndex),"current"===l?d:"incoming"===l?u:[...d,...u]),p=[...h.slice(0,c.startLineIndex),...f,...h.slice(c.endLineIndex+1)].join("");return{name:n?.name??r.name,contents:p,cacheKey:n?.cacheKey!=null?`${n.cacheKey}:mc-${t}-${o}`:void 0}}({fileDiff:e,resolvedAction:m,resolvedConflictIndex:n,previousFile:r,resolution:o}),actions:b,markerRows:v}}({fileDiff:o,previousActions:this.conflictActions,resolvedConflictIndex:e,previousFile:a,resolution:t});return{file:s,fileDiff:o,actions:d,markerRows:u}}resolveConflictAndRender(e,t){let n=this.conflictActions[e];if(null==n)return;if(n.conflictIndex!==e)throw console.error({conflictIndex:e,action:n}),Error("UnresolvedFile.resolveConflictAndRender: conflictIndex and conflictAction don't match");let i={resolution:t,conflict:n.conflict},{file:r,fileDiff:o,actions:a,markerRows:s}=this.resolveConflict(e,t)??{};null!=r&&null!=o&&null!=a&&null!=s&&(this.computedCache={file:r,fileDiff:o,actions:a,markerRows:s},this.setActiveMergeConflictState(a,s),null!=this.workerManager?this.hunksRenderer.renderDiff(o):this.render({forceRender:!0}),this.options.onMergeConflictResolve?.(r,i))}setActiveMergeConflictState(e=this.conflictActions,t=this.markerRows){this.conflictActions=e,this.markerRows=t,null!=this.computedCache.fileDiff&&this.hunksRenderer instanceof d.UnresolvedFileHunksRenderer&&this.hunksRenderer.setConflictState("none"===this.options.mergeConflictActionsType?[]:e,t,this.computedCache.fileDiff)}handleMergeConflictActionClick=e=>{let t=this.conflictActions[e.conflictIndex];if(null==t)return;if(t.conflictIndex!==e.conflictIndex)throw console.error({conflictIndex:e.conflictIndex,action:t}),Error("UnresolvedFile.handleMergeConflictActionClick: conflictIndex and conflictAction don't match");let n={resolution:e.resolution,conflict:t.conflict};null!=this.options.onMergeConflictAction?this.options.onMergeConflictAction(n,this):this.resolveConflictAndRender(e.conflictIndex,e.resolution)};renderMergeConflictActionSlots(){let{fileDiff:e}=this.computedCache;if(this.isContainerManaged||null==this.fileContainer||"function"!=typeof this.options.mergeConflictActionsType||0===this.conflictActions.length||null==e)return void this.clearMergeConflictActionCache();let t=new Map(this.conflictActionCache);for(let n=0;n<this.conflictActions.length;n++){let i=this.conflictActions[n];if(null==i)continue;if(i.conflictIndex!==n)throw console.error({conflictIndex:n,action:i}),Error("UnresolvedFile.renderMergeConflictActionSlots: conflictIndex and conflictAction don't match");let r=(0,l.getMergeConflictActionAnchor)(i,e);if(null==r)continue;let a=i.conflictIndex,d=(0,s.getMergeConflictActionSlotName)({hunkIndex:r.hunkIndex,lineIndex:r.lineIndex,conflictIndex:a}),h=`${n}-${d}`,c=this.conflictActionCache.get(h);if(null==c||!(0,u.areMergeConflictActionsEqual)(c.action,i)){c?.element.remove();let e=this.renderMergeConflictAction(i);if(null==e)continue;let t=(0,o.createAnnotationWrapperNode)(d);t.appendChild(e),this.fileContainer.appendChild(t),c={element:t,action:i},this.conflictActionCache.set(h,c)}t.delete(h)}for(let[e,{element:n}]of t.entries())this.conflictActionCache.delete(e),n.remove()}renderMergeConflictAction(e){if("function"!=typeof this.options.mergeConflictActionsType)return;let t=this.options.mergeConflictActionsType(e,this);if(null!=t){if(t instanceof HTMLElement)return t;if("u">typeof DocumentFragment&&t instanceof DocumentFragment){let e=document.createElement("div");return e.style.display="contents",e.appendChild(t),e}}}clearMergeConflictActionCache(){for(let{element:e}of this.conflictActionCache.values())e.remove();this.conflictActionCache.clear()}};function p(e,t){return{...t,...e,hunkSeparators:"function"==typeof e?.hunkSeparators?"custom":e?.hunkSeparators,mergeConflictActionsType:"function"==typeof e?.mergeConflictActionsType?"custom":e?.mergeConflictActionsType}}e.s(["UnresolvedFile",0,f,"getUnresolvedDiffHunksRendererOptions",0,p])}]);