getborg 0.0.124 → 0.0.126

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 (75) hide show
  1. package/dist/bin.mjs +4900 -2407
  2. package/dist/client/.vite/manifest.json +359 -359
  3. package/dist/client/assets/{ArrowRight-D8u8fAtz.js → ArrowRight-sXL3WqRj.js} +2 -2
  4. package/dist/client/assets/{ArrowSquareOut-B_f6YUhV.js → ArrowSquareOut-BXw7kBJ2.js} +2 -2
  5. package/dist/client/assets/{ArrowsClockwise-DQYZ1Xbo.js → ArrowsClockwise-C2ZJkkb1.js} +2 -2
  6. package/dist/client/assets/{CaretLeft-CfrkuxuJ.js → CaretLeft-u94enBjz.js} +2 -2
  7. package/dist/client/assets/{ChatMarkdown-Ch9PipMk.js → ChatMarkdown-PlWZFDnz.js} +5 -5
  8. package/dist/client/assets/{CircleNotch-BcVOnWaH.js → CircleNotch-DqcpMoTY.js} +2 -2
  9. package/dist/client/assets/{DesignWorkspace-CrijZIpE.js → DesignWorkspace-DmKoQxKI.js} +3 -3
  10. package/dist/client/assets/DiffPanel-D77xCxTK.js +2 -0
  11. package/dist/client/assets/{DiffWorkerPoolProvider-B-AH2sbL.js → DiffWorkerPoolProvider-ClROlLBb.js} +2 -2
  12. package/dist/client/assets/{DocxPreview-HXde7oD1.js → DocxPreview-HJVaPJXL.js} +4 -4
  13. package/dist/client/assets/{FilePreviewPanel-DkspqFyX.js → FilePreviewPanel-CFCxGnPA.js} +9 -9
  14. package/dist/client/assets/{HtmlPreview-pfh_hRgS.js → HtmlPreview-CJQuCP2x.js} +2 -2
  15. package/dist/client/assets/{PdfPreview-VSGe6F9I.js → PdfPreview-BgV8uugr.js} +3 -3
  16. package/dist/client/assets/{PptxPreview-CZZ5e7rI.js → PptxPreview-BVdzk7UG.js} +3 -3
  17. package/dist/client/assets/PreviewPanel-C8wYTZ3K.js +2 -0
  18. package/dist/client/assets/PullRequestCodeTab-6b-pnSLs.js +6 -0
  19. package/dist/client/assets/{PullRequestReactions-BJ4eU_08.js → PullRequestReactions-kdg3iZ85.js} +4 -4
  20. package/dist/client/assets/{RightPanelResizeHandle-XlC9gY5e.js → RightPanelResizeHandle-kUStdA3L.js} +2 -2
  21. package/dist/client/assets/{VirtualizedFile-qiRlyNDc.js → VirtualizedFile-DuJYdYdq.js} +2 -2
  22. package/dist/client/assets/{XlsxPreview-BPtt3tW-.js → XlsxPreview-Bi4rmMAb.js} +3 -3
  23. package/dist/client/assets/accountData-B88fzgQo.js +16 -0
  24. package/dist/client/assets/assetUrls-CF9bvkMB.js +2 -0
  25. package/dist/client/assets/assets-CkgNlvqv.js +2 -0
  26. package/dist/client/assets/{browserHistoryStore-CEVJXGfr.js → browserHistoryStore-DIuEAuCl.js} +3 -3
  27. package/dist/client/assets/{browserRecording-BavNt16V.js → browserRecording-2dQePGOK.js} +2 -2
  28. package/dist/client/assets/clientAnalytics-BbUHu8ei.js +1 -0
  29. package/dist/client/assets/{clientPersistenceStorage-CeJLSpQl.js → clientPersistenceStorage-DsdIKJBh.js} +2 -2
  30. package/dist/client/assets/{combobox-CQHB5X6j.js → combobox-DVmHwJKi.js} +2 -2
  31. package/dist/client/assets/{composerMentionDrag-CdTT1rUK.js → composerMentionDrag-CB6wqaTe.js} +2 -2
  32. package/dist/client/assets/{designCanvas.logic-DduGt5E7.js → designCanvas.logic-Ce5c0YLY.js} +4 -4
  33. package/dist/client/assets/{designOpenFileContext-CMKir5dG.js → designOpenFileContext-B0d1oDHN.js} +2 -2
  34. package/dist/client/assets/{diffFileContents-CHRsIT6_.js → diffFileContents-DuZ8MpUA.js} +2 -2
  35. package/dist/client/assets/{empty-DUUjhkFh.js → empty-d8cb8Ewx.js} +2 -2
  36. package/dist/client/assets/entities-DI7lpu_V.js +2 -0
  37. package/dist/client/assets/{followUpQueuePersistence-C_pFQCnT.js → followUpQueuePersistence-BL42ySpK.js} +1 -1
  38. package/dist/client/assets/{index-DrITfTBh.js → index-e-hiL6eh.js} +3 -3
  39. package/dist/client/assets/{input-CyCAHFxI.js → input-DzNFHo2W.js} +2 -2
  40. package/dist/client/assets/{lib-BRpsbmNP.js → lib-IA-5-mGB.js} +2 -2
  41. package/dist/client/assets/{main-C0iNAqq8.css → main-BM6qmGP4.css} +1 -1
  42. package/dist/client/assets/main-U2I6YwT-.js +169 -0
  43. package/dist/client/assets/{pdf-C3xMIdpt.js → pdf-Bh3amywC.js} +2 -2
  44. package/dist/client/assets/{popover-BXSj56CI.js → popover-DZf7p2yc.js} +2 -2
  45. package/dist/client/assets/{pptxDocument-BnTLF4HV.js → pptxDocument-Bsm1SylK.js} +2 -2
  46. package/dist/client/assets/{projectFilesQueryState-Cs5skZOc.js → projectFilesQueryState-DWDFHsif.js} +2 -2
  47. package/dist/client/assets/queries-B-YwYiCl.js +2 -0
  48. package/dist/client/assets/{scroll-area-DAaT-DGF.js → scroll-area-C5ps_bkR.js} +46 -46
  49. package/dist/client/assets/session-BKSQ__kZ.js +68 -0
  50. package/dist/client/assets/{spinner-K3N_kbJr.js → spinner-BYvweYT_.js} +2 -2
  51. package/dist/client/assets/textarea-bjEgsW0n.js +2 -0
  52. package/dist/client/assets/{toggle-Sui8J_p3.js → toggle-D4wtRT7F.js} +2 -2
  53. package/dist/client/assets/{toggle-group-BDgfPfOF.js → toggle-group-iSglhZY5.js} +2 -2
  54. package/dist/client/assets/useSettings-BgyJJ6VZ.js +5 -0
  55. package/dist/client/assets/{useWorkspaceMutationRefresh-ApasU6PB.js → useWorkspaceMutationRefresh-C-GODI1R.js} +2 -2
  56. package/dist/client/assets/utils-dD8AT1Cf.js +30 -0
  57. package/dist/client/assets/{xlsxDocument-SRKfhPKH.js → xlsxDocument-C12kQUhH.js} +2 -2
  58. package/dist/client/index.html +1 -1
  59. package/dist/service-launcher.mjs +20 -2
  60. package/dist/sharedChatWorker.mjs +21887 -0
  61. package/package.json +2 -1
  62. package/dist/client/assets/DiffPanel-Bbs-arXF.js +0 -2
  63. package/dist/client/assets/PreviewPanel-C_WqPJu_.js +0 -2
  64. package/dist/client/assets/PullRequestCodeTab-DLajHhi9.js +0 -6
  65. package/dist/client/assets/accountData-BKyjOPQm.js +0 -16
  66. package/dist/client/assets/assetUrls-33nMWFnF.js +0 -2
  67. package/dist/client/assets/assets-1BW7ZJgz.js +0 -2
  68. package/dist/client/assets/clientAnalytics-ChPHl8_D.js +0 -1
  69. package/dist/client/assets/entities-BtD3_L53.js +0 -2
  70. package/dist/client/assets/main-Bi6AoLeM.js +0 -167
  71. package/dist/client/assets/queries-BevoHPqY.js +0 -2
  72. package/dist/client/assets/session-Dmu9Hk5C.js +0 -68
  73. package/dist/client/assets/textarea-BT0tVWKM.js +0 -2
  74. package/dist/client/assets/useSettings-GEQSU1F5.js +0 -5
  75. package/dist/client/assets/utils-ClZ5OxbV.js +0 -30
@@ -1,4 +1,4 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-BKyjOPQm.js";import{Eo as r,Ho as i,zo as a}from"./utils-ClZ5OxbV.js";import{on as o}from"./session-Dmu9Hk5C.js";import{B as s,G as c,H as l,Jn as u,Mt as d,Nt as f,R as p,U as m,V as h,W as g,br as _,cr as v,dr as y,fr as b,gr as x,hr as S,sr as C,tr as w,yr as T,z as E}from"./scroll-area-DAaT-DGF.js";import{c as ee,n as D,o as O}from"./DiffWorkerPoolProvider-B-AH2sbL.js";import{r as k,t as A}from"./VirtualizedFile-qiRlyNDc.js";var j=e(n(),1),M=new Map([[`bold`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M100,28H64A20,20,0,0,0,44,48V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,100,28ZM96,204H68V52H96ZM192,28H156a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,192,28Zm-4,176H160V52h28Z`}))],[`duotone`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M112,48V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,112,48Zm80-8H152a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h40a8,8,0,0,0,8-8V48A8,8,0,0,0,192,40Z`,opacity:`0.2`}),j.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`fill`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M120,48V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V48A16,16,0,0,1,64,32h40A16,16,0,0,1,120,48Zm72-16H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Z`}))],[`light`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,34H64A14,14,0,0,0,50,48V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,104,34Zm2,174a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM192,34H152a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,192,34Zm2,174a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2Z`}))],[`regular`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`thin`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,36H64A12,12,0,0,0,52,48V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,104,36Zm4,172a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM192,36H152a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,192,36Zm4,172a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4Z`}))]]),te=new Map([[`bold`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,136H48a20,20,0,0,0-20,20v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V156A20,20,0,0,0,208,136Zm-4,52H52V160H204Zm4-144H48A20,20,0,0,0,28,64v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm-4,52H52V68H204Z`}))],[`duotone`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M216,152v40a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8H208A8,8,0,0,1,216,152Zm-8-96H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V64A8,8,0,0,0,208,56Z`,opacity:`0.2`}),j.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`fill`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M224,152v40a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V152a16,16,0,0,1,16-16H208A16,16,0,0,1,224,152ZM208,48H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Z`}))],[`light`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,138H48a14,14,0,0,0-14,14v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V152A14,14,0,0,0,208,138Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM208,50H48A14,14,0,0,0,34,64v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V64A14,14,0,0,0,208,50Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`}))],[`regular`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`thin`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,140H48a12,12,0,0,0-12,12v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V152A12,12,0,0,0,208,140Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM208,52H48A12,12,0,0,0,36,64v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V64A12,12,0,0,0,208,52Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z`}))]]),N=Object.defineProperty,P=Object.defineProperties,F=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B=(e,t)=>{for(var n in t||={})L.call(t,n)&&z(e,n,t[n]);if(I)for(var n of I(t))R.call(t,n)&&z(e,n,t[n]);return e},V=(e,t)=>P(e,F(t)),H=(0,j.forwardRef)((e,t)=>j.createElement(r,V(B({ref:t},e),{weights:M})));H.displayName=`Columns`;var ne=Object.defineProperty,U=Object.defineProperties,W=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,oe=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,se=(e,t)=>{for(var n in t||={})ie.call(t,n)&&oe(e,n,t[n]);if(re)for(var n of re(t))ae.call(t,n)&&oe(e,n,t[n]);return e},ce=(e,t)=>U(e,W(t)),le=(0,j.forwardRef)((e,t)=>j.createElement(r,ce(se({ref:t},e),{weights:te})));le.displayName=`Rows`;function ue(e,t){return e.length>0&&e.every(e=>t.has(e))}function de(e,t){return ue(e,t)?new Set:new Set(e)}function fe(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:pe(e.items,t.items)}function pe(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.version!==i.version)return!1}return!0}function me(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(v,``),t.before(r)):(r.setAttribute(C,``),t.after(r)),n?.observe(r),r}function he(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function G(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var ge=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),_e=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],ve=new Set([`useTokenTransformer`,`enableGutterUtility`,`enableLineSelection`,`lineHoverHighlight`]),ye=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],be=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],xe=Symbol(`CodeView.itemOptionsState`);function Se(e,t){Object.defineProperty(e,xe,{configurable:!1,enumerable:!1,value:t})}function K(e){return e[xe]}function q(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Ce=120,we=`--diffs-overflow-override`,J=12e6,Te=1e6,Ee=2e6,De=J-Ee,Oe=J-Te,ke=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),Ae=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=y;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:x},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??b}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??y.hunkLineCount,lineHeight:e?.lineHeight??y.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??y.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??y.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??S}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return T&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<1||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),ke&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(we,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Ce)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(we,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??me(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){h(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(_),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Fe(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return he()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncSelection(),this.syncItemEditors(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncSelection(),this.syncItemEditors()}setItems(e){if(e.length===0){let e=[];for(let t of this.itemEditors.values()){let{lastChange:n}=t.state;n!=null&&e.push(n)}this.reset();for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}else this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||this.reconcileItems(e);this.syncSelection(),this.syncItemEditors()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=je(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;Me(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!g(r,i),o=!g(n,this.getLayout());o&&this.syncLayout();let s=a||Ne(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||Pe(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),m(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){e.__STOP||(t?(h(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):l(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Be(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new D(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new A(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&s(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null;return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return this.options.createEditor!=null&&e.item.edit===!0&&e.item.collapsed!==!0}isReceiverEdited(e,t){let n=K(e);if(n==null)return!1;let r=this.getItemOptions(n,t);return r!=null&&this.isItemInEditMode(r)}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(n==null||e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t);if(r==null){let e={id:t},i=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(i==null)return;r={editor:i,state:e},this.itemEditors.set(t,r)}this.selectedLines?.id===t&&this.applySelectedLines(null,{notify:!1}),r.editor.edit(e.instance),this.attachedEditors.add(t)}syncItemEditors(){if(this.itemEditors.size===0)return;let e=[];for(let[t,n]of this.itemEditors){let r=this.idToItem.get(t);if(r!=null&&this.isItemInEditMode(r))continue;n.editor.cleanUp(),this.itemEditors.delete(t),this.attachedEditors.delete(t);let i=r?.item??n.state.lastChange?.item;i?.type===`diff`&&(r!=null&&r.type===`diff`&&r.instance.completeEditSession()&&(this.markItemLayoutDirty(r),this.render()),O(i.fileDiff));let{lastChange:a}=n.state;a!=null&&e.push(r==null?a:{...a,item:r.item})}for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of _e)ve.has(t)||q(e,t,()=>this.options[t]);q(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`file`)?!0:this.options.useTokenTransformer),q(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableGutterUtility),q(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableLineSelection),q(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`file`)?`disabled`:this.options.lineHoverHighlight),q(e,`stickyHeader`,()=>this.options.stickyHeaders),q(e,`collapsed`,e=>{let t=K(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`file`,t);for(let t of be)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of ge)ve.has(t)||q(e,t,()=>this.options[t]);q(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`diff`)?!0:this.options.useTokenTransformer),q(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableGutterUtility),q(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableLineSelection),q(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`diff`)?`disabled`:this.options.lineHoverHighlight),q(e,`stickyHeader`,()=>this.options.stickyHeaders),q(e,`hunkSeparators`,()=>this.options.hunkSeparators),q(e,`collapsed`,e=>{let t=K(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`diff`,t);for(let t of be)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return Se(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return Se(t,{id:e}),t}updateItemOptionsId(e,t){let n=K(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){q(e,n,e=>{if(this.options[n]==null)return;let r=K(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){q(e,n,e=>{if(this.options.enableLineSelection!==!0)return;let r=K(e);if(r==null)return;let i=this.getItemOptions(r,t);if(i!=null&&this.isItemInEditMode(i))return;let a=r.callbackCache??={},o=a[n];return o??(o=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),a[n]=o),o})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s;for(let c=0;c<e.length;c++){let l=e[c];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,c,0);d.index=c,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(s=Math.min(s??c,c))):s=Math.min(s??c,c),t[c]!==d&&(s=Math.min(s??c,c)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);s=Math.min(s??a,a)}s!=null&&(this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(s),this.scrollDirty=!0,this.render())}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>Oe}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),J):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=G(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=G(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>Oe&&t<i,o=n<Te&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(De,r):Ee):{pagedScrollTop:G(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=G(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ie(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ie(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=E({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Re(this.stickyContainer,t.element,h),n.virtualizedSetup(),Y(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Re(this.stickyContainer,t.element,h),Y(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=G(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null)return;let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{for(let t of e)if(t.target===this.stickyContainer){if(t.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){let e=this.getScrollTop(),t=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let n=t==null?void 0:this.resolveAnchoredScrollTop(t);if(n!=null){let t=n-e;this.applyScrollFix(n,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else if(t.target===this.header.element||t.target===this.footer.element){let e=t.target===this.header.element?this.header:this.footer,n=t.borderBoxSize[0].blockSize;if(n!==e.height){let t=this.getScrollTop(),r=this.getScrollAnchor(t);this.setHostHeight(e,n);let i=r==null?void 0:this.resolveAnchoredScrollTop(r);if(i!=null){let e=i-t;this.applyScrollFix(i,t,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.render()}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;if(e<=0)return;let{firstIndex:t,lastIndex:n,stickyTop:r,stickyBottom:i}=this.renderState;if(t===-1||n===-1)return;let a=this.getHeight();if(!(r===-1||i===-1))for(let r=t;r<=n;r++){let t=this.items[r];if(t==null)continue;let n=this.getItemTopOffset()+t.top;if(n+t.height<=e)continue;if(n>=e+a)break;if(n>=e)return{type:`item`,id:t.item.id,viewportOffset:n-e};let i=this.getScrollAnchorViewportTop(n,e)-n,o=t.instance.getNumericScrollAnchor(i);if(o!=null){let r=n+o.top;return{type:`line`,id:t.item.id,lineNumber:o.lineNumber,side:o.side,viewportOffset:r-e}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=G(this.clampScrollTop(e)),i=G(t),{scrollPageOffset:a}=this,o=G(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:G(this.getScrollTop())===G(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);fe(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function je(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function Me(e,t){return!d(e.theme??x,t.theme??x)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Ne(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Pe(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Fe(e){return e instanceof SVGElement?!0:p(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Ie(e){let t=Le(e.start,e.side),n=Le(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Le(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Y(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Re(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function ze(e){return(e.annotations?.length??0)>0}function Be(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)ze(t.item)&&i.push(t);return i.length>0?i:void 0}var X=e(a(),1),Z=i(),Ve=typeof window>`u`?j.useEffect:j.useLayoutEffect;function He(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function Ue(e,t){let{className:n,containerRef:r,createEditor:i,disableWorkerPool:a=!1,initialItems:o,items:s,onItemEditChange:l,onItemEditComplete:u,onScroll:d,onSelectedLinesChange:p,options:h,renderAnnotation:g,renderCodeViewFooter:_,renderCodeViewHeader:v,renderCustomHeader:y,renderGutterUtility:b,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderHeaderPrefix:C,selectedLines:w,style:T}=e,E=s!==void 0,ee=(0,j.useContext)(c),D=(0,j.useRef)(He(E)),O=y!=null,k=g!=null,A=b!=null,M=O||C!=null||x!=null||S!=null,te=M||k||A,N=v!=null,P=_!=null,F=f(e=>{p?.(e)}),I=w!==void 0,L=f(e=>i?.(e)),R=f((e,t,n)=>{l?.(e,t,n)}),z=f((e,t,n)=>{u?.(e,t,n)}),B=(0,j.useMemo)(()=>Je({options:h,hasCustomHeader:O,hasGutterRenderer:A,hasCodeViewHeader:N,hasCodeViewFooter:P,onSelectedLinesChange:p==null?void 0:F,controlledSelection:I,createEditor:i==null?void 0:L,onItemEditChange:l==null?void 0:R,onItemEditComplete:u==null?void 0:z}),[h,O,A,N,P,p,F,I,i,L,l,R,u,z]),[V]=(0,j.useState)(()=>qe()),[,H]=(0,j.useState)({}),ne=f(e=>{D.current.instance!=null&&(e==null||e!==D.current.instance.getContainerElement())&&(D.current.instance.cleanUp(),V.publish(void 0),D.current=He(E)),e!=null&&e!==D.current.instance?.getContainerElement()&&(D.current.instance=new Ae(B,a?void 0:ee,!0),D.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),U=f(e=>{D.current.disableFlushSync?V.publish(e):(0,X.flushSync)(()=>{V.publish(e)})}),W=(0,j.useMemo)(()=>{if(!(!M&&!k&&!A&&!N&&!P))return{hasHeaderRenderers:M,hasAnnotationRenderer:k,hasGutterRenderer:A,onSnapshotChange:U}},[U,k,A,M,N,P]);return Ve(()=>d==null?void 0:D.current.instance?.subscribeToScroll(d)),Ve(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=D.current;if(e!=null)try{D.current.disableFlushSync=!0;let a=!1;if(m(B,r)||(D.current.managedOptions=B,e.setOptions(B),a=!0),t!==E){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(E)s!==n&&(Ke(n,s)?D.current.items=s:Ge(n,s)?(D.current.items=s,e.addItems(s.slice(n.length))):(D.current.items=s,e.setItems(s),a=!0));else if(n==null){let t=o??[];D.current.items=t,t.length>0&&(e.setItems(t),a=!0)}w!==void 0&&e.setSelectedLines(w,{notify:!1});let c=e.setSlotCoordinator(W),l=!1;W!==i&&((W==null||i==null)&&(l=!0),D.current.slotCoordinator=W),(a||c)&&e.render(!0),c&&W==null&&V.publish(void 0),l&&H({})}finally{D.current.disableFlushSync=!1}}),(0,j.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=D.current;Q(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},updateItem(e){let{controlled:t,instance:n}=D.current;return Q(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=D.current;return Q(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=D.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=D.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),F(e))},getSelectedLines(){let{instance:e}=D.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=D.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),F(null))},getEditor(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getEditor: no valid instance exists`,e);return}return t.getEditor(e)},getInstance(){return D.current.instance}}),[F]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:ne,className:n,style:T}),(te||N||P)&&(0,Z.jsx)(Ye,{managedContentStore:V,renderCustomHeader:y,renderHeaderPrefix:C,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderAnnotation:g,renderGutterUtility:b,renderCodeViewHeader:v,renderCodeViewFooter:_})]})}var We=(0,j.forwardRef)(Ue);function Ge(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Ke(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Q(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function qe(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!fe(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Je({options:e,hasCustomHeader:t,hasGutterRenderer:n,hasCodeViewHeader:r,hasCodeViewFooter:i,onSelectedLinesChange:a,controlledSelection:o,createEditor:s,onItemEditChange:c,onItemEditComplete:l}){return!t&&!n&&!r&&!i&&a==null&&!o&&s==null&&c==null&&l==null?e??{}:(e={...e,controlledSelection:o,onSelectedLinesChange:a},s!=null&&(e.createEditor=s),c!=null&&(e.onItemEditChange=c),l!=null&&(e.onItemEditComplete=l),t&&(e.renderCustomHeader=$),n&&(e.renderGutterUtility=$),r&&(e.renderCodeViewHeader=$),i&&(e.renderCodeViewFooter=$),e)}var Ye=(0,j.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderCodeViewHeader:s,renderCodeViewFooter:c}){"use no memo";let l=f(t=>e.subscribe(t)),u=f(()=>e.getSnapshot()),d=(0,j.useSyncExternalStore)(l,u,u),p=``;for(let e of d?.items??[])p+=`${e.id}:${e.version}:${e.type}`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,j.useMemo)(()=>d?.items?.map(e=>(0,X.createPortal)(Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}),e.element,e.id)),[t,n,r,i,a,o,p]),(0,j.useMemo)(()=>s!=null&&d?.header!=null?(0,X.createPortal)(s(),d.header):null,[s,d?.header]),(0,j.useMemo)(()=>c!=null&&d?.footer!=null?(0,X.createPortal)(c(),d.footer):null,[c,d?.footer])]})});function Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}){if(e.type===`diff`){let{item:s,instance:c}=e;return ee({fileDiff:s.fileDiff,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}else{let{item:s,instance:c}=e;return k({file:s.file,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}}function $(){}var Ze=t(),Qe=`${u}
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-B88fzgQo.js";import{Eo as r,Ho as i,zo as a}from"./utils-dD8AT1Cf.js";import{sn as o}from"./session-BKSQ__kZ.js";import{B as s,G as c,H as l,Jn as u,Mt as d,Nt as f,R as p,U as m,V as h,W as g,br as _,cr as v,dr as y,fr as b,gr as x,hr as S,sr as C,tr as w,yr as T,z as E}from"./scroll-area-C5ps_bkR.js";import{c as ee,n as D,o as O}from"./DiffWorkerPoolProvider-ClROlLBb.js";import{r as k,t as A}from"./VirtualizedFile-DuJYdYdq.js";var j=e(n(),1),M=new Map([[`bold`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M100,28H64A20,20,0,0,0,44,48V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,100,28ZM96,204H68V52H96ZM192,28H156a20,20,0,0,0-20,20V208a20,20,0,0,0,20,20h36a20,20,0,0,0,20-20V48A20,20,0,0,0,192,28Zm-4,176H160V52h28Z`}))],[`duotone`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M112,48V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8h40A8,8,0,0,1,112,48Zm80-8H152a8,8,0,0,0-8,8V208a8,8,0,0,0,8,8h40a8,8,0,0,0,8-8V48A8,8,0,0,0,192,40Z`,opacity:`0.2`}),j.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`fill`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M120,48V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V48A16,16,0,0,1,64,32h40A16,16,0,0,1,120,48Zm72-16H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Z`}))],[`light`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,34H64A14,14,0,0,0,50,48V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,104,34Zm2,174a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2ZM192,34H152a14,14,0,0,0-14,14V208a14,14,0,0,0,14,14h40a14,14,0,0,0,14-14V48A14,14,0,0,0,192,34Zm2,174a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V48a2,2,0,0,1,2-2h40a2,2,0,0,1,2,2Z`}))],[`regular`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,32H64A16,16,0,0,0,48,48V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,104,32Zm0,176H64V48h40ZM192,32H152a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,192,32Zm0,176H152V48h40Z`}))],[`thin`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M104,36H64A12,12,0,0,0,52,48V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,104,36Zm4,172a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4ZM192,36H152a12,12,0,0,0-12,12V208a12,12,0,0,0,12,12h40a12,12,0,0,0,12-12V48A12,12,0,0,0,192,36Zm4,172a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V48a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4Z`}))]]),te=new Map([[`bold`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,136H48a20,20,0,0,0-20,20v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V156A20,20,0,0,0,208,136Zm-4,52H52V160H204Zm4-144H48A20,20,0,0,0,28,64v36a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44Zm-4,52H52V68H204Z`}))],[`duotone`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M216,152v40a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V152a8,8,0,0,1,8-8H208A8,8,0,0,1,216,152Zm-8-96H48a8,8,0,0,0-8,8v40a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V64A8,8,0,0,0,208,56Z`,opacity:`0.2`}),j.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`fill`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M224,152v40a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V152a16,16,0,0,1,16-16H208A16,16,0,0,1,224,152ZM208,48H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Z`}))],[`light`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,138H48a14,14,0,0,0-14,14v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V152A14,14,0,0,0,208,138Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2ZM208,50H48A14,14,0,0,0,34,64v40a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V64A14,14,0,0,0,208,50Zm2,54a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H208a2,2,0,0,1,2,2Z`}))],[`regular`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,136H48a16,16,0,0,0-16,16v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,56H48V152H208v40Zm0-144H48A16,16,0,0,0,32,64v40a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V64A16,16,0,0,0,208,48Zm0,56H48V64H208v40Z`}))],[`thin`,j.createElement(j.Fragment,null,j.createElement(`path`,{d:`M208,140H48a12,12,0,0,0-12,12v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V152A12,12,0,0,0,208,140Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4ZM208,52H48A12,12,0,0,0,36,64v40a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V64A12,12,0,0,0,208,52Zm4,52a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H208a4,4,0,0,1,4,4Z`}))]]),N=Object.defineProperty,P=Object.defineProperties,F=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertySymbols,L=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,z=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,B=(e,t)=>{for(var n in t||={})L.call(t,n)&&z(e,n,t[n]);if(I)for(var n of I(t))R.call(t,n)&&z(e,n,t[n]);return e},V=(e,t)=>P(e,F(t)),H=(0,j.forwardRef)((e,t)=>j.createElement(r,V(B({ref:t},e),{weights:M})));H.displayName=`Columns`;var ne=Object.defineProperty,U=Object.defineProperties,W=Object.getOwnPropertyDescriptors,re=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,oe=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,se=(e,t)=>{for(var n in t||={})ie.call(t,n)&&oe(e,n,t[n]);if(re)for(var n of re(t))ae.call(t,n)&&oe(e,n,t[n]);return e},ce=(e,t)=>U(e,W(t)),le=(0,j.forwardRef)((e,t)=>j.createElement(r,ce(se({ref:t},e),{weights:te})));le.displayName=`Rows`;function ue(e,t){return e.length>0&&e.every(e=>t.has(e))}function de(e,t){return ue(e,t)?new Set:new Set(e)}function fe(e,t){return e==null||t==null?e===t:e.header!==t.header||e.footer!==t.footer?!1:pe(e.items,t.items)}function pe(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r==null||i==null||r.id!==i.id||r.type!==i.type||r.element!==i.element||r.version!==i.version)return!1}return!0}function me(e,t,n){let r=document.createElement(`div`);return r.style.display=`flow-root`,e===`header`?(r.setAttribute(v,``),t.before(r)):(r.setAttribute(C,``),t.after(r)),n?.observe(r),r}function he(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function G(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}var ge=`theme.disableLineNumbers.overflow.themeType.disableFileHeader.disableVirtualizationBuffers.preferredHighlighter.useCSSClasses.useTokenTransformer.tokenizeMaxLineLength.tokenizeMaxLength.unsafeCSS.diffStyle.diffIndicators.disableBackground.expandUnchanged.loadDiffFiles.collapsedContextThreshold.lineDiffType.maxLineDiffLength.expansionLineCount.lineHoverHighlight.enableTokenInteractionsOnWhitespace.enableGutterUtility.__debugPointerEvents.enableLineSelection.controlledSelection.disableErrorHandling`.split(`.`),_e=[`theme`,`disableLineNumbers`,`overflow`,`themeType`,`disableFileHeader`,`disableVirtualizationBuffers`,`preferredHighlighter`,`useCSSClasses`,`useTokenTransformer`,`tokenizeMaxLineLength`,`tokenizeMaxLength`,`unsafeCSS`,`lineHoverHighlight`,`enableTokenInteractionsOnWhitespace`,`enableGutterUtility`,`__debugPointerEvents`,`enableLineSelection`,`controlledSelection`,`disableErrorHandling`],ve=new Set([`useTokenTransformer`,`enableGutterUtility`,`enableLineSelection`,`lineHoverHighlight`]),ye=[`renderCustomHeader`,`renderHeaderPrefix`,`renderHeaderFilenameSuffix`,`renderHeaderMetadata`,`renderAnnotation`,`renderGutterUtility`,`onPostRender`,`onGutterUtilityClick`,`onLineClick`,`onLineNumberClick`,`onLineEnter`,`onLineLeave`,`onTokenClick`,`onTokenEnter`,`onTokenLeave`],be=[`onLineSelected`,`onLineSelectionStart`,`onLineSelectionChange`,`onLineSelectionEnd`],xe=Symbol(`CodeView.itemOptionsState`);function Se(e,t){Object.defineProperty(e,xe,{configurable:!1,enumerable:!1,value:t})}function K(e){return e[xe]}function q(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var Ce=120,we=`--diffs-overflow-override`,J=12e6,Te=1e6,Ee=2e6,De=J-Ee,Oe=J-Te,ke=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),r=e.platform===`MacIntel`&&e.maxTouchPoints>1;return(n||r)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),Ae=class e{static __STOP=!1;static __lastScrollPosition=0;type=`advanced`;config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=y;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement(`div`);stickyContainer=document.createElement(`div`);stickyOffset=document.createElement(`div`);header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(e={theme:x},t,n=!1){this.options=e,this.computeMetricsCache(e.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=t,this.isContainerManaged=n,this.stickyOffset.style.contain=`layout size`,this.stickyContainer.style.position=`sticky`,this.stickyContainer.style.width=`100%`,this.stickyContainer.style.contain=`layout style inline-size`,this.stickyContainer.style.isolation=`isolate`,this.stickyContainer.style.display=`flex`,this.stickyContainer.style.flexDirection=`column`}getLayout(){return this.options.layout??b}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(e){return this.itemMetricsCache={hunkLineCount:e?.hunkLineCount??y.hunkLineCount,lineHeight:e?.lineHeight??y.lineHeight,diffHeaderHeight:e?.diffHeaderHeight??y.diffHeaderHeight,hunkSeparatorHeight:e?.hunkSeparatorHeight,spacing:e?.spacing??y.spacing,paddingTop:e?.paddingTop,paddingBottom:e?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??S}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return T&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(e){if(!this.shouldValidateItemHeights()||e.element==null)return;let t=e.instance.getAdvancedStickySpecs();if(t==null)return;let n=t.height,r=e.element.getBoundingClientRect().height;n!==r&&console.error(`CodeView: reconciled item height does not match DOM height`,{id:e.item.id,type:e.type,index:e.index,version:e.version,expectedHeight:n,actualHeight:r,delta:r-n,stickyTopOffset:t.topOffset,virtualizedHeight:e.instance.getVirtualizedHeight(),top:e.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:e.element,instance:e.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:e,lastIndex:t,stickyHeight:n,stickyTop:r,stickyBottom:i}=this.renderState;if(e===-1||t===-1)return;let a=this.stickyContainer.getBoundingClientRect().height;Math.abs(a-n)<1||console.error(`CodeView: sticky container height does not match computed layout`,{computedStickyHeight:n,actualStickyHeight:a,delta:a-n,stickyTop:r,stickyBottom:i,firstIndex:e,lastIndex:t,firstStickySpecs:this.items[e]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){this.scrollInteractionFixTimer!=null&&(clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0)}suspendScrollInteractions(){this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled&&(this.stickyContainer.style.pointerEvents=`none`,this.pointerEventsDisabled=!0),ke&&!this.codeOverflowFix&&(this.stickyContainer.style.setProperty(we,`hidden`),this.codeOverflowFix=!0),this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,Ce)}restoreScrollInteractions=()=>{this.clearScrollInteractionTimer(),this.pointerEventsDisabled&&=(this.stickyContainer.style.removeProperty(`pointer-events`),!1),this.codeOverflowFix&&=(this.stickyContainer.style.setProperty(we,`auto`),!1)};syncLayout(){let{gap:e,paddingBottom:t,paddingTop:n}=this.getLayout();this.stickyContainer.style.gap=`${e}px`,this.container?.style.setProperty(`margin-top`,`${n}px`),this.container?.style.setProperty(`margin-bottom`,`${t}px`)}reconcileHeaderFooterHosts(){let e=this.reconcileHost(`header`),t=this.reconcileHost(`footer`);return e||t}reconcileHost(e){let{root:t,container:n}=this;if(t==null||n==null)return!1;let r=e===`header`?this.header:this.footer,i=e===`header`?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(i==null)return r.element==null?!1:(this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1);if(r.element!=null&&i===r.render)return!1;let a=r.element??me(e,n,this.resizeObserver);r.element=a;let o=i();return o==null?!this.isContainerManaged&&a.children.length>0&&(a.textContent=``):a.replaceChildren(o),r.render=i,!0}setHostHeight(e,t){e.height!==t&&(e.height=t,this.scrollDirty=!0)}measureMountedHosts(){this.header.element!=null&&this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height),this.footer.element!=null&&this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error(`CodeView.setup: already setup`);this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor=`none`,this.root.hasAttribute(`tabindex`)||(this.root.tabIndex=-1),this.container??=document.createElement(`div`),this.container.style.contain=`layout style`,this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener(`scroll`,this.handleScroll,{passive:!0}),this.root.addEventListener(`wheel`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`touchstart`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`pointerdown`,this.clearPendingScroll,{passive:!0}),this.root.addEventListener(`keydown`,this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,this.scrollTo({type:`position`,position:e.__lastScrollPosition,behavior:`instant`})):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)}}reset(){h(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let e of this.itemEditors.values())e.editor.cleanUp();this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent=``,this.stickyOffset.style.height=``,this.container?.style.removeProperty(`height`),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),this.isContainerManaged||this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleScroll),this.root?.removeEventListener(`wheel`,this.clearPendingScroll),this.root?.removeEventListener(`touchstart`,this.clearPendingScroll),this.root?.removeEventListener(`pointerdown`,this.clearPendingScroll),this.root?.removeEventListener(`keydown`,this.clearPendingScroll),this.root?.style.removeProperty(`overflow-anchor`),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent=``,this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex!==-1)for(let e=this.renderState.firstIndex;e<=this.renderState.lastIndex;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${e}`);this.releaseRenderedItem(t)}}primeScrollTarget(e){e.type!==`position`&&this.idToItem.get(e.id)?.instance.primeHighlightCache()}getElementPoolLimit(){let e=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:t}=this.itemMetricsCache;return Math.max(8,Math.ceil(e/Math.max(t,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let e=this.elementPool.pop();for(;e!=null&&!this.isElementPoolGenerationCurrent(e);)e=this.elementPool.pop();return e??=document.createElement(_),this.markElementPoolGenerationCurrent(e),e}releaseRenderedItem(e){let{element:t}=e;t!=null&&this.renderedItemOwnsFocus(t)&&(this.shouldFixContainerFocus=!0),e.instance.cleanUp(!0),this.attachedEditors.delete(e.item.id),e.element=void 0,t!=null&&(t.remove(),this.cleanElement(t),this.queueElementForPool(t))}renderedItemOwnsFocus(e){let{activeElement:t}=document;return t===e||e.contains(t)||e.shadowRoot?.activeElement!=null}fixContainerFocus(){this.shouldFixContainerFocus&&(this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0}))}cleanElement(e){let{shadowRoot:t}=e;if(t!=null)for(let e of Array.from(t.children))Fe(e)||e.remove();this.isContainerManaged||e.replaceChildren()}queueElementForPool(e){let t=this.getElementPoolLimit();!this.isElementPoolGenerationCurrent(e)||this.getElementPoolSize()>=t||(this.isElementClean(e)?this.elementPool.push(e):this.pendingElementPool.push(e))}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:e}=this;this.pendingElementPool=[];let t=this.getElementPoolLimit();for(let n of e)this.isElementPoolGenerationCurrent(n)&&this.isElementClean(n)&&this.elementPool.length<t?this.elementPool.push(n):this.isElementPoolGenerationCurrent(n)&&this.getElementPoolSize()<t&&this.pendingElementPool.push(n)}isElementClean(e){return e.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(e){this.elementPoolTracker.set(e,this.elementPoolVersion)}isElementPoolGenerationCurrent(e){return this.elementPoolTracker.get(e)===this.elementPoolVersion}resolveEffectiveScrollBehavior(e,t){return he()?`instant`:e.behavior===`smooth-auto`?Math.abs(t-this.getScrollTop())<=this.getHeight()*10?`smooth`:`instant`:e.behavior??`instant`}scrollTo(e){if(this.root==null)return;let t=this.normalizeScrollTarget(e);if(t==null)return;let n=this.resolveScrollTargetTop(t);n!=null&&(this.primeScrollTarget(t),this.resolveEffectiveScrollBehavior(t,n)===`smooth`?this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()}:this.scrollAnimation=void 0,this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=t,this.render())}setSelectedLines(e,t){this.applySelectedLines(e,t)}getSelectedLines(){return this.selectedLines}clearSelectedLines(e){this.applySelectedLines(null,e)}getItem(e){return this.idToItem.get(e)?.item}getEditor(e){return this.itemEditors.get(e)?.editor}updateItem(e){let t=this.idToItem.get(e.id);return t==null?(console.error(`CodeView.updateItem: unknown item id "${e.id}"`),!1):this.syncItemRecord(t,e)?(this.markItemLayoutDirty(t),this.scrollDirty=!0,this.render(),this.syncSelection(),this.syncItemEditors(),!0):!1}updateItemId(e,t){if(e===t)return!0;let n=this.idToItem.get(e);if(n==null)return console.error(`CodeView.updateItemId: unknown item id "${e}"`),!1;if(this.idToItem.has(t))return console.error(`CodeView.updateItemId: duplicate item id "${t}"`),!1;this.idToItem.delete(e),n.item.id=t,this.idToItem.set(t,n),this.updateItemOptionsId(n.instance.options,t),this.selectedLines?.id===e&&(this.selectedLines={...this.selectedLines,id:t},this.options.onSelectedLinesChange?.(this.selectedLines));let r=this.itemEditors.get(e);return r!=null&&(r.state.id=t,this.itemEditors.delete(e),this.itemEditors.set(t,r),this.attachedEditors.delete(e)&&this.attachedEditors.add(t)),this.renamePendingScrollTarget(e,t),this.renamePendingLayoutAnchor(e,t),this.render(),!0}addItem(e){this.addItems([e])}addItems(e){this.appendItemsInternal(e),this.syncSelection(),this.syncItemEditors()}setItems(e){if(e.length===0){let e=[];for(let t of this.itemEditors.values()){let{lastChange:n}=t.state;n!=null&&e.push(n)}this.reset();for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}else this.items.length===0?this.appendItemsInternal(e):this.tryAppendItems(e)||this.reconcileItems(e);this.syncSelection(),this.syncItemEditors()}appendItemsInternal(e,t=!0){if(e.length===0)return;let n=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+n.gap,i=r;for(let t=0;t<e.length;t++){let i=e[t];if(i==null)throw Error(`CodeView.appendItemsInternal: missing input item`);if(this.idToItem.has(i.id))throw Error(`CodeView.addItem: duplicate id "${i.id}"`);let a=this.createItem(i,this.items.length,r);this.items.push(a),this.idToItem.set(a.item.id,a),this.instanceToItem.set(a.instance,a),a.height=je(a),r+=a.height+n.gap}this.scrollHeight=r-n.gap,this.scrollDirty=!0,t&&(this.canSkipRenderForAppend(i)?this.syncContainerHeight():this.render())}canSkipRenderForAppend(e){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&e>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(e){if(e==null)return;this.capturePendingLayoutAnchor();let{options:t}=this,n=this.getLayout(),{itemMetricsCache:r}=this;Me(t,e)&&this.invalidateElementPool(),this.options=e;let i=this.computeMetricsCache(e.itemMetrics),a=!g(r,i),o=!g(n,this.getLayout());o&&this.syncLayout();let s=a||Ne(t,e);if(s){let n=this.pendingLayoutReset;this.pendingLayoutReset={metrics:a?i:n?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:n?.includeEstimatedDiffHeights===!0||a||Pe(t,e)}}(o||s)&&(this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0),m(t,e)||this.renderOptionsRevision++,this.syncItemEditors();let c=t.renderCodeViewHeader!==e.renderCodeViewHeader||t.renderCodeViewFooter!==e.renderCodeViewFooter;!this.isContainerManaged&&(this.items.length>0||c)&&this.render()}capturePendingLayoutAnchor(){this.root==null||this.items.length===0||this.pendingScrollTarget!=null||(this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop()))}render(t=!1){e.__STOP||(t?(h(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit()):l(this.computeRenderRangeAndEmit))}isReady(){let{workerManager:e}=this;return e==null||e.isInitialized()||e.getStats().workersFailed?(this.clearReadySubscription(),!0):(this.isReadySubscription??=e.subscribeToStatChanges(e=>{e.managerState!==`initialized`&&!e.workersFailed||(this.clearReadySubscription(),this.render(!0))}),e.getStats().managerState===`waiting`&&e.initialize().catch(()=>{}),!1)}clearReadySubscription(){this.isReadySubscription!=null&&(this.isReadySubscription(),this.isReadySubscription=void 0)}instanceChanged(e,t){let n=this.instanceToItem.get(e);if(n==null)throw Error(`CodeView.instanceChanged: An instance has changed that is not registered`);t&&this.markItemLayoutDirty(n),this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:e,lastIndex:t}=this.renderState;if(e===-1||t===-1||t<e)return[];let n=[];for(let r=e;r<=t;r++){let e=this.items[r];e?.element!=null&&(e.type===`diff`?n.push({id:e.item.id,type:`diff`,item:e.item,version:e.version,element:e.element,instance:e.instance}):n.push({id:e.item.id,type:`file`,item:e.item,version:e.version,element:e.element,instance:e.instance}))}return n}setSlotCoordinator(e){return e===this.slotCoordinator?!1:(this.slotCoordinator=e,this.slotSnapshot=void 0,!0)}getSlotSnapshot(e){return this.buildSlotSnapshot(e)}buildSlotSnapshot(e){let t=Be(this.getRenderedItems(),e),{element:n}=this.header,{element:r}=this.footer;if(!(t==null&&n==null&&r==null))return{items:t,header:n,footer:r}}subscribeToScroll(e){return this.scrollListeners.add(e),()=>{this.scrollListeners.delete(e)}}getLocalTopForInstance(e){let t=this.instanceToItem.get(e);if(t==null)throw Error(`CodeView.getLocalTopForInstance: unknown virtualized instance`);return t.top}getTopForItem(e){let t=this.idToItem.get(e);if(t!=null)return t.top+this.getItemTopOffset()}createItem(e,t,n){let{itemMetricsCache:r}=this;if(e.type===`diff`){let i=new D(this.createDiffOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`diff`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}let i=new A(this.createFileOptions(e.id),this,r,this.workerManager,this.isContainerManaged);return{type:`file`,item:e,version:e.version,index:t,top:n,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:i}}applySelectedLines(e,t){let{selectedLines:n}=this;e==null&&n==null||e!=null&&n?.id===e.id&&s(n.range,e.range)||(n!=null&&n.id!==e?.id&&this.idToItem.get(n.id)?.instance.setSelectedLines(null,{notify:!1}),this.selectedLines=e,this.idToItem.get(e?.id??``)?.instance.setSelectedLines(e?.range??null,t))}syncSelection(){if(this.selectedLines==null)return;let e=this.idToItem.get(this.selectedLines.id);if(e==null){this.selectedLines=null;return}e.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(e){return this.options.createEditor!=null&&e.item.edit===!0&&e.item.collapsed!==!0}isReceiverEdited(e,t){let n=K(e);if(n==null)return!1;let r=this.getItemOptions(n,t);return r!=null&&this.isItemInEditMode(r)}attachItemEditor(e){let{id:t}=e.item,{createEditor:n}=this.options;if(n==null||e.element==null||this.attachedEditors.has(t)||!this.isItemInEditMode(e))return;let r=this.itemEditors.get(t);if(r==null){let e={id:t},i=n({onChange:(t,n)=>{let r=this.idToItem.get(e.id);r!=null&&(e.lastChange={item:r.item,file:t,lineAnnotations:n},this.options.onItemEditChange?.(r.item,t,n))}});if(i==null)return;r={editor:i,state:e},this.itemEditors.set(t,r)}this.selectedLines?.id===t&&this.applySelectedLines(null,{notify:!1}),r.editor.edit(e.instance),this.attachedEditors.add(t)}syncItemEditors(){if(this.itemEditors.size===0)return;let e=[];for(let[t,n]of this.itemEditors){let r=this.idToItem.get(t);if(r!=null&&this.isItemInEditMode(r))continue;n.editor.cleanUp(),this.itemEditors.delete(t),this.attachedEditors.delete(t);let i=r?.item??n.state.lastChange?.item;i?.type===`diff`&&(r!=null&&r.type===`diff`&&r.instance.completeEditSession()&&(this.markItemLayoutDirty(r),this.render()),O(i.fileDiff));let{lastChange:a}=n.state;a!=null&&e.push(r==null?a:{...a,item:r.item})}for(let{item:t,file:n,lineAnnotations:r}of e)this.options.onItemEditComplete?.(t,n,r)}renamePendingScrollTarget(e,t){let{pendingScrollTarget:n}=this;n==null||n.type===`position`||n.id!==e||(this.pendingScrollTarget={...n,id:t})}renamePendingLayoutAnchor(e,t){this.pendingLayoutAnchor?.id===e&&(this.pendingLayoutAnchor.id=t)}createFileOptionsPrototype(){let e={};for(let t of _e)ve.has(t)||q(e,t,()=>this.options[t]);q(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`file`)?!0:this.options.useTokenTransformer),q(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableGutterUtility),q(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`file`)?!1:this.options.enableLineSelection),q(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`file`)?`disabled`:this.options.lineHoverHighlight),q(e,`stickyHeader`,()=>this.options.stickyHeaders),q(e,`collapsed`,e=>{let t=K(e);if(t!=null)return this.getItemOptions(t,`file`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`file`,t);for(let t of be)this.defineItemSelectionCallback(e,`file`,t);return e}createDiffOptionsPrototype(){let e={};for(let t of ge)ve.has(t)||q(e,t,()=>this.options[t]);q(e,`useTokenTransformer`,e=>this.isReceiverEdited(e,`diff`)?!0:this.options.useTokenTransformer),q(e,`enableGutterUtility`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableGutterUtility),q(e,`enableLineSelection`,e=>this.isReceiverEdited(e,`diff`)?!1:this.options.enableLineSelection),q(e,`lineHoverHighlight`,e=>this.isReceiverEdited(e,`diff`)?`disabled`:this.options.lineHoverHighlight),q(e,`stickyHeader`,()=>this.options.stickyHeaders),q(e,`hunkSeparators`,()=>this.options.hunkSeparators),q(e,`collapsed`,e=>{let t=K(e);if(t!=null)return this.getItemOptions(t,`diff`)?.item.collapsed});for(let t of ye)this.defineItemSharedCallback(e,`diff`,t);for(let t of be)this.defineItemSelectionCallback(e,`diff`,t);return e}createFileOptions(e){let t=Object.create(this.fileOptionsPrototype);return Se(t,{id:e}),t}createDiffOptions(e){let t=Object.create(this.diffOptionsPrototype);return Se(t,{id:e}),t}updateItemOptionsId(e,t){let n=K(e);if(n==null)throw Error(`CodeView.updateItemOptionsId: No valid state`);n.id=t}getItemOptions(e,t){let n=this.idToItem.get(e.id);if(!(n==null||n.type!==t))return n}defineItemSharedCallback(e,t,n){q(e,n,e=>{if(this.options[n]==null)return;let r=K(e);if(r==null)return;let i=r.callbackCache??={},a=i[n];return a??(a=((...e)=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=this.options[n];return a?.(...e,i)}),i[n]=a),a})}defineItemSelectionCallback(e,t,n){q(e,n,e=>{if(this.options.enableLineSelection!==!0)return;let r=K(e);if(r==null)return;let i=this.getItemOptions(r,t);if(i!=null&&this.isItemInEditMode(i))return;let a=r.callbackCache??={},o=a[n];return o??(o=(e=>{let i=this.getItemOptions(r,t);if(i==null)return;let a=e==null?null:{id:i.item.id,range:e};this.options.controlledSelection!==!0&&(e!=null||this.selectedLines?.id===i.item.id)&&this.applySelectedLines(a,{notify:!1}),this.options.onSelectedLinesChange?.(a);let o=this.options[n];return o?.(e,i)}),a[n]=o),o})}markLayoutDirtyFromIndex(e){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??e,e)}markItemLayoutDirty(e){if(this.items[e.index]!==e)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${e.item.id}"`);this.markLayoutDirtyFromIndex(e.index)}tryAppendItems(e){if(e.length<=this.items.length)return!1;for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null||n.item.id!==r.id||n.type!==r.type)return!1}for(let t=0;t<this.items.length;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.tryAppendItems: missing existing item`);let r=e[t];if(r==null)throw Error(`CodeView.tryAppendItems: append candidate missing prefix item`);this.syncItemRecord(n,r)&&this.markLayoutDirtyFromIndex(t)}return this.appendItemsInternal(e.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(e){let{items:t,idToItem:n}=this,r=new Set(t),i=[],a=new Map,o=new Map,s;for(let c=0;c<e.length;c++){let l=e[c];if(l==null)throw Error(`CodeView.reconcileItems: missing input item`);if(a.has(l.id))throw Error(`CodeView.setItems: duplicate id "${l.id}"`);let u=n.get(l.id),d=u!=null&&u.type===l.type?u:this.createItem(l,c,0);d.index=c,u!=null&&u.type===l.type?(r.delete(u),this.syncItemRecord(d,l)&&(s=Math.min(s??c,c))):s=Math.min(s??c,c),t[c]!==d&&(s=Math.min(s??c,c)),i.push(d),a.set(l.id,d),o.set(d.instance,d)}for(let e=0;e<t.length;e++){let n=t[e];if(n==null||!r.has(n))continue;this.releaseRenderedItem(n);let a=Math.max(i.length-1,0);s=Math.min(s??a,a)}s!=null&&(this.items=i,this.idToItem=a,this.instanceToItem=o,this.renderState.firstIndex>=i.length?this.resetRenderState():this.renderState.lastIndex>=i.length&&(this.renderState.lastIndex=i.length-1),this.markLayoutDirtyFromIndex(s),this.scrollDirty=!0,this.render())}syncItemRecord(e,t){if(e.type!==t.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${t.id}"`);return e.version===t.version?!1:(e.item=t,e.version=t.version,e.renderedOptionsRevision=-1,!0)}getMaxScrollTopForHeight(e){let{paddingBottom:t,paddingTop:n}=this.getLayout();return Math.max(n+this.header.height+e+this.footer.height+t-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>Oe}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),J):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(e){let t=this.getMaxPagedScrollTop();return Math.max(0,Math.min(e,t))}clampScrollTop(e){let t=this.getMaxScrollTop();return Math.max(0,Math.min(e,t))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(e){let t=this.getMaxScrollPageOffset();return Math.max(0,Math.min(e,t))}resolveScrollPageWindow(e,t){let n=G(this.clampPagedScrollTop(t)),r=this.clampScrollPageOffset(e-n);return n=G(this.clampPagedScrollTop(e-r)),r=this.clampScrollPageOffset(e-n),{pagedScrollTop:n,scrollPageOffset:r}}resolvePagedScrollPosition(e){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(e),scrollPageOffset:0};let t=this.clampScrollPageOffset(this.scrollPageOffset),n=e-t,r=this.getMaxPagedScrollTop(),i=this.getMaxScrollPageOffset(),a=n>Oe&&t<i,o=n<Te&&t>0;return n<0||n>r||a||o?this.resolveScrollPageWindow(e,o?Math.min(De,r):Ee):{pagedScrollTop:G(this.clampPagedScrollTop(n)),scrollPageOffset:t}}needsScrollPageUpdate(e){let t=G(this.clampScrollTop(e)),{scrollPageOffset:n}=this.resolvePagedScrollPosition(t);return n!==this.scrollPageOffset}getPagedLayoutTop(e){return this.shouldRebaseScroll()?Math.max(e-this.scrollPageOffset,0):e}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(e){let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return{top:t.top,height:t.height};if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ie(e.range)} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return{top:t.top+n.top,height:n.height}}normalizeScrollTarget(e){if(e.type===`position`||e.align!==`nearest`)return e;let t=this.getScrollTargetRect(e);if(t==null)return;let n=e.offset??0,r=this.getItemTopOffset()+t.top,i=r+t.height,a=this.getScrollTop(),o=a+(e.type===`line`||e.type===`range`?this.getStickyHeaderOffset():0),s=a+this.getHeight();if(!(r-n<=o&&i+n>=s)){if(r-n<o)return{...e,align:`start`};if(i+n>s)return{...e,align:`end`}}}resolveScrollTargetTop(e){if(e.type===`position`){let t=this.clampScrollTop(e.position);return t===e.position?this.clampScrollTop(e.position-this.getStickyHeaderOffset()):t}let t=this.idToItem.get(e.id);if(t==null){console.warn(`CodeView.scrollTo: unknown item id "${e.id}"`);return}if(e.type===`item`)return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top,t.height,e.align,e.offset));if(e.type===`range`){let n=this.getRangeScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Ie(e.range)} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}let n=this.getLineScrollPosition(t,e);if(n==null){console.warn(`CodeView.scrollTo: unable to resolve line ${e.lineNumber} for item "${e.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(t.top+n.top,n.height,e.align,e.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(e,t,n,r=0,i=0){e+=this.getItemTopOffset();let a=this.getHeight();return n===`center`&&t+r<a?e-(a-t)/2+r:n===`end`?e-(a-t)+r:e-i-r}getLineScrollPosition(e,t){return e.type===`diff`?e.instance.getLinePosition(t.lineNumber,t.side):e.instance.getLinePosition(t.lineNumber)}getRangeScrollPosition(e,t){let{range:n}=t,r=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.start,side:n.side}),i=this.getLineScrollPosition(e,{type:`line`,id:t.id,lineNumber:n.end,side:n.endSide??n.side});if(r==null||i==null)return;let a=r.top,o=a+r.height,s=i.top,c=s+i.height,l=Math.min(a,s);return{top:l,height:Math.max(o,c)-l}}computeTargetScrollTopForFrame(e,t){if(this.pendingScrollTarget==null)return e;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null)return e;let{scrollAnimation:r}=this;return r==null?n:this.computeSpringStep(r,n,t).position}computeSpringStep(e,t,n){let r=Math.max(0,n-e.lastTimestamp),{omega:i}=this.getSmoothScrollSettings(),a=Math.exp(-i*r),o=e.position-t,s=e.velocity+i*o;return{position:t+(o+s*r)*a,velocity:(s*(1-i*r)-i*o)*a}}advanceScrollAnimation(e,t){if(this.pendingScrollTarget==null)return;let n=this.resolveScrollTargetTop(this.pendingScrollTarget);if(n==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return n;r.position+=t;let{position:i,velocity:a}=this.computeSpringStep(r,n,e);r.lastTimestamp=e,r.position=i,r.velocity=a;let{positionEpsilon:o,velocityEpsilon:s}=this.getSmoothScrollSettings();return Math.abs(n-i)<=o&&Math.abs(a)<=s?(r.position=n,r.velocity=0,this.scrollAnimation=void 0,n):r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null||!this.isReady())return;let n=this.getHeight(),r=this.getScrollTop(),i=r,a=this.pendingLayoutAnchor!=null,o=this.getScrollAnchor(i);if(this.layoutDirtyIndex!=null&&(this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,a=!0),a&&o!=null){let e=this.resolveAnchoredScrollTop(o);if(e!=null){let t=e-i;i=e,this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}}a&&(i=this.clampScrollTop(i),this.syncContainerHeight());let s=this.computeTargetScrollTopForFrame(i,t),c=!a&&(this.renderState.scrollTop===-1||Math.abs(s-this.renderState.scrollTop)>n+this.config.overscrollSize*2);c&&(o=void 0),this.windowSpecs=E({scrollTop:s-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:c,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let l=r;(this.pendingScrollTarget!=null&&s!==l||this.needsScrollPageUpdate(s))&&(this.applyScrollFix(s,l,this.windowSpecs),l=s);let{top:u,bottom:d}=this.windowSpecs,{firstIndex:f,lastIndex:p}=this.renderState;if(f>=0)for(let e=f;e<=p;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${e}`);t.top>u-t.height&&t.top<=d||this.releaseRenderedItem(t)}let m=this.reconcileHeaderFooterHosts(),h,g=new Set,_=this.findFirstVisibleIndex(u),v=this.findLastVisibleIndex(d);for(let e=_;e<=v;e++){let t=this.items[e];if(t==null)throw Error(`CodeView.computeRenderRangeAndEmit: missing item`);let{instance:n}=t;t.element==null?(t.element=this.acquireElement(),Re(this.stickyContainer,t.element,h),n.virtualizedSetup(),Y(t,t.element)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element):(Re(this.stickyContainer,t.element,h),Y(t,void 0,t.renderedOptionsRevision!==this.renderOptionsRevision)&&(t.renderedOptionsRevision=this.renderOptionsRevision,g.add(t)),h=t.element),t.item.edit===!0&&this.attachItemEditor(t)}this.renderState.firstIndex=_<=v?_:-1,this.renderState.lastIndex=v,this.flushSlotCoordinator(),this.flushManagers(g),m&&this.measureMountedHosts(),this.reconcileRenderedItems(g),this.syncContainerHeight(),this.updateStickyPositioning();let y=o==null?void 0:this.resolveAnchoredScrollTop(o);o===this.pendingLayoutAnchor&&(this.pendingLayoutAnchor=void 0);let b=y==null?0:y-i,x=s,S=!1;if(this.pendingScrollTarget!=null){let e=this.advanceScrollAnimation(t,b);e==null?x=i:(x=e,S=!0)}else x=y??s;x!==l&&(this.applyScrollFix(x,l,this.windowSpecs),l=x),S&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.renderState.scrollTop=G(l),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),(c||this.scrollAnimation!=null)&&this.render()};flushManagers(e){for(let t of e)t.instance.flushManagers()}syncContainerHeight(){let e=this.getPagedScrollHeight();this.container==null||this.containerHeight===e||(this.container.style.height=`${e}px`,this.containerHeight=e)}getStickyBounds(e){let{firstIndex:t,lastIndex:n}=e==null?this.renderState:{firstIndex:this.findFirstVisibleIndex(e.top),lastIndex:this.findLastVisibleIndex(e.bottom)};if(t===-1||n===-1||t>n)return;let r=this.items[t]?.instance.getAdvancedStickySpecs(e),i=this.items[n]?.instance.getAdvancedStickySpecs(e);if(!(r==null||i==null))return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(i.topOffset+i.height)}}applyStickyPositioning({stickyTop:e,stickyBottom:t}){let n=this.getHeight(),{itemMetricsCache:r}=this,i=t-e;this.renderState.stickyHeight=i,this.renderState.stickyTop=e,this.renderState.stickyBottom=t,this.stickyOffset.style.height=`${e}px`;let a=(Math.random()*r.lineHeight>>0)*-1,o=-Math.max(i+a,0)+n;this.stickyContainer.style.top=`${o}px`,this.stickyContainer.style.bottom=`${o+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(e){this.syncContainerHeight();let t=this.getStickyBounds(e);t!=null&&this.applyStickyPositioning(t)}reconcileRenderedItems(e){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1)return;let r=-1,i=!1;for(let a=t;a<this.items.length&&!(!i&&a>n);a++){let t=this.items[a];if(t==null)throw Error(`CodeView.reconcileRenderedItems: Invalid item`);r===-1?r=t.top:t.top!==r&&(t.top=r,t.instance.syncVirtualizedTop(),i=!0),(e==null?a<=n:e.has(t))&&(t.instance.reconcileHeights()&&(i=!0,t.height=t.instance.getVirtualizedHeight()),this.validateRenderedItemHeight(t)),r+=t.instance.getVirtualizedHeight(),a<this.items.length-1&&(r+=this.getLayout().gap)}i&&r!=null&&(this.scrollDirty=!0,this.scrollHeight=r)}updateStickyPositioning(){let e=this.getStickyBounds();if(e==null)return;let{stickyTop:t,stickyBottom:n}=e;n-t===this.renderState.stickyHeight&&t===this.renderState.stickyTop&&n===this.renderState.stickyBottom||this.applyStickyPositioning(e)}handleScroll=()=>{e.__STOP||(this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render())};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=e=>{for(let t of e)if(t.target===this.stickyContainer){if(t.borderBoxSize[0].blockSize!==this.renderState.stickyHeight){let e=this.getScrollTop(),t=this.getScrollAnchor(e);this.reconcileRenderedItems(),this.updateStickyPositioning();let n=t==null?void 0:this.resolveAnchoredScrollTop(t);if(n!=null){let t=n-e;this.applyScrollFix(n,e,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=t)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0)}}else if(t.target===this.header.element||t.target===this.footer.element){let e=t.target===this.header.element?this.header:this.footer,n=t.borderBoxSize[0].blockSize;if(n!==e.height){let t=this.getScrollTop(),r=this.getScrollAnchor(t);this.setHostHeight(e,n);let i=r==null?void 0:this.resolveAnchoredScrollTop(r);if(i!=null){let e=i-t;this.applyScrollFix(i,t,this.windowSpecs),this.scrollAnimation!=null&&(this.scrollAnimation.position+=e)}this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget)&&(this.pendingScrollTarget=void 0,this.scrollAnimation=void 0),this.render()}}else this.scrollDirty=!0,this.heightDirty=!0,this.render()};getScrollAnchorViewportTop(e,t){return e<t?t+this.getStickyHeaderOffset():t}getScrollAnchor(e){if(this.pendingLayoutAnchor!=null)return this.pendingLayoutAnchor;if(e<=0)return;let{firstIndex:t,lastIndex:n,stickyTop:r,stickyBottom:i}=this.renderState;if(t===-1||n===-1)return;let a=this.getHeight();if(!(r===-1||i===-1))for(let r=t;r<=n;r++){let t=this.items[r];if(t==null)continue;let n=this.getItemTopOffset()+t.top;if(n+t.height<=e)continue;if(n>=e+a)break;if(n>=e)return{type:`item`,id:t.item.id,viewportOffset:n-e};let i=this.getScrollAnchorViewportTop(n,e)-n,o=t.instance.getNumericScrollAnchor(i);if(o!=null){let r=n+o.top;return{type:`line`,id:t.item.id,lineNumber:o.lineNumber,side:o.side,viewportOffset:r-e}}}}resolveAnchoredScrollTop(e){let t=this.idToItem.get(e.id);if(t==null)return;let n=this.getItemTopOffset();if(e.type===`item`){let r=n+t.top;return this.clampScrollTop(r-e.viewportOffset)}let r=t.type===`diff`?t.instance.getLinePosition(e.lineNumber,e.side):t.instance.getLinePosition(e.lineNumber);if(r==null)return;let i=n+t.top+r.top;return this.clampScrollTop(i-e.viewportOffset)}applyScrollFix(e,t,n){if(this.root==null)return;let r=G(this.clampScrollTop(e)),i=G(t),{scrollPageOffset:a}=this,o=G(this.clampPagedScrollTop(i-a)),{pagedScrollTop:s,scrollPageOffset:c}=this.resolvePagedScrollPosition(r),l=s,u=a!==c;r===this.renderState.scrollTop&&r===i&&l===o&&!u||(this.suspendScrollInteractions(),(l!==o||u)&&(this.scrollPageOffset=c,this.syncPagedScrollScaffolding(n)),l!==o&&this.root.scrollTo({top:l,behavior:`instant`}),this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1)}isPendingTargetSettled(e){let t=this.resolveScrollTargetTop(e);return t==null?!0:G(this.getScrollTop())===G(t)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(e+this.scrollPageOffset),this.scrollTop}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height):this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let e=this.buildSlotSnapshot(this.slotCoordinator);fe(this.slotSnapshot,e)||(this.slotSnapshot=e,this.slotCoordinator.onSnapshotChange(e))}notifyScroll(){if(this.scrollListeners.size===0)return;let e=this.getScrollTop();for(let t of this.scrollListeners)t(e,this)}findFirstVisibleIndex(e){let t=0,n=this.items.length-1,r=this.items.length;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findFirstVisibleIndex: invalid item index`);a.top+a.height>e?(r=i,n=i-1):t=i+1}return r}findLastVisibleIndex(e){let t=0,n=this.items.length-1,r=-1;for(;t<=n;){let i=t+n>>1,a=this.items[i];if(a==null)throw Error(`CodeView.findLastVisibleIndex: invalid item index`);a.top<=e?(r=i,t=i+1):n=i-1}return r}recomputeLayout(e=0,t){if(this.items.length===0){this.scrollHeight=0;return}let n=this.getLayout(),r=0;if(e>0){let t=this.items[e-1];if(t==null)throw Error(`CodeView.recomputeLayout: invalid dirty index`);r=t.top+t.height+n.gap}for(let i=e;i<this.items.length;i++){let e=this.items[i];if(e==null)throw Error(`CodeView.recomputeLayout: invalid item index`);if(e.top=r,e.type===`diff`){let n=e.instance.consumeCodeViewLayoutChanges(e.item.fileDiff);n!=null&&Object.assign(e.item.fileDiff,n),e.height=e.instance.prepareCodeViewItem(e.item.fileDiff,r,t,e.item.annotations??[])}else e.height=e.instance.prepareCodeViewItem(e.item.file,r,t,e.item.annotations??[]);r+=e.height,i<this.items.length-1&&(r+=n.gap)}r!==this.scrollHeight&&(this.scrollDirty=!0),this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function je(e){return e.instance.cleanUp(!0),e.type===`diff`?e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]):e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function Me(e,t){return!d(e.theme??x,t.theme??x)||(e.themeType??`system`)!==(t.themeType??`system`)||e.unsafeCSS!==t.unsafeCSS}function Ne(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Pe(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Fe(e){return e instanceof SVGElement?!0:p(e)&&(e.hasAttribute(`data-core-css`)||e.hasAttribute(`data-theme-css`)||e.hasAttribute(`data-unsafe-css`))}function Ie(e){let t=Le(e.start,e.side),n=Le(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Le(e,t){return t==null?`${e}`:`${t===`deletions`?`D`:`A`}${e}`}function Y(e,t,n=!1){return e.type===`diff`?e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]}):e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Re(e,t,n){if(n==null){e.firstChild!==t&&e.prepend(t);return}n.nextSibling!==t&&n.after(t)}function ze(e){return(e.annotations?.length??0)>0}function Be(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:r}){if(e.length===0)return;if(t||r)return e;if(!n)return;let i=[];for(let t of e)ze(t.item)&&i.push(t);return i.length>0?i:void 0}var X=e(a(),1),Z=i(),Ve=typeof window>`u`?j.useEffect:j.useLayoutEffect;function He(e){return{instance:void 0,items:void 0,controlled:e,managedOptions:void 0,disableFlushSync:!1,slotCoordinator:void 0}}function Ue(e,t){let{className:n,containerRef:r,createEditor:i,disableWorkerPool:a=!1,initialItems:o,items:s,onItemEditChange:l,onItemEditComplete:u,onScroll:d,onSelectedLinesChange:p,options:h,renderAnnotation:g,renderCodeViewFooter:_,renderCodeViewHeader:v,renderCustomHeader:y,renderGutterUtility:b,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderHeaderPrefix:C,selectedLines:w,style:T}=e,E=s!==void 0,ee=(0,j.useContext)(c),D=(0,j.useRef)(He(E)),O=y!=null,k=g!=null,A=b!=null,M=O||C!=null||x!=null||S!=null,te=M||k||A,N=v!=null,P=_!=null,F=f(e=>{p?.(e)}),I=w!==void 0,L=f(e=>i?.(e)),R=f((e,t,n)=>{l?.(e,t,n)}),z=f((e,t,n)=>{u?.(e,t,n)}),B=(0,j.useMemo)(()=>Je({options:h,hasCustomHeader:O,hasGutterRenderer:A,hasCodeViewHeader:N,hasCodeViewFooter:P,onSelectedLinesChange:p==null?void 0:F,controlledSelection:I,createEditor:i==null?void 0:L,onItemEditChange:l==null?void 0:R,onItemEditComplete:u==null?void 0:z}),[h,O,A,N,P,p,F,I,i,L,l,R,u,z]),[V]=(0,j.useState)(()=>qe()),[,H]=(0,j.useState)({}),ne=f(e=>{D.current.instance!=null&&(e==null||e!==D.current.instance.getContainerElement())&&(D.current.instance.cleanUp(),V.publish(void 0),D.current=He(E)),e!=null&&e!==D.current.instance?.getContainerElement()&&(D.current.instance=new Ae(B,a?void 0:ee,!0),D.current.instance.setup(e)),typeof r==`function`?r(e):r!=null&&(r.current=e)}),U=f(e=>{D.current.disableFlushSync?V.publish(e):(0,X.flushSync)(()=>{V.publish(e)})}),W=(0,j.useMemo)(()=>{if(!(!M&&!k&&!A&&!N&&!P))return{hasHeaderRenderers:M,hasAnnotationRenderer:k,hasGutterRenderer:A,onSnapshotChange:U}},[U,k,A,M,N,P]);return Ve(()=>d==null?void 0:D.current.instance?.subscribeToScroll(d)),Ve(()=>{let{instance:e,controlled:t,items:n,managedOptions:r,slotCoordinator:i}=D.current;if(e!=null)try{D.current.disableFlushSync=!0;let a=!1;if(m(B,r)||(D.current.managedOptions=B,e.setOptions(B),a=!0),t!==E){console.error(`CodeView: cannot switch between controlled and uncontrolled modes. Remount with a new key instead.`);return}if(E)s!==n&&(Ke(n,s)?D.current.items=s:Ge(n,s)?(D.current.items=s,e.addItems(s.slice(n.length))):(D.current.items=s,e.setItems(s),a=!0));else if(n==null){let t=o??[];D.current.items=t,t.length>0&&(e.setItems(t),a=!0)}w!==void 0&&e.setSelectedLines(w,{notify:!1});let c=e.setSlotCoordinator(W),l=!1;W!==i&&((W==null||i==null)&&(l=!0),D.current.slotCoordinator=W),(a||c)&&e.render(!0),c&&W==null&&V.publish(void 0),l&&H({})}finally{D.current.disableFlushSync=!1}}),(0,j.useImperativeHandle)(t,()=>({addItems(e){let{controlled:t,instance:n}=D.current;Q(t,`addItems`),n==null?console.error(`CodeView.addItems: no valid instance to append items with`,e):n.addItems(e)},getItem(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getItem: no valid instance exists`,e);return}else return t.getItem(e)},updateItem(e){let{controlled:t,instance:n}=D.current;return Q(t,`updateItem`),n==null?(console.error(`CodeView.updateItem: no valid instance to update item with`,e),!1):n.updateItem(e)},updateItemId(e,t){let{controlled:n,instance:r}=D.current;return Q(n,`updateItemId`),r==null?(console.error(`CodeView.updateItemId: no valid instance to update item id with`,e,t),!1):r.updateItemId(e,t)},scrollTo(e){let{instance:t}=D.current;t==null?console.error(`CodeView.scrollTo: no valid instance to scroll with`,e):t.scrollTo(e)},setSelectedLines(e){let{instance:t}=D.current;t==null?console.error(`CodeView.setSelectedLines: no valid instance to update selection with`,e):(t.setSelectedLines(e,{notify:!1}),F(e))},getSelectedLines(){let{instance:e}=D.current;return e==null?(console.error(`CodeView.getSelectedLines: no valid instance exists`),null):e.getSelectedLines()},clearSelectedLines(){let{instance:e}=D.current;e==null?console.error(`CodeView.clearSelectedLines: no valid instance to update selection with`):(e.clearSelectedLines({notify:!1}),F(null))},getEditor(e){let{instance:t}=D.current;if(t==null){console.error(`CodeView.getEditor: no valid instance exists`,e);return}return t.getEditor(e)},getInstance(){return D.current.instance}}),[F]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{ref:ne,className:n,style:T}),(te||N||P)&&(0,Z.jsx)(Ye,{managedContentStore:V,renderCustomHeader:y,renderHeaderPrefix:C,renderHeaderFilenameSuffix:x,renderHeaderMetadata:S,renderAnnotation:g,renderGutterUtility:b,renderCodeViewHeader:v,renderCodeViewFooter:_})]})}var We=(0,j.forwardRef)(Ue);function Ge(e,t){if(e==null||t.length<=e.length)return!1;if(e.length===0)return!0;for(let n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}function Ke(e,t){if(e==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Q(e,t){if(e)throw Error(`CodeView.${t} cannot be used when CodeView is controlled. Use initialItems for imperative item updates.`)}function qe(){let e,t=new Set;return{getSnapshot(){return e},publish(n){if(!fe(e,n)){e=n;for(let e of t)e()}},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function Je({options:e,hasCustomHeader:t,hasGutterRenderer:n,hasCodeViewHeader:r,hasCodeViewFooter:i,onSelectedLinesChange:a,controlledSelection:o,createEditor:s,onItemEditChange:c,onItemEditComplete:l}){return!t&&!n&&!r&&!i&&a==null&&!o&&s==null&&c==null&&l==null?e??{}:(e={...e,controlledSelection:o,onSelectedLinesChange:a},s!=null&&(e.createEditor=s),c!=null&&(e.onItemEditChange=c),l!=null&&(e.onItemEditComplete=l),t&&(e.renderCustomHeader=$),n&&(e.renderGutterUtility=$),r&&(e.renderCodeViewHeader=$),i&&(e.renderCodeViewFooter=$),e)}var Ye=(0,j.memo)(function({managedContentStore:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o,renderCodeViewHeader:s,renderCodeViewFooter:c}){"use no memo";let l=f(t=>e.subscribe(t)),u=f(()=>e.getSnapshot()),d=(0,j.useSyncExternalStore)(l,u,u),p=``;for(let e of d?.items??[])p+=`${e.id}:${e.version}:${e.type}`;return(0,Z.jsxs)(Z.Fragment,{children:[(0,j.useMemo)(()=>d?.items?.map(e=>(0,X.createPortal)(Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}),e.element,e.id)),[t,n,r,i,a,o,p]),(0,j.useMemo)(()=>s!=null&&d?.header!=null?(0,X.createPortal)(s(),d.header):null,[s,d?.header]),(0,j.useMemo)(()=>c!=null&&d?.footer!=null?(0,X.createPortal)(c(),d.footer):null,[c,d?.footer])]})});function Xe({renderedItem:e,renderCustomHeader:t,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:i,renderAnnotation:a,renderGutterUtility:o}){if(e.type===`diff`){let{item:s,instance:c}=e;return ee({fileDiff:s.fileDiff,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}else{let{item:s,instance:c}=e;return k({file:s.file,renderCustomHeader:t==null?void 0:()=>t(s),renderHeaderPrefix:n==null?void 0:()=>n(s),renderHeaderFilenameSuffix:r==null?void 0:()=>r(s),renderHeaderMetadata:i==null?void 0:()=>i(s),renderAnnotation:a==null?void 0:e=>a(e,s),lineAnnotations:s.annotations,renderGutterUtility:o==null?void 0:e=>o(e,s),getHoveredLine:c.getHoveredLine})}}function $(){}var Ze=t(),Qe=`${u}
2
2
  :is(
3
3
  [data-line],
4
4
  [data-line-annotation],
@@ -245,4 +245,4 @@ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./a
245
245
  }
246
246
  }
247
247
  `;function $e(e){let t=(0,Ze.c)(18),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({options:r,viewerRef:o,className:n,unsafeCSSExtra:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===o?s=t[7]:(s=o?{ref:o}:{},t[6]=o,t[7]=s);let c=n?`diff-render-surface [--code-background:var(--background)] outline-none ${n}`:`diff-render-surface [--code-background:var(--background)] outline-none`,l=a?`${Qe}\n${a}`:Qe,u,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u={diffHeaderHeight:32,hunkSeparatorHeight:24,spacing:0,paddingTop:0,paddingBottom:8},d={paddingTop:0,paddingBottom:0,gap:0},t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;t[10]!==r||t[11]!==l?(f={...r,unsafeCSS:l,itemMetrics:u,layout:d},t[10]=r,t[11]=l,t[12]=f):f=t[12];let p;return t[13]!==i||t[14]!==s||t[15]!==c||t[16]!==f?(p=(0,Z.jsx)(We,{...i,...s,className:c,options:f}),t[13]=i,t[14]=s,t[15]=c,t[16]=f,t[17]=p):p=t[17],p}function et(e,t){return async n=>{let r=w(n),i=n.prevName?w({...n,name:n.prevName}):r,a=await e({changeType:n.type,oldPath:i,newPath:r}),o={name:r,contents:a.newContents,cacheKey:`${t}:new:${r}`};return n.type===`rename-pure`?{oldFile:null,newFile:o}:{oldFile:{name:i,contents:a.oldContents,cacheKey:`${t}:old:${i}`},newFile:o}}}function tt(e,t){return et(async({changeType:n,oldPath:r,newPath:i})=>{let a=await e({environmentId:t.environmentId,input:{cwd:t.cwd,threadId:t.threadId,sourceKind:t.sourceKind,changeType:n,baseRef:t.baseRef,headRef:t.headRef,oldPath:r,newPath:i}});if(a._tag!==`Success`)throw o(a);return a.value},t.cacheKey)}function nt(e,t){return et(async({changeType:n,oldPath:r,newPath:i})=>{let a=await e({environmentId:t.environmentId,input:{...t.reference,...t.commit===null?{}:{commit:t.commit},changeType:n,oldPath:r,newPath:i}});if(a._tag!==`Success`)throw o(a);return a.value},t.cacheKey)}export{de as a,ue as i,nt as n,le as o,$e as r,H as s,tt as t};
248
- //# sourceMappingURL=diffFileContents-CHRsIT6_.js.map
248
+ //# sourceMappingURL=diffFileContents-DuZ8MpUA.js.map
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-BKyjOPQm.js";import{Eo as r,Ho as i,mo as a,t as o}from"./utils-ClZ5OxbV.js";import"./textarea-BT0tVWKM.js";import{t as s}from"./input-CyCAHFxI.js";var c=e(n(),1),l=new Map([[`bold`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),u=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||={})m.call(t,n)&&g(e,n,t[n]);if(p)for(var n of p(t))h.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>d(e,f(t)),y=(0,c.forwardRef)((e,t)=>c.createElement(r,v(_({ref:t},e),{weights:l})));y.displayName=`ArrowClockwise`;var b=t(),x=i(),S=a(`relative inline-flex w-full min-w-0 items-center rounded-[var(--control-radius)] border text-base text-foreground ring-ring/24 transition-shadow has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--control-radius)-1px)]`,{defaultVariants:{variant:`default`},variants:{variant:{default:`border-input bg-background not-dark:bg-clip-padding shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--control-radius)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)]`,ghost:`border-transparent bg-transparent shadow-none hover:bg-muted/40 has-[input:focus-visible,textarea:focus-visible]:bg-background`}}});function C(e){let t=(0,b.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=o(S({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,x.jsx)(`div`,{className:a,"data-slot":`input-group`,role:`group`,...r}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}var w=a(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function T(e){let t=(0,b.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,s;t[4]!==a||t[5]!==n?(s=o(w({align:a}),n),t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==s?(c=(0,x.jsx)(`div`,{className:s,"data-align":a,"data-slot":`input-group-addon`,onMouseDown:E,...r}),t[7]=a,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function E(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function D(e){let t=(0,b.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,x.jsx)(s,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function O(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance p-6 text-center md:p-12`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex max-w-sm flex-col items-center text-center`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var A=a(`flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent`,icon:`relative flex size-10 shrink-0 items-center justify-center rounded-control bg-canvas-quiet text-foreground [&_svg:not([class*='size-'])]:size-4.5`}}});function j(e){let t=(0,b.c)(21),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,s;t[4]===n?s=t[5]:(s=o(`relative mb-6`,n),t[4]=n,t[5]=s);let c;t[6]!==n||t[7]!==a?(c=a===`icon`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{"aria-hidden":`true`,className:o(A({className:n,variant:a}),`-translate-x-0.5 -rotate-10 pointer-events-none absolute bottom-px origin-bottom-left scale-84 shadow-none`)}),(0,x.jsx)(`div`,{"aria-hidden":`true`,className:o(A({className:n,variant:a}),`pointer-events-none absolute bottom-px origin-bottom-right translate-x-0.5 rotate-10 scale-84 shadow-none`)})]}),t[6]=n,t[7]=a,t[8]=c):c=t[8];let l;t[9]!==n||t[10]!==a?(l=o(A({className:n,variant:a})),t[9]=n,t[10]=a,t[11]=l):l=t[11];let u;t[12]!==r||t[13]!==l?(u=(0,x.jsx)(`div`,{className:l,...r}),t[12]=r,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==r||t[16]!==s||t[17]!==c||t[18]!==u||t[19]!==a?(d=(0,x.jsxs)(`div`,{className:s,"data-slot":`empty-media`,"data-variant":a,...r,children:[c,u]}),t[15]=r,t[16]=s,t[17]=c,t[18]=u,t[19]=a,t[20]=d):d=t[20],d}function M(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`font-serif text-[26px] font-normal leading-[1.15] tracking-[-0.01em]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function N(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`text-muted-foreground text-sm [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-slot=empty-title]+&]:mt-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function P(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-content`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,T as c,k as i,D as l,P as n,M as o,N as r,C as s,O as t,y as u};
2
- //# sourceMappingURL=empty-DUUjhkFh.js.map
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{v as t,y as n}from"./accountData-B88fzgQo.js";import{Eo as r,Ho as i,mo as a,t as o}from"./utils-dD8AT1Cf.js";import"./textarea-bjEgsW0n.js";import{t as s}from"./input-DzNFHo2W.js";var c=e(n(),1),l=new Map([[`bold`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,c.createElement(c.Fragment,null,c.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),u=Object.defineProperty,d=Object.defineProperties,f=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||={})m.call(t,n)&&g(e,n,t[n]);if(p)for(var n of p(t))h.call(t,n)&&g(e,n,t[n]);return e},v=(e,t)=>d(e,f(t)),y=(0,c.forwardRef)((e,t)=>c.createElement(r,v(_({ref:t},e),{weights:l})));y.displayName=`ArrowClockwise`;var b=t(),x=i(),S=a(`relative inline-flex w-full min-w-0 items-center rounded-[var(--control-radius)] border text-base text-foreground ring-ring/24 transition-shadow has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/64 has-[input:focus-visible,textarea:focus-visible]:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/16 has-[textarea]:h-auto has-data-[align=block-end]:h-auto has-data-[align=block-start]:h-auto has-data-[align=block-end]:flex-col has-data-[align=block-start]:flex-col has-[input:focus-visible,textarea:focus-visible]:border-ring has-[input[aria-invalid],textarea[aria-invalid]]:border-destructive/36 has-autofill:bg-foreground/4 has-[input:disabled,textarea:disabled]:opacity-64 has-[input:disabled,textarea:disabled,input:focus-visible,textarea:focus-visible,input[aria-invalid],textarea[aria-invalid]]:shadow-none has-[input:focus-visible,textarea:focus-visible]:ring-[3px] sm:text-sm dark:has-autofill:bg-foreground/8 dark:has-[input[aria-invalid],textarea[aria-invalid]]:ring-destructive/24 has-data-[align=inline-start]:**:[[data-size=sm]_input]:ps-1.5 has-data-[align=inline-end]:**:[[data-size=sm]_input]:pe-1.5 *:[[data-slot=input-control],[data-slot=textarea-control]]:contents *:[[data-slot=input-control],[data-slot=textarea-control]]:before:hidden has-[[data-align=block-start],[data-align=block-end]]:**:[input]:h-auto has-data-[align=inline-start]:**:[input]:ps-2 has-data-[align=inline-end]:**:[input]:pe-2 has-data-[align=block-end]:**:[input]:pt-1.5 has-data-[align=block-start]:**:[input]:pb-1.5 **:[textarea]:min-h-20.5 **:[textarea]:resize-none **:[textarea]:py-[calc(--spacing(3)-1px)] **:[textarea]:max-sm:min-h-23.5 **:[textarea_button]:rounded-[calc(var(--control-radius)-1px)]`,{defaultVariants:{variant:`default`},variants:{variant:{default:`border-input bg-background not-dark:bg-clip-padding shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--control-radius)-1px)] not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-has-[input:disabled,textarea:disabled]:not-has-[input:focus-visible,textarea:focus-visible]:not-has-[input[aria-invalid],textarea[aria-invalid]]:before:shadow-[0_-1px_--theme(--color-white/6%)]`,ghost:`border-transparent bg-transparent shadow-none hover:bg-muted/40 has-[input:focus-visible,textarea:focus-visible]:bg-background`}}});function C(e){let t=(0,b.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=o(S({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,x.jsx)(`div`,{className:a,"data-slot":`input-group`,role:`group`,...r}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}var w=a(`[&_svg]:-mx-0.5 flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80`,{defaultVariants:{align:`inline-start`},variants:{align:{"block-end":`order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"block-start":`order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]`,"inline-end":`has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 order-last pe-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]`,"inline-start":`has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 order-first ps-[calc(--spacing(3)-1px)] has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]`}}});function T(e){let t=(0,b.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,s;t[4]!==a||t[5]!==n?(s=o(w({align:a}),n),t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==a||t[8]!==r||t[9]!==s?(c=(0,x.jsx)(`div`,{className:s,"data-align":a,"data-slot":`input-group-addon`,onMouseDown:E,...r}),t[7]=a,t[8]=r,t[9]=s,t[10]=c):c=t[10],c}function E(e){if(e.target.closest(`button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']`))return;e.preventDefault();let t=e.currentTarget.parentElement,n=t?.querySelector(`input, textarea`);n&&!t?.querySelector(`input:focus, textarea:focus`)&&n.focus()}function D(e){let t=(0,b.c)(6),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;return t[3]!==n||t[4]!==r?(i=(0,x.jsx)(s,{className:n,unstyled:!0,...r}),t[3]=n,t[4]=r,t[5]=i):i=t[5],i}function O(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance p-6 text-center md:p-12`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function k(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex max-w-sm flex-col items-center text-center`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-header`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var A=a(`flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-transparent`,icon:`relative flex size-10 shrink-0 items-center justify-center rounded-control bg-canvas-quiet text-foreground [&_svg:not([class*='size-'])]:size-4.5`}}});function j(e){let t=(0,b.c)(21),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,s;t[4]===n?s=t[5]:(s=o(`relative mb-6`,n),t[4]=n,t[5]=s);let c;t[6]!==n||t[7]!==a?(c=a===`icon`&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{"aria-hidden":`true`,className:o(A({className:n,variant:a}),`-translate-x-0.5 -rotate-10 pointer-events-none absolute bottom-px origin-bottom-left scale-84 shadow-none`)}),(0,x.jsx)(`div`,{"aria-hidden":`true`,className:o(A({className:n,variant:a}),`pointer-events-none absolute bottom-px origin-bottom-right translate-x-0.5 rotate-10 scale-84 shadow-none`)})]}),t[6]=n,t[7]=a,t[8]=c):c=t[8];let l;t[9]!==n||t[10]!==a?(l=o(A({className:n,variant:a})),t[9]=n,t[10]=a,t[11]=l):l=t[11];let u;t[12]!==r||t[13]!==l?(u=(0,x.jsx)(`div`,{className:l,...r}),t[12]=r,t[13]=l,t[14]=u):u=t[14];let d;return t[15]!==r||t[16]!==s||t[17]!==c||t[18]!==u||t[19]!==a?(d=(0,x.jsxs)(`div`,{className:s,"data-slot":`empty-media`,"data-variant":a,...r,children:[c,u]}),t[15]=r,t[16]=s,t[17]=c,t[18]=u,t[19]=a,t[20]=d):d=t[20],d}function M(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`font-serif text-[26px] font-normal leading-[1.15] tracking-[-0.01em]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-title`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function N(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`text-muted-foreground text-sm [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4 [[data-slot=empty-title]+&]:mt-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-description`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function P(e){let t=(0,b.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=o(`flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,x.jsx)(`div`,{className:i,"data-slot":`empty-content`,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}export{j as a,T as c,k as i,D as l,P as n,M as o,N as r,C as s,O as t,y as u};
2
+ //# sourceMappingURL=empty-d8cb8Ewx.js.map
@@ -0,0 +1,2 @@
1
+ import{i as e,v as t}from"./accountData-B88fzgQo.js";import{dt as n,gt as r,ht as i,mt as a,yo as o}from"./utils-dD8AT1Cf.js";import{An as s,Nn as c,Tn as l,kn as u,m as d,tt as f}from"./session-BKSQ__kZ.js";import{T as p,ot as m,w as h,wt as g}from"./textarea-bjEgsW0n.js";import{U as _}from"./useSettings-BgyJJ6VZ.js";var v=new Set([`pull-request`]);function y(e,t){return t||!v.has(e)}function ee(e,t){return e.filter(e=>y(e.kind,t))}var b=e(`borgcode:right-panel-state:v2`),x=12,S=e=>e.endsWith(`:pull-requests-panel`),C={isOpen:!1,activeSurfaceId:null,surfaces:[]},w=e=>{switch(e){case`diff`:return{id:`diff`,kind:e};case`files`:return{id:`files`,kind:e};case`file-preview`:return{id:`file-preview`,kind:e,relativePath:null,revealLine:null,revealRequestId:0};case`agents`:return{id:`agents`,kind:e}}},T=e=>e?{id:`browser:${e}`,kind:`preview`,resourceId:e}:{id:`browser:new`,kind:`preview`,resourceId:null},E=(e,t,n)=>({id:`file:${e}`,kind:`file`,relativePath:e,revealLine:t,revealRequestId:n}),te=e=>({id:`terminal:${e}`,kind:`terminal`,resourceId:e,terminalIds:[e],activeTerminalId:e});function ne(e){return`pull-request:${e.environmentId===void 0?``:`${encodeURIComponent(e.environmentId)}:`}${encodeURIComponent(e.projectId)}:${encodeURIComponent(e.repository)}:${e.number}`}function D(e){return{id:ne(e),kind:`pull-request`,...e.environmentId===void 0?{}:{environmentId:e.environmentId},projectId:e.projectId,repository:e.repository,number:e.number}}function O(e,t,n){return e[t]?.state===n.state&&e[t]?.isDraft===n.isDraft?e:{...e,[t]:n}}var k=(e,t,n=!0)=>({isOpen:!0,surfaces:e.surfaces.some(e=>e.id===t.id)?e.surfaces:[...e.surfaces,t],activeSurfaceId:n?t.id:e.activeSurfaceId}),A=(e,t,n)=>{let r=e[t]??C,i=n(r);if(!i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0){if(!(t in e))return e;let{[t]:n,...r}=e;return r}return i===r?e:{...e,[t]:i}};function j(e){return e===void 0||!Number.isFinite(e)?null:Math.max(1,Math.trunc(e))}function M(e){return!e||typeof e!=`object`?{byThreadKey:{}}:{byThreadKey:`byThreadKey`in e&&e.byThreadKey&&typeof e.byThreadKey==`object`?Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!S(e)).map(([e,t])=>{let n=t&&typeof t==`object`?t:null,r=Array.isArray(n?.surfaces)?n.surfaces.flatMap(e=>{let t=e.kind;if(t===`plan`||t===`design`)return[];if(e.kind===`file`){let t=typeof e.revealLine==`number`&&Number.isFinite(e.revealLine)?Math.max(1,Math.trunc(e.revealLine)):null,n=typeof e.revealRequestId==`number`&&Number.isSafeInteger(e.revealRequestId)&&e.revealRequestId>=0?e.revealRequestId:0;return[{...e,revealLine:t,revealRequestId:n}]}if(e.kind===`pull-request`){if(typeof e.projectId!=`string`||typeof e.repository!=`string`||typeof e.number!=`number`||!Number.isSafeInteger(e.number)||e.number<1)return[];let{environmentId:t,...n}=e;return[D({...n,...typeof t==`string`?{environmentId:t}:{}})]}if(e.kind!==`terminal`)return[e];if(!(`resourceId`in e)||typeof e.resourceId!=`string`||e.id!==`terminal:${e.resourceId}`)return[];let n=`terminalIds`in e&&Array.isArray(e.terminalIds)?[...new Set(e.terminalIds.filter(e=>typeof e==`string`))]:[e.resourceId],r=`activeTerminalId`in e&&typeof e.activeTerminalId==`string`&&n.includes(e.activeTerminalId)?e.activeTerminalId:n[0]??e.resourceId;return[{...e,terminalIds:n.length>0?n:[e.resourceId],activeTerminalId:r}]}):[],i=n?.activeSurfaceId,a=r.some(e=>e.id===i)?i??null:i===`pull-request`?r.find(e=>e.kind===`pull-request`)?.id??null:null,o=r.length>0&&(typeof n?.isOpen==`boolean`?n.isOpen:a!==null);return[e,{isOpen:o,surfaces:r,activeSurfaceId:a??(o?r[0]?.id??null:null)}]})):{}}}var N=r()(i(e=>({byThreadKey:{},open:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>n===`preview`?k(e,e.surfaces.find(e=>e.kind===`preview`)??T(null)):k(e,w(n)))})),openBrowser:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=T(n),r=n?e.surfaces.filter(e=>e.id!==`browser:new`):e.surfaces;return k({...e,surfaces:r},t)})})),selectFilePreview:(t,n,r)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.kind===`file-preview`),i={id:`file-preview`,kind:`file-preview`,relativePath:n,revealLine:j(r),revealRequestId:(t?.kind===`file-preview`?t.revealRequestId:0)+1};return k({...e,surfaces:e.surfaces.map(e=>e.kind===`file-preview`?i:e)},i)})})),openPullRequest:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>k(e,D(n)))})),openFile:(t,n,r)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.filter(e=>e.kind!==`files`),i=`file:${n}`,a=t.find(e=>e.id===i&&e.kind===`file`),o=E(n,j(r),(a?.revealRequestId??0)+1);return{isOpen:!0,activeSurfaceId:o.id,surfaces:a?t.map(e=>e.id===o.id?o:e):[...t,o]}})})),openTerminal:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>k(e,te(n)))})),splitTerminal:(t,n,r,i=`horizontal`)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>({...e,isOpen:!0,activeSurfaceId:n,surfaces:e.surfaces.map(e=>{if(e.id!==n||e.kind!==`terminal`)return e;let{splitDirection:t,...a}=e;return{...a,terminalIds:e.terminalIds.includes(r)?e.terminalIds:[...e.terminalIds,r],activeTerminalId:r,...i===`vertical`?{splitDirection:`vertical`}:{}}})}))})),activateTerminal:(t,n,r)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>({...e,activeSurfaceId:n,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`&&e.terminalIds.includes(r)?{...e,activeTerminalId:r}:e)}))})),closeTerminal:(t,n,r)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.id===n&&e.kind===`terminal`);if(!t||t.kind!==`terminal`)return e;let i=t.terminalIds.filter(e=>e!==r);if(i.length===0){let t=e.surfaces.findIndex(e=>e.id===n),r=e.surfaces.filter(e=>e.id!==n),i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:e.activeSurfaceId===n?i?.id??null:e.activeSurfaceId}}return{...e,surfaces:e.surfaces.map(e=>e.id===n&&e.kind===`terminal`?{...e,terminalIds:i,activeTerminalId:e.activeTerminalId===r?i.at(-1)??i[0]:e.activeTerminalId}:e)}})})),activateSurface:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>e.surfaces.some(e=>e.id===n)?{...e,isOpen:!0,activeSurfaceId:n}:e)})),closeSurface:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0)return e;let r=e.surfaces.filter(e=>e.id!==n);if(e.activeSurfaceId!==n)return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r};let i=r[Math.min(t,r.length-1)]??null;return{...e,isOpen:r.length>0&&e.isOpen,surfaces:r,activeSurfaceId:i?.id??null}})})),closeOtherSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(e=>e.id===n);return!t||e.surfaces.length===1?e:{...e,isOpen:!0,surfaces:[t],activeSurfaceId:t.id}})})),closeSurfacesToRight:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.findIndex(e=>e.id===n);if(t<0||t===e.surfaces.length-1)return e;let r=e.surfaces.slice(0,t+1),i=r.some(t=>t.id===e.activeSurfaceId);return{...e,surfaces:r,activeSurfaceId:i?e.activeSurfaceId:n}})})),closeAllSurfaces:t=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>e.surfaces.length===0?e:{...e,isOpen:!1,surfaces:[],activeSurfaceId:null})})),reconcileBrowserSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=new Set(n.map(e=>`browser:${e}`)),r=e.surfaces.filter(e=>e.kind!==`preview`),i=e.surfaces.filter(e=>e.kind===`preview`&&e.id!==`browser:new`&&t.has(e.id)),a=new Set(i.map(e=>e.id)),o=n.filter(e=>!a.has(`browser:${e}`)).map(e=>T(e)),s=[...r,...i,...o],c=s.some(t=>t.id===e.activeSurfaceId),l=s.find(e=>e.kind===`preview`);return{...e,surfaces:s,activeSurfaceId:c?e.activeSurfaceId:l?.id??s[0]?.id??null}})})),reconcileFileSurfaces:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{if(n)return e;let t=e.surfaces.filter(e=>e.kind!==`files`&&e.kind!==`file`);if(t.length===e.surfaces.length)return e;let r=t.some(t=>t.id===e.activeSurfaceId);return{...e,isOpen:t.length>0?e.isOpen:!1,surfaces:t,activeSurfaceId:r?e.activeSurfaceId:t.at(-1)?.id??null}})})),show:t=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>e.isOpen?e:{...e,isOpen:!0})})),close:t=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>e.isOpen?{...e,isOpen:!1}:e)})),toggleVisibility:t=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>({...e,isOpen:!e.isOpen}))})),toggle:(t,n)=>e(e=>({byThreadKey:A(e.byThreadKey,o(t),e=>{let t=e.surfaces.find(t=>t.id===e.activeSurfaceId);return e.isOpen&&t?.kind===n?{...e,isOpen:!1}:n===`preview`?k(e,e.surfaces.find(e=>e.kind===`preview`)??T(null)):k(e,w(n))})})),removeThread:t=>e(e=>{let n=o(t);if(!(n in e.byThreadKey))return e;let{[n]:r,...i}=e.byThreadKey;return{byThreadKey:i}})}),{name:b,version:x,storage:a(()=>n(typeof window<`u`?window.localStorage:void 0)),partialize:e=>({byThreadKey:Object.fromEntries(Object.entries(e.byThreadKey).filter(([e])=>!S(e)))}),migrate:M}));function P(e,t){return t?e[o(t)]??C:C}function F(e,t){let n=P(e,t);return n.isOpen?n.surfaces.find(e=>e.id===n.activeSurfaceId)?.kind??null:null}function I(e,t){return P(e,t).isOpen?L(e,t):null}function L(e,t){let n=P(e,t);return n.surfaces.find(e=>e.id===n.activeSurfaceId)??null}var R=t(),z=Object.freeze([]),B=Object.freeze([]),V=Object.freeze([]),H=Object.freeze([]),U=Object.freeze([]),W=s(null).pipe(c(`web-project:empty`));s(z).pipe(c(`web-project-refs:empty`));var G=s(B).pipe(c(`web-thread-refs:empty`)),K=s(null).pipe(c(`web-thread-shell:empty`)),q=s(null).pipe(c(`web-thread-detail:empty`)),re=s(`empty`).pipe(c(`web-thread-status:empty`));s(V).pipe(c(`web-thread-messages:empty`)),s(H).pipe(c(`web-thread-activities:empty`)),s(U).pipe(c(`web-thread-proposed-plans:empty`)),s(null).pipe(c(`web-thread-session:empty`));var J=s(null).pipe(u,c(`web-active-environment-id`));function Y(){return l(J)}function X(e){d.set(J,e)}function ie(){return l(p.threadRefsAtom)}function ae(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?G:p.environmentThreadRefsAtom(e),t[0]=e,t[1]=n),l(n)}function oe(){return l(m.projectsAtom)}function se(){return l(_)}function ce(){return l(p.threadShellsAtom)}function le(){return l(g)}function ue(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=p.threadShellsForProjectRefsAtom(e),t[0]=e,t[1]=n),l(n)}function de(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?W:m.projectAtom(e),t[0]=e,t[1]=n),l(n)}function Z(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?K:p.threadShellAtom(e),t[0]=e,t[1]=n),l(n)}function Q(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?q:h.detailAtom(e),t[0]=e,t[1]=n),l(n)}function fe(e){let t=(0,R.c)(2),n;return t[0]===e?n=t[1]:(n=e===null?re:h.statusAtom(e),t[0]=e,t[1]=n),l(n)}function pe(e,t){return e!==null&&(!t.waitForShell||t.shellExists)?e:null}function me(e,t){let n=(0,R.c)(7),r=Z(e),i=r!==null,a=t?.waitForShell===!0,o;n[0]!==e||n[1]!==i||n[2]!==a?(o=pe(e,{shellExists:i,waitForShell:a}),n[0]=e,n[1]=i,n[2]=a,n[3]=o):o=n[3];let s=Q(o),c;return n[4]!==s||n[5]!==r?(c=f(s,r),n[4]=s,n[5]=r,n[6]=c):c=n[6],c}function he(e){return d.get(m.projectAtom(e))}function ge(e){return d.get(p.threadShellAtom(e))}function $(e){return d.get(_).get(e)?.environment.capabilities.threadSettlement===!0}function _e(e){return d.get(_).get(e)?.environment.capabilities.threadSnooze===!0}function ve(e){return d.get(_).get(e)?.environment.capabilities.threadPublish===!0}function ye(e){return d.get(_).get(e)?.environment.capabilities.threadPinning===!0}function be(e){return d.get(_).get(e)?.environment.capabilities.threadTitleRegeneration===!0}function xe(e){return d.get(_).get(e)?.environment.capabilities.threadPinReorder===!0}function Se(e){return d.get(p.environmentThreadRefsAtom(e))}function Ce(){return d.get(p.threadShellsAtom)}export{O as A,ue as C,I as D,F as E,ee as M,L as O,ce as S,y as T,se as _,_e as a,ie as b,he as c,X as d,Y as f,oe as g,de as h,$ as i,N as j,P as k,ge as l,ae as m,ye as n,be as o,le as p,ve as r,Se as s,xe as t,Ce as u,me as v,fe as w,Z as x,Q as y};
2
+ //# sourceMappingURL=entities-DI7lpu_V.js.map
@@ -1 +1 @@
1
- import{c as e,d as t,f as n,g as r,h as i,l as a,m as o,o as s,p as c,s as l,u}from"./main-Bi6AoLeM.js";export{s as ENVIRONMENT_CHANGE_STORAGE_KEY,l as FOLLOW_UP_QUEUE_STORAGE_KEY,e as MAX_PERSISTED_QUEUE_IMAGE_CHARS,a as clearFollowUpQueuesEnvironment,u as fromPersistedFollowUpQueue,t as planFollowUpQueueRecovery,n as queuedFileUploadId,c as readEnvironmentChangeAnnouncement,o as rebindPersistedFollowUpQueues,i as startFollowUpQueuePersistence,r as toPersistedFollowUpQueues};
1
+ import{c as e,d as t,f as n,g as r,h as i,l as a,m as o,o as s,p as c,s as l,u}from"./main-U2I6YwT-.js";export{s as ENVIRONMENT_CHANGE_STORAGE_KEY,l as FOLLOW_UP_QUEUE_STORAGE_KEY,e as MAX_PERSISTED_QUEUE_IMAGE_CHARS,a as clearFollowUpQueuesEnvironment,u as fromPersistedFollowUpQueue,t as planFollowUpQueueRecovery,n as queuedFileUploadId,c as readEnvironmentChangeAnnouncement,o as rebindPersistedFollowUpQueues,i as startFollowUpQueuePersistence,r as toPersistedFollowUpQueues};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-Bi6AoLeM.js","assets/rolldown-runtime-DAXXjFlN.js","assets/accountData-BKyjOPQm.js","assets/utils-ClZ5OxbV.js","assets/session-Dmu9Hk5C.js","assets/queries-BevoHPqY.js","assets/textarea-BT0tVWKM.js","assets/useSettings-GEQSU1F5.js","assets/clientPersistenceStorage-CeJLSpQl.js","assets/CircleNotch-BcVOnWaH.js","assets/designOpenFileContext-CMKir5dG.js","assets/empty-DUUjhkFh.js","assets/input-CyCAHFxI.js","assets/browserRecording-BavNt16V.js","assets/RightPanelResizeHandle-XlC9gY5e.js","assets/browserHistoryStore-CEVJXGfr.js","assets/entities-BtD3_L53.js","assets/env-71Gq9H0m.js","assets/ArrowRight-D8u8fAtz.js","assets/ArrowSquareOut-B_f6YUhV.js","assets/scroll-area-DAaT-DGF.js","assets/lib-BpnzBIoA.js","assets/ArrowsClockwise-DQYZ1Xbo.js","assets/ChatMarkdown-Ch9PipMk.js","assets/assets-1BW7ZJgz.js","assets/assetUrls-33nMWFnF.js","assets/lib-CCiVGdun.js","assets/designCanvas.logic-DduGt5E7.js","assets/projectFilesQueryState-Cs5skZOc.js","assets/designCanvas-CfWhq9nr.css","assets/CaretLeft-CfrkuxuJ.js","assets/toggle-Sui8J_p3.js","assets/PullRequestReactions-BJ4eU_08.js","assets/popover-BXSj56CI.js","assets/composerMentionDrag-CdTT1rUK.js","assets/combobox-CQHB5X6j.js","assets/useWorkspaceMutationRefresh-ApasU6PB.js","assets/DiffWorkerPoolProvider-B-AH2sbL.js","assets/toggle-group-BDgfPfOF.js","assets/spinner-K3N_kbJr.js","assets/zipGuard-BHHl8sLU.js","assets/main-C0iNAqq8.css"])))=>i.map(i=>d[i]);
2
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=78,t=[[e,0,0],[0,0,e],[-78,0,0],[0,0,-78]],n=[1,0,0,0,1,0,0,0,1],r=[2600,3400,2900,3800,3100],i=[`y`,`x`,`y`,`x`,`x`],a=t.flatMap((n,r)=>{let i=t[(r+1)%t.length];return[!0,!1].map(t=>{let r=t?n:i,a=t?i:n,o=[0,t?-78:e,0],s=r.map((e,t)=>(a[t]-e)/100),c=r.map((e,t)=>(o[t]-(e+a[t])/2)/100),l=[s[1]*c[2]-s[2]*c[1],s[2]*c[0]-s[0]*c[2],s[0]*c[1]-s[1]*c[0]],u=Math.hypot(...l),d=l.map(e=>e/u);return{normal:d,vertices:[r,a,o],transform:`matrix3d(${s[0]},${s[1]},${s[2]},0,${c[0]},${c[1]},${c[2]},0,${d[0]},${d[1]},${d[2]},0,${r[0]},${r[1]},${r[2]},1)`}})});function o(e,t){return Array.from({length:9},(n,r)=>{let i=Math.floor(r/3),a=r%3;return[0,1,2].reduce((n,r)=>n+e[i*3+r]*t[r*3+a],0)})}function s(e,t){let n=Math.cos(t*Math.PI/180),r=Math.sin(t*Math.PI/180);return e===`x`?[1,0,0,0,n,-r,0,r,n]:[n,0,r,0,1,0,-r,0,n]}var c=o(s(`x`,-8),s(`y`,-24));function l(e){let t=o(c,e);return`matrix3d(${t[0]},${t[3]},${t[6]},0,${t[1]},${t[4]},${t[7]},0,${t[2]},${t[5]},${t[8]},0,0,0,0,1)`}function u(e){let t=a.map(({normal:t})=>{let n=[0,1,2].map(n=>[0,1,2].reduce((r,i)=>r+e[n*3+i]*t[i],0));return n[0]-n[1]+n[2]});return t.indexOf(Math.max(...t))}function d(e,t){let n=o(c,t),r=a[e].vertices.map(e=>[n[0]*e[0]+n[1]*e[1]+n[2]*e[2],n[3]*e[0]+n[4]*e[1]+n[5]*e[2]]),i=[[0,0],[100,0],[50,100]],s=0,l=1/0;for(let e=0;e<3;e++){let t=r[e],n=r[(e+1)%3],i=Math.abs(n[1]-t[1])/Math.hypot(n[0]-t[0],n[1]-t[1]);i<l&&(s=e,l=i)}let u=i[s],d=i[(s+1)%3];r[s][0]>r[(s+1)%3][0]&&([u,d]=[d,u]);let f=i[(s+2)%3];return`matrix(${(d[0]-u[0])/100},${(d[1]-u[1])/100},${(f[0]-(u[0]+d[0])/2)/100},${(f[1]-(u[1]+d[1])/2)/100},${u[0]},${u[1]})`}function f(){let e=[],t=n;for(let n=0;n<20;n++){let r=i[n%i.length],a=o(s(r,90),t).map(Math.round);e.push({axis:r,before:t,after:a}),t=a}let c=e.reduce((e,t,n)=>e+r[n%r.length],0),f=0,p=[],m=a.map(()=>[]),h=a.map(()=>[]),g=[];for(let[t,n]of e.entries()){let e=u(n.before),i=u(n.after),a=r[t%r.length],_=a-850;g.push([f,f+_-100]);for(let[e,t]of[[0,0],[_,0],[_+140,-4],[_+570,92],[_+720,90],[a,90]])p.push({offset:(f+e)/c,transform:l(o(s(n.axis,t),n.before)),easing:`cubic-bezier(0.22, 0.8, 0.32, 1)`});for(let[t,r]of m.entries()){for(let[e,r]of[[0,n.before],[_+300,n.before],[_+301,n.after],[a,n.after]])h[t].push({offset:(f+e)/c,transform:d(t,r)});for(let[n,o]of[[0,t===e],[_-100,t===e],[_+60,!1],[_+640,!1],[a,t===i]])r.push({offset:(f+n)/c,transform:`scaleY(${+!!o})`})}f+=a}return{turns:p,eyes:m,orientations:h,rests:g,duration:c}}var p=f();function m(e){let t=(e%p.duration+p.duration)%p.duration;for(let[e,n]of p.rests){if(t<e)return e-t;if(t<=n)return 0}return p.duration-t+p.rests[0][0]}var h=`modulepreload`,g=function(e){return`/`+e},_={},v=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../../../../vite/packages/vite/src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=g(t,n),t=s(t),t in _)return;_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:h,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},y=document.getElementById(`boot-shell-card`);if(y){y.innerHTML=`<span class="borg-prism" aria-hidden="true" style="width:80px;height:80px;--borg-prism-scale:${80/176}"><span class="borg-prism-scale"><span class="borg-prism-turn" style="transform:${l(n)}">${a.map((e,t)=>`<svg class="borg-prism-face" viewBox="0 0 100 100" style="transform:${e.transform}"><defs><mask id="boot-borg-${t}"><rect width="100" height="100" fill="white"/><g class="borg-prism-eye-orientation" style="transform:${d(t,n)}"><g class="borg-prism-eyes" fill="black" style="transform:scaleY(${+(t===0)})"><path d="M31.5 27.83 L31.5 33.99 C31.5 41.91 44.5 41.91 44.5 33.99 L44.5 27.83 Z M55.5 27.83 L55.5 33.99 C55.5 41.91 68.5 41.91 68.5 33.99 L68.5 27.83 Z"/></g></g></mask></defs><path d="M6.24 2 L93.76 2 Q97 2 95.55 4.9 L51.45 93.1 Q50 96 48.55 93.1 L4.45 4.9 Q3 2 6.24 2 Z" fill="currentColor" mask="url(#boot-borg-${t})"/></svg>`).join(``)}</span></span></span>`;let e=y.querySelector(`.borg-prism-turn`),t=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=[],i=()=>{r.forEach(e=>document.hidden?e.pause():e.play())},o=()=>{if(r.forEach(e=>e.cancel()),r=[],t.matches)return;let n={duration:p.duration,iterations:1/0};r.push(e.animate(p.turns,n)),e.querySelectorAll(`.borg-prism-eyes`).forEach((e,t)=>{r.push(e.animate(p.eyes[t],n))}),e.querySelectorAll(`.borg-prism-eye-orientation`).forEach((e,t)=>{r.push(e.animate(p.orientations[t],n))});let a=document.timeline.currentTime;typeof a==`number`&&r.forEach(e=>{e.startTime=a}),i()};o(),t.addEventListener(`change`,o),document.addEventListener(`visibilitychange`,i);let s=new MutationObserver(()=>{y.isConnected||(r.forEach(e=>e.cancel()),t.removeEventListener(`change`,o),document.removeEventListener(`visibilitychange`,i),s.disconnect())});s.observe(document.getElementById(`root`),{childList:!0,subtree:!0})}v(()=>import(`./main-Bi6AoLeM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]));export{d as a,p as i,a as n,l as o,n as r,m as s,v as t};
3
- //# sourceMappingURL=index-DrITfTBh.js.map
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-U2I6YwT-.js","assets/rolldown-runtime-DAXXjFlN.js","assets/accountData-B88fzgQo.js","assets/utils-dD8AT1Cf.js","assets/session-BKSQ__kZ.js","assets/queries-B-YwYiCl.js","assets/textarea-bjEgsW0n.js","assets/useSettings-BgyJJ6VZ.js","assets/clientPersistenceStorage-DsdIKJBh.js","assets/CircleNotch-DqcpMoTY.js","assets/designOpenFileContext-B0d1oDHN.js","assets/empty-d8cb8Ewx.js","assets/input-DzNFHo2W.js","assets/browserRecording-2dQePGOK.js","assets/RightPanelResizeHandle-kUStdA3L.js","assets/browserHistoryStore-DIuEAuCl.js","assets/entities-DI7lpu_V.js","assets/env-71Gq9H0m.js","assets/ArrowRight-sXL3WqRj.js","assets/ArrowSquareOut-BXw7kBJ2.js","assets/scroll-area-C5ps_bkR.js","assets/lib-BpnzBIoA.js","assets/ArrowsClockwise-C2ZJkkb1.js","assets/ChatMarkdown-PlWZFDnz.js","assets/assets-CkgNlvqv.js","assets/assetUrls-CF9bvkMB.js","assets/lib-CCiVGdun.js","assets/designCanvas.logic-Ce5c0YLY.js","assets/projectFilesQueryState-DWDFHsif.js","assets/designCanvas-CfWhq9nr.css","assets/CaretLeft-u94enBjz.js","assets/toggle-D4wtRT7F.js","assets/PullRequestReactions-kdg3iZ85.js","assets/popover-DZf7p2yc.js","assets/composerMentionDrag-CB6wqaTe.js","assets/combobox-DVmHwJKi.js","assets/useWorkspaceMutationRefresh-C-GODI1R.js","assets/DiffWorkerPoolProvider-ClROlLBb.js","assets/toggle-group-iSglhZY5.js","assets/spinner-BYvweYT_.js","assets/zipGuard-BHHl8sLU.js","assets/main-BM6qmGP4.css"])))=>i.map(i=>d[i]);
2
+ (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=78,t=[[e,0,0],[0,0,e],[-78,0,0],[0,0,-78]],n=[1,0,0,0,1,0,0,0,1],r=[2600,3400,2900,3800,3100],i=[`y`,`x`,`y`,`x`,`x`],a=t.flatMap((n,r)=>{let i=t[(r+1)%t.length];return[!0,!1].map(t=>{let r=t?n:i,a=t?i:n,o=[0,t?-78:e,0],s=r.map((e,t)=>(a[t]-e)/100),c=r.map((e,t)=>(o[t]-(e+a[t])/2)/100),l=[s[1]*c[2]-s[2]*c[1],s[2]*c[0]-s[0]*c[2],s[0]*c[1]-s[1]*c[0]],u=Math.hypot(...l),d=l.map(e=>e/u);return{normal:d,vertices:[r,a,o],transform:`matrix3d(${s[0]},${s[1]},${s[2]},0,${c[0]},${c[1]},${c[2]},0,${d[0]},${d[1]},${d[2]},0,${r[0]},${r[1]},${r[2]},1)`}})});function o(e,t){return Array.from({length:9},(n,r)=>{let i=Math.floor(r/3),a=r%3;return[0,1,2].reduce((n,r)=>n+e[i*3+r]*t[r*3+a],0)})}function s(e,t){let n=Math.cos(t*Math.PI/180),r=Math.sin(t*Math.PI/180);return e===`x`?[1,0,0,0,n,-r,0,r,n]:[n,0,r,0,1,0,-r,0,n]}var c=o(s(`x`,-8),s(`y`,-24));function l(e){let t=o(c,e);return`matrix3d(${t[0]},${t[3]},${t[6]},0,${t[1]},${t[4]},${t[7]},0,${t[2]},${t[5]},${t[8]},0,0,0,0,1)`}function u(e){let t=a.map(({normal:t})=>{let n=[0,1,2].map(n=>[0,1,2].reduce((r,i)=>r+e[n*3+i]*t[i],0));return n[0]-n[1]+n[2]});return t.indexOf(Math.max(...t))}function d(e,t){let n=o(c,t),r=a[e].vertices.map(e=>[n[0]*e[0]+n[1]*e[1]+n[2]*e[2],n[3]*e[0]+n[4]*e[1]+n[5]*e[2]]),i=[[0,0],[100,0],[50,100]],s=0,l=1/0;for(let e=0;e<3;e++){let t=r[e],n=r[(e+1)%3],i=Math.abs(n[1]-t[1])/Math.hypot(n[0]-t[0],n[1]-t[1]);i<l&&(s=e,l=i)}let u=i[s],d=i[(s+1)%3];r[s][0]>r[(s+1)%3][0]&&([u,d]=[d,u]);let f=i[(s+2)%3];return`matrix(${(d[0]-u[0])/100},${(d[1]-u[1])/100},${(f[0]-(u[0]+d[0])/2)/100},${(f[1]-(u[1]+d[1])/2)/100},${u[0]},${u[1]})`}function f(){let e=[],t=n;for(let n=0;n<20;n++){let r=i[n%i.length],a=o(s(r,90),t).map(Math.round);e.push({axis:r,before:t,after:a}),t=a}let c=e.reduce((e,t,n)=>e+r[n%r.length],0),f=0,p=[],m=a.map(()=>[]),h=a.map(()=>[]),g=[];for(let[t,n]of e.entries()){let e=u(n.before),i=u(n.after),a=r[t%r.length],_=a-850;g.push([f,f+_-100]);for(let[e,t]of[[0,0],[_,0],[_+140,-4],[_+570,92],[_+720,90],[a,90]])p.push({offset:(f+e)/c,transform:l(o(s(n.axis,t),n.before)),easing:`cubic-bezier(0.22, 0.8, 0.32, 1)`});for(let[t,r]of m.entries()){for(let[e,r]of[[0,n.before],[_+300,n.before],[_+301,n.after],[a,n.after]])h[t].push({offset:(f+e)/c,transform:d(t,r)});for(let[n,o]of[[0,t===e],[_-100,t===e],[_+60,!1],[_+640,!1],[a,t===i]])r.push({offset:(f+n)/c,transform:`scaleY(${+!!o})`})}f+=a}return{turns:p,eyes:m,orientations:h,rests:g,duration:c}}var p=f();function m(e){let t=(e%p.duration+p.duration)%p.duration;for(let[e,n]of p.rests){if(t<e)return e-t;if(t<=n)return 0}return p.duration-t+p.rests[0][0]}var h=`modulepreload`,g=function(e){return`/`+e},_={},v=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../../../../vite/packages/vite/src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=g(t,n),t=s(t),t in _)return;_[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:h,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},y=document.getElementById(`boot-shell-card`);if(y){y.innerHTML=`<span class="borg-prism" aria-hidden="true" style="width:80px;height:80px;--borg-prism-scale:${80/176}"><span class="borg-prism-scale"><span class="borg-prism-turn" style="transform:${l(n)}">${a.map((e,t)=>`<svg class="borg-prism-face" viewBox="0 0 100 100" style="transform:${e.transform}"><defs><mask id="boot-borg-${t}"><rect width="100" height="100" fill="white"/><g class="borg-prism-eye-orientation" style="transform:${d(t,n)}"><g class="borg-prism-eyes" fill="black" style="transform:scaleY(${+(t===0)})"><path d="M31.5 27.83 L31.5 33.99 C31.5 41.91 44.5 41.91 44.5 33.99 L44.5 27.83 Z M55.5 27.83 L55.5 33.99 C55.5 41.91 68.5 41.91 68.5 33.99 L68.5 27.83 Z"/></g></g></mask></defs><path d="M6.24 2 L93.76 2 Q97 2 95.55 4.9 L51.45 93.1 Q50 96 48.55 93.1 L4.45 4.9 Q3 2 6.24 2 Z" fill="currentColor" mask="url(#boot-borg-${t})"/></svg>`).join(``)}</span></span></span>`;let e=y.querySelector(`.borg-prism-turn`),t=window.matchMedia(`(prefers-reduced-motion: reduce)`),r=[],i=()=>{r.forEach(e=>document.hidden?e.pause():e.play())},o=()=>{if(r.forEach(e=>e.cancel()),r=[],t.matches)return;let n={duration:p.duration,iterations:1/0};r.push(e.animate(p.turns,n)),e.querySelectorAll(`.borg-prism-eyes`).forEach((e,t)=>{r.push(e.animate(p.eyes[t],n))}),e.querySelectorAll(`.borg-prism-eye-orientation`).forEach((e,t)=>{r.push(e.animate(p.orientations[t],n))});let a=document.timeline.currentTime;typeof a==`number`&&r.forEach(e=>{e.startTime=a}),i()};o(),t.addEventListener(`change`,o),document.addEventListener(`visibilitychange`,i);let s=new MutationObserver(()=>{y.isConnected||(r.forEach(e=>e.cancel()),t.removeEventListener(`change`,o),document.removeEventListener(`visibilitychange`,i),s.disconnect())});s.observe(document.getElementById(`root`),{childList:!0,subtree:!0})}v(()=>import(`./main-U2I6YwT-.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]));export{d as a,p as i,a as n,l as o,n as r,m as s,v as t};
3
+ //# sourceMappingURL=index-e-hiL6eh.js.map
@@ -1,2 +1,2 @@
1
- import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{y as t}from"./accountData-BKyjOPQm.js";import{Ho as n,t as r}from"./utils-ClZ5OxbV.js";import{n as i}from"./textarea-BT0tVWKM.js";var a=e(t()),o=n(),s=a.forwardRef(function(e,t){return(0,o.jsx)(i,{ref:t,...e})});function c({className:e,size:t=`default`,unstyled:n=!1,nativeInput:i=!1,...a}){let c=r(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-placeholder sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`compact`&&`h-7 px-[calc(--spacing(2.5)-1px)] text-xs leading-7 sm:h-7 sm:leading-7`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,a.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,a.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),l;if(i){let{style:e,onValueChange:n,...r}=a;l=(0,o.jsx)(`input`,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else l=(0,o.jsx)(s,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,...a});return(0,o.jsx)(`span`,{className:r(!n&&`relative inline-flex w-full rounded-control border border-input bg-canvas-quiet text-base text-foreground transition-[border-color,box-shadow] has-aria-invalid:border-destructive/50 has-focus-visible:border-ring has-focus-visible:ring-2 has-focus-visible:ring-selection has-autofill:bg-foreground/4 has-disabled:opacity-64 sm:text-sm`,!n&&t===`compact`&&`rounded-small`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:l})}export{c as t};
2
- //# sourceMappingURL=input-CyCAHFxI.js.map
1
+ import{o as e}from"./rolldown-runtime-DAXXjFlN.js";import{y as t}from"./accountData-B88fzgQo.js";import{Ho as n,t as r}from"./utils-dD8AT1Cf.js";import{n as i}from"./textarea-bjEgsW0n.js";var a=e(t()),o=n(),s=a.forwardRef(function(e,t){return(0,o.jsx)(i,{ref:t,...e})});function c({className:e,size:t=`default`,unstyled:n=!1,nativeInput:i=!1,...a}){let c=r(`h-8.5 w-full min-w-0 rounded-[inherit] px-[calc(--spacing(3)-1px)] leading-8.5 outline-none placeholder:text-placeholder sm:h-7.5 sm:leading-7.5 [transition:background-color_5000000s_ease-in-out_0s]`,t===`compact`&&`h-7 px-[calc(--spacing(2.5)-1px)] text-xs leading-7 sm:h-7 sm:leading-7`,t===`sm`&&`h-7.5 px-[calc(--spacing(2.5)-1px)] leading-7.5 sm:h-6.5 sm:leading-6.5`,t===`lg`&&`h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5`,a.type===`search`&&`[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none`,a.type===`file`&&`text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm`),l;if(i){let{style:e,onValueChange:n,...r}=a;l=(0,o.jsx)(`input`,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,style:typeof e==`function`?void 0:e,...r})}else l=(0,o.jsx)(s,{className:c,"data-slot":`input`,size:typeof t==`number`?t:void 0,...a});return(0,o.jsx)(`span`,{className:r(!n&&`relative inline-flex w-full rounded-control border border-input bg-canvas-quiet text-base text-foreground transition-[border-color,box-shadow] has-aria-invalid:border-destructive/50 has-focus-visible:border-ring has-focus-visible:ring-2 has-focus-visible:ring-selection has-autofill:bg-foreground/4 has-disabled:opacity-64 sm:text-sm`,!n&&t===`compact`&&`rounded-small`,e)||void 0,"data-size":t,"data-slot":`input-control`,children:l})}export{c as t};
2
+ //# sourceMappingURL=input-DzNFHo2W.js.map
@@ -1,4 +1,4 @@
1
- import{a as e,n as t,r as n,t as r}from"./rolldown-runtime-DAXXjFlN.js";import{_ as i}from"./main-Bi6AoLeM.js";var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t((()=>{a=`1.13.8`,o=typeof self==`object`&&self.self===self&&self||typeof global==`object`&&global.global===global&&global||Function(`return this`)()||{},s=Array.prototype,c=Object.prototype,l=typeof Symbol<`u`?Symbol.prototype:null,u=s.push,d=s.slice,f=c.toString,p=c.hasOwnProperty,m=typeof ArrayBuffer<`u`,h=typeof DataView<`u`,g=Array.isArray,_=Object.keys,v=Object.create,y=m&&ArrayBuffer.isView,b=isNaN,x=isFinite,S=!{toString:null}.propertyIsEnumerable(`toString`),C=[`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],w=2**53-1}));function E(e,t){return t=t==null?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var a=Array(t+1);for(i=0;i<t;i++)a[i]=arguments[i];return a[t]=r,e.apply(this,a)}}var D=t((()=>{}));function O(e){var t=typeof e;return t===`function`||t===`object`&&!!e}var k=t((()=>{}));function A(e){return e===null}var j=t((()=>{}));function M(e){return e===void 0}var N=t((()=>{}));function P(e){return e===!0||e===!1||f.call(e)===`[object Boolean]`}var F=t((()=>{T()}));function I(e){return!!(e&&e.nodeType===1)}var ee=t((()=>{}));function L(e){var t=`[object `+e+`]`;return function(e){return f.call(e)===t}}var R=t((()=>{T()})),z,te=t((()=>{R(),z=L(`String`)})),ne,B=t((()=>{R(),ne=L(`Number`)})),re,ie=t((()=>{R(),re=L(`Date`)})),ae,V=t((()=>{R(),ae=L(`RegExp`)})),oe,se=t((()=>{R(),oe=L(`Error`)})),ce,H=t((()=>{R(),ce=L(`Symbol`)})),U,le=t((()=>{R(),U=L(`ArrayBuffer`)})),ue,de,W,G=t((()=>{R(),T(),ue=L(`Function`),de=o.document&&o.document.childNodes,typeof/./!=`function`&&typeof Int8Array!=`object`&&typeof de!=`function`&&(ue=function(e){return typeof e==`function`||!1}),W=ue})),K,fe=t((()=>{R(),K=L(`Object`)})),pe,me,he=t((()=>{T(),fe(),pe=h&&(!/\[native code\]/.test(String(DataView))||K(new DataView(new ArrayBuffer(8)))),me=typeof Map<`u`&&K(new Map)}));function ge(e){return e!=null&&W(e.getInt8)&&U(e.buffer)}var _e,ve,ye=t((()=>{R(),G(),le(),he(),_e=L(`DataView`),ve=pe?ge:_e})),be,xe=t((()=>{T(),R(),be=g||L(`Array`)}));function Se(e,t){return e!=null&&p.call(e,t)}var Ce=t((()=>{T()})),we,Te,Ee=t((()=>{R(),Ce(),we=L(`Arguments`),(function(){we(arguments)||(we=function(e){return Se(e,`callee`)})})(),Te=we}));function De(e){return!ce(e)&&x(e)&&!isNaN(parseFloat(e))}var Oe=t((()=>{T(),H()}));function ke(e){return ne(e)&&b(e)}var Ae=t((()=>{T(),B()}));function je(e){return function(){return e}}var Me=t((()=>{}));function Ne(e){return function(t){var n=e(t);return typeof n==`number`&&n>=0&&n<=w}}var Pe=t((()=>{T()}));function Fe(e){return function(t){return t?.[e]}}var Ie=t((()=>{})),Le,Re=t((()=>{Ie(),Le=Fe(`byteLength`)})),ze,Be=t((()=>{Pe(),Re(),ze=Ne(Le)}));function Ve(e){return y?y(e)&&!ve(e):ze(e)&&He.test(f.call(e))}var He,Ue,We=t((()=>{T(),ye(),Me(),Be(),He=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Ue=m?Ve:je(!1)})),q,Ge=t((()=>{Ie(),q=Fe(`length`)}));function Ke(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return t[e]===!0},push:function(n){return t[n]=!0,e.push(n)}}}function qe(e,t){t=Ke(t);var n=C.length,r=e.constructor,i=W(r)&&r.prototype||c,a=`constructor`;for(Se(e,a)&&!t.contains(a)&&t.push(a);n--;)a=C[n],a in e&&e[a]!==i[a]&&!t.contains(a)&&t.push(a)}var Je=t((()=>{T(),G(),Ce()}));function J(e){if(!O(e))return[];if(_)return _(e);var t=[];for(var n in e)Se(e,n)&&t.push(n);return S&&qe(e,t),t}var Y=t((()=>{k(),T(),Ce(),Je()}));function Ye(e){if(e==null)return!0;var t=q(e);return typeof t==`number`&&(be(e)||z(e)||Te(e))?t===0:q(J(e))===0}var Xe=t((()=>{Ge(),xe(),te(),Ee(),Y()}));function Ze(e,t){var n=J(t),r=n.length;if(e==null)return!r;for(var i=Object(e),a=0;a<r;a++){var o=n[a];if(t[o]!==i[o]||!(o in i))return!1}return!0}var Qe=t((()=>{Y()}));function X(e){if(e instanceof X)return e;if(!(this instanceof X))return new X(e);this._wrapped=e}var $e=t((()=>{T(),X.VERSION=a,X.prototype.value=function(){return this._wrapped},X.prototype.valueOf=X.prototype.toJSON=X.prototype.value,X.prototype.toString=function(){return String(this._wrapped)}}));function et(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Le(e))}var tt=t((()=>{Re()}));function nt(e,t){for(var n=[{a:e,b:t}],r=[],i=[];n.length;){var a=n.pop();if(a===!0){r.pop(),i.pop();continue}if(e=a.a,t=a.b,e===t){if(e!==0||1/e==1/t)continue;return!1}if(e==null||t==null)return!1;if(e!==e){if(t!==t)continue;return!1}var o=typeof e;if(o!==`function`&&o!==`object`&&typeof t!=`object`)return!1;e instanceof X&&(e=e._wrapped),t instanceof X&&(t=t._wrapped);var s=f.call(e);if(s!==f.call(t))return!1;if(pe&&s==`[object Object]`&&ve(e)){if(!ve(t))return!1;s=rt}switch(s){case`[object RegExp]`:case`[object String]`:if(``+e==``+t)continue;return!1;case`[object Number]`:n.push({a:+e,b:+t});continue;case`[object Date]`:case`[object Boolean]`:if(+e==+t)continue;return!1;case`[object Symbol]`:if(l.valueOf.call(e)===l.valueOf.call(t))continue;return!1;case`[object ArrayBuffer]`:case rt:n.push({a:et(e),b:et(t)});continue}var c=s===`[object Array]`;if(!c&&Ue(e)){if(Le(e)!==Le(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if(typeof e!=`object`||typeof t!=`object`)return!1;var u=e.constructor,d=t.constructor;if(u!==d&&!(W(u)&&u instanceof u&&W(d)&&d instanceof d)&&`constructor`in e&&`constructor`in t)return!1}for(var p=r.length;p--;)if(r[p]===e){if(i[p]===t)break;return!1}if(!(p>=0))if(r.push(e),i.push(t),n.push(!0),c){if(p=e.length,p!==t.length)return!1;for(;p--;)n.push({a:e[p],b:t[p]})}else{var m=J(e),h;if(p=m.length,J(t).length!==p)return!1;for(;p--;){if(h=m[p],!Se(t,h))return!1;n.push({a:e[h],b:t[h]})}}}return!0}var rt,it=t((()=>{$e(),T(),Re(),We(),G(),he(),ye(),Y(),Ce(),tt(),rt=`[object DataView]`}));function at(e){if(!O(e))return[];var t=[];for(var n in e)t.push(n);return S&&qe(e,t),t}var ot=t((()=>{k(),T(),Je()}));function st(e){var t=q(e);return function(n){if(n==null||q(at(n)))return!1;for(var r=0;r<t;r++)if(!W(n[e[r]]))return!1;return e!==pt||!W(n[ct])}}var ct,lt,ut,dt,ft,pt,mt,ht=t((()=>{Ge(),G(),ot(),ct=`forEach`,lt=`has`,ut=[`clear`,`delete`],dt=[`get`,lt,`set`],ft=ut.concat(ct,dt),pt=ut.concat(dt),mt=[`add`].concat(ut,ct,lt)})),gt,_t=t((()=>{R(),he(),ht(),gt=me?st(ft):L(`Map`)})),vt,yt=t((()=>{R(),he(),ht(),vt=me?st(pt):L(`WeakMap`)})),bt,xt=t((()=>{R(),he(),ht(),bt=me?st(mt):L(`Set`)})),St,Ct=t((()=>{R(),St=L(`WeakSet`)}));function wt(e){for(var t=J(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}var Tt=t((()=>{Y()}));function Et(e){for(var t=J(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}var Dt=t((()=>{Y()}));function Ot(e){for(var t={},n=J(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}var kt=t((()=>{Y()}));function At(e){var t=[];for(var n in e)W(e[n])&&t.push(n);return t.sort()}var jt=t((()=>{G()}));function Mt(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||n==null)return n;for(var i=1;i<r;i++)for(var a=arguments[i],o=e(a),s=o.length,c=0;c<s;c++){var l=o[c];(!t||n[l]===void 0)&&(n[l]=a[l])}return n}}var Nt=t((()=>{})),Pt,Ft=t((()=>{Nt(),ot(),Pt=Mt(at)})),It,Lt=t((()=>{Nt(),Y(),It=Mt(J)})),Rt,zt=t((()=>{Nt(),ot(),Rt=Mt(at,!0)}));function Bt(){return function(){}}function Vt(e){if(!O(e))return{};if(v)return v(e);var t=Bt();t.prototype=e;var n=new t;return t.prototype=null,n}var Ht=t((()=>{k(),T()}));function Ut(e,t){var n=Vt(e);return t&&It(n,t),n}var Wt=t((()=>{Ht(),Lt()}));function Gt(e){return O(e)?be(e)?e.slice():Pt({},e):e}var Kt=t((()=>{k(),xe(),Ft()}));function qt(e,t){return t(e),e}var Jt=t((()=>{}));function Yt(e){return be(e)?e:[e]}var Xt=t((()=>{$e(),xe(),X.toPath=Yt}));function Zt(e){return X.toPath(e)}var Qt=t((()=>{$e(),Xt()}));function $t(e,t){for(var n=t.length,r=0;r<n;r++){if(e==null)return;e=e[t[r]]}return n?e:void 0}var en=t((()=>{}));function tn(e,t,n){var r=$t(e,Zt(t));return M(r)?n:r}var nn=t((()=>{Qt(),en(),N()}));function rn(e,t){t=Zt(t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(!Se(e,i))return!1;e=e[i]}return!!n}var an=t((()=>{Ce(),Qt()}));function on(e){return e}var sn=t((()=>{}));function cn(e){return e=It({},e),function(t){return Ze(t,e)}}var ln=t((()=>{Lt(),Qe()}));function un(e){return e=Zt(e),function(t){return $t(t,e)}}var dn=t((()=>{en(),Qt()}));function fn(e,t,n){if(t===void 0)return e;switch(n??3){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)}}return function(){return e.apply(t,arguments)}}var pn=t((()=>{}));function mn(e,t,n){return e==null?on:W(e)?fn(e,t,n):O(e)&&!be(e)?cn(e):un(e)}var hn=t((()=>{sn(),G(),k(),xe(),ln(),dn(),pn()}));function gn(e,t){return mn(e,t,1/0)}var _n=t((()=>{$e(),hn(),X.iteratee=gn}));function vn(e,t,n){return X.iteratee===gn?mn(e,t,n):X.iteratee(e,t)}var yn=t((()=>{$e(),hn(),_n()}));function bn(e,t,n){t=vn(t,n);for(var r=J(e),i=r.length,a={},o=0;o<i;o++){var s=r[o];a[s]=t(e[s],s,e)}return a}var xn=t((()=>{yn(),Y()}));function Sn(){}var Cn=t((()=>{}));function wn(e){return e==null?Sn:function(t){return tn(e,t)}}var Tn=t((()=>{Cn(),nn()}));function En(e,t,n){var r=Array(Math.max(0,e));t=fn(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}var Dn=t((()=>{pn()}));function On(e,t){return t??(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}var kn=t((()=>{})),An,jn=t((()=>{An=Date.now||function(){return new Date().getTime()}}));function Mn(e){var t=function(t){return e[t]},n=`(?:`+J(e).join(`|`)+`)`,r=RegExp(n),i=RegExp(n,`g`);return function(e){return e=e==null?``:``+e,r.test(e)?e.replace(i,t):e}}var Nn=t((()=>{Y()})),Pn,Fn=t((()=>{Pn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#x27;`,"`":`&#x60;`}})),In,Ln=t((()=>{Nn(),Fn(),In=Mn(Pn)})),Rn,zn=t((()=>{kt(),Fn(),Rn=Ot(Pn)})),Bn,Vn=t((()=>{Nn(),zn(),Bn=Mn(Rn)})),Hn,Un=t((()=>{$e(),Hn=X.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}}));function Wn(e){return`\\`+qn[e]}function Gn(e,t,n){!t&&n&&(t=n),t=Rt({},t,X.templateSettings);var r=RegExp([(t.escape||Kn).source,(t.interpolate||Kn).source,(t.evaluate||Kn).source].join(`|`)+`|$`,`g`),i=0,a=`__p+='`;e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(Jn,Wn),i=s+t.length,n?a+=`'+
1
+ import{a as e,n as t,r as n,t as r}from"./rolldown-runtime-DAXXjFlN.js";import{_ as i}from"./main-U2I6YwT-.js";var a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=t((()=>{a=`1.13.8`,o=typeof self==`object`&&self.self===self&&self||typeof global==`object`&&global.global===global&&global||Function(`return this`)()||{},s=Array.prototype,c=Object.prototype,l=typeof Symbol<`u`?Symbol.prototype:null,u=s.push,d=s.slice,f=c.toString,p=c.hasOwnProperty,m=typeof ArrayBuffer<`u`,h=typeof DataView<`u`,g=Array.isArray,_=Object.keys,v=Object.create,y=m&&ArrayBuffer.isView,b=isNaN,x=isFinite,S=!{toString:null}.propertyIsEnumerable(`toString`),C=[`valueOf`,`isPrototypeOf`,`toString`,`propertyIsEnumerable`,`hasOwnProperty`,`toLocaleString`],w=2**53-1}));function E(e,t){return t=t==null?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var a=Array(t+1);for(i=0;i<t;i++)a[i]=arguments[i];return a[t]=r,e.apply(this,a)}}var D=t((()=>{}));function O(e){var t=typeof e;return t===`function`||t===`object`&&!!e}var k=t((()=>{}));function A(e){return e===null}var j=t((()=>{}));function M(e){return e===void 0}var N=t((()=>{}));function P(e){return e===!0||e===!1||f.call(e)===`[object Boolean]`}var F=t((()=>{T()}));function I(e){return!!(e&&e.nodeType===1)}var ee=t((()=>{}));function L(e){var t=`[object `+e+`]`;return function(e){return f.call(e)===t}}var R=t((()=>{T()})),z,te=t((()=>{R(),z=L(`String`)})),ne,B=t((()=>{R(),ne=L(`Number`)})),re,ie=t((()=>{R(),re=L(`Date`)})),ae,V=t((()=>{R(),ae=L(`RegExp`)})),oe,se=t((()=>{R(),oe=L(`Error`)})),ce,H=t((()=>{R(),ce=L(`Symbol`)})),U,le=t((()=>{R(),U=L(`ArrayBuffer`)})),ue,de,W,G=t((()=>{R(),T(),ue=L(`Function`),de=o.document&&o.document.childNodes,typeof/./!=`function`&&typeof Int8Array!=`object`&&typeof de!=`function`&&(ue=function(e){return typeof e==`function`||!1}),W=ue})),K,fe=t((()=>{R(),K=L(`Object`)})),pe,me,he=t((()=>{T(),fe(),pe=h&&(!/\[native code\]/.test(String(DataView))||K(new DataView(new ArrayBuffer(8)))),me=typeof Map<`u`&&K(new Map)}));function ge(e){return e!=null&&W(e.getInt8)&&U(e.buffer)}var _e,ve,ye=t((()=>{R(),G(),le(),he(),_e=L(`DataView`),ve=pe?ge:_e})),be,xe=t((()=>{T(),R(),be=g||L(`Array`)}));function Se(e,t){return e!=null&&p.call(e,t)}var Ce=t((()=>{T()})),we,Te,Ee=t((()=>{R(),Ce(),we=L(`Arguments`),(function(){we(arguments)||(we=function(e){return Se(e,`callee`)})})(),Te=we}));function De(e){return!ce(e)&&x(e)&&!isNaN(parseFloat(e))}var Oe=t((()=>{T(),H()}));function ke(e){return ne(e)&&b(e)}var Ae=t((()=>{T(),B()}));function je(e){return function(){return e}}var Me=t((()=>{}));function Ne(e){return function(t){var n=e(t);return typeof n==`number`&&n>=0&&n<=w}}var Pe=t((()=>{T()}));function Fe(e){return function(t){return t?.[e]}}var Ie=t((()=>{})),Le,Re=t((()=>{Ie(),Le=Fe(`byteLength`)})),ze,Be=t((()=>{Pe(),Re(),ze=Ne(Le)}));function Ve(e){return y?y(e)&&!ve(e):ze(e)&&He.test(f.call(e))}var He,Ue,We=t((()=>{T(),ye(),Me(),Be(),He=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,Ue=m?Ve:je(!1)})),q,Ge=t((()=>{Ie(),q=Fe(`length`)}));function Ke(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return t[e]===!0},push:function(n){return t[n]=!0,e.push(n)}}}function qe(e,t){t=Ke(t);var n=C.length,r=e.constructor,i=W(r)&&r.prototype||c,a=`constructor`;for(Se(e,a)&&!t.contains(a)&&t.push(a);n--;)a=C[n],a in e&&e[a]!==i[a]&&!t.contains(a)&&t.push(a)}var Je=t((()=>{T(),G(),Ce()}));function J(e){if(!O(e))return[];if(_)return _(e);var t=[];for(var n in e)Se(e,n)&&t.push(n);return S&&qe(e,t),t}var Y=t((()=>{k(),T(),Ce(),Je()}));function Ye(e){if(e==null)return!0;var t=q(e);return typeof t==`number`&&(be(e)||z(e)||Te(e))?t===0:q(J(e))===0}var Xe=t((()=>{Ge(),xe(),te(),Ee(),Y()}));function Ze(e,t){var n=J(t),r=n.length;if(e==null)return!r;for(var i=Object(e),a=0;a<r;a++){var o=n[a];if(t[o]!==i[o]||!(o in i))return!1}return!0}var Qe=t((()=>{Y()}));function X(e){if(e instanceof X)return e;if(!(this instanceof X))return new X(e);this._wrapped=e}var $e=t((()=>{T(),X.VERSION=a,X.prototype.value=function(){return this._wrapped},X.prototype.valueOf=X.prototype.toJSON=X.prototype.value,X.prototype.toString=function(){return String(this._wrapped)}}));function et(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Le(e))}var tt=t((()=>{Re()}));function nt(e,t){for(var n=[{a:e,b:t}],r=[],i=[];n.length;){var a=n.pop();if(a===!0){r.pop(),i.pop();continue}if(e=a.a,t=a.b,e===t){if(e!==0||1/e==1/t)continue;return!1}if(e==null||t==null)return!1;if(e!==e){if(t!==t)continue;return!1}var o=typeof e;if(o!==`function`&&o!==`object`&&typeof t!=`object`)return!1;e instanceof X&&(e=e._wrapped),t instanceof X&&(t=t._wrapped);var s=f.call(e);if(s!==f.call(t))return!1;if(pe&&s==`[object Object]`&&ve(e)){if(!ve(t))return!1;s=rt}switch(s){case`[object RegExp]`:case`[object String]`:if(``+e==``+t)continue;return!1;case`[object Number]`:n.push({a:+e,b:+t});continue;case`[object Date]`:case`[object Boolean]`:if(+e==+t)continue;return!1;case`[object Symbol]`:if(l.valueOf.call(e)===l.valueOf.call(t))continue;return!1;case`[object ArrayBuffer]`:case rt:n.push({a:et(e),b:et(t)});continue}var c=s===`[object Array]`;if(!c&&Ue(e)){if(Le(e)!==Le(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if(typeof e!=`object`||typeof t!=`object`)return!1;var u=e.constructor,d=t.constructor;if(u!==d&&!(W(u)&&u instanceof u&&W(d)&&d instanceof d)&&`constructor`in e&&`constructor`in t)return!1}for(var p=r.length;p--;)if(r[p]===e){if(i[p]===t)break;return!1}if(!(p>=0))if(r.push(e),i.push(t),n.push(!0),c){if(p=e.length,p!==t.length)return!1;for(;p--;)n.push({a:e[p],b:t[p]})}else{var m=J(e),h;if(p=m.length,J(t).length!==p)return!1;for(;p--;){if(h=m[p],!Se(t,h))return!1;n.push({a:e[h],b:t[h]})}}}return!0}var rt,it=t((()=>{$e(),T(),Re(),We(),G(),he(),ye(),Y(),Ce(),tt(),rt=`[object DataView]`}));function at(e){if(!O(e))return[];var t=[];for(var n in e)t.push(n);return S&&qe(e,t),t}var ot=t((()=>{k(),T(),Je()}));function st(e){var t=q(e);return function(n){if(n==null||q(at(n)))return!1;for(var r=0;r<t;r++)if(!W(n[e[r]]))return!1;return e!==pt||!W(n[ct])}}var ct,lt,ut,dt,ft,pt,mt,ht=t((()=>{Ge(),G(),ot(),ct=`forEach`,lt=`has`,ut=[`clear`,`delete`],dt=[`get`,lt,`set`],ft=ut.concat(ct,dt),pt=ut.concat(dt),mt=[`add`].concat(ut,ct,lt)})),gt,_t=t((()=>{R(),he(),ht(),gt=me?st(ft):L(`Map`)})),vt,yt=t((()=>{R(),he(),ht(),vt=me?st(pt):L(`WeakMap`)})),bt,xt=t((()=>{R(),he(),ht(),bt=me?st(mt):L(`Set`)})),St,Ct=t((()=>{R(),St=L(`WeakSet`)}));function wt(e){for(var t=J(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}var Tt=t((()=>{Y()}));function Et(e){for(var t=J(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}var Dt=t((()=>{Y()}));function Ot(e){for(var t={},n=J(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}var kt=t((()=>{Y()}));function At(e){var t=[];for(var n in e)W(e[n])&&t.push(n);return t.sort()}var jt=t((()=>{G()}));function Mt(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||n==null)return n;for(var i=1;i<r;i++)for(var a=arguments[i],o=e(a),s=o.length,c=0;c<s;c++){var l=o[c];(!t||n[l]===void 0)&&(n[l]=a[l])}return n}}var Nt=t((()=>{})),Pt,Ft=t((()=>{Nt(),ot(),Pt=Mt(at)})),It,Lt=t((()=>{Nt(),Y(),It=Mt(J)})),Rt,zt=t((()=>{Nt(),ot(),Rt=Mt(at,!0)}));function Bt(){return function(){}}function Vt(e){if(!O(e))return{};if(v)return v(e);var t=Bt();t.prototype=e;var n=new t;return t.prototype=null,n}var Ht=t((()=>{k(),T()}));function Ut(e,t){var n=Vt(e);return t&&It(n,t),n}var Wt=t((()=>{Ht(),Lt()}));function Gt(e){return O(e)?be(e)?e.slice():Pt({},e):e}var Kt=t((()=>{k(),xe(),Ft()}));function qt(e,t){return t(e),e}var Jt=t((()=>{}));function Yt(e){return be(e)?e:[e]}var Xt=t((()=>{$e(),xe(),X.toPath=Yt}));function Zt(e){return X.toPath(e)}var Qt=t((()=>{$e(),Xt()}));function $t(e,t){for(var n=t.length,r=0;r<n;r++){if(e==null)return;e=e[t[r]]}return n?e:void 0}var en=t((()=>{}));function tn(e,t,n){var r=$t(e,Zt(t));return M(r)?n:r}var nn=t((()=>{Qt(),en(),N()}));function rn(e,t){t=Zt(t);for(var n=t.length,r=0;r<n;r++){var i=t[r];if(!Se(e,i))return!1;e=e[i]}return!!n}var an=t((()=>{Ce(),Qt()}));function on(e){return e}var sn=t((()=>{}));function cn(e){return e=It({},e),function(t){return Ze(t,e)}}var ln=t((()=>{Lt(),Qe()}));function un(e){return e=Zt(e),function(t){return $t(t,e)}}var dn=t((()=>{en(),Qt()}));function fn(e,t,n){if(t===void 0)return e;switch(n??3){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,a){return e.call(t,n,r,i,a)}}return function(){return e.apply(t,arguments)}}var pn=t((()=>{}));function mn(e,t,n){return e==null?on:W(e)?fn(e,t,n):O(e)&&!be(e)?cn(e):un(e)}var hn=t((()=>{sn(),G(),k(),xe(),ln(),dn(),pn()}));function gn(e,t){return mn(e,t,1/0)}var _n=t((()=>{$e(),hn(),X.iteratee=gn}));function vn(e,t,n){return X.iteratee===gn?mn(e,t,n):X.iteratee(e,t)}var yn=t((()=>{$e(),hn(),_n()}));function bn(e,t,n){t=vn(t,n);for(var r=J(e),i=r.length,a={},o=0;o<i;o++){var s=r[o];a[s]=t(e[s],s,e)}return a}var xn=t((()=>{yn(),Y()}));function Sn(){}var Cn=t((()=>{}));function wn(e){return e==null?Sn:function(t){return tn(e,t)}}var Tn=t((()=>{Cn(),nn()}));function En(e,t,n){var r=Array(Math.max(0,e));t=fn(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}var Dn=t((()=>{pn()}));function On(e,t){return t??(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}var kn=t((()=>{})),An,jn=t((()=>{An=Date.now||function(){return new Date().getTime()}}));function Mn(e){var t=function(t){return e[t]},n=`(?:`+J(e).join(`|`)+`)`,r=RegExp(n),i=RegExp(n,`g`);return function(e){return e=e==null?``:``+e,r.test(e)?e.replace(i,t):e}}var Nn=t((()=>{Y()})),Pn,Fn=t((()=>{Pn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#x27;`,"`":`&#x60;`}})),In,Ln=t((()=>{Nn(),Fn(),In=Mn(Pn)})),Rn,zn=t((()=>{kt(),Fn(),Rn=Ot(Pn)})),Bn,Vn=t((()=>{Nn(),zn(),Bn=Mn(Rn)})),Hn,Un=t((()=>{$e(),Hn=X.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g}}));function Wn(e){return`\\`+qn[e]}function Gn(e,t,n){!t&&n&&(t=n),t=Rt({},t,X.templateSettings);var r=RegExp([(t.escape||Kn).source,(t.interpolate||Kn).source,(t.evaluate||Kn).source].join(`|`)+`|$`,`g`),i=0,a=`__p+='`;e.replace(r,function(t,n,r,o,s){return a+=e.slice(i,s).replace(Jn,Wn),i=s+t.length,n?a+=`'+
2
2
  ((__t=(`+n+`))==null?'':_.escape(__t))+
3
3
  '`:r?a+=`'+
4
4
  ((__t=(`+r+`))==null?'':__t)+
@@ -218,4 +218,4 @@ Character number: `+e.characterNumber},n.prototype.lineNumber=function(){return
218
218
  `+t.errors().map(w).join(`
219
219
  `)}function w(e){return`Error was at character number `+e.characterNumber()+`: Expected `+e.expected+` but got `+e.actual}var T=l()})),nc=r((t=>{t.readOptions=a;var n=(Q(),e(Z)),r=t._defaultStyleMap=`p.Heading1 => h1:fresh,p.Heading2 => h2:fresh,p.Heading3 => h3:fresh,p.Heading4 => h4:fresh,p.Heading5 => h5:fresh,p.Heading6 => h6:fresh,p[style-name='Heading 1'] => h1:fresh,p[style-name='Heading 2'] => h2:fresh,p[style-name='Heading 3'] => h3:fresh,p[style-name='Heading 4'] => h4:fresh,p[style-name='Heading 5'] => h5:fresh,p[style-name='Heading 6'] => h6:fresh,p[style-name='heading 1'] => h1:fresh,p[style-name='heading 2'] => h2:fresh,p[style-name='heading 3'] => h3:fresh,p[style-name='heading 4'] => h4:fresh,p[style-name='heading 5'] => h5:fresh,p[style-name='heading 6'] => h6:fresh,p.Heading => h1:fresh,p[style-name='Heading'] => h1:fresh,r[style-name='Strong'] => strong,p[style-name='footnote text'] => p:fresh,r[style-name='footnote reference'] =>,p[style-name='endnote text'] => p:fresh,r[style-name='endnote reference'] =>,p[style-name='annotation text'] => p:fresh,r[style-name='annotation reference'] =>,p[style-name='Footnote'] => p:fresh,r[style-name='Footnote anchor'] =>,p[style-name='Endnote'] => p:fresh,r[style-name='Endnote anchor'] =>,p:unordered-list(1) => ul > li:fresh,p:unordered-list(2) => ul|ol > li > ul > li:fresh,p:unordered-list(3) => ul|ol > li > ul|ol > li > ul > li:fresh,p:unordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh,p:unordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ul > li:fresh,p:ordered-list(1) => ol > li:fresh,p:ordered-list(2) => ul|ol > li > ol > li:fresh,p:ordered-list(3) => ul|ol > li > ul|ol > li > ol > li:fresh,p:ordered-list(4) => ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh,p:ordered-list(5) => ul|ol > li > ul|ol > li > ul|ol > li > ul|ol > li > ol > li:fresh,r[style-name='Hyperlink'] =>,p[style-name='Normal'] => p:fresh,p.Body => p:fresh,p[style-name='Body'] => p:fresh`.split(`,`),i=t._standardOptions={externalFileAccess:!1,transformDocument:s,includeDefaultStyleMap:!0,includeEmbeddedStyleMap:!0};function a(e){return e||={},n.extend({},i,e,{customStyleMap:o(e.styleMap),readStyleMap:function(){var e=this.customStyleMap;return this.includeEmbeddedStyleMap&&(e=e.concat(o(this.embeddedStyleMap))),this.includeDefaultStyleMap&&(e=e.concat(r)),e}})}function o(e){return e?n.isString(e)?e.split(`
220
220
  `).map(function(e){return e.trim()}).filter(function(e){return e!==``&&e.charAt(0)!==`#`}):e:[]}function s(e){return e}})),rc=r((e=>{var t=Ao(),n=Po();e.openZip=r;function r(e){return e.arrayBuffer?t.resolve(n.openArrayBuffer(e.arrayBuffer)):t.reject(Error(`Could not find file in options`))}})),ic=r((e=>{var t=Ps(),n=Ns();e.element=r;function r(e){return function(r){return n.elementWithTag(t.element(e),[r])}}})),ac=r((t=>{var n=(Q(),e(Z)),r=ks(),i=As(),a=zs().DocumentConverter,o=Bs().convertElementToRawText,s=tc().readStyle,c=nc().readOptions,l=rc(),u=Mo().Result;t.convertToHtml=d,t.convertToMarkdown=f,t.convert=p,t.extractRawText=_,t.images=Fs(),t.transforms=vs(),t.underline=ic(),t.embedStyleMap=v,t.readEmbeddedStyleMap=m;function d(e,t){return p(e,t)}function f(e,t){var n=Object.create(t||{});return n.outputFormat=`markdown`,p(e,n)}function p(e,t){return t=c(t),l.openZip(e).tap(function(e){return i.readStyleMap(e).then(function(e){t.embeddedStyleMap=e})}).then(function(n){return r.read(n,e,t).then(function(e){return e.map(t.transformDocument)}).then(function(e){return h(e,t)})})}function m(e){return l.openZip(e).then(i.readStyleMap)}function h(e,t){var r=g(t.readStyleMap()),i=new a(n.extend({},t,{styleMap:r.value}));return e.flatMapThen(function(e){return r.flatMapThen(function(t){return i.convertToHtml(e)})})}function g(e){return u.combine((e||[]).map(s)).map(function(e){return e.filter(function(e){return!!e})})}function _(e){return l.openZip(e).then(r.read).then(function(e){return e.map(o)})}function v(e,t){return l.openZip(e).tap(function(e){return i.writeStyleMap(e,t)}).then(function(e){return e.toArrayBuffer()}).then(function(e){return{toArrayBuffer:function(){return e},toBuffer:function(){return Buffer.from(e)}}})}t.styleMapping=function(){throw Error(`Use a raw string instead of mammoth.styleMapping e.g. "p[style-name='Title'] => h1" instead of mammoth.styleMapping("p[style-name='Title'] => h1")`)}}));export default ac();
221
- //# sourceMappingURL=lib-BRpsbmNP.js.map
221
+ //# sourceMappingURL=lib-IA-5-mGB.js.map