epiq 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gui/main.js +2 -2
- package/dist/index.js +100 -100
- package/dist/mcp.js +118 -90
- package/package.json +1 -1
- package/readme.md +18 -143
package/dist/gui/main.js
CHANGED
|
@@ -1375,13 +1375,13 @@ ${t}`,i=e.startsWith(t)?0:w_(e,n,0);if(i===-1)return[e];let r=[];i>0&&r.push(e.s
|
|
|
1375
1375
|
`;if(t.endsWith("\r"))return"\r"}return`
|
|
1376
1376
|
`}function gb(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function b$(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function d2(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function f2(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function h2(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:lb(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function v$(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}var S$=-1,yw,yb=(yw=class{constructor(e={theme:rt},t,n=!1){I(this,"options");I(this,"workerManager");I(this,"isContainerManaged");I(this,"__id",`file-diff:${++S$}`);I(this,"type","file-diff");I(this,"fileContainer");I(this,"spriteSVG");I(this,"pre");I(this,"codeUnified");I(this,"codeDeletions");I(this,"codeAdditions");I(this,"bufferBefore");I(this,"bufferAfter");I(this,"themeCSSStyle");I(this,"appliedThemeCSS");I(this,"hasAdoptedThemeCSS",!1);I(this,"unsafeCSSStyle");I(this,"appliedUnsafeCSS");I(this,"gutterUtilityContent");I(this,"headerElement");I(this,"headerPrefix");I(this,"headerFilenameSuffix");I(this,"headerMetadata");I(this,"headerCustom");I(this,"separatorCache",new Map);I(this,"errorWrapper");I(this,"placeHolder");I(this,"hunksRenderer");I(this,"resizeManager");I(this,"scrollSyncManager");I(this,"interactionManager");I(this,"annotationCache",new Map);I(this,"lineAnnotations",[]);I(this,"managersDirty",!1);I(this,"deletionFile");I(this,"additionFile");I(this,"fileDiff");I(this,"renderRange");I(this,"pendingFiles");I(this,"appliedPreAttributes");I(this,"lastRenderedHeaderHTML");I(this,"cachedHeaderHTML");I(this,"lastRowCount");I(this,"mounted",!1);I(this,"enabled",!0);I(this,"editor");I(this,"refreshViewTimeout");I(this,"lineStateRefreshPending",!1);I(this,"deferredSelectedLines");I(this,"deferredEditorActiveLine");I(this,"handleHighlightRender",()=>{this.rerender()});I(this,"getLineIndex",(e,t="additions")=>{let n=this.fileDiffCache;if(n==null)return;let i=n.hunks.at(-1),r,o;e:for(let a of n.hunks){let l=t==="deletions"?a.deletionStart:a.additionStart,s=t==="deletions"?a.deletionCount:a.additionCount,u=Hn(l,s)+1,c=a.splitLineStart,d=a.unifiedLineStart;if(e<u){let f=u-e;r=Math.max(d-f,0),o=Math.max(c-f,0);break e}if(e>=u+s){if(a===i){let f=e-(u+s);r=d+a.unifiedLineCount+f,o=c+a.splitLineCount+f;break e}continue}for(let f of a.hunkContent)if(f.type==="context")if(e<u+f.lines){let h=e-u;o=c+h,r=d+h;break e}else u+=f.lines,c+=f.lines,d+=f.lines;else{let h=t==="deletions"?f.deletions:f.additions;if(e<u+h){let m=e-u;r=d+(t==="additions"?f.deletions:0)+m,o=c+m;break e}else u+=h,c+=Math.max(f.deletions,f.additions),d+=f.deletions+f.additions}break e}if(!(r==null||o==null))return[r,o]});I(this,"getHoveredLine",()=>this.interactionManager.getHoveredLine());I(this,"handleExpandHunk",(e,t,n)=>{this.expandHunk(e,t,n)});I(this,"expandHunk",(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.loadFilesIfNecessary(),this.rerender()});I(this,"handleEditSessionRender",()=>{this.rerender(),this.flushDeferredLineState()});this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new qy,this.scrollSyncManager=new i2,this.interactionManager=new Vy("diff",sd(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}getHunksRendererOptions(e){return h2(e)}createHunksRenderer(e){return new c2(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(sd(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Sr(this.appliedThemeCSS.theme,this.options.theme??rt)}setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators=="function"?!0:e==="scroll"&&(this.lineAnnotations.length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){Hh(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:i,fileDiff:r,...o}){if(!this.enabled)throw new Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");let a=qh(o,"FileDiff.hydrate"),l=a?.oldFile,s=a?.newFile;this.hydrateElements(e,t),w$(this.pre,x$({fileDiff:r,oldFile:l,newFile:s}),this.options.collapsed)||C$(this.headerElement,E$({fileDiff:r,oldFile:l,newFile:s}),this.options.disableFileHeader)?this.render({...o,fileContainer:e,lineAnnotations:i,fileDiff:r,preventEmit:!0}):this.hydrationSetup({fileDiff:r,lineAnnotations:i,...a}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),cb(e,t);for(let n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(let i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Xi(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;e==null||t==null||!v$(e)||this.pendingFiles?.fileDiff===e||(this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)})}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(n){if(this.options.disableErrorHandling===!0)throw n;console.error(n)}finally{this.pendingFiles?.fileDiff===e&&(this.pendingFiles=void 0)}}async handleFilesLoaded(e,t){this.fileDiff!==e||!e.isPartial||(jh("merge",e,t),this.setHydratedState(t),await Vh(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender())}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:i=!1,lineAnnotations:r,fileContainer:o,containerWrapper:a,renderRange:l,...s}){let u=qh(s,"FileDiff.render"),c=u?.oldFile,d=u?.newFile;if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");e!=null&&e.cacheKey===void 0&&(e.cacheKey=e.prevName!=null?e.prevName+":"+e.name:e.name),this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:h="system",expandUnchanged:m=!1}=this.options,y=f?void 0:l,S=this.hasThemeChanged(),p=u!=null,g=p&&(!m2(c,this.deletionFile)||!m2(d,this.additionFile)),b=e!=null&&e!==this.fileDiff,x=r!=null&&(r.length>0||this.lineAnnotations.length>0)?r!==this.lineAnnotations:!1;if(!f&&Ll(y,this.renderRange)&&!n&&!x&&!S&&(e!=null&&e===this.fileDiff||e==null&&!g))return this.applyCachedThemeState(h);let C;e==null&&p&&(g||this.fileDiff==null)&&(C=Xi(u.oldFile,u.newFile,this.options.parseDiffOptions));let{renderRange:E}=this;if(this.renderRange=y,p?(this.deletionFile=c,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null?this.fileDiff=e:C!=null&&(b=!0,this.fileDiff=C),b&&(this.cachedHeaderHTML=void 0),r!=null&&this.setLineAnnotations(r),this.fileDiff==null)return!1;this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(sw(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:w=!1,disableFileHeader:A=!1}=this.options;if(A&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,a),this.applyCachedThemeState(h),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let T=this.hunksRenderer.renderDiff(this.fileDiff,ly);T!=null&&this.applyThemeState(o,T.themeStyles,h,T.baseThemeType),T?.headerElement!=null&&this.applyHeaderToDOM(T.headerElement,o),this.renderSeparators([]),this.injectUnsafeCSS()}catch(T){if(w)throw T;console.error(T),T instanceof Error&&this.applyErrorToDOM(T,o)}return i||this.emitPostRender(),!0}try{let T=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(n,x,g||b||S)&&this.applyPartialRender({previousRenderRange:E,renderRange:y}))){let k=this.hunksRenderer.renderDiff(this.fileDiff,y);if(k==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(o,k.themeStyles,h,k.baseThemeType),k.headerElement!=null&&this.applyHeaderToDOM(k.headerElement,o),k.additionsContentAST!=null||k.deletionsContentAST!=null||k.unifiedContentAST!=null?this.applyHunksToDOM(T,k):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(k.hunkData)}this.applyBuffers(T,y),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.editor!=null&&this.syncRenderViewToEditor()}catch(T){if(w)throw T;console.error(T),T instanceof Error&&this.applyErrorToDOM(T,o)}return i||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;let i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,i=this.lineAnnotations,r=this.computeEditorRenderRange(this.renderRange);e!=null&&t!=null&&n!=null&&!n.isPartial&&this.hunksRenderer.initializeHighlighter().then(o=>{!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n||e.__syncRenderView(o,t,n,i,r)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||Wh(e))return e;let{diffStyle:n="split",expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o,a;return Gr({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({additionLine:l})=>{l!=null&&(o??(o=l.lineNumber),a=l.lineNumber)}}),o==null||a==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:o-1,totalLines:a-o+1}}attachEditor(e){if(this.type!=="file-diff")throw new Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);return this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary(),this.hunksRenderer.editorRenderReady()?this.syncRenderViewToEditor():this.rerender(),t=>{this.editor=void 0,t!==!0&&this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=H_(e,this.hunksRenderer.getExpandedHunksMap(),t);return sw(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(N_(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let i=this.fileDiff?.cacheKey;i!=null&&n.cacheKey==null&&(n.cacheKey=i),this.fileDiff=n}t!==void 0&&t!==this.lineAnnotations&&(this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()),this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:i,lineCountChangeInFlight:r}=n;if(this.hunksRenderer.updateRenderCache(e,t,r)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle==="split"?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options;return ky({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options;return l_({fileDiff:n,lineNumber:e,direction:t,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:i=1,expansionLineCount:r=100}=this.options;if(t==null||t.isPartial||n)return!1;let o=this.hunksRenderer.getExpandedHunksMap();for(let[u,c]of t.hunks.entries()){let[d,f]=nd(c);if(e<d){let h=Ti({isPartial:t.isPartial,rangeSize:c.collapsedBefore,expandedHunks:o,hunkIndex:u,collapsedContextThreshold:i}),m=d-h.rangeSize;if(h.renderAll||e<m+h.fromStart||e>=d-h.fromEnd)return!1;let y=e-(m+h.fromStart)+1,S=d-h.fromEnd-e;return y<=S?this.expandHunk(u,"up",y+r):this.expandHunk(u,"down",S+r),!0}if(e<f)return!1}let a=Ri({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"FileDiff.revealLine"});if(a==null||a.renderAll)return!1;let l=t.hunks[t.hunks.length-1],[,s]=nd(l);return e<s+a.fromStart||e>=s+a.rangeSize?!1:(this.expandHunk(t.hunks.length,"up",e-(s+a.fromStart)+1+r),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Iy(this.handleEditSessionRender)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||ga(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(i=>{console.error(i)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(let{element:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let i of e){let r=i.slotName,o=this.separatorCache.get(r);if(o==null||!f2(i,o.hunkData)){o?.element.remove();let a=document.createElement("div");a.style.display="contents",a.slot=i.slotName;let l=t(i,this);l!=null&&a.appendChild(l),this.fileContainer.appendChild(a),o={element:a,hunkData:i},this.separatorCache.set(r,o)}n.delete(r)}for(let[i,{element:r}]of n.entries())this.separatorCache.delete(i),r.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,i]of this.lineAnnotations.entries()){let r=`${n}-${On(i)}`,o=this.annotationCache.get(r);if(o==null||!d2(i,o.annotation)){o?.element.remove();let a=t(i);if(a==null)continue;o={element:eb(On(i)),annotation:i},o.element.appendChild(a),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(let[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=tb();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;return n!=null&&r&&this.editor?.__captureFocusForDOMReplacement(),r&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&r&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let n of t.children)n instanceof SVGElement?this.spriteSVG??(this.spriteSVG=n):ld(n)&&n.hasAttribute("data-theme-css")?(this.themeCSSStyle??(this.themeCSSStyle=n),this.hasAdoptedThemeCSS=!0):ld(n)&&n.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??(this.unsafeCSSStyle=n),this.appliedUnsafeCSS??(this.appliedUnsafeCSS=this.options.unsafeCSS??void 0))}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){let n=document.createElement("div");n.innerHTML=Zy;let i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,i=this.cachedHeaderHTML??fn(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){let d=document.createElement("div");d.innerHTML=i;let f=d.firstElementChild;if(!(f instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(f,this.headerElement):t.shadowRoot?.prepend(f),this.headerElement=f,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:r,renderHeaderPrefix:o,renderHeaderFilenameSuffix:a,renderHeaderMetadata:l}=this.options;if(r!=null){let d=r(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,co,d),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let s=o?.(n)??void 0,u=a?.(n)??void 0,c=l?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Kc,s),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,Xc,u),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,Qc,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}let r=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??(this.unsafeCSSStyle=nb()),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=rb(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,a=this.options.theme??rt,l=typeof a=="string"?a:{...a},s=Al(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===s){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:s};return}this.themeCSSStyle=sb({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:ob(t,o,s)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:s}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=ab(this.themeCSSStyle.textContent??"",Al(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&ub()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?$h(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let i=this.getColumnPair(e);if(i==null)return!1;let r=Ml(t[0]),o=Ml(t[1]);return r==null||o==null?!1:(i.gutter.innerHTML=fn(r),i.content.innerHTML=fn(o),n!==this.lastRowCount&&(i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],l=this.hunksRenderer.renderCodeAST("unified",t),s=this.hunksRenderer.renderCodeAST("deletions",t),u=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),l!=null?(o=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=cd({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeUnified,l,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l)),a.push(this.codeUnified)):s!=null||u!=null?(s!=null?(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=cd({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeDeletions,s,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(s)),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),u!=null?(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=cd({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),this.applyCodeColumnsInPlace(this.codeAdditions,u,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(u)),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),a.length===0?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let l=this.getCodeColumns(a,i,o,r);if(l==null)return!1;let s=e.startingLine,u=t.startingLine,c=s+e.totalLines,d=u+t.totalLines,f=Math.max(s,u),h=Math.min(c,d);if(h<=f)return!1;let m=Math.max(0,f-s),y=Math.max(0,c-h),S=this.trimColumns({columns:l,trimStart:m,trimEnd:y,previousStart:s,overlapStart:f,overlapEnd:h,diffStyle:a});if(S<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<S)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let p=this.lastRowCount-S,g=(E,w)=>{if(!(w<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:E,totalLines:w,bufferBefore:0,bufferAfter:0})},b=g(u,Math.max(f-u,0));if(b==null&&u<f)return!1;let x=g(h,Math.max(d-h,0));if(x==null&&d>h)return!1;let C=(E,w)=>{if(E!=null){if(a==="unified"&&!Array.isArray(l))this.insertPartialHTML(a,l,E,w);else if(a==="split"&&Array.isArray(l))this.insertPartialHTML(a,l,E,w);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");p+=E.rowCount}};return this.cleanupErrorWrapper(),C(b,"afterbegin"),C(x,"beforeend"),this.lastRowCount!==p&&(this.applyRowSpan(a,l,p),this.lastRowCount=p),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){let r=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,r,i)}else if(e==="split"&&Array.isArray(t)){let r=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],r,i),this.renderPartialColumn(t[1],o,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){if(this.options.diffStyle!=="split")return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(i,r)=>{if(r==null)return;let o=this.hunksRenderer.renderCodeAST(i,e),a=Ml(o?.[0]),l=Ml(o?.[1]);for(let[s,u]of[[r.gutter,a],[r.content,l]])if(u!=null&&s.childElementCount===u.length)for(let c=0;c<u.length;c++){let d=s.children[c],f=u[c].properties["data-line-type"];f!=null&&d.dataset.lineType!==f&&(d.dataset.lineType=f)}};n("deletions",t[0]),n("additions",t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!=="unified")return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST("unified",e),i=Ml(n?.[0]),r=Ml(n?.[1]),o=()=>{for(let[a,l]of[[t.gutter,i],[t.content,r]])l!=null&&(a.innerHTML=fn(l));e.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",t,e.rowCount),this.lastRowCount=e.rowCount)};this.shouldGuardRebuildScroll()?$h(this.pre,o):o(),this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let i=Ml(t[0]),r=Ml(t[1]);if(i==null||r==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);n==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);let a=r.at(-1);n==="afterbegin"&&a?.type==="element"&&typeof a.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);a!=null&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let i=r=>{r!=null&&(r.gutter.style.setProperty("grid-row",`span ${n}`),r.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,r=0,o=0,a=!1,l=n>=0;if(e==null)return 0;let s=Array.from(e.content.children),u=Array.from(e.gutter.children);if(s.length!==u.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;o<s.length&&!(t<=0&&!l&&!a);){let c=u[o],d=s[o];if(o++,!(c instanceof HTMLElement)||!(d instanceof HTMLElement))throw console.error({gutterElement:c,contentElement:d}),new Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in d.dataset||c.dataset.gutterBuffer==="metadata"&&"noNewline"in d.dataset)){c.remove(),d.remove(),r++;continue}if("lineIndex"in c.dataset&&"lineIndex"in d.dataset){(t>0||l&&i>=n)&&(c.remove(),d.remove(),t>0&&(t--,t===0&&(a=!0)),r++),i++;continue}if("separator"in c.dataset&&"separator"in d.dataset){(t>0||l&&i>=n)&&(c.remove(),d.remove(),r++);continue}if(c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in d.dataset){(t>0||l&&i>=n)&&(c.remove(),d.remove(),r++);continue}if(c.dataset.gutterBuffer==="metadata"&&"noNewline"in d.dataset){(t>0||l&&i>=n)&&(c.remove(),d.remove(),r++);continue}if(c.dataset.gutterBuffer==="buffer"&&"contentBuffer"in d.dataset){let f=this.getBufferSize(d.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){let h=Math.min(t,f),m=f-h;m>0?(this.updateBufferSize(c,m),this.updateBufferSize(d,m),r+=h):(c.remove(),d.remove(),r+=f),t-=h,t===0&&m===0&&(a=!0)}else if(l){let h=i,m=i+f-1;if(n<=h)c.remove(),d.remove(),r+=f;else if(n<=m){let y=m-n+1,S=f-y;this.updateBufferSize(c,S),this.updateBufferSize(d,S),r+=y}}i+=f;continue}throw console.error({gutterElement:c,contentElement:d}),new Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:a}){let l=Math.max(0,i-r),s=n-r;if(s<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");let u=a>0,c=o>0;if(!u&&!c)return 0;let d=u?l:0,f=c?s:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t==="split"&&Array.isArray(e)){let h=this.trimColumnRows(e[0],d,f),m=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&h!==m)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?h:m}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(!(!(t instanceof HTMLElement)||!(n instanceof HTMLElement)||t.dataset.gutter==null||n.dataset.content==null))return{gutter:t,content:n}}getCodeColumns(e,t,n,i){if(e==="unified")return this.getColumnPair(t);{let r=this.getColumnPair(n),o=this.getColumnPair(i);return r!=null||o!=null?[r,o]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:a=!1,disableLineNumbers:l=!1,overflow:s="scroll",diffStyle:u="split"}=this.options,c={type:"diff",diffIndicators:o,disableBackground:a,disableLineNumbers:l,overflow:s,split:u==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:r};Jy(c,this.appliedPreAttributes)||(db(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??(this.errorWrapper=document.createElement("div")),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);let i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);let r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}},I(yw,"LoadedCustomComponent",!0),yw);function m2(e,t){return e==null||t==null?e==null&&t==null:Nn(e,t)}function x$({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function E$({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function w$(e,t,n=!1){return!n&&e==null&&t}function C$(e,t,n=!1){return e==null&&t&&!n}function Ml(e){if(!(e==null||e.type!=="element"))return e.children??[]}var vw=3e3,k$=-1,b2=class extends yb{constructor(t,n,i,r,o=!1){super(t,r,o);I(this,"__id",`little-virtualized-file-diff:${++k$}`);I(this,"top");I(this,"height",0);I(this,"metrics");I(this,"cache",{heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0});I(this,"isVisible",!1);I(this,"isSetup",!1);I(this,"virtualizer");I(this,"layoutDirty",!0);I(this,"forceRenderOverride");I(this,"currentCollapsed");I(this,"currentExpandUnchanged");I(this,"pendingHydratedDiff");I(this,"pendingExpansions");I(this,"onRender",t=>this.fileContainer==null?!1:(t&&(this.top=this.getVirtualizedTop()),this.render()));I(this,"expandHunk",(t,n,i)=>{this.fileDiff!=null&&(this.isAdvancedMode()?(this.pendingExpansions??(this.pendingExpansions=[]),this.pendingExpansions.push({hunkIndex:t,direction:n,expansionLineCountOverride:i})):(this.hunksRenderer.expandHunk(t,n,i),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))});this.virtualizer=n,this.metrics=td(i)}setMetrics(t,n=!1){let i=td(t);!n&&js(this.metrics,i)||(this.metrics=i,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(t){this.syncLineAnnotations(t)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(t){return t==null||t===this.lineAnnotations||t.length===0&&this.lineAnnotations.length===0?!1:(super.setLineAnnotations(t),!0)}setFileAnnotationHeight(t){let n=this.cache.fileAnnotationHeight;return t===n?!1:(this.cache.fileAnnotationHeight=t,this.cache.measuredHeightDeltaTotal+=t-n,!0)}hasFileAnnotations(t=this.fileDiff){return t==null||!zh(this.lineAnnotations)?!1:this.lineAnnotations.some(n=>n.lineNumber!==0?!1:t.type==="new"?n.side==="additions":t.type==="deleted"?n.side==="deletions":!0)}getLineHeight(t,n=!1){return this.getEstimatedLineHeight(n)+(this.cache.heightDeltas.get(t)??0)}getEstimatedLineHeight(t=!1){let n=t?2:1;return this.metrics.lineHeight*n}setOptions(t){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(t==null)return;let{options:n}=this,i=!Tl(n,t),r=i&&I$(n,t);super.setOptions(t),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:D$(n,t)}),i&&(this.forceRenderOverride=!0),i&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(t){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(t)}resetLayoutCache({forceSimpleRecompute:t=!1,includeEstimatedHeights:n=!1,resetRenderRange:i=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.invalidateDerivedLayoutCache(n,i),t&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(t,n=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&n&&(this.renderRange=void 0)}reconcileHeights(){let t=!1,{overflow:n="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(t=!0),this.height=0,t;if(this.top=this.getVirtualizedTop(),n==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return t;let i=this.getDiffStyle(),r=i==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],o=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&o&&Rl(this.renderRange)){let a=T$(r)??0;this.setFileAnnotationHeight(a)&&(t=!0)}else!o&&this.setFileAnnotationHeight(0)&&(t=!0);for(let a of r){if(a==null)continue;let l=a.children[1];if(l instanceof HTMLElement)for(let s of l.children){if(!(s instanceof HTMLElement))continue;let u=s.dataset.lineIndex;if(u==null)continue;let c=O$(u,i),d=s.getBoundingClientRect().height,f=!1;s.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in s.nextElementSibling.dataset||"noNewline"in s.nextElementSibling.dataset)&&("noNewline"in s.nextElementSibling.dataset&&(f=!0),d+=s.nextElementSibling.getBoundingClientRect().height);let h=this.getEstimatedLineHeight(f),m=this.cache.heightDeltas.get(c)??0,y=d-h;y!==m&&(t=!0,this.cache.measuredHeightDeltaTotal+=y-m,y===0?this.cache.heightDeltas.delete(c):this.cache.heightDeltas.set(c,y))}}return(t||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),t}flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}prepareCodeViewItem(t,n,i,r){let o=!ho(this.fileDiff,t),a=this.syncLineAnnotations(r),l=i?.resetDiffLayoutCache===!0||o||a,s=o||i?.resetDiffLayoutCache===!0&&i.includeEstimatedDiffHeights;i?.metrics!=null&&(this.metrics=td(i.metrics),l=!0,s=!0);let{collapsed:u=!1,expandUnchanged:c=!1}=this.options;return this.currentCollapsed!==u&&(this.currentCollapsed=u,l=!0),this.currentExpandUnchanged!==c&&(this.currentExpandUnchanged=c,l=!0,s=!0),l&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=t,this.top=n,this.computeApproximateSize(),this.height}getLinePosition(t,n="additions"){if(this.fileDiff==null||t<1)return;let i=this.getLineIndex(t,n);if(i==null)return;let{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsed:a=!1,collapsedContextThreshold:l=1}=this.options,s=this.getDiffStyle(),u=this.getHunkSeparatorType(),c=s==="split"?i[1]:i[0];this.approximateLayoutCheckpoints();let d=Ki(this.metrics,r),f=this.getLayoutCheckpointBeforeLineIndex(c),h=f?.top??d+this.cache.fileAnnotationHeight;if(a)return{top:d,height:0};let m;return Gr({diff:this.fileDiff,diffStyle:s,startingLine:f?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:y,hunk:S,collapsedBefore:p,collapsedAfter:g,deletionLine:b,additionLine:x})=>{let C=s==="split"?x?.splitLineIndex??b?.splitLineIndex:x?.unifiedLineIndex??b?.unifiedLineIndex;if(C==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(p>0){let w=qs({type:u,metrics:this.metrics,hunkIndex:y,hunkSpecs:S?.hunkSpecs});if(w!=null){if(h+=w.gapBefore,c>=C-p&&c<C)return m={top:h,height:w.height},!0;h+=w.height+w.gapAfter}}let E=this.getLineHeight(C,(x?.noEOFCR??!1)||(b?.noEOFCR??!1));if(C===c)return m={top:h,height:E},!0;if(h+=E,g>0){let w=ya({type:u,metrics:this.metrics});if(w!=null){if(c>C&&c<=C+g)return m={top:h+w.gapBefore,height:w.height},!0;h+=w.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(t){if(this.fileDiff==null)return;let{disableFileHeader:n=!1,expandUnchanged:i=!1,collapsed:r=!1,collapsedContextThreshold:o=1}=this.options;if(r)return;let a=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(t),u=s?.top??Ki(this.metrics,n)+this.cache.fileAnnotationHeight,c;return Gr({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:d,hunk:f,collapsedBefore:h,collapsedAfter:m,deletionLine:y,additionLine:S})=>{let p=a==="split"?S?.splitLineIndex??y?.splitLineIndex:S?.unifiedLineIndex??y?.unifiedLineIndex;if(p==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(h>0){let b=qs({type:l,metrics:this.metrics,hunkIndex:d,hunkSpecs:f?.hunkSpecs});b!=null&&(u+=b.totalHeight)}if(u>=t&&(y!=null?c={lineNumber:y.lineNumber,side:"deletions",top:u}:S!=null&&(c={lineNumber:S.lineNumber,side:"additions",top:u}),c!=null))return!0;let g=this.getLineHeight(p,(S?.noEOFCR??!1)||(y?.noEOFCR??!1));if(u+=g,m>0){let b=ya({type:l,metrics:this.metrics});b!=null&&(u+=b.totalHeight)}return!1}}),c}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(t){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=t!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,t):this.renderRange;if(n==null)return;let{bufferBefore:i,bufferAfter:r,totalLines:o}=n,a=0;if(o===0){let l=t??this.virtualizer.getWindowSpecs();this.top<l.top&&(a=r)}return{topOffset:this.top+i+a,height:this.height-(i+r)}}cleanUp(t=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),t||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.isSetup=!1,super.cleanUp(t)}async handleFilesLoaded(t,n){if(!(this.fileDiff!==t||!t.isPartial)){if(this.isAdvancedMode()){let i=jh("clone",t,n);if(await Vh(()=>this.primeHighlightCache(i)),!this.enabled||this.fileDiff!==t)return;this.pendingHydratedDiff={expectedDiff:t,nextDiff:i,files:n}}else{if(jh("merge",t,n),this.setHydratedState(n),await Vh(()=>this.primeHighlightCache(t)),!this.enabled||this.fileDiff!==t)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}consumeCodeViewLayoutChanges(t){let n=!1,i,{pendingExpansions:r,pendingHydratedDiff:o}=this;if(r!=null){this.pendingExpansions=void 0;for(let a of r)this.hunksRenderer.expandHunk(a.hunkIndex,a.direction,a.expansionLineCountOverride),n=!0}return o!=null&&(this.pendingHydratedDiff=void 0,o.expectedDiff===t&&(this.setHydratedState(o.files),i=o.nextDiff)),i!=null?(this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0})):n&&(this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0)),i}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(t){if(super.isLineRenderable(t))return!0;let{pendingExpansions:n}=this,i=this.fileDiffCache;if(n==null||n.length===0||i==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:o=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let l of n){let s={...a.get(l.hunkIndex)??{fromStart:0,fromEnd:0}},u=l.expansionLineCountOverride??r;(l.direction==="up"||l.direction==="both")&&(s.fromStart+=u),(l.direction==="down"||l.direction==="both")&&(s.fromEnd+=u),a.set(l.hunkIndex,s)}return ky({fileDiff:i,lineNumber:t,expandedHunks:a,collapsedContextThreshold:o})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(t){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,t&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!t&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}applyDocumentChange(t,n,i=!1){let{renderRange:r}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(t,n),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&r!==void 0&&this.fileDiff!==void 0){let o=this.virtualizer.getWindowSpecs(),a=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,o);a.bufferAfter!==r.bufferAfter&&this.updateBuffers(a)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(t=!1,n=this.fileDiff){let i=this.isResizeDebuggingEnabled();if(!t&&!this.layoutDirty&&!i)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,n==null){this.layoutDirty=!1;return}let{disableFileHeader:o=!1,collapsed:a=!1}=this.options,l=Ki(this.metrics,o);if(this.height+=l,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(n)+this.cache.measuredHeightDeltaTotal,i&&!r&&this.validateComputedHeight(n),this.layoutDirty=!1}getActiveEstimatedHeight(t=this.fileDiff){this.ensureEstimatedDiffHeights(t);let n=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(n==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return n}ensureEstimatedDiffHeights(t=this.fileDiff){if(t==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:n=!1,expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,{splitHeight:o,unifiedHeight:a}=J_({fileDiff:t,metrics:this.metrics,disableFileHeader:n,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:i,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:bw(t,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=o,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(t=this.fileDiff){if(this.fileContainer==null||t==null)return;let n=this.fileContainer.getBoundingClientRect();n.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:n.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:t,fileDiff:n,forceRender:i=!1,lineAnnotations:r,...o}={}){let a=qh(o,"VirtualizedFileDiff.render"),l=a!=null,s=a?.oldFile,u=a?.newFile,c=l&&(!y2(s,this.deletionFile)||!y2(u,this.additionFile)),d=n??this.fileDiff;n==null&&l&&(c||this.fileDiff==null)&&(d=Xi(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:f,isSetup:h}=this;this.forceRenderOverride=void 0;let m=this.syncLineAnnotations(r);m&&this.resetLayoutCache({includeEstimatedHeights:!1});let y=n!=null&&n!==this.fileDiff,S=d!=null&&!ho(this.fileDiff,d),p=y||c;if(S&&this.resetLayoutCache({includeEstimatedHeights:!0}),t=this.getOrCreateFileContainer(t),d==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(h)this.top??(this.top=this.getVirtualizedTop()),S&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,d));else{this.computeApproximateSize(!1,d);let E=this.getSimpleVirtualizer();if(this.top??(this.top=this.getVirtualizedTop()),this.isAdvancedMode())this.isVisible=!0;else{if(E==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");E.connect(t,this),this.isVisible=E.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!p||!h))return this.fileDiff=d,a!=null&&(this.deletionFile=s,this.additionFile=u),S&&(this.cachedHeaderHTML=void 0),this.renderPlaceholder(this.height);let g=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(d,b,g),C=super.render({fileDiff:d,fileContainer:t,renderRange:x,lineAnnotations:r,forceRender:(f??i)||m||S,...a,...o});return this.isSimpleMode()&&C&&this.getSimpleVirtualizer()?.requestHeightReconcile(this),C}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return _$(this.options.hunkSeparators)}approximateLayoutCheckpoints(t=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||t==null||t.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:n=!1,expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o=t.hunks.length-1,a=bw(t,this.options.loadDiffFiles!=null),l=this.getDiffStyle(),s=this.getHunkSeparatorType(),u=i?!0:this.hunksRenderer.getExpandedHunksMap(),c=R$(this.cache.heightDeltas),d=Ki(this.metrics,n)+this.cache.fileAnnotationHeight,f=0,h=({rowCount:m,startLineIndex:y,preSeparatorHeight:S=0,postSeparatorHeight:p=0,metadataOffsets:g=[]})=>{if(m<=0)return;let b=f,x=f+m,C=L$(b);for(;C<x;){let E=C-b,w=d+(E>0?S:0)+E*this.metrics.lineHeight+A$(g,E)*this.metrics.lineHeight+p2(c,y,y+E);this.cache.checkpoints.push({renderedLineIndex:C,lineIndex:y+E,top:w}),C+=vw}d+=S+m*this.metrics.lineHeight+g.length*this.metrics.lineHeight+p2(c,y,y+m)+p,f=x};for(let m=0;m<t.hunks.length;m++){let y=t.hunks[m];if(y==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");let S=Ti({isPartial:t.isPartial,rangeSize:y.collapsedBefore,expandedHunks:u,hunkIndex:m,collapsedContextThreshold:r}),p=S.collapsedLines>0?qs({type:s,metrics:this.metrics,hunkIndex:m,hunkSpecs:y.hunkSpecs})?.totalHeight??0:0;h({rowCount:S.fromStart,startLineIndex:(l==="split"?y.splitLineStart:y.unifiedLineStart)-S.rangeSize});let g=p;h({rowCount:S.fromEnd,startLineIndex:(l==="split"?y.splitLineStart:y.unifiedLineStart)-S.fromEnd,preSeparatorHeight:g}),S.fromEnd>0&&(g=0);let b=m===o?Ri({fileDiff:t,hunkIndex:m,expandedHunks:u,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"}):void 0,x=b!=null&&b.collapsedLines>0?ya({type:s,metrics:this.metrics})?.totalHeight??0:m===o&&a?ya({type:s,metrics:this.metrics})?.totalHeight??0:0,C=b!=null?b.fromStart+b.fromEnd:0,E=l==="split"?y.splitLineCount:y.unifiedLineCount,w=l==="split"?y.splitLineStart:y.unifiedLineStart;h({rowCount:E,startLineIndex:w,preSeparatorHeight:g,postSeparatorHeight:C===0?x:0,metadataOffsets:M$({diffStyle:l,hunk:y,rowCount:E})}),b!=null&&C>0&&h({rowCount:C,startLineIndex:w+E,postSeparatorHeight:x})}this.cache.totalLines=f}getLayoutCheckpointBeforeLineIndex(t){if(t<=0||this.cache.checkpoints.length===0)return;let n=0,i=this.cache.checkpoints.length-1,r;for(;n<=i;){let o=n+i>>1,a=this.cache.checkpoints[o];if(a==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");a.lineIndex<=t?(r=a,n=o+1):i=o-1}return r}getLayoutCheckpointBeforeTop(t,n){let i=0,r=this.cache.checkpoints.length-1,o=-1;for(;i<=r;){let a=i+r>>1,l=this.cache.checkpoints[a];if(l==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");l.top<=t?(o=a,i=a+1):r=a-1}if(n==null)return o>=0?this.cache.checkpoints[o]:void 0;for(let a=o;a>=0;a--){let l=this.cache.checkpoints[a];if(l==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(l.renderedLineIndex%n===0)return l}}getExpandedLineCount(t,n){let i=0;if(t.isPartial){for(let s of t.hunks)i+=n==="split"?s.splitLineCount:s.unifiedLineCount;return i}let{expandUnchanged:r=!1,collapsedContextThreshold:o=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[s,u]of t.hunks.entries()){let c=n==="split"?u.splitLineCount:u.unifiedLineCount;i+=c;let d=Math.max(u.collapsedBefore,0),{fromStart:f,fromEnd:h,renderAll:m}=Ti({isPartial:t.isPartial,rangeSize:d,expandedHunks:a,hunkIndex:s,collapsedContextThreshold:o});d>0&&(i+=m?d:f+h)}let l=Ri({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:o,errorPrefix:"VirtualizedFileDiff"});return l!=null&&(i+=l.fromStart+l.fromEnd),i}getLayoutLineCount(t,n){let i=this.getExpandedLineCount(t,n),r=n==="split"?t.splitLineCount:t.unifiedLineCount;return Math.max(i,r,t.additionLines.length,t.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(t,n,{top:i,bottom:r}){let{disableFileHeader:o=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=1}=this.options,{hunkLineCount:s,lineHeight:u}=this.metrics,c=this.getDiffStyle(),d=this.getHunkSeparatorType(),f=bw(t,this.options.loadDiffFiles!=null),h=this.height,m=this.getLayoutLineCount(t,c),y=Ki(this.metrics,o),S=t.hunks.length>0?Vs(this.metrics):0,{fileAnnotationHeight:p}=this.cache,g=y+p,b=Math.max(0,h-y-p-S),x=this.hasFileAnnotations(t),C=n+y,E=p>0&&x&&C<r&&C+p>i;if(n<i-h||n>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-y-S};if(m<=s||t.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(t),m=this.getLayoutLineCount(t,c);let w=Math.ceil(Math.max(r-i,0)/u),A=Math.ceil(w/s)*s+s,T=A/s,k=T,O=[],N=(i+r)/2,H=this.getLayoutCheckpointBeforeTop(Math.max(0,i-n-A*u*2),s),F=n+(H?.top??g),z=H?.renderedLineIndex??0,q,G,Z;if(Gr({diff:t,diffStyle:c,startingLine:H?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:Q,hunk:ie,collapsedBefore:fe,collapsedAfter:Ze,deletionLine:De,additionLine:J})=>{let Ae=J!=null?J.splitLineIndex:De.splitLineIndex,ze=J!=null?J.unifiedLineIndex:De.unifiedLineIndex,Ot=(J?.noEOFCR??!1)||(De?.noEOFCR??!1),Pe=Q===t.hunks.length-1&&ie!=null&&(c==="split"?Ae===ie.splitLineStart+ie.splitLineCount-1:ze===ie.unifiedLineStart+ie.unifiedLineCount-1),Ye=(fe>0?qs({type:d,metrics:this.metrics,hunkIndex:Q,hunkSpecs:ie?.hunkSpecs}):void 0)?.totalHeight??0;F+=Ye;let lt=z%s===0,et=Math.floor(z/s);if(lt&&(O[et]=F-(n+g+Ye),Z!=null)){if(Z<=0)return!0;Z--}let Ut=this.getLineHeight(c==="split"?Ae:ze,Ot);if(F>i-Ut&&F<r&&(q??(q=et)),G==null&&F+Ut>N&&(G=et),Z==null&&F>=r&<&&(Z=k),z++,F+=Ut,Ze>0||Pe&&f){let Gt=ya({type:d,metrics:this.metrics});Gt!=null&&(F<r&&F+Gt.totalHeight>i&&(q??(q=et)),G==null&&F+Gt.totalHeight>N&&(G=et),F+=Gt.totalHeight)}return!1}}),q==null)if(E)q=0,G=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-y-S};G??(G=q);let oe=Math.round(G-T/2),L=Math.max(0,Math.ceil(m/s)-T),he=Math.max(0,Math.min(oe,L)),pe=he*s,M=oe<0?A+oe*s:A,le=O[he]??0,ye=pe===0?0:p+le,Te=he+M/s,Qe=Te<O.length?b-O[Te]:b-(F-n-g);return{startingLine:pe,totalLines:M,bufferBefore:ye,bufferAfter:Math.max(0,Qe)}}};function T$(e){let t;for(let n of e){if(n==null)continue;let i=n.children[1];if(i instanceof HTMLElement)for(let r of i.children)r instanceof HTMLElement&&r.dataset.lineAnnotation===Uy&&(t=Math.max(t??0,r.getBoundingClientRect().height))}return t}function R$(e){let t=Array.from(e).sort((o,a)=>o[0]-a[0]),n=[],i=[0],r=0;for(let[o,a]of t)n.push(o),r+=a,i.push(r);return{lineIndexes:n,prefixTotals:i}}function p2({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;let r=g2(e,n);return(t[g2(e,i)]??0)-(t[r]??0)}function g2(e,t){let n=0,i=e.length;for(;n<i;){let r=n+i>>1,o=e[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid prefix index");o<t?n=r+1:i=r}return n}function L$(e){return Math.ceil(e/vw)*vw}function A$(e,t){let n=0;for(let i of e)i<t&&n++;return n}function M$({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];let r=Math.max(i.deletions,i.additions),o=i.deletions+i.additions;if(e==="split")return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let a=[],l=n-o;return i.deletions>0&&t.noEOFCRDeletions&&a.push(l+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&a.push(n-1),a}function I$(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function D$(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function bw(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function _$(e){return typeof e=="function"?"custom":e??"line-info"}function y2(e,t){return e==null||t==null?e==null&&t==null:Nn(e,t)}function O$(e,t){let[n,i]=e.split(",").map(Number);return t==="split"?i:n}var Il=R(_(),1);function bb(e,t){return typeof window>"u"&&t!=null?(0,Il.jsxs)(Il.Fragment,{children:[(0,Il.jsx)("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):(0,Il.jsx)(Il.Fragment,{children:e})}var dd=R(Y(),1),H$=R(_(),1),N$=(0,dd.createContext)(void 0);function vb(){return(0,dd.useContext)(N$)}var po=R(Y(),1),v2=typeof window>"u"?po.useEffect:po.useLayoutEffect;function S2({file:e,options:t,editorOptions:n,lineAnnotations:i,selectedLines:r,prerenderedHTML:o,metrics:a,hasGutterRenderUtility:l,hasCustomHeader:s,disableWorkerPool:u,edit:c}){let d=vb(),f=r!==void 0,h=(0,po.useContext)(id),m=ry(),y=(0,po.useRef)(null),S=ny(p=>{if(p!=null){if(y.current!=null)throw new Error("File: An instance should not already exist when a node is created");d!=null?y.current=new Z_(Sw({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),d,a,u?void 0:h,!0):y.current=new fb(Sw({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),u?void 0:h,!0),y.current.hydrate({file:e,fileContainer:p,lineAnnotations:i,prerenderedHTML:o})}else{if(y.current==null)throw new Error("File: A File instance should exist when unmounting");y.current.cleanUp(),y.current=null}});return v2(()=>{if(y.current==null)return;let p=Sw({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),g=p!==void 0&&!Tl(y.current.options,p);y.current.setOptions(p),y.current.render({file:e,lineAnnotations:i,forceRender:g}),r!==void 0&&y.current.setSelectedLines(r)}),v2(()=>{if(c&&y.current!=null){if(m===void 0)throw new Error("File: EditContext is not attached");let p=m(n??{});if(p==null)throw new Error("File: EditProvider.createEditor must return an editor instance");try{return p.edit(y.current)}catch(g){throw p.cleanUp(),g}}},[c]),{ref:S,getHoveredLine:(0,po.useCallback)(()=>y.current?.getHoveredLine(),[])}}function Sw({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i}){return t||i||n?{...e,controlledSelection:t,renderCustomHeader:n?Wc:e?.renderCustomHeader,renderGutterUtility:i?Wc:e?.renderGutterUtility}:e}var x2=R(_(),1);function xw({file:e,lineAnnotations:t,selectedLines:n,options:i,editorOptions:r,metrics:o,className:a,style:l,renderAnnotation:s,renderCustomHeader:u,renderHeaderPrefix:c,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f,prerenderedHTML:h,renderGutterUtility:m,disableWorkerPool:y=!1,edit:S=!1}){let{ref:p,getHoveredLine:g}=S2({file:e,options:i,editorOptions:r,metrics:o,lineAnnotations:t,selectedLines:n,prerenderedHTML:h,hasGutterRenderUtility:m!=null,hasCustomHeader:u!=null,disableWorkerPool:y,edit:S});return(0,x2.jsx)(Yc,{ref:p,className:a,style:l,children:bb(YD({file:e,renderAnnotation:s,renderCustomHeader:u,renderHeaderPrefix:c,renderHeaderFilenameSuffix:d,renderHeaderMetadata:f,renderGutterUtility:m,lineAnnotations:t,getHoveredLine:g}),h)})}var go=R(Y(),1),E2=typeof window>"u"?go.useEffect:go.useLayoutEffect;function w2({fileDiff:e,options:t,editorOptions:n,lineAnnotations:i,selectedLines:r,prerenderedHTML:o,metrics:a,hasGutterRenderUtility:l,hasCustomHeader:s,disableWorkerPool:u,edit:c}){let d=vb(),f=r!==void 0,h=(0,go.useContext)(id),m=ry(),y=(0,go.useRef)(null),S=ny(p=>{if(p!=null){if(y.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");d!=null?y.current=new b2(Ew({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),d,a,u?void 0:h,!0):y.current=new yb(Ew({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),u?void 0:h,!0),y.current.hydrate({fileDiff:e,fileContainer:p,lineAnnotations:i,prerenderedHTML:o})}else{if(y.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");y.current.cleanUp(),y.current=null}});return E2(()=>{let{current:p}=y;if(p==null)return;let g=Ew({controlledSelection:f,hasCustomHeader:s,hasGutterRenderUtility:l,options:t}),b=g!==void 0&&!Tl(p.options,g);p.setOptions(g),p.render({forceRender:b,fileDiff:e,lineAnnotations:i}),r!==void 0&&p.setSelectedLines(r)}),E2(()=>{if(c&&y.current!=null){if(m===void 0)throw new Error("FileDiff: EditContext is not attached");let p=m(n??{});if(p==null)throw new Error("FileDiff: EditProvider.createEditor must return an editor instance");try{return p.edit(y.current)}catch(g){throw p.cleanUp(),g}}},[c]),{ref:S,getHoveredLine:(0,go.useCallback)(()=>y.current?.getHoveredLine(),[])}}function Ew({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:i}){return t||i||n?{...e,controlledSelection:t,renderCustomHeader:n?Wc:e?.renderCustomHeader,renderGutterUtility:i?Wc:e?.renderGutterUtility}:e}var C2=R(Y(),1),k2=R(_(),1);function ww({oldFile:e,newFile:t,options:n,editorOptions:i,metrics:r,lineAnnotations:o,selectedLines:a,className:l,style:s,prerenderedHTML:u,renderAnnotation:c,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderGutterUtility:y,disableWorkerPool:S=!1,edit:p=!1}){let g=(0,C2.useMemo)(()=>Xi(e,t,n?.parseDiffOptions),[e,t,n?.parseDiffOptions]),{ref:b,getHoveredLine:x}=w2({fileDiff:g,options:n,editorOptions:i,metrics:r,lineAnnotations:o,selectedLines:a,prerenderedHTML:u,hasGutterRenderUtility:y!=null,hasCustomHeader:d!=null,disableWorkerPool:S,edit:p});return(0,k2.jsx)(Yc,{ref:b,className:l,style:s,children:bb(WD({fileDiff:g,renderCustomHeader:d,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderAnnotation:c,lineAnnotations:o,renderGutterUtility:y,getHoveredLine:x}),u)})}var Ai=R(Y(),1),se=R(Y(),1),vt=R(Y(),1),$w=R(Y(),1),rO=R(Y(),1),We=R(Y(),1),X7=R(Y(),1),Q7=R(Y(),1),Z7=R(Y(),1),ue=R(Y(),1),yO=R(Y(),1);var T2="popstate";function R2(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function O2(e={}){function t(i,r){let o=r.state?.masked,{pathname:a,search:l,hash:s}=o||i.location;return Rw("",{pathname:a,search:l,hash:s},r.state&&r.state.usr||null,r.state&&r.state.key||"default",o?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:fd(r)}return z$(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Li(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function F$(){return Math.random().toString(36).substring(2,10)}function L2(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Rw(e,t,n=null,i,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xs(t):t,state:n,key:t&&t.key||i||F$(),mask:r}}function fd({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Xs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function z$(e,t,n,i={}){let{window:r=document.defaultView,v5Compat:o=!1}=i,a=r.history,l="POP",s=null,u=c();u==null&&(u=0,a.replaceState({...a.state,idx:u},""));function c(){return(a.state||{idx:null}).idx}function d(){l="POP";let S=c(),p=S==null?null:S-u;u=S,s&&s({action:l,location:y.location,delta:p})}function f(S,p){l="PUSH";let g=R2(S)?S:Rw(y.location,S,p);n&&n(g,S),u=c()+1;let b=L2(g,u),x=y.createHref(g.mask||g);try{a.pushState(b,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;r.location.assign(x)}o&&s&&s({action:l,location:y.location,delta:1})}function h(S,p){l="REPLACE";let g=R2(S)?S:Rw(y.location,S,p);n&&n(g,S),u=c();let b=L2(g,u),x=y.createHref(g.mask||g);a.replaceState(b,"",x),o&&s&&s({action:l,location:y.location,delta:0})}function m(S){return P$(r,S)}let y={get action(){return l},get location(){return e(r,a)},listen(S){if(s)throw new Error("A history only accepts one active listener");return r.addEventListener(T2,d),s=S,()=>{r.removeEventListener(T2,d),s=null}},createHref(S){return t(r,S)},createURL:m,encodeLocation(S){let p=m(S);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:f,replace:h,go(S){return a.go(S)}};return y}function P$(e,t,n=!1){let i="http://localhost";e&&(i=e.location.origin!=="null"?e.location.origin:e.location.href),bt(i,"No window.location.(origin|href) available to create URL");let r=typeof t=="string"?t:fd(t);return r=r.replace(/ $/,"%20"),!n&&r.startsWith("//")&&(r=i+r),new URL(r,i)}var B$;B$=new WeakMap;function Iw(e,t,n="/"){return U$(e,t,n,!1)}function U$(e,t,n,i,r){let o=typeof t=="string"?Xs(t):t,a=yo(o.pathname||"/",n);if(a==null)return null;let l=r??$$(e),s=null,u=F2(a);for(let c=0;s==null&&c<l.length;++c)s=J$(l[c],u,i);return s}function G$(e,t){let{route:n,pathname:i,params:r}=e;return{id:n.id,pathname:i,params:r,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function $$(e){let t=H2(e);return V$(t),t}function H2(e,t=[],n=[],i="",r=!1){let o=(a,l,s=r,u)=>{let c={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(i)&&s)return;bt(c.relativePath.startsWith(i),`Absolute route path "${c.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(i.length)}let d=$r([i,c.relativePath]),f=n.concat(c);a.children&&a.children.length>0&&(bt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),H2(a.children,t,f,d,s)),!(a.path==null&&!a.index)&&t.push({path:d,score:Q$(d,a.index),routesMeta:f})};return e.forEach((a,l)=>{if(a.path===""||!a.path?.includes("?"))o(a,l);else for(let s of N2(a.path))o(a,l,!0,s)}),t}function N2(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,r=n.endsWith("?"),o=n.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let a=N2(i.join("/")),l=[];return l.push(...a.map(s=>s===""?o:[o,s].join("/"))),r&&l.push(...a),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function V$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Z$(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var q$=/^:[\w-]+$/,j$=3,W$=2,Y$=1,K$=10,X$=-2,A2=e=>e==="*";function Q$(e,t){let n=e.split("/"),i=n.length;return n.some(A2)&&(i+=X$),t&&(i+=W$),n.filter(r=>!A2(r)).reduce((r,o)=>r+(q$.test(o)?j$:o===""?Y$:K$),i)}function Z$(e,t){return e.length===t.length&&e.slice(0,-1).every((i,r)=>i===t[r])?e[e.length-1]-t[t.length-1]:0}function J$(e,t,n=!1){let{routesMeta:i}=e,r={},o="/",a=[];for(let l=0;l<i.length;++l){let s=i[l],u=l===i.length-1,c=o==="/"?t:t.slice(o.length)||"/",d=hd({path:s.relativePath,caseSensitive:s.caseSensitive,end:u},c),f=s.route;if(!d&&u&&n&&!i[i.length-1].route.index&&(d=hd({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!d)return null;Object.assign(r,d.params),a.push({params:r,pathname:$r([o,d.pathname]),pathnameBase:i7($r([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=$r([o,d.pathnameBase]))}return a}function hd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=e7(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let o=r[0],a=o.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:i.reduce((u,{paramName:c,isOptional:d},f)=>{if(c==="*"){let m=l[f]||"";a=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}let h=l[f];return d&&!h?u[c]=void 0:u[c]=(h||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:a,pattern:e}}function e7(e,t=!1,n=!0){Li(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let i=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,s,u,c)=>{if(i.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+a.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),i]}function F2(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Li(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function yo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}var t7=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function z2(e,t="/"){let{pathname:n,search:i="",hash:r=""}=typeof e=="string"?Xs(e):e,o;return n?(n=P2(n),n.startsWith("/")?o=M2(n.substring(1),"/"):o=M2(n,t)):o=t,{pathname:o,search:r7(i),hash:o7(r)}}function M2(e,t){let n=Cb(t).split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Cw(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function n7(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Dw(e){let t=n7(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function Rb(e,t,n,i=!1){let r;typeof e=="string"?r=Xs(e):(r={...e},bt(!r.pathname||!r.pathname.includes("?"),Cw("?","pathname","search",r)),bt(!r.pathname||!r.pathname.includes("#"),Cw("#","pathname","hash",r)),bt(!r.search||!r.search.includes("#"),Cw("#","search","hash",r)));let o=e===""||r.pathname==="",a=o?"/":r.pathname,l;if(a==null)l=n;else{let d=t.length-1;if(!i&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let s=z2(r,l),u=a&&a!=="/"&&a.endsWith("/"),c=(o||a===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var P2=e=>e.replace(/\/\/+/g,"/"),$r=e=>P2(e.join("/")),Cb=e=>e.replace(/\/+$/,""),i7=e=>Cb(e).replace(/^\/*/,"/"),r7=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,o7=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var B2=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function U2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function a7(e){let t=e.map(n=>n.route.path).filter(Boolean);return $r(t)||"/"}var G2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $2(e,t){let n=e;if(typeof n!="string"||!t7.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(G2)try{let o=new URL(window.location.href),a=n.startsWith("//")?new URL(o.protocol+n):new URL(n),l=yo(a.pathname,t);a.origin===o.origin&&l!=null?n=l+a.search+a.hash:r=!0}catch{Li(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}var Hle=Symbol("Uninstrumented");var Nle=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var V2=["POST","PUT","PATCH","DELETE"],Fle=new Set(V2),l7=["GET",...V2],zle=new Set(l7);var Ple=Symbol("ResetLoaderData"),s7,u7,c7,d7;s7=new WeakMap;u7=new WeakMap;c7=new WeakMap;d7=new WeakMap;var Qs=Ai.createContext(null);Qs.displayName="DataRouter";var md=Ai.createContext(null);md.displayName="DataRouterState";var q2=Ai.createContext(!1);function f7(){return Ai.useContext(q2)}var _w=Ai.createContext({isTransitioning:!1});_w.displayName="ViewTransition";var j2=Ai.createContext(new Map);j2.displayName="Fetchers";var h7=Ai.createContext(null);h7.displayName="Await";var Yn=Ai.createContext(null);Yn.displayName="Navigation";var pd=Ai.createContext(null);pd.displayName="Location";var wr=Ai.createContext({outlet:null,matches:[],isDataRoute:!1});wr.displayName="Route";var Ow=Ai.createContext(null);Ow.displayName="RouteError";var Lw=!0,W2="REACT_ROUTER_ERROR",m7="REDIRECT",p7="ROUTE_ERROR_RESPONSE";function g7(e){if(e.startsWith(`${W2}:${m7}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function y7(e){if(e.startsWith(`${W2}:${p7}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new B2(t.status,t.statusText,t.data)}catch{}}function Y2(e,{relative:t}={}){bt(Dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=se.useContext(Yn),{hash:r,pathname:o,search:a}=yd(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:$r([n,o])),i.createHref({pathname:l,search:a,hash:r})}function Dl(){return se.useContext(pd)!=null}function ui(){return bt(Dl(),"useLocation() may be used only in the context of a <Router> component."),se.useContext(pd).location}function Lb(e){bt(Dl(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=ui();return se.useMemo(()=>hd(e,F2(t)),[t,e])}var K2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function X2(e){se.useContext(Yn).static||se.useLayoutEffect(e)}function gd(){let{isDataRoute:e}=se.useContext(wr);return e?R7():b7()}function b7(){bt(Dl(),"useNavigate() may be used only in the context of a <Router> component.");let e=se.useContext(Qs),{basename:t,navigator:n}=se.useContext(Yn),{matches:i}=se.useContext(wr),{pathname:r}=ui(),o=JSON.stringify(Dw(i)),a=se.useRef(!1);return X2(()=>{a.current=!0}),se.useCallback((s,u={})=>{if(Li(a.current,K2),!a.current)return;if(typeof s=="number"){n.go(s);return}let c=Rb(s,JSON.parse(o),r,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$r([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,o,r,e])}var Ble=se.createContext(null);function Hw(){let{matches:e}=se.useContext(wr);return e[e.length-1]?.params??{}}function yd(e,{relative:t}={}){let{matches:n}=se.useContext(wr),{pathname:i}=ui(),r=JSON.stringify(Dw(n));return se.useMemo(()=>Rb(e,JSON.parse(r),i,t==="path"),[e,r,i,t])}function Q2(e,t){return Z2(e,t)}function Z2(e,t,n){bt(Dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=se.useContext(Yn),{matches:r}=se.useContext(wr),o=r[r.length-1],a=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Lw){let S=u&&u.path||"";nO(l,!u||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${S}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1377
1377
|
|
|
1378
|
-
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let c=ui(),d;if(t){let S=typeof t=="string"?Xs(t):t;bt(s==="/"||S.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${S.pathname}" was given in the \`location\` prop.`),d=S}else d=c;let f=d.pathname||"/",h=f;if(s!=="/"){let S=s.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(S.length).join("/")}let m=n&&n.state.matches.length?n.state.matches.map(S=>Object.assign(S,{route:n.manifest[S.route.id]||S.route})):Iw(e,{pathname:h});Lw&&(Li(u||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Li(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let y=w7(m&&m.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:$r([s,i.encodeLocation?i.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:$r([s,i.encodeLocation?i.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),r,n);return t&&y?se.createElement(pd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},y):y}function v7(){let e=tO(),t=U2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},a=null;return Lw&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=se.createElement(se.Fragment,null,se.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),se.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",se.createElement("code",{style:o},"ErrorBoundary")," or"," ",se.createElement("code",{style:o},"errorElement")," prop on your route."))),se.createElement(se.Fragment,null,se.createElement("h2",null,"Unexpected Application Error!"),se.createElement("h3",{style:{fontStyle:"italic"}},t),n?se.createElement("pre",{style:r},n):null,a)}var S7=se.createElement(v7,null),J2=class extends se.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=y7(e.digest);n&&(e=n)}let t=e!==void 0?se.createElement(wr.Provider,{value:this.props.routeContext},se.createElement(Ow.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?se.createElement(x7,{error:e},t):t}};J2.contextType=q2;var kw=new WeakMap;function x7({children:e,error:t}){let{basename:n}=se.useContext(Yn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=g7(t.digest);if(i){let r=kw.get(t);if(r)throw r;let o=$2(i.location,n);if(G2&&!kw.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{let a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw kw.set(t,a),a}return se.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function E7({routeContext:e,match:t,children:n}){let i=se.useContext(Qs);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),se.createElement(wr.Provider,{value:e},n)}function w7(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let r=e,o=i?.errors;if(o!=null){let c=r.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);bt(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,c+1))}let a=!1,l=-1;if(n&&i){a=i.renderFallback;for(let c=0;c<r.length;c++){let d=r[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:f,errors:h}=i,m=d.route.loader&&!f.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){n.isStatic&&(a=!0),l>=0?r=r.slice(0,l+1):r=[r[0]];break}}}}let s=n?.onError,u=i&&s?(c,d)=>{s(c,{location:i.location,params:i.matches?.[0]?.params??{},pattern:a7(i.matches),errorInfo:d})}:void 0;return r.reduceRight((c,d,f)=>{let h,m=!1,y=null,S=null;i&&(h=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||S7,a&&(l<0&&f===0?(nO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,S=null):l===f&&(m=!0,S=d.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,f+1)),g=()=>{let b;return h?b=y:m?b=S:d.route.Component?b=se.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,se.createElement(E7,{match:d,routeContext:{outlet:c,matches:p,isDataRoute:i!=null},children:b})};return i&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?se.createElement(J2,{location:i.location,revalidation:i.revalidation,component:y,error:h,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):g()},null)}function Nw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C7(e){let t=se.useContext(Qs);return bt(t,Nw(e)),t}function Fw(e){let t=se.useContext(md);return bt(t,Nw(e)),t}function k7(e){let t=se.useContext(wr);return bt(t,Nw(e)),t}function zw(e){let t=k7(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function T7(){return zw("useRouteId")}function eO(){let e=Fw("useNavigation");return se.useMemo(()=>{let{matches:t,historyAction:n,...i}=e.navigation;return i},[e.navigation])}function Pw(){let{matches:e,loaderData:t}=Fw("useMatches");return se.useMemo(()=>e.map(n=>G$(n,t)),[e,t])}function tO(){let e=se.useContext(Ow),t=Fw("useRouteError"),n=zw("useRouteError");return e!==void 0?e:t.errors?.[n]}function R7(){let{router:e}=C7("useNavigate"),t=zw("useNavigate"),n=se.useRef(!1);return X2(()=>{n.current=!0}),se.useCallback(async(r,o={})=>{Li(n.current,K2),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))},[e,t])}var I2={};function nO(e,t,n){!t&&!I2[e]&&(I2[e]=!0,Li(!1,n))}var L7="useOptimistic",Ule=vt[L7];var Gle=vt.memo(A7);function A7({routes:e,manifest:t,future:n,state:i,isStatic:r,onError:o}){return Z2(e,void 0,{manifest:t,state:i,isStatic:r,onError:o,future:n})}function Bw({to:e,replace:t,state:n,relative:i}){bt(Dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=vt.useContext(Yn);Li(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=vt.useContext(wr),{pathname:a}=ui(),l=gd(),s=Rb(e,Dw(o),a,i==="path"),u=JSON.stringify(s);return vt.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:i})},[l,u,i,t,n]),null}function Zs(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Uw({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:r,static:o=!1,useTransitions:a}){bt(!Dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=vt.useMemo(()=>({basename:l,navigator:r,static:o,useTransitions:a,future:{}}),[l,r,o,a]);typeof n=="string"&&(n=Xs(n));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:h="default",mask:m}=n,y=vt.useMemo(()=>{let S=yo(u,l);return S==null?null:{location:{pathname:S,search:c,hash:d,state:f,key:h,mask:m},navigationType:i}},[l,u,c,d,f,h,i,m]);return Li(y!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:vt.createElement(Yn.Provider,{value:s},vt.createElement(pd.Provider,{children:t,value:y}))}function Gw({children:e,location:t}){return Q2(kb(e),t)}function kb(e,t=[]){let n=[];return vt.Children.forEach(e,(i,r)=>{if(!vt.isValidElement(i))return;let o=[...t,r];if(i.type===vt.Fragment){n.push.apply(n,kb(i.props.children,o));return}bt(i.type===Zs,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let a={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(a.children=kb(i.props.children,o)),n.push(a)}),n}var Eb="get",wb="application/x-www-form-urlencoded";function Ab(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function M7(e){return Ab(e)&&e.tagName.toLowerCase()==="button"}function I7(e){return Ab(e)&&e.tagName.toLowerCase()==="form"}function D7(e){return Ab(e)&&e.tagName.toLowerCase()==="input"}function _7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function O7(e,t){return e.button===0&&(!t||t==="_self")&&!_7(e)}function Tb(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function H7(e,t){let n=Tb(e);return t&&t.forEach((i,r)=>{n.has(r)||t.getAll(r).forEach(o=>{n.append(r,o)})}),n}var Sb=null;function N7(){if(Sb===null)try{new FormData(document.createElement("form"),0),Sb=!1}catch{Sb=!0}return Sb}var F7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Tw(e){return e!=null&&!F7.has(e)?(Li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wb}"`),null):e}function z7(e,t){let n,i,r,o,a;if(I7(e)){let l=e.getAttribute("action");i=l?yo(l,t):null,n=e.getAttribute("method")||Eb,r=Tw(e.getAttribute("enctype"))||wb,o=new FormData(e)}else if(M7(e)||D7(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(i=s?yo(s,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Eb,r=Tw(e.getAttribute("formenctype"))||Tw(l.getAttribute("enctype"))||wb,o=new FormData(l,e),!N7()){let{name:u,type:c,value:d}=e;if(c==="image"){let f=u?`${u}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else u&&o.append(u,d)}}else{if(Ab(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Eb,i=null,r=wb,a=e}return o&&r==="text/plain"&&(a=o,o=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:o,body:a}}var $le=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var P7={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},B7=/[&><\u2028\u2029]/g;function D2(e){return e.replace(B7,t=>P7[t])}function Vw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var U7=Symbol("SingleFetchRedirect");function iO(e,t,n,i){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:t&&yo(r.pathname,t)==="/"?r.pathname=`${Cb(t)}/_root.${i}`:r.pathname=`${Cb(r.pathname)}.${i}`,r}async function G7(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw n;return window.location.reload(),new Promise(()=>{})}}function $7(e){return e!=null&&typeof e.page=="string"}function V7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function q7(e,t,n){let i=await Promise.all(e.map(async r=>{let o=t.routes[r.route.id];if(o){let a=await G7(o,n);return a.links?a.links():[]}return[]}));return K7(i.flat(1).filter(V7).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function _2(e,t,n,i,r,o){let a=(s,u)=>n[u]?s.route.id!==n[u].route.id:!0,l=(s,u)=>n[u].pathname!==s.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>a(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=i.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(a(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function j7(e,t,{includeHydrateFallback:n}={}){return W7(e.map(i=>{let r=t.routes[i.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function W7(e){return[...new Set(e)]}function Y7(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function K7(e,t){let n=new Set,i=new Set(t);return e.reduce((r,o)=>{if(t&&!$7(o)&&o.as==="script"&&o.href&&i.has(o.href))return r;let l=JSON.stringify(Y7(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function qw(){let e=We.useContext(Qs);return Vw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function J7(){let e=We.useContext(md);return Vw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qh=We.createContext(void 0);Qh.displayName="FrameworkContext";function jw(){let e=We.useContext(Qh);return Vw(e,"You must render this element inside a <HydratedRouter> element"),e}function eV(e,t){let n=We.useContext(Qh),[i,r]=We.useState(!1),[o,a]=We.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=We.useRef(null);We.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=p=>{p.forEach(g=>{a(g.isIntersecting)})},S=new IntersectionObserver(y,{threshold:.5});return f.current&&S.observe(f.current),()=>{S.disconnect()}}},[e]),We.useEffect(()=>{if(i){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[i]);let h=()=>{r(!0)},m=()=>{r(!1),a(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Xh(l,h),onBlur:Xh(s,m),onMouseEnter:Xh(u,h),onMouseLeave:Xh(c,m),onTouchStart:Xh(d,h)}]:[!1,f,{}]}function Xh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oO({page:e,...t}){let n=f7(),{router:i}=qw(),r=We.useMemo(()=>Iw(i.routes,e,i.basename),[i.routes,e,i.basename]);return r?n?We.createElement(nV,{page:e,matches:r,...t}):We.createElement(iV,{page:e,matches:r,...t}):null}function tV(e){let{manifest:t,routeModules:n}=jw(),[i,r]=We.useState([]);return We.useEffect(()=>{let o=!1;return q7(e,t,n).then(a=>{o||r(a)}),()=>{o=!0}},[e,t,n]),i}function nV({page:e,matches:t,...n}){let i=ui(),{future:r}=jw(),{basename:o}=qw(),a=We.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let l=iO(e,o,r.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,r.v8_trailingSlashAwareDataRequests,e,i,t]);return We.createElement(We.Fragment,null,a.map(l=>We.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function iV({page:e,matches:t,...n}){let i=ui(),{future:r,manifest:o,routeModules:a}=jw(),{basename:l}=qw(),{loaderData:s,matches:u}=J7(),c=We.useMemo(()=>_2(e,t,u,o,i,"data"),[e,t,u,o,i]),d=We.useMemo(()=>_2(e,t,u,o,i,"assets"),[e,t,u,o,i]),f=We.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let y=new Set,S=!1;if(t.forEach(g=>{let b=o.routes[g.route.id];!b||!b.hasLoader||(!c.some(x=>x.route.id===g.route.id)&&g.route.id in s&&a[g.route.id]?.shouldRevalidate||b.hasClientLoader?S=!0:y.add(g.route.id))}),y.size===0)return[];let p=iO(e,l,r.v8_trailingSlashAwareDataRequests,"data");return S&&y.size>0&&p.searchParams.set("_routes",t.filter(g=>y.has(g.route.id)).map(g=>g.route.id).join(",")),[p.pathname+p.search]},[l,r.v8_trailingSlashAwareDataRequests,s,i,o,c,t,e,a]),h=We.useMemo(()=>j7(d,o),[d,o]),m=tV(d);return We.createElement(We.Fragment,null,f.map(y=>We.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),h.map(y=>We.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),m.map(({key:y,link:S})=>We.createElement("link",{key:y,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function rV(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var oV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oV&&(window.__reactRouterVersion="7.17.0")}catch{}function Ww({basename:e,children:t,useTransitions:n,window:i}){let r=ue.useRef();r.current==null&&(r.current=O2({window:i,v5Compat:!0}));let o=r.current,[a,l]=ue.useState({action:o.action,location:o.location}),s=ue.useCallback(u=>{n===!1?l(u):ue.startTransition(()=>l(u))},[n]);return ue.useLayoutEffect(()=>o.listen(s),[o,s]),ue.createElement(Uw,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,useTransitions:n})}function aO({basename:e,children:t,history:n,useTransitions:i}){let[r,o]=ue.useState({action:n.action,location:n.location}),a=ue.useCallback(l=>{i===!1?o(l):ue.startTransition(()=>o(l))},[i]);return ue.useLayoutEffect(()=>n.listen(a),[n,a]),ue.createElement(Uw,{basename:e,children:t,location:r.location,navigationType:r.action,navigator:n,useTransitions:i})}aO.displayName="unstable_HistoryRouter";var lO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yw=ue.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:r,reloadDocument:o,replace:a,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:h,...m},y){let{basename:S,navigator:p,useTransitions:g}=ue.useContext(Yn),b=typeof c=="string"&&lO.test(c),x=$2(c,S);c=x.to;let C=Y2(c,{relative:r}),E=ui(),w=null;if(l){let z=Rb(l,[],E.mask?E.mask.pathname:"/",!0);S!=="/"&&(z.pathname=z.pathname==="/"?S:$r([S,z.pathname])),w=p.createHref(z)}let[A,T,k]=eV(i,m),O=fO(c,{replace:a,mask:l,state:s,target:u,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:h,useTransitions:g});function N(z){t&&t(z),z.defaultPrevented||O(z)}let H=!(x.isExternal||o),F=ue.createElement("a",{...m,...k,href:(H?w:void 0)||x.absoluteURL||C,onClick:H?N:t,ref:rV(y,T),target:u,"data-discover":!b&&n==="render"?"true":void 0});return A&&!b?ue.createElement(ue.Fragment,null,F,ue.createElement(oO,{page:C})):F});Yw.displayName="Link";var sO=ue.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:r=!1,style:o,to:a,viewTransition:l,children:s,...u},c){let d=yd(a,{relative:u.relative}),f=ui(),h=ue.useContext(md),{navigator:m,basename:y}=ue.useContext(Yn),S=h!=null&&gO(d)&&l===!0,p=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=f.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(g=g.toLowerCase(),b=b?b.toLowerCase():null,p=p.toLowerCase()),b&&y&&(b=yo(b,y)||b);let x=p!=="/"&&p.endsWith("/")?p.length-1:p.length,C=g===p||!r&&g.startsWith(p)&&g.charAt(x)==="/",E=b!=null&&(b===p||!r&&b.startsWith(p)&&b.charAt(p.length)==="/"),w={isActive:C,isPending:E,isTransitioning:S},A=C?t:void 0,T;typeof i=="function"?T=i(w):T=[i,C?"active":null,E?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(w):o;return ue.createElement(Yw,{...u,"aria-current":A,className:T,ref:c,style:k,to:a,viewTransition:l},typeof s=="function"?s(w):s)});sO.displayName="NavLink";var uO=ue.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:r,state:o,method:a=Eb,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...h},m)=>{let{useTransitions:y}=ue.useContext(Yn),S=hO(),p=mO(l,{relative:u}),g=a.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&lO.test(l);return ue.createElement("form",{ref:m,method:g,action:p,onSubmit:i?s:C=>{if(s&&s(C),C.defaultPrevented)return;C.preventDefault();let E=C.nativeEvent.submitter,w=E?.getAttribute("formmethod")||a,A=()=>S(E||C.currentTarget,{fetcherKey:t,method:w,navigate:n,replace:r,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f});y&&n!==!1?ue.startTransition(()=>A()):A()},...h,"data-discover":!b&&e==="render"?"true":void 0})});uO.displayName="Form";function cO({getKey:e,storageKey:t,...n}){let i=ue.useContext(Qh),{basename:r}=ue.useContext(Yn),o=ui(),a=Pw();pO({getKey:e,storageKey:t});let l=ue.useMemo(()=>{if(!i||!e)return null;let u=Mw(o,a,r,e);return u!==o.key?u:null},[]);if(!i||i.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let f=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return ue.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${D2(JSON.stringify(t||Aw))}, ${D2(JSON.stringify(l))})`}})}cO.displayName="ScrollRestoration";function dO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kw(e){let t=ue.useContext(Qs);return bt(t,dO(e)),t}function aV(e){let t=ue.useContext(md);return bt(t,dO(e)),t}function fO(e,{target:t,replace:n,mask:i,state:r,preventScrollReset:o,relative:a,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=gd(),d=ui(),f=yd(e,{relative:a});return ue.useCallback(h=>{if(O7(h,t)){h.preventDefault();let m=n!==void 0?n:fd(d)===fd(f),y=()=>c(e,{replace:m,mask:i,state:r,preventScrollReset:o,relative:a,viewTransition:l,defaultShouldRevalidate:s});u?ue.startTransition(()=>y()):y()}},[d,c,f,n,i,r,t,e,o,a,l,s,u])}function Zh(e){Li(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=ue.useRef(Tb(e)),n=ue.useRef(!1),i=ui(),r=ue.useMemo(()=>H7(i.search,n.current?null:t.current),[i.search]),o=gd(),a=ue.useCallback((l,s)=>{let u=Tb(typeof l=="function"?l(new URLSearchParams(r)):l);n.current=!0,o("?"+u,s)},[o,r]);return[r,a]}var lV=0,sV=()=>`__${String(++lV)}__`;function hO(){let{router:e}=Kw("useSubmit"),{basename:t}=ue.useContext(Yn),n=T7(),i=e.fetch,r=e.navigate;return ue.useCallback(async(o,a={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=z7(o,t);if(a.navigate===!1){let f=a.fetcherKey||sV();await i(f,n,a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||u,flushSync:a.flushSync})}else await r(a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[i,r,t,n])}function mO(e,{relative:t}={}){let{basename:n}=ue.useContext(Yn),i=ue.useContext(wr);bt(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),o={...yd(e||".",{relative:t})},a=ui();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&r.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:$r([n,o.pathname])),fd(o)}var Aw="react-router-scroll-positions",xb={};function Mw(e,t,n,i){let r=null;return i&&(n!=="/"?r=i({...e,pathname:yo(e.pathname,n)||e.pathname},t):r=i(e,t)),r==null&&(r=e.key),r}function pO({getKey:e,storageKey:t}={}){let{router:n}=Kw("useScrollRestoration"),{restoreScrollPosition:i,preventScrollReset:r}=aV("useScrollRestoration"),{basename:o}=ue.useContext(Yn),a=ui(),l=Pw(),s=eO();ue.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),uV(ue.useCallback(()=>{if(s.state==="idle"){let u=Mw(a,l,o,e);xb[u]=window.scrollY}try{sessionStorage.setItem(t||Aw,JSON.stringify(xb))}catch(u){Li(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,a,l,t])),typeof document<"u"&&(ue.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Aw);u&&(xb=JSON.parse(u))}catch{}},[t]),ue.useLayoutEffect(()=>{let u=n?.enableScrollRestoration(xb,()=>window.scrollY,e?(c,d)=>Mw(c,d,o,e):void 0);return()=>u&&u()},[n,o,e]),ue.useLayoutEffect(()=>{if(i!==!1){if(typeof i=="number"){window.scrollTo(0,i);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{Li(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}r!==!0&&window.scrollTo(0,0)}},[a,i,r]))}function uV(e,t){let{capture:n}=t||{};ue.useEffect(()=>{let i=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,i),()=>{window.removeEventListener("pagehide",e,i)}},[e,n])}function gO(e,{relative:t}={}){let n=ue.useContext(_w);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Kw("useViewTransitionState"),r=yd(e,{relative:t});if(!n.isTransitioning)return!1;let o=yo(n.currentLocation.pathname,i)||n.currentLocation.pathname,a=yo(n.nextLocation.pathname,i)||n.nextLocation.pathname;return hd(r.pathname,a)!=null||hd(r.pathname,o)!=null}var ne=R(Y(),1);var It=R(Y(),1);var Cr='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',_l="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",W={label:10,meta:11,ui:12,prose:13,title:18},v={bg:"#06070a",chrome:"#000000",bgHighlight:"#10111a65",panel:"#11141b",panel2:"#151a24",line:"rgba(70, 87, 126, 0.15)",edge:"rgba(96, 116, 165, 0.55)",edgeOnChrome:"rgba(96, 116, 165, 0.28)",primary:"#c2c5d0",primarySoft:"#aeb3c2",chromePrimary:"#c0c5d4",secondary:"#7f8aa3",tertiary:"rgb(31 33 43)",dim:"#6a7090",dim2:"rgb(120 128 160)",hover:"rgba(255,255,255,0.04)",raised:"rgba(255,255,255,0.055)",raisedHover:"rgba(255,255,255,0.1)",accent:"#76d4ff",accentWash:"rgba(118, 212, 255, 0.1)",green:"#8ce99a",amber:"#ffc078",red:"#ff8787",transparent:"rgba(0, 0, 0, 0)"},Jh={tickets:v.accent,comments:"#ffd479",tagging:"#c9a5ff",assigning:"#ff9ecd"},bO="#7fd8c4";var Mb=e=>({marginRight:-e/2,paddingRight:e/2});var vO=R(Y(),1);var Xw=R(_(),1),Ib=({edge:e,active:t,onPointerDown:n,testId:i})=>{let[r,o]=(0,vO.useState)(!1),a=e==="top";return(0,Xw.jsx)("div",{"data-testid":i,onPointerDown:n,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),title:"Drag to resize",style:{position:"absolute",zIndex:1,display:"flex",...a?{top:0,left:0,right:0,height:12,marginTop:-6,cursor:"ns-resize",alignItems:"center"}:{[e]:0,top:0,bottom:0,width:12,[e==="left"?"marginLeft":"marginRight"]:-6,cursor:"ew-resize",justifyContent:"center"}},children:(0,Xw.jsx)("div",{style:{...a?{height:2,width:"100%"}:{width:2,alignSelf:"stretch"},background:r||t?v.accent:"transparent",transition:"background 120ms ease"}})})};var Js=R(_(),1),cV=440,em=20,xO=380,EO=1400,SO=.9,dV=380,wO=160,tm=760,CO="epiq.aside.width",kO="epiq.aside.height",eu=()=>{let e=Number(localStorage.getItem(CO));return Number.isFinite(e)&&e>=xO&&e<=EO?e:cV},fV=()=>{let e=Number(localStorage.getItem(kO));return Number.isFinite(e)&&e>=wO?e:dV},Qw=(0,It.createContext)(null),xa=(0,It.forwardRef)(({children:e,onWidthChange:t,dock:n="right"},i)=>{let[r,o]=(0,It.useState)(eu),[a,l]=(0,It.useState)(fV),[s,u]=(0,It.useState)(!1),[c,d]=(0,It.useState)(null),[f,h]=(0,It.useState)(!1),m=n==="bottom",y=(0,It.useRef)({width:r,height:a}),S=(0,It.useRef)(null),p=(0,It.useRef)(null);(0,It.useEffect)(()=>{y.current={width:r,height:a}},[r,a]);let g=(0,It.useCallback)(T=>{let k=S.current;if(!k)return;let O=k.bottom?k.pointer-T.clientY:k.pointer-T.clientX,N=Math.min(k.max,Math.max(k.bottom?wO:xO,k.size+O));k.bottom?l(N):o(N)},[]),b=(0,It.useCallback)(()=>{let T=S.current?.bottom??!1;S.current=null,h(!1),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",b),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(T?kO:CO,String(T?y.current.height:y.current.width))},[g]);(0,It.useEffect)(()=>()=>{S.current&&b()},[b]);let x=T=>{T.preventDefault(),s&&u(!1);let O=T.currentTarget.parentElement?.parentElement?.getBoundingClientRect();S.current={pointer:m?T.clientY:T.clientX,size:m?a:r,bottom:m,max:m?(O?.height??window.innerHeight)*SO:Math.min(EO,window.innerWidth*SO)},h(!0),document.addEventListener("pointermove",g),document.addEventListener("pointerup",b),document.body.style.cursor=m?"ns-resize":"ew-resize",document.body.style.userSelect="none"},C=(0,It.useCallback)(()=>{u(T=>(T?(o(p.current??eu()),p.current=null):p.current=y.current.width,!T))},[]),[E,w]=(0,It.useState)(()=>window.innerWidth);(0,It.useEffect)(()=>{if(!s&&!m)return;w(window.innerWidth);let T=()=>w(window.innerWidth);return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[s,m]);let A=s||m?E:r;return(0,It.useLayoutEffect)(()=>{t?.(A)},[A]),(0,Js.jsxs)("aside",{ref:i,style:{boxSizing:"border-box",...s?{position:"absolute",top:0,right:0,bottom:0,left:0}:m?{position:"relative",height:a,minHeight:a}:{position:"relative",width:r,minWidth:r},...m&&!s?{borderTop:`1px solid ${v.edge}`,boxShadow:"0 -10px 24px rgba(0, 0, 0, 0.45)"}:{borderLeft:`1px solid ${v.edge}`,boxShadow:"-10px 0 24px rgba(0, 0, 0, 0.45)"},background:v.panel,padding:`0 ${em}px ${em}px`,fontSize:12,display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,Js.jsx)(Ib,{edge:m?"top":"left",active:f,onPointerDown:x}),(0,Js.jsx)("div",{"data-testid":"aside-header",ref:d,style:{flexShrink:0}}),(0,Js.jsx)("div",{"data-testid":"aside-pane",style:{flex:1,minHeight:0,overflow:"auto",...Mb(em)},children:(0,Js.jsx)(Qw.Provider,{value:c,children:typeof e=="function"?e({isFullscreen:s,toggleFullscreen:C}):e})})]})});xa.displayName="Aside";var TO=R(Y(),1);var RO=R(_(),1),re=({children:e,variant:t="default",tint:n,held:i=!1,dense:r=!1,style:o,onMouseEnter:a,onMouseLeave:l,testId:s,...u})=>{let[c,d]=(0,TO.useState)(!1),f=t==="primary",h=i?c?"4d":"3d":c?"2b":"1c",m=i?"ff":c?"7a":"3d";return(0,RO.jsx)("button",{"data-testid":s,...u,onMouseEnter:y=>{d(!0),a?.(y)},onMouseLeave:y=>{d(!1),l?.(y)},style:{appearance:"none",WebkitAppearance:"none",background:n?`${n}${h}`:f?c?v.raisedHover:v.raised:c?v.hover:"transparent",color:v.secondary,border:n?`1px solid ${n}${m}`:f?"none":t==="ghost"&&!c?"1px solid transparent":`1px solid ${c?v.secondary:v.line}`,borderRadius:t==="chip"?999:6,cursor:u.disabled?"default":"pointer",padding:r?"2px 8px":t==="ghost"?"3px 6px":"5px 9px",fontFamily:"inherit",fontSize:r?11:12,fontWeight:400,lineHeight:1,transition:"color 120ms ease, background 120ms ease, border-color 120ms ease",outline:"none",opacity:u.disabled?.7:1,...o},children:e})};var bo=R(_(),1),Ol=({eyebrow:e,fieldLabel:t,placeholder:n,confirmLabel:i="create",title:r,onChangeTitle:o,onCreate:a,onClose:l})=>(0,bo.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:l,children:(0,bo.jsxs)("form",{onSubmit:s=>{s.preventDefault(),a()},onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-200px",width:360,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20},children:[(0,bo.jsx)("div",{style:{color:v.accent,fontSize:10,marginBottom:8,letterSpacing:1,textTransform:"uppercase"},children:e}),(0,bo.jsx)("h2",{style:{margin:"0 0 20px",fontSize:10,color:v.primary},children:t}),(0,bo.jsx)("input",{autoFocus:!0,value:r,maxLength:300,placeholder:n,onChange:s=>o(s.target.value),onKeyDown:s=>{s.key==="Escape"&&l()},style:{width:"100%",boxSizing:"border-box",background:v.bg,color:v.primary,border:`1px solid ${v.line}`,borderRadius:8,padding:"10px",font:"inherit",fontSize:12,outline:"none",boxShadow:`inset 0 0 0 1px ${v.accent}22`}}),(0,bo.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:20},children:[(0,bo.jsx)(re,{type:"button",variant:"ghost",onClick:l,children:"cancel"}),(0,bo.jsx)(re,{type:"submit",variant:"primary",children:i})]})]})});var AO=R(Y(),1);var nm=R(_(),1),LO=360,MO=({onClick:e})=>{let[t,n]=(0,AO.useState)(!1);return(0,nm.jsxs)("button",{type:"button","data-testid":"add-swimlane",title:"Add swimlane",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{appearance:"none",WebkitAppearance:"none",width:LO,minWidth:LO,height:"100%",boxSizing:"border-box",border:`1px dashed ${t?v.secondary:v.line}`,borderRadius:12,background:t?v.bgHighlight:"transparent",color:t?v.secondary:v.dim,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,cursor:"pointer",fontFamily:"inherit",outline:"none",transition:"color 120ms ease, border-color 120ms ease, background 120ms ease"},children:[(0,nm.jsx)("span",{style:{fontSize:20,lineHeight:1},children:"+"}),(0,nm.jsx)("span",{style:{fontSize:12},children:"new swimlane"})]})};var vo=R(_(),1),IO=({eyebrow:e,heading:t,body:n,confirmLabel:i,onConfirm:r,onClose:o})=>(0,vo.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:o,children:(0,vo.jsxs)("form",{"data-testid":"confirm-modal",onSubmit:a=>{a.preventDefault(),r()},onMouseDown:a=>a.stopPropagation(),onKeyDown:a=>{a.key==="Escape"&&o()},style:{marginTop:"-200px",width:360,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20},children:[(0,vo.jsx)("div",{style:{color:v.red,fontSize:10,marginBottom:8,letterSpacing:1,textTransform:"uppercase"},children:e}),(0,vo.jsx)("h2",{style:{margin:"0 0 10px",fontSize:13,color:v.primary},children:t}),(0,vo.jsx)("p",{style:{margin:0,fontSize:12,lineHeight:1.7,color:v.secondary},children:n}),(0,vo.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:20},children:[(0,vo.jsx)(re,{autoFocus:!0,type:"button",variant:"ghost",onClick:o,children:"cancel"}),(0,vo.jsx)(re,{type:"submit",variant:"primary",style:{color:v.red},children:i})]})]})});var Cd=R(Y(),1);var Dt="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",Zw=20,Db={"--diffs-font-family":Dt,"--diffs-font-size":`${W.ui}px`,"--diffs-line-height":`${Zw}px`,"--diffs-header-font-family":Dt};var DO=e=>{if(e==="")return 0;let t=1;for(let n=e.indexOf(`
|
|
1378
|
+
Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let c=ui(),d;if(t){let S=typeof t=="string"?Xs(t):t;bt(s==="/"||S.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${S.pathname}" was given in the \`location\` prop.`),d=S}else d=c;let f=d.pathname||"/",h=f;if(s!=="/"){let S=s.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(S.length).join("/")}let m=n&&n.state.matches.length?n.state.matches.map(S=>Object.assign(S,{route:n.manifest[S.route.id]||S.route})):Iw(e,{pathname:h});Lw&&(Li(u||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),Li(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let y=w7(m&&m.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:$r([s,i.encodeLocation?i.encodeLocation(S.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:$r([s,i.encodeLocation?i.encodeLocation(S.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),r,n);return t&&y?se.createElement(pd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},y):y}function v7(){let e=tO(),t=U2(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},o={padding:"2px 4px",backgroundColor:i},a=null;return Lw&&(console.error("Error handled by React Router default ErrorBoundary:",e),a=se.createElement(se.Fragment,null,se.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),se.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",se.createElement("code",{style:o},"ErrorBoundary")," or"," ",se.createElement("code",{style:o},"errorElement")," prop on your route."))),se.createElement(se.Fragment,null,se.createElement("h2",null,"Unexpected Application Error!"),se.createElement("h3",{style:{fontStyle:"italic"}},t),n?se.createElement("pre",{style:r},n):null,a)}var S7=se.createElement(v7,null),J2=class extends se.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let n=y7(e.digest);n&&(e=n)}let t=e!==void 0?se.createElement(wr.Provider,{value:this.props.routeContext},se.createElement(Ow.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?se.createElement(x7,{error:e},t):t}};J2.contextType=q2;var kw=new WeakMap;function x7({children:e,error:t}){let{basename:n}=se.useContext(Yn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let i=g7(t.digest);if(i){let r=kw.get(t);if(r)throw r;let o=$2(i.location,n);if(G2&&!kw.get(t))if(o.isExternal||i.reloadDocument)window.location.href=o.absoluteURL||o.to;else{let a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:i.replace}));throw kw.set(t,a),a}return se.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function E7({routeContext:e,match:t,children:n}){let i=se.useContext(Qs);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),se.createElement(wr.Provider,{value:e},n)}function w7(e,t=[],n){let i=n?.state;if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(t.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let r=e,o=i?.errors;if(o!=null){let c=r.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);bt(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,c+1))}let a=!1,l=-1;if(n&&i){a=i.renderFallback;for(let c=0;c<r.length;c++){let d=r[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:f,errors:h}=i,m=d.route.loader&&!f.hasOwnProperty(d.route.id)&&(!h||h[d.route.id]===void 0);if(d.route.lazy||m){n.isStatic&&(a=!0),l>=0?r=r.slice(0,l+1):r=[r[0]];break}}}}let s=n?.onError,u=i&&s?(c,d)=>{s(c,{location:i.location,params:i.matches?.[0]?.params??{},pattern:a7(i.matches),errorInfo:d})}:void 0;return r.reduceRight((c,d,f)=>{let h,m=!1,y=null,S=null;i&&(h=o&&d.route.id?o[d.route.id]:void 0,y=d.route.errorElement||S7,a&&(l<0&&f===0?(nO("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,S=null):l===f&&(m=!0,S=d.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,f+1)),g=()=>{let b;return h?b=y:m?b=S:d.route.Component?b=se.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=c,se.createElement(E7,{match:d,routeContext:{outlet:c,matches:p,isDataRoute:i!=null},children:b})};return i&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?se.createElement(J2,{location:i.location,revalidation:i.revalidation,component:y,error:h,children:g(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):g()},null)}function Nw(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C7(e){let t=se.useContext(Qs);return bt(t,Nw(e)),t}function Fw(e){let t=se.useContext(md);return bt(t,Nw(e)),t}function k7(e){let t=se.useContext(wr);return bt(t,Nw(e)),t}function zw(e){let t=k7(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function T7(){return zw("useRouteId")}function eO(){let e=Fw("useNavigation");return se.useMemo(()=>{let{matches:t,historyAction:n,...i}=e.navigation;return i},[e.navigation])}function Pw(){let{matches:e,loaderData:t}=Fw("useMatches");return se.useMemo(()=>e.map(n=>G$(n,t)),[e,t])}function tO(){let e=se.useContext(Ow),t=Fw("useRouteError"),n=zw("useRouteError");return e!==void 0?e:t.errors?.[n]}function R7(){let{router:e}=C7("useNavigate"),t=zw("useNavigate"),n=se.useRef(!1);return X2(()=>{n.current=!0}),se.useCallback(async(r,o={})=>{Li(n.current,K2),n.current&&(typeof r=="number"?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))},[e,t])}var I2={};function nO(e,t,n){!t&&!I2[e]&&(I2[e]=!0,Li(!1,n))}var L7="useOptimistic",Ule=vt[L7];var Gle=vt.memo(A7);function A7({routes:e,manifest:t,future:n,state:i,isStatic:r,onError:o}){return Z2(e,void 0,{manifest:t,state:i,isStatic:r,onError:o,future:n})}function Bw({to:e,replace:t,state:n,relative:i}){bt(Dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=vt.useContext(Yn);Li(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=vt.useContext(wr),{pathname:a}=ui(),l=gd(),s=Rb(e,Dw(o),a,i==="path"),u=JSON.stringify(s);return vt.useEffect(()=>{l(JSON.parse(u),{replace:t,state:n,relative:i})},[l,u,i,t,n]),null}function Zs(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Uw({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:r,static:o=!1,useTransitions:a}){bt(!Dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=vt.useMemo(()=>({basename:l,navigator:r,static:o,useTransitions:a,future:{}}),[l,r,o,a]);typeof n=="string"&&(n=Xs(n));let{pathname:u="/",search:c="",hash:d="",state:f=null,key:h="default",mask:m}=n,y=vt.useMemo(()=>{let S=yo(u,l);return S==null?null:{location:{pathname:S,search:c,hash:d,state:f,key:h,mask:m},navigationType:i}},[l,u,c,d,f,h,i,m]);return Li(y!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:vt.createElement(Yn.Provider,{value:s},vt.createElement(pd.Provider,{children:t,value:y}))}function Gw({children:e,location:t}){return Q2(kb(e),t)}function kb(e,t=[]){let n=[];return vt.Children.forEach(e,(i,r)=>{if(!vt.isValidElement(i))return;let o=[...t,r];if(i.type===vt.Fragment){n.push.apply(n,kb(i.props.children,o));return}bt(i.type===Zs,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!i.props.index||!i.props.children,"An index route cannot have child routes.");let a={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(a.children=kb(i.props.children,o)),n.push(a)}),n}var Eb="get",wb="application/x-www-form-urlencoded";function Ab(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function M7(e){return Ab(e)&&e.tagName.toLowerCase()==="button"}function I7(e){return Ab(e)&&e.tagName.toLowerCase()==="form"}function D7(e){return Ab(e)&&e.tagName.toLowerCase()==="input"}function _7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function O7(e,t){return e.button===0&&(!t||t==="_self")&&!_7(e)}function Tb(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(r=>[n,r]):[[n,i]])},[]))}function H7(e,t){let n=Tb(e);return t&&t.forEach((i,r)=>{n.has(r)||t.getAll(r).forEach(o=>{n.append(r,o)})}),n}var Sb=null;function N7(){if(Sb===null)try{new FormData(document.createElement("form"),0),Sb=!1}catch{Sb=!0}return Sb}var F7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Tw(e){return e!=null&&!F7.has(e)?(Li(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wb}"`),null):e}function z7(e,t){let n,i,r,o,a;if(I7(e)){let l=e.getAttribute("action");i=l?yo(l,t):null,n=e.getAttribute("method")||Eb,r=Tw(e.getAttribute("enctype"))||wb,o=new FormData(e)}else if(M7(e)||D7(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(i=s?yo(s,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Eb,r=Tw(e.getAttribute("formenctype"))||Tw(l.getAttribute("enctype"))||wb,o=new FormData(l,e),!N7()){let{name:u,type:c,value:d}=e;if(c==="image"){let f=u?`${u}.`:"";o.append(`${f}x`,"0"),o.append(`${f}y`,"0")}else u&&o.append(u,d)}}else{if(Ab(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Eb,i=null,r=wb,a=e}return o&&r==="text/plain"&&(a=o,o=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:o,body:a}}var $le=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var P7={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},B7=/[&><\u2028\u2029]/g;function D2(e){return e.replace(B7,t=>P7[t])}function Vw(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var U7=Symbol("SingleFetchRedirect");function iO(e,t,n,i){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:t&&yo(r.pathname,t)==="/"?r.pathname=`${Cb(t)}/_root.${i}`:r.pathname=`${Cb(r.pathname)}.${i}`,r}async function G7(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw n;return window.location.reload(),new Promise(()=>{})}}function $7(e){return e!=null&&typeof e.page=="string"}function V7(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function q7(e,t,n){let i=await Promise.all(e.map(async r=>{let o=t.routes[r.route.id];if(o){let a=await G7(o,n);return a.links?a.links():[]}return[]}));return K7(i.flat(1).filter(V7).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function _2(e,t,n,i,r,o){let a=(s,u)=>n[u]?s.route.id!==n[u].route.id:!0,l=(s,u)=>n[u].pathname!==s.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>a(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=i.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(a(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function j7(e,t,{includeHydrateFallback:n}={}){return W7(e.map(i=>{let r=t.routes[i.route.id];if(!r)return[];let o=[r.module];return r.clientActionModule&&(o=o.concat(r.clientActionModule)),r.clientLoaderModule&&(o=o.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(o=o.concat(r.hydrateFallbackModule)),r.imports&&(o=o.concat(r.imports)),o}).flat(1))}function W7(e){return[...new Set(e)]}function Y7(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function K7(e,t){let n=new Set,i=new Set(t);return e.reduce((r,o)=>{if(t&&!$7(o)&&o.as==="script"&&o.href&&i.has(o.href))return r;let l=JSON.stringify(Y7(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function qw(){let e=We.useContext(Qs);return Vw(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function J7(){let e=We.useContext(md);return Vw(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Qh=We.createContext(void 0);Qh.displayName="FrameworkContext";function jw(){let e=We.useContext(Qh);return Vw(e,"You must render this element inside a <HydratedRouter> element"),e}function eV(e,t){let n=We.useContext(Qh),[i,r]=We.useState(!1),[o,a]=We.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,f=We.useRef(null);We.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let y=p=>{p.forEach(g=>{a(g.isIntersecting)})},S=new IntersectionObserver(y,{threshold:.5});return f.current&&S.observe(f.current),()=>{S.disconnect()}}},[e]),We.useEffect(()=>{if(i){let y=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(y)}}},[i]);let h=()=>{r(!0)},m=()=>{r(!1),a(!1)};return n?e!=="intent"?[o,f,{}]:[o,f,{onFocus:Xh(l,h),onBlur:Xh(s,m),onMouseEnter:Xh(u,h),onMouseLeave:Xh(c,m),onTouchStart:Xh(d,h)}]:[!1,f,{}]}function Xh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function oO({page:e,...t}){let n=f7(),{router:i}=qw(),r=We.useMemo(()=>Iw(i.routes,e,i.basename),[i.routes,e,i.basename]);return r?n?We.createElement(nV,{page:e,matches:r,...t}):We.createElement(iV,{page:e,matches:r,...t}):null}function tV(e){let{manifest:t,routeModules:n}=jw(),[i,r]=We.useState([]);return We.useEffect(()=>{let o=!1;return q7(e,t,n).then(a=>{o||r(a)}),()=>{o=!0}},[e,t,n]),i}function nV({page:e,matches:t,...n}){let i=ui(),{future:r}=jw(),{basename:o}=qw(),a=We.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let l=iO(e,o,r.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,r.v8_trailingSlashAwareDataRequests,e,i,t]);return We.createElement(We.Fragment,null,a.map(l=>We.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...n})))}function iV({page:e,matches:t,...n}){let i=ui(),{future:r,manifest:o,routeModules:a}=jw(),{basename:l}=qw(),{loaderData:s,matches:u}=J7(),c=We.useMemo(()=>_2(e,t,u,o,i,"data"),[e,t,u,o,i]),d=We.useMemo(()=>_2(e,t,u,o,i,"assets"),[e,t,u,o,i]),f=We.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let y=new Set,S=!1;if(t.forEach(g=>{let b=o.routes[g.route.id];!b||!b.hasLoader||(!c.some(x=>x.route.id===g.route.id)&&g.route.id in s&&a[g.route.id]?.shouldRevalidate||b.hasClientLoader?S=!0:y.add(g.route.id))}),y.size===0)return[];let p=iO(e,l,r.v8_trailingSlashAwareDataRequests,"data");return S&&y.size>0&&p.searchParams.set("_routes",t.filter(g=>y.has(g.route.id)).map(g=>g.route.id).join(",")),[p.pathname+p.search]},[l,r.v8_trailingSlashAwareDataRequests,s,i,o,c,t,e,a]),h=We.useMemo(()=>j7(d,o),[d,o]),m=tV(d);return We.createElement(We.Fragment,null,f.map(y=>We.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),h.map(y=>We.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),m.map(({key:y,link:S})=>We.createElement("link",{key:y,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function rV(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var oV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oV&&(window.__reactRouterVersion="7.17.0")}catch{}function Ww({basename:e,children:t,useTransitions:n,window:i}){let r=ue.useRef();r.current==null&&(r.current=O2({window:i,v5Compat:!0}));let o=r.current,[a,l]=ue.useState({action:o.action,location:o.location}),s=ue.useCallback(u=>{n===!1?l(u):ue.startTransition(()=>l(u))},[n]);return ue.useLayoutEffect(()=>o.listen(s),[o,s]),ue.createElement(Uw,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:o,useTransitions:n})}function aO({basename:e,children:t,history:n,useTransitions:i}){let[r,o]=ue.useState({action:n.action,location:n.location}),a=ue.useCallback(l=>{i===!1?o(l):ue.startTransition(()=>o(l))},[i]);return ue.useLayoutEffect(()=>n.listen(a),[n,a]),ue.createElement(Uw,{basename:e,children:t,location:r.location,navigationType:r.action,navigator:n,useTransitions:i})}aO.displayName="unstable_HistoryRouter";var lO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yw=ue.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:r,reloadDocument:o,replace:a,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:h,...m},y){let{basename:S,navigator:p,useTransitions:g}=ue.useContext(Yn),b=typeof c=="string"&&lO.test(c),x=$2(c,S);c=x.to;let C=Y2(c,{relative:r}),E=ui(),w=null;if(l){let z=Rb(l,[],E.mask?E.mask.pathname:"/",!0);S!=="/"&&(z.pathname=z.pathname==="/"?S:$r([S,z.pathname])),w=p.createHref(z)}let[A,T,k]=eV(i,m),O=fO(c,{replace:a,mask:l,state:s,target:u,preventScrollReset:d,relative:r,viewTransition:f,defaultShouldRevalidate:h,useTransitions:g});function N(z){t&&t(z),z.defaultPrevented||O(z)}let H=!(x.isExternal||o),F=ue.createElement("a",{...m,...k,href:(H?w:void 0)||x.absoluteURL||C,onClick:H?N:t,ref:rV(y,T),target:u,"data-discover":!b&&n==="render"?"true":void 0});return A&&!b?ue.createElement(ue.Fragment,null,F,ue.createElement(oO,{page:C})):F});Yw.displayName="Link";var sO=ue.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:r=!1,style:o,to:a,viewTransition:l,children:s,...u},c){let d=yd(a,{relative:u.relative}),f=ui(),h=ue.useContext(md),{navigator:m,basename:y}=ue.useContext(Yn),S=h!=null&&gO(d)&&l===!0,p=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,g=f.pathname,b=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;n||(g=g.toLowerCase(),b=b?b.toLowerCase():null,p=p.toLowerCase()),b&&y&&(b=yo(b,y)||b);let x=p!=="/"&&p.endsWith("/")?p.length-1:p.length,C=g===p||!r&&g.startsWith(p)&&g.charAt(x)==="/",E=b!=null&&(b===p||!r&&b.startsWith(p)&&b.charAt(p.length)==="/"),w={isActive:C,isPending:E,isTransitioning:S},A=C?t:void 0,T;typeof i=="function"?T=i(w):T=[i,C?"active":null,E?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(w):o;return ue.createElement(Yw,{...u,"aria-current":A,className:T,ref:c,style:k,to:a,viewTransition:l},typeof s=="function"?s(w):s)});sO.displayName="NavLink";var uO=ue.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:r,state:o,method:a=Eb,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f,...h},m)=>{let{useTransitions:y}=ue.useContext(Yn),S=hO(),p=mO(l,{relative:u}),g=a.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&lO.test(l);return ue.createElement("form",{ref:m,method:g,action:p,onSubmit:i?s:C=>{if(s&&s(C),C.defaultPrevented)return;C.preventDefault();let E=C.nativeEvent.submitter,w=E?.getAttribute("formmethod")||a,A=()=>S(E||C.currentTarget,{fetcherKey:t,method:w,navigate:n,replace:r,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:f});y&&n!==!1?ue.startTransition(()=>A()):A()},...h,"data-discover":!b&&e==="render"?"true":void 0})});uO.displayName="Form";function cO({getKey:e,storageKey:t,...n}){let i=ue.useContext(Qh),{basename:r}=ue.useContext(Yn),o=ui(),a=Pw();pO({getKey:e,storageKey:t});let l=ue.useMemo(()=>{if(!i||!e)return null;let u=Mw(o,a,r,e);return u!==o.key?u:null},[]);if(!i||i.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let f=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return ue.createElement("script",{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${D2(JSON.stringify(t||Aw))}, ${D2(JSON.stringify(l))})`}})}cO.displayName="ScrollRestoration";function dO(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kw(e){let t=ue.useContext(Qs);return bt(t,dO(e)),t}function aV(e){let t=ue.useContext(md);return bt(t,dO(e)),t}function fO(e,{target:t,replace:n,mask:i,state:r,preventScrollReset:o,relative:a,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=gd(),d=ui(),f=yd(e,{relative:a});return ue.useCallback(h=>{if(O7(h,t)){h.preventDefault();let m=n!==void 0?n:fd(d)===fd(f),y=()=>c(e,{replace:m,mask:i,state:r,preventScrollReset:o,relative:a,viewTransition:l,defaultShouldRevalidate:s});u?ue.startTransition(()=>y()):y()}},[d,c,f,n,i,r,t,e,o,a,l,s,u])}function Zh(e){Li(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=ue.useRef(Tb(e)),n=ue.useRef(!1),i=ui(),r=ue.useMemo(()=>H7(i.search,n.current?null:t.current),[i.search]),o=gd(),a=ue.useCallback((l,s)=>{let u=Tb(typeof l=="function"?l(new URLSearchParams(r)):l);n.current=!0,o("?"+u,s)},[o,r]);return[r,a]}var lV=0,sV=()=>`__${String(++lV)}__`;function hO(){let{router:e}=Kw("useSubmit"),{basename:t}=ue.useContext(Yn),n=T7(),i=e.fetch,r=e.navigate;return ue.useCallback(async(o,a={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=z7(o,t);if(a.navigate===!1){let f=a.fetcherKey||sV();await i(f,n,a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||u,flushSync:a.flushSync})}else await r(a.action||l,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:c,body:d,formMethod:a.method||s,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[i,r,t,n])}function mO(e,{relative:t}={}){let{basename:n}=ue.useContext(Yn),i=ue.useContext(wr);bt(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),o={...yd(e||".",{relative:t})},a=ui();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&r.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:$r([n,o.pathname])),fd(o)}var Aw="react-router-scroll-positions",xb={};function Mw(e,t,n,i){let r=null;return i&&(n!=="/"?r=i({...e,pathname:yo(e.pathname,n)||e.pathname},t):r=i(e,t)),r==null&&(r=e.key),r}function pO({getKey:e,storageKey:t}={}){let{router:n}=Kw("useScrollRestoration"),{restoreScrollPosition:i,preventScrollReset:r}=aV("useScrollRestoration"),{basename:o}=ue.useContext(Yn),a=ui(),l=Pw(),s=eO();ue.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),uV(ue.useCallback(()=>{if(s.state==="idle"){let u=Mw(a,l,o,e);xb[u]=window.scrollY}try{sessionStorage.setItem(t||Aw,JSON.stringify(xb))}catch(u){Li(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,a,l,t])),typeof document<"u"&&(ue.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||Aw);u&&(xb=JSON.parse(u))}catch{}},[t]),ue.useLayoutEffect(()=>{let u=n?.enableScrollRestoration(xb,()=>window.scrollY,e?(c,d)=>Mw(c,d,o,e):void 0);return()=>u&&u()},[n,o,e]),ue.useLayoutEffect(()=>{if(i!==!1){if(typeof i=="number"){window.scrollTo(0,i);return}try{if(a.hash){let u=document.getElementById(decodeURIComponent(a.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{Li(!1,`"${a.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}r!==!0&&window.scrollTo(0,0)}},[a,i,r]))}function uV(e,t){let{capture:n}=t||{};ue.useEffect(()=>{let i=n!=null?{capture:n}:void 0;return window.addEventListener("pagehide",e,i),()=>{window.removeEventListener("pagehide",e,i)}},[e,n])}function gO(e,{relative:t}={}){let n=ue.useContext(_w);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Kw("useViewTransitionState"),r=yd(e,{relative:t});if(!n.isTransitioning)return!1;let o=yo(n.currentLocation.pathname,i)||n.currentLocation.pathname,a=yo(n.nextLocation.pathname,i)||n.nextLocation.pathname;return hd(r.pathname,a)!=null||hd(r.pathname,o)!=null}var ne=R(Y(),1);var It=R(Y(),1);var Cr='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',_l="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",W={label:10,meta:11,ui:12,prose:13,title:18},v={bg:"#06070a",chrome:"#000000",bgHighlight:"#10111a65",panel:"#11141b",panel2:"#151a24",line:"rgba(70, 87, 126, 0.15)",edge:"rgba(96, 116, 165, 0.55)",edgeOnChrome:"rgba(96, 116, 165, 0.28)",primary:"#c2c5d0",primarySoft:"#aeb3c2",secondary:"#7f8aa3",tertiary:"rgb(31 33 43)",dim:"#6a7090",dim2:"rgb(120 128 160)",hover:"rgba(255,255,255,0.04)",raised:"rgba(255,255,255,0.055)",raisedHover:"rgba(255,255,255,0.1)",accent:"#76d4ff",accentWash:"rgba(118, 212, 255, 0.1)",green:"#8ce99a",amber:"#ffc078",red:"#ff8787",transparent:"rgba(0, 0, 0, 0)"},Jh={tickets:v.accent,comments:"#ffd479",tagging:"#c9a5ff",assigning:"#ff9ecd"},bO="#7fd8c4";var Mb=e=>({marginRight:-e/2,paddingRight:e/2});var vO=R(Y(),1);var Xw=R(_(),1),Ib=({edge:e,active:t,onPointerDown:n,testId:i})=>{let[r,o]=(0,vO.useState)(!1),a=e==="top";return(0,Xw.jsx)("div",{"data-testid":i,onPointerDown:n,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),title:"Drag to resize",style:{position:"absolute",zIndex:1,display:"flex",...a?{top:0,left:0,right:0,height:12,marginTop:-6,cursor:"ns-resize",alignItems:"center"}:{[e]:0,top:0,bottom:0,width:12,[e==="left"?"marginLeft":"marginRight"]:-6,cursor:"ew-resize",justifyContent:"center"}},children:(0,Xw.jsx)("div",{style:{...a?{height:2,width:"100%"}:{width:2,alignSelf:"stretch"},background:r||t?v.accent:"transparent",transition:"background 120ms ease"}})})};var Js=R(_(),1),cV=440,em=20,xO=380,EO=1400,SO=.9,dV=380,wO=160,tm=760,CO="epiq.aside.width",kO="epiq.aside.height",eu=()=>{let e=Number(localStorage.getItem(CO));return Number.isFinite(e)&&e>=xO&&e<=EO?e:cV},fV=()=>{let e=Number(localStorage.getItem(kO));return Number.isFinite(e)&&e>=wO?e:dV},Qw=(0,It.createContext)(null),xa=(0,It.forwardRef)(({children:e,onWidthChange:t,dock:n="right"},i)=>{let[r,o]=(0,It.useState)(eu),[a,l]=(0,It.useState)(fV),[s,u]=(0,It.useState)(!1),[c,d]=(0,It.useState)(null),[f,h]=(0,It.useState)(!1),m=n==="bottom",y=(0,It.useRef)({width:r,height:a}),S=(0,It.useRef)(null),p=(0,It.useRef)(null);(0,It.useEffect)(()=>{y.current={width:r,height:a}},[r,a]);let g=(0,It.useCallback)(T=>{let k=S.current;if(!k)return;let O=k.bottom?k.pointer-T.clientY:k.pointer-T.clientX,N=Math.min(k.max,Math.max(k.bottom?wO:xO,k.size+O));k.bottom?l(N):o(N)},[]),b=(0,It.useCallback)(()=>{let T=S.current?.bottom??!1;S.current=null,h(!1),document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",b),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem(T?kO:CO,String(T?y.current.height:y.current.width))},[g]);(0,It.useEffect)(()=>()=>{S.current&&b()},[b]);let x=T=>{T.preventDefault(),s&&u(!1);let O=T.currentTarget.parentElement?.parentElement?.getBoundingClientRect();S.current={pointer:m?T.clientY:T.clientX,size:m?a:r,bottom:m,max:m?(O?.height??window.innerHeight)*SO:Math.min(EO,window.innerWidth*SO)},h(!0),document.addEventListener("pointermove",g),document.addEventListener("pointerup",b),document.body.style.cursor=m?"ns-resize":"ew-resize",document.body.style.userSelect="none"},C=(0,It.useCallback)(()=>{u(T=>(T?(o(p.current??eu()),p.current=null):p.current=y.current.width,!T))},[]),[E,w]=(0,It.useState)(()=>window.innerWidth);(0,It.useEffect)(()=>{if(!s&&!m)return;w(window.innerWidth);let T=()=>w(window.innerWidth);return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[s,m]);let A=s||m?E:r;return(0,It.useLayoutEffect)(()=>{t?.(A)},[A]),(0,Js.jsxs)("aside",{ref:i,style:{boxSizing:"border-box",...s?{position:"absolute",top:0,right:0,bottom:0,left:0}:m?{position:"relative",height:a,minHeight:a}:{position:"relative",width:r,minWidth:r},...m&&!s?{borderTop:`1px solid ${v.edge}`,boxShadow:"0 -10px 24px rgba(0, 0, 0, 0.45)"}:{borderLeft:`1px solid ${v.edge}`,boxShadow:"-10px 0 24px rgba(0, 0, 0, 0.45)"},background:v.panel,padding:`0 ${em}px ${em}px`,fontSize:12,display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,Js.jsx)(Ib,{edge:m?"top":"left",active:f,onPointerDown:x}),(0,Js.jsx)("div",{"data-testid":"aside-header",ref:d,style:{flexShrink:0}}),(0,Js.jsx)("div",{"data-testid":"aside-pane",style:{flex:1,minHeight:0,overflow:"auto",...Mb(em)},children:(0,Js.jsx)(Qw.Provider,{value:c,children:typeof e=="function"?e({isFullscreen:s,toggleFullscreen:C}):e})})]})});xa.displayName="Aside";var TO=R(Y(),1);var RO=R(_(),1),re=({children:e,variant:t="default",tint:n,held:i=!1,dense:r=!1,style:o,onMouseEnter:a,onMouseLeave:l,testId:s,...u})=>{let[c,d]=(0,TO.useState)(!1),f=t==="primary",h=i?c?"4d":"3d":c?"2b":"1c",m=i?"ff":c?"7a":"3d";return(0,RO.jsx)("button",{"data-testid":s,...u,onMouseEnter:y=>{d(!0),a?.(y)},onMouseLeave:y=>{d(!1),l?.(y)},style:{appearance:"none",WebkitAppearance:"none",background:n?`${n}${h}`:f?c?v.raisedHover:v.raised:c?v.hover:"transparent",color:v.secondary,border:n?`1px solid ${n}${m}`:f?"none":t==="ghost"&&!c?"1px solid transparent":`1px solid ${c?v.secondary:v.line}`,borderRadius:t==="chip"?999:6,cursor:u.disabled?"default":"pointer",padding:r?"2px 8px":t==="ghost"?"3px 6px":"5px 9px",fontFamily:"inherit",fontSize:r?11:12,fontWeight:400,lineHeight:1,transition:"color 120ms ease, background 120ms ease, border-color 120ms ease",outline:"none",opacity:u.disabled?.7:1,...o},children:e})};var bo=R(_(),1),Ol=({eyebrow:e,fieldLabel:t,placeholder:n,confirmLabel:i="create",title:r,onChangeTitle:o,onCreate:a,onClose:l})=>(0,bo.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:l,children:(0,bo.jsxs)("form",{onSubmit:s=>{s.preventDefault(),a()},onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-200px",width:360,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20},children:[(0,bo.jsx)("div",{style:{color:v.accent,fontSize:10,marginBottom:8,letterSpacing:1,textTransform:"uppercase"},children:e}),(0,bo.jsx)("h2",{style:{margin:"0 0 20px",fontSize:10,color:v.primary},children:t}),(0,bo.jsx)("input",{autoFocus:!0,value:r,maxLength:300,placeholder:n,onChange:s=>o(s.target.value),onKeyDown:s=>{s.key==="Escape"&&l()},style:{width:"100%",boxSizing:"border-box",background:v.bg,color:v.primary,border:`1px solid ${v.line}`,borderRadius:8,padding:"10px",font:"inherit",fontSize:12,outline:"none",boxShadow:`inset 0 0 0 1px ${v.accent}22`}}),(0,bo.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:20},children:[(0,bo.jsx)(re,{type:"button",variant:"ghost",onClick:l,children:"cancel"}),(0,bo.jsx)(re,{type:"submit",variant:"primary",children:i})]})]})});var AO=R(Y(),1);var nm=R(_(),1),LO=360,MO=({onClick:e})=>{let[t,n]=(0,AO.useState)(!1);return(0,nm.jsxs)("button",{type:"button","data-testid":"add-swimlane",title:"Add swimlane",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{appearance:"none",WebkitAppearance:"none",width:LO,minWidth:LO,height:"100%",boxSizing:"border-box",border:`1px dashed ${t?v.secondary:v.line}`,borderRadius:12,background:t?v.bgHighlight:"transparent",color:t?v.secondary:v.dim,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6,cursor:"pointer",fontFamily:"inherit",outline:"none",transition:"color 120ms ease, border-color 120ms ease, background 120ms ease"},children:[(0,nm.jsx)("span",{style:{fontSize:20,lineHeight:1},children:"+"}),(0,nm.jsx)("span",{style:{fontSize:12},children:"new swimlane"})]})};var vo=R(_(),1),IO=({eyebrow:e,heading:t,body:n,confirmLabel:i,onConfirm:r,onClose:o})=>(0,vo.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:o,children:(0,vo.jsxs)("form",{"data-testid":"confirm-modal",onSubmit:a=>{a.preventDefault(),r()},onMouseDown:a=>a.stopPropagation(),onKeyDown:a=>{a.key==="Escape"&&o()},style:{marginTop:"-200px",width:360,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20},children:[(0,vo.jsx)("div",{style:{color:v.red,fontSize:10,marginBottom:8,letterSpacing:1,textTransform:"uppercase"},children:e}),(0,vo.jsx)("h2",{style:{margin:"0 0 10px",fontSize:13,color:v.primary},children:t}),(0,vo.jsx)("p",{style:{margin:0,fontSize:12,lineHeight:1.7,color:v.secondary},children:n}),(0,vo.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:20},children:[(0,vo.jsx)(re,{autoFocus:!0,type:"button",variant:"ghost",onClick:o,children:"cancel"}),(0,vo.jsx)(re,{type:"submit",variant:"primary",style:{color:v.red},children:i})]})]})});var Cd=R(Y(),1);var Dt="ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",Zw=20,Db={"--diffs-font-family":Dt,"--diffs-font-size":`${W.ui}px`,"--diffs-line-height":`${Zw}px`,"--diffs-header-font-family":Dt};var DO=e=>{if(e==="")return 0;let t=1;for(let n=e.indexOf(`
|
|
1379
1379
|
`);n!==-1;n=e.indexOf(`
|
|
1380
1380
|
`,n+1))t++;return t},im=e=>Math.max(DO(e.before),DO(e.after)),Ea=e=>Math.max(e.before.length,e.after.length)>2e5||im(e)>4e3;var mV=e=>e.before.length+e.after.length,rm=e=>!e.isBinary,Jw=e=>{let t=0;return e.map(n=>!rm(n)||Ea(n)||t>=5e5?!1:(t+=mV(n),!0))},_b=e=>{let t=Jw(e);return e.filter((n,i)=>t[i]).map(n=>n.path)};var vd=R(Y(),1);var _O=R(Y(),1);var Ob=R(_(),1),bd=24,Ee=14,_e=({title:e,pressed:t,disabled:n=!1,testId:i,onClick:r,children:o,label:a,tone:l="quiet",...s})=>{let[u,c]=(0,_O.useState)(!1),d=t===!0||u&&!n,f=l==="solid"&&t===!0;return(0,Ob.jsxs)("button",{type:"button",title:e,"aria-label":s["aria-label"],"aria-pressed":t,"aria-haspopup":s["aria-haspopup"],"aria-expanded":s["aria-expanded"],"data-testid":i,disabled:n,onClick:r,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,width:a===void 0?bd:void 0,height:bd,flexShrink:0,padding:a===void 0?0:"0 6px 0 5px",background:f?v.accent:d?v.hover:"transparent",border:"none",borderRadius:4,color:f?v.panel:d?v.accent:v.dim,cursor:n?"default":"pointer",opacity:n?.4:1,fontFamily:"inherit",fontSize:Ee,lineHeight:1,transition:"color 120ms ease, background 120ms ease"},children:[o,a!==void 0&&(0,Ob.jsx)("span",{style:{fontSize:f?10:11,fontWeight:f?700:void 0,letterSpacing:f?.6:void 0,fontVariantNumeric:"tabular-nums"},children:a})]})};var eC=R(_(),1),OO=({size:e=14})=>(0,eC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,eC.jsx)("polyline",{points:"20 6 9 17 4 12"})});var om=R(_(),1),HO=({size:e=14})=>(0,om.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,om.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,om.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]});var Hb=R(_(),1),pV=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}},Sd=({sha:e})=>{let[t,n]=(0,vd.useState)(!1),i=(0,vd.useRef)(void 0);return(0,vd.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,Hb.jsx)(_e,{testId:"copy-sha",title:t?"Copied!":`Copy ${e}`,pressed:t,onClick:async r=>{r.stopPropagation(),await pV(e)&&(n(!0),clearTimeout(i.current),i.current=setTimeout(()=>n(!1),1200))},children:t?(0,Hb.jsx)(OO,{size:Ee}):(0,Hb.jsx)(HO,{size:Ee})})};var NO=R(Y(),1);var nu=R(_(),1),xd=e=>(0,nu.jsx)("input",{...e,style:{width:"100%",boxSizing:"border-box",background:v.bg,color:v.primary,border:`1px solid ${v.line}`,borderRadius:8,padding:"8px 10px",outline:"none",font:"inherit",...e.style}}),Hl=NO.default.forwardRef((e,t)=>(0,nu.jsx)("textarea",{ref:t,maxLength:e.maxLength??1500,...e,style:{width:"100%",minHeight:140,boxSizing:"border-box",background:v.bg,color:v.primary,border:`1px solid ${v.line}`,borderRadius:8,padding:"8px 10px",outline:"none",lineHeight:1.6,resize:"vertical",font:"inherit",...e.style}}));Hl.displayName="Textarea";var tu=({children:e})=>(0,nu.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:8},children:e}),Ed=({children:e})=>(0,nu.jsx)("div",{style:{display:"flex",gap:8,marginTop:10},children:e}),Qi=({children:e})=>(0,nu.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:10},children:e}),Ge=({children:e})=>(0,nu.jsx)("span",{style:{display:"inline-block",marginTop:8,color:v.dim},children:e});var FO=R(Y(),1),zO=R(vs(),1);var PO=R(_(),1),Nl=({children:e,testId:t})=>{let n=(0,FO.useContext)(Qw),i=(0,PO.jsx)("div",{"data-testid":t,style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:12,padding:`${8}px 0`,borderBottom:`1px solid ${v.line}`,marginBottom:10},children:e});return n?(0,zO.createPortal)(i,n):i};var iu=R(_(),1),BO=({size:e=14})=>(0,iu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,iu.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,iu.jsx)("polyline",{points:"9 21 3 21 3 15"}),(0,iu.jsx)("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),(0,iu.jsx)("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]});var ru=R(_(),1),UO=({size:e=14})=>(0,ru.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,ru.jsx)("polyline",{points:"4 14 10 14 10 20"}),(0,ru.jsx)("polyline",{points:"20 10 14 10 14 4"}),(0,ru.jsx)("line",{x1:"14",y1:"10",x2:"21",y2:"3"}),(0,ru.jsx)("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]});var Fb=R(_(),1),zb=({isFullscreen:e,onClick:t})=>(0,Fb.jsx)(_e,{testId:"fullscreen-toggle",title:e?"Exit fullscreen":"Fullscreen",onClick:t,children:e?(0,Fb.jsx)(UO,{size:Ee}):(0,Fb.jsx)(BO,{size:Ee})});var am=R(_(),1),Pb=({size:e=16})=>(0,am.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,am.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,am.jsx)("line",{x1:"3",y1:"14",x2:"21",y2:"14"})]});var lm=R(_(),1),Bb=({size:e=16})=>(0,lm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,lm.jsx)("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),(0,lm.jsx)("line",{x1:"14",y1:"4",x2:"14",y2:"20"})]});var wa=R(_(),1),GO=({dock:e,onDock:t})=>(0,wa.jsxs)(wa.Fragment,{children:[(0,wa.jsx)(_e,{title:"Dock to bottom",pressed:e==="bottom",onClick:()=>t("bottom"),children:(0,wa.jsx)(Pb,{size:Ee})}),(0,wa.jsx)(_e,{title:"Dock to right",pressed:e==="right",onClick:()=>t("right"),children:(0,wa.jsx)(Bb,{size:Ee})})]});var au=R(Y(),1);var ou=R(_(),1),Ub=({items:e=[],testId:t,title:n="Actions",icon:i,children:r})=>{let[o,a]=(0,au.useState)(!1),l=(0,au.useRef)(null);return(0,au.useEffect)(()=>{if(!o)return;let s=c=>{l.current&&!l.current.contains(c.target)&&a(!1)},u=c=>{c.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",u)}},[o]),(0,ou.jsxs)("div",{ref:l,style:{position:"relative",display:"flex"},children:[(0,ou.jsx)(_e,{testId:t,title:n,pressed:o,"aria-haspopup":"menu","aria-expanded":o,onClick:()=>a(s=>!s),children:i??"\u22EE"}),o&&(0,ou.jsxs)("div",{role:"menu",style:{position:"absolute",top:26,right:0,minWidth:140,background:v.bg,border:`1px solid ${v.line}`,borderRadius:8,boxShadow:"0 12px 32px rgba(0, 0, 0, 0.35)",padding:6,zIndex:20},children:[r?.(()=>a(!1)),e.map(s=>(0,ou.jsx)(gV,{item:s,testId:t?`${t}-${s.id}`:void 0,onDone:()=>a(!1)},s.id))]})]})},gV=({item:e,testId:t,onDone:n})=>{let[i,r]=(0,au.useState)(!1),o=e.danger?v.red:v.primary;return(0,ou.jsx)("button",{type:"button",role:"menuitem","data-testid":t,onClick:()=>{n(),e.onSelect()},onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),style:{width:"100%",border:"none",background:i?v.line:"transparent",color:o,fontFamily:"inherit",fontSize:11,textAlign:"left",padding:"8px 10px",borderRadius:6,cursor:"pointer"},children:e.label})};var Ca=R(_(),1),Gb=({dock:e,onDock:t})=>(0,Ca.jsx)(Ub,{testId:"panel-menu",title:e==="bottom"?"Docked to bottom":"Docked to right",icon:e==="bottom"?(0,Ca.jsx)(Pb,{size:Ee}):(0,Ca.jsx)(Bb,{size:Ee}),children:n=>(0,Ca.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"4px 6px"},children:[(0,Ca.jsx)("span",{style:{color:v.secondary,fontSize:W.label,textTransform:"uppercase",letterSpacing:"0.08em"},children:"Dock"}),(0,Ca.jsx)("span",{style:{display:"inline-flex",gap:2},children:(0,Ca.jsx)(GO,{dock:e,onDock:i=>{t(i),n()}})})]})});function tC(e,t){try{let n=Bs({name:e,load:t});Zt.registerTheme(n.name,n.load)}catch(n){if(n instanceof CR){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}throw n}}var wd=e=>({display:"grid",gridTemplateColumns:e?"repeat(2, 1fr)":"repeat(auto-fit, minmax(82px, 1fr))",gap:16,marginTop:14}),$O={display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:4,minWidth:0,padding:"6px 4px",borderRadius:6,transition:"background 120ms ease"},VO={color:v.primary,fontSize:38,lineHeight:1,letterSpacing:"-0.01em"},qO={color:v.secondary,fontSize:9,textTransform:"uppercase",letterSpacing:"0.1em"},jO={color:v.dim,fontSize:10,lineHeight:1.35},nC={color:v.secondary,fontSize:11,marginTop:12},sm={display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,padding:"5px 0",borderBottom:`1px solid ${v.line}`,fontSize:12},So=e=>`${Math.round(e*100)}%`,iC=e=>{let t=Math.floor(e/864e5);return t<1?"<1":String(t)},WO=e=>{let t=e.split("/");return t.length<=2?e:`\u2026/${t.slice(-2).join("/")}`},yV=["#3987e5","#d95926","#199e70","#c98500","#d55181"],bV=v.dim2,lu=e=>yV[e]??bV,$b="#ffe066";var vV="github-dark",Fl="epiq-dark",SV=$b,xV=e=>(Array.isArray(e)?e:[e??""]).some(t=>t==="comment"||t.startsWith("comment.")||t.startsWith("comment ")),YO=!1,EV=()=>{YO||(YO=!0,tC(Fl,async()=>{let e=await Lh(vV);return{...e,name:Fl,settings:e.settings.map(t=>xV(t.scope)?{...t,settings:{...t.settings,foreground:SV}}:t)}}))};EV();var XO=R(Y(),1);var wV="/diffs-worker.js",CV=()=>{let e=globalThis.navigator?.hardwareConcurrency??4;return Math.max(2,Math.min(4,e-1))},rC=!0,oC=new Set,kV=()=>{if(rC){rC=!1;for(let e of oC)e()}},TV=e=>(oC.add(e),()=>{oC.delete(e)}),KO=()=>rC,QO=()=>(0,XO.useSyncExternalStore)(TV,KO,KO),ZO={workerFactory:()=>{let e=new Worker(wV,{type:"module"});return e.addEventListener("error",kV),e},poolSize:CV()},JO={theme:Fl};var st=R(_(),1),RV=Fl,LV=e=>{let t={name:e.path,contents:e.before},n={name:e.path,contents:e.after};return e.before===""&&e.after!==""?{oldFile:null,newFile:n}:e.after===""&&e.before!==""?{oldFile:t,newFile:null}:{oldFile:t,newFile:n}},Vb={...Db,marginBottom:16,border:`1px solid ${v.line}`,borderRadius:8,overflow:"clip"},AV=({file:e,diffStyle:t,selectedLines:n,onSelectionEnd:i,lineAnnotations:r,renderAnnotation:o,renderCustomHeader:a})=>(0,st.jsx)("div",{style:Vb,children:(0,st.jsx)(ww,{...LV(e),disableWorkerPool:!QO(),options:{diffStyle:t,theme:RV,enableLineSelection:i!==void 0,controlledSelection:i!==void 0,onLineSelectionEnd:i,lineHoverHighlight:i!==void 0?"both":"disabled",stickyHeader:!0},selectedLines:n,lineAnnotations:r,renderAnnotation:o,renderCustomHeader:a})}),MV=(e,t)=>e===t||!!e&&!!t&&e.start===t.start&&e.end===t.end&&e.side===t.side&&e.endSide===t.endSide,IV=(e,t)=>e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,i)=>n.side===t[i]?.side&&n.lineNumber===t[i]?.lineNumber),aC=(0,Cd.memo)(AV,(e,t)=>e.file===t.file&&e.diffStyle===t.diffStyle&&e.renderKey===t.renderKey&&MV(e.selectedLines,t.selectedLines)&&IV(e.lineAnnotations,t.lineAnnotations)),lC=({path:e,framed:t=!0})=>(0,st.jsxs)("div",{"data-testid":"binary-file-notice",style:{display:"flex",alignItems:"center",justifyContent:t?"space-between":"flex-start",gap:12,padding:"10px 12px",color:v.dim,fontSize:12,...t?{marginBottom:16,border:`1px solid ${v.line}`,borderRadius:8}:{borderTop:`1px solid ${v.line}`}},children:[t&&e!==void 0&&(0,st.jsx)("span",{style:{fontFamily:Dt,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),(0,st.jsx)("span",{style:{flexShrink:0},children:"binary file"})]}),DV=({file:e,diffStyle:t,open:n})=>{let[i,r]=(0,Cd.useState)(!1);return e.isBinary?(0,st.jsx)(lC,{path:e.path}):i||n?(0,st.jsx)(aC,{file:e,diffStyle:t}):(0,st.jsxs)("div",{"data-testid":"large-diff-notice",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:16,padding:"10px 12px",border:`1px solid ${v.line}`,borderRadius:8,color:v.dim,fontSize:12},children:[(0,st.jsx)("span",{style:{fontFamily:Dt,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.path}),(0,st.jsxs)("span",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:8},children:[Ea(e)?`${im(e).toLocaleString()} lines`:"large commit",(0,st.jsx)(re,{variant:"ghost",onClick:()=>r(!0),children:"show diff"})]})]})},_V=({files:e,diffStyle:t})=>{let n=(0,Cd.useMemo)(()=>Jw(e),[e]);return(0,st.jsx)(st.Fragment,{children:e.map((i,r)=>(0,st.jsx)(DV,{file:i,diffStyle:t,open:n[r]??!1},i.path))})},eH=({sha:e,files:t,loading:n,error:i,diffStyle:r,onClose:o,isFullscreen:a,toggleFullscreen:l,dock:s,onDock:u})=>(0,st.jsxs)(st.Fragment,{children:[(0,st.jsxs)(Nl,{children:[(0,st.jsx)("span",{style:{color:v.secondary,fontSize:10,textTransform:"uppercase",letterSpacing:"0.08em"},children:"Commit"}),(0,st.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:2},children:[(0,st.jsx)(Sd,{sha:e}),(0,st.jsx)(Gb,{dock:s,onDock:u}),(0,st.jsx)(zb,{isFullscreen:a,onClick:l}),(0,st.jsx)(re,{variant:"ghost",onClick:o,children:"\xD7"})]})]}),n&&(0,st.jsx)(Ge,{children:"Loading diff\u2026"}),!n&&i&&(0,st.jsx)(Ge,{children:i}),!n&&!i&&t?.length===0&&(0,st.jsx)(Ge,{children:"No changes."}),!n&&!i&&t&&(0,st.jsx)(_V,{files:t,diffStyle:r})]});var ka=R(Y(),1);var um=R(_(),1),OV=16,zl=({as:e,children:t,active:n=!1,borderColor:i=v.line,glowColor:r=v.secondary,glowOpacity:o=.25,glowRadius:a=200,proximityReach:l,borderRadius:s=12,style:u,...c})=>{let d=e??"div",[f,h]=(0,ka.useState)({x:0,y:0}),[m,y]=(0,ka.useState)(!1),[S,p]=(0,ka.useState)(0),g=(0,ka.useRef)(null),b=(0,ka.useRef)(0);(0,ka.useEffect)(()=>{if(l===void 0)return;let C=E=>{let w=Date.now();if(w-b.current<OV)return;b.current=w;let A=g.current?.parentElement;if(!A)return;let T=A.getBoundingClientRect(),k=Math.max(T.left-E.clientX,0,E.clientX-T.right),O=Math.max(T.top-E.clientY,0,E.clientY-T.bottom),N=Math.hypot(k,O);p(N>=l?0:1-N/l),h({x:E.clientX-T.left,y:E.clientY-T.top})};return window.addEventListener("mousemove",C),()=>window.removeEventListener("mousemove",C)},[l]);let x=n?1:l!==void 0?S:m?1:0;return(0,um.jsxs)(d,{...c,onMouseMove:C=>{let E=C.currentTarget.getBoundingClientRect();h({x:C.clientX-E.left,y:C.clientY-E.top}),c.onMouseMove?.(C)},onMouseEnter:C=>{y(!0),c.onMouseEnter?.(C)},onMouseLeave:C=>{y(!1),c.onMouseLeave?.(C)},style:{position:"relative",border:`1px solid ${i}`,borderRadius:s,overflow:"hidden",...u},children:[(0,um.jsx)("div",{ref:g,style:{position:"absolute",inset:0,borderRadius:s,padding:1,pointerEvents:"none",opacity:x*o,background:`radial-gradient(
|
|
1381
1381
|
${a}px circle at ${f.x}px ${f.y}px,
|
|
1382
1382
|
${r},
|
|
1383
1383
|
transparent 100%
|
|
1384
|
-
)`,mask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",WebkitMask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",maskComposite:"exclude",WebkitMaskComposite:"xor",transition:"opacity 140ms ease"}}),(0,um.jsx)("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",minHeight:0},children:t})]})};var Pt=R(_(),1),cm={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"2px 6px",color:v.primary},tH=({repoRoot:e,message:t,recentProjects:n=[],onRetry:i,onOpen:r})=>(0,Pt.jsx)("div",{"data-testid":"init-project-screen",style:{height:"100vh",background:v.bg,color:v.primary,fontFamily:_l,display:"flex",alignItems:"center",justifyContent:"center",padding:30},children:(0,Pt.jsx)(zl,{proximityReach:300,style:{width:520,background:v.panel},children:(0,Pt.jsxs)("div",{style:{padding:28,display:"flex",flexDirection:"column",gap:16},children:[(0,Pt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Initialize project"}),(0,Pt.jsx)("h1",{style:{margin:0,fontSize:16,fontWeight:700},children:"This folder is not an epiq project yet"}),(0,Pt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["No ",(0,Pt.jsx)("span",{style:cm,children:".epiq/project.json"})," was found in this directory or any of its parents:"]}),(0,Pt.jsx)("div",{style:{...cm,fontSize:12,padding:"10px 12px",wordBreak:"break-all"},children:e}),(0,Pt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["To start tracking issues here, run ",(0,Pt.jsx)("span",{style:cm,children:"epiq"})," ","in that folder and type ",(0,Pt.jsx)("span",{style:cm,children:":init"}),". That creates, commits and pushes"," ",(0,Pt.jsx)("span",{style:cm,children:".epiq/project.json"}),". Then come back and reload."]}),n.length>0&&(0,Pt.jsxs)("div",{"data-testid":"recent-projects",style:{display:"flex",flexDirection:"column",gap:8},children:[(0,Pt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Or open a recent project"}),n.map(o=>(0,Pt.jsxs)("div",{"data-testid":"recent-project",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,fontSize:12},children:[(0,Pt.jsxs)("div",{style:{minWidth:0},children:[(0,Pt.jsx)("div",{style:{fontWeight:700},children:o.name}),(0,Pt.jsx)("div",{style:{color:v.dim,fontSize:10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.root,children:o.root})]}),(0,Pt.jsx)(re,{variant:"primary",onClick:()=>r(o.root),"data-testid":"open-recent-project",children:"open"})]},o.projectId))]}),(0,Pt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginTop:4},children:[(0,Pt.jsx)("span",{style:{fontSize:10,color:v.dim},children:t}),(0,Pt.jsx)(re,{variant:"primary",onClick:i,children:"check again"})]})]})})});var wo=R(Y(),1),iH=R(vs(),1);var xo=(e,t)=>({display:"inline-flex",alignItems:"center",justifyContent:"space-between",gap:6,boxSizing:"border-box",background:"rgba(208, 223, 255, 0.08)",border:"none",color:t?v.dim:e,borderRadius:6,fontFamily:"inherit",fontSize:11,padding:"5px 7px 5px 9px",cursor:t?"not-allowed":"pointer",opacity:t?.4:1}),su={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Pl={position:"absolute",top:"100%",left:0,marginTop:6,display:"flex",flexDirection:"column",gap:7,padding:"10px 14px 10px 10px",minWidth:178,background:"rgba(21, 26, 36, 0.88)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${v.line}`,borderRadius:8,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.45)",zIndex:30,whiteSpace:"nowrap"};var qb=R(Y(),1),Eo=(e,t,n=[])=>{let i=(0,qb.useRef)(null);return(0,qb.useEffect)(()=>{if(!e)return;let r=a=>{let l=a.target;i.current?.contains(l)||n.some(u=>u.current?.contains(l))||t()},o=a=>{a.key==="Escape"&&t()};return document.addEventListener("mousedown",r),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",o)}},[e,t]),i};var sC=R(_(),1),Fn=({size:e=16})=>(0,sC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,sC.jsx)("polyline",{points:"6 9 12 15 18 9"})});var Zi=R(_(),1),nH=200,rH=({value:e,items:t,placeholder:n="Select...",onSelect:i,testId:r})=>{let[o,a]=(0,wo.useState)(!1),l=(0,wo.useId)(),s=(0,wo.useRef)(null),u=(0,wo.useRef)(null),c=Eo(o,()=>a(!1),[s]),[d,f]=(0,wo.useState)(null);return(0,wo.useLayoutEffect)(()=>{if(!o)return;let h=()=>{let m=u.current?.getBoundingClientRect();m&&f({left:m.left,top:m.bottom+6})};return h(),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[o]),(0,Zi.jsxs)("div",{ref:c,style:{position:"relative"},children:[(0,Zi.jsxs)("button",{ref:u,type:"button","data-testid":r,onClick:()=>a(h=>!h),"aria-haspopup":"listbox","aria-controls":o?l:void 0,"aria-expanded":o,title:e?.label,style:{...xo(v.chromePrimary,!1),width:nH,fontSize:12,padding:"5px 8px 5px 10px"},children:[(0,Zi.jsx)("span",{style:su,children:e?.label??n}),(0,Zi.jsx)("span",{style:{display:"inline-flex",flexShrink:0},children:(0,Zi.jsx)(Fn,{size:14})})]}),o&&t.length>0&&d?(0,iH.createPortal)((0,Zi.jsx)("div",{ref:s,id:l,role:"listbox",style:{...Pl,position:"fixed",left:d.left,top:d.top,marginTop:0,fontFamily:_l,gap:2,padding:6,minWidth:nH},children:t.map(h=>{let m=h.id===e?.id;return(0,Zi.jsxs)("button",{type:"button",role:"option","aria-selected":m,"data-testid":r?`${r}-option`:void 0,onClick:()=>{a(!1),i(h.id)},style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,border:"none",background:m?v.line:"transparent",color:m?v.accent:v.primary,fontFamily:"inherit",fontSize:11,textAlign:"left",padding:"8px 10px",borderRadius:6,cursor:"pointer"},children:[(0,Zi.jsx)("span",{children:h.label}),(0,Zi.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:10},children:[h.hint?(0,Zi.jsx)("span",{style:{color:v.dim},children:h.hint}):null,(0,Zi.jsx)("span",{"aria-hidden":!m,style:{width:"1ch",textAlign:"right"},children:m?"\u2713":""})]})]},h.id)})}),document.body):null]})};var kd=R(Y(),1),cH=R(vs(),1);var aH=R(Y(),1);var uu=R(_(),1),HV=()=>typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),oH=({children:e})=>(0,uu.jsx)("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",borderRadius:4,background:v.panel2,border:`1px solid ${v.line}`,color:v.secondary,font:"inherit",fontSize:W.label,lineHeight:1},children:e}),lH=({onOpen:e})=>{let[t,n]=(0,aH.useState)(!1);return(0,uu.jsxs)("button",{type:"button","data-testid":"command-palette-hint",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),title:"Open the command palette","aria-label":"Open the command palette",style:{display:"inline-flex",alignItems:"center",gap:7,background:t?v.hover:"transparent",border:"none",borderRadius:6,padding:"3px 6px",color:v.dim2,fontSize:W.label,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap"},children:[(0,uu.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[(0,uu.jsx)(oH,{children:HV()?"\u2318":"Ctrl"}),(0,uu.jsx)(oH,{children:"K"})]}),"commands"]})};var sH=R(_(),1),jb=({user:e,index:t,isFocus:n})=>(0,sH.jsx)("span",{title:e.name,style:{width:18,height:18,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",color:e.color,border:`1px solid ${e.color}`,fontSize:11,fontWeight:700,marginLeft:t===0?0:4,flexShrink:0},children:e.name.at(0)?.toUpperCase()},e.id);var uH="1.11.0";var gt=R(_(),1),dH=({state:e,connection:t,onReconnect:n,scrubbing:i,syncStatus:r,onOpenCommands:o,board:a,identity:l})=>{let s=(0,kd.useRef)(null),u=Eo(l.open,l.onDismiss,[s]),[c,d]=(0,kd.useState)(null);(0,kd.useLayoutEffect)(()=>{if(!l.open)return;let m=()=>{let y=u.current?.getBoundingClientRect();y&&d({right:Math.max(8,window.innerWidth-y.right),top:y.bottom+8})};return m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[l.open,u]);let f=r.status==="synced"?v.green:r.status==="failed"?v.red:r.status==="offline"?v.dim:v.accent,h=t!=="connected"?"Not connected":r.status==="failed"?`Sync failed \u2014 ${r.msg}`:r.msg;return(0,gt.jsx)(zl,{as:"header",borderRadius:0,borderColor:v.line,glowOpacity:.08,style:{height:56,padding:"0 30px",borderLeft:"none",borderRight:"none",borderTop:"none"},children:(0,gt.jsxs)("div",{style:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,gt.jsx)("div",{style:{color:v.accent,fontSize:12,fontWeight:700},children:":epiq"}),(0,gt.jsx)("span",{style:{color:v.dim,fontSize:12},children:"/"}),a,(0,gt.jsx)(lH,{onOpen:o})]}),(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:24},children:[(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:11,whiteSpace:"nowrap"},children:[i&&(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("span",{style:{color:v.accent,fontWeight:700},children:"Read-only"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"})]}),(0,gt.jsx)("span",{"data-testid":"sync-dot",title:h,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"5px 7px"},children:(0,gt.jsx)("span",{style:{width:4,height:4,borderRadius:999,background:t==="connected"?f:v.dim}})}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"}),t==="connected"?(0,gt.jsx)("span",{style:{color:v.dim},children:"connected"}):t==="connecting"?(0,gt.jsx)("span",{style:{color:v.dim},children:"connecting\u2026"}):t==="reconnecting"?(0,gt.jsx)("span",{"data-testid":"reconnecting",style:{color:v.accent},children:"reconnecting\u2026"}):(0,gt.jsx)(re,{"data-testid":"connection-lost",variant:"ghost",onClick:n,title:"Not connected \u2014 reconnect now",style:{color:v.red,fontSize:10},children:"reconnect"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"v"+uH})]}),e?.user&&(0,gt.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,gt.jsx)("button",{onClick:l.onToggle,"aria-label":"Your identity on this board",style:{background:"transparent",border:"none",cursor:"pointer",display:"flex",padding:0},children:(0,gt.jsx)(jb,{user:e.user})}),l.open&&c&&(0,cH.createPortal)((0,gt.jsx)("div",{ref:s,style:{position:"fixed",right:c.right,top:c.top,zIndex:60,maxHeight:`calc(100vh - ${c.top+16}px)`,display:"flex"},children:l.panel}),document.body)]})]})]})})};var bn=R(Y(),1);var uC=R(Y(),1);var NV="rgba(255, 135, 135, 0.14)",Wb=({armed:e,hovered:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 8px",borderRadius:6,background:e?NV:t?v.line:"transparent",boxShadow:e?`inset 0 0 0 1px ${v.red}`:void 0});var Td=R(_(),1),Yb=({size:e=13})=>(0,Td.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Td.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,Td.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),(0,Td.jsx)("circle",{cx:"12",cy:"16.5",r:"2.1",fill:"currentColor",stroke:"none"})]});var cu=R(_(),1),Kb=({size:e=14})=>(0,cu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,cu.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,cu.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,cu.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,cu.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]});var zn=R(_(),1),fH=({contributors:e,onRemove:t,onClose:n})=>{let[i,r]=(0,uC.useState)(null),[o,a]=(0,uC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,zn.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,zn.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,zn.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage external contributors"}),(0,zn.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Remove contributors from the suggestion lists. Locked ones have contributed, so their name is in the immutable log either way."}),(0,zn.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=s.hasAuthoredAnywhere,c=i===s.id;return(0,zn.jsxs)("div",{"data-testid":"manage-contributor-row","data-armed":c?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:Wb({armed:c,hovered:o===s.id}),children:[(0,zn.jsxs)("span",{style:{fontSize:12,color:s.color,opacity:u?.5:1},children:["@",s.name]}),u?(0,zn.jsx)("span",{title:"Has contributed \u2014 their name is in the immutable log either way",style:{display:"flex",color:v.dim,opacity:.7,padding:"3px 6px"},children:(0,zn.jsx)(Yb,{})}):s.isRemoved?(0,zn.jsx)("span",{style:{color:v.dim,fontSize:10},children:"removed"}):(0,zn.jsxs)(re,{variant:"ghost",title:c?`Click again to remove @${s.name}`:`Remove @${s.name}`,onClick:()=>{if(!c)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:c?v.red:v.dim,...c?{border:`1px solid ${v.red}`}:{}},children:[c&&(0,zn.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,zn.jsx)(Kb,{})]})]},s.id)})}),(0,zn.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,zn.jsx)(re,{variant:"ghost",onClick:n,children:"close"})})]})})};var cC=R(Y(),1);var Mi=R(_(),1),hH=({tags:e,onDelete:t,onClose:n})=>{let[i,r]=(0,cC.useState)(null),[o,a]=(0,cC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,Mi.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,Mi.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,Mi.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage tags"}),(0,Mi.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Delete tags across the whole workspace. A deleted tag comes off every ticket at once; its history stays in the log."}),(0,Mi.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=i===s.id,c=o===s.id;return(0,Mi.jsxs)("div",{"data-testid":"manage-tag-row","data-armed":u?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:Wb({armed:u,hovered:c}),children:[(0,Mi.jsx)("span",{style:{fontSize:12,color:s.color},children:s.name}),(0,Mi.jsxs)(re,{variant:"ghost",testId:"delete-tag",title:u?`Click again to delete "${s.name}" everywhere`:`Delete "${s.name}"`,onClick:()=>{if(!u)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:u?v.red:v.dim,...u?{border:`1px solid ${v.red}`}:{}},children:[u&&(0,Mi.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,Mi.jsx)(Kb,{})]})]},s.id)})}),(0,Mi.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,Mi.jsx)(re,{variant:"ghost",onClick:n,children:"close"})})]})})};var Rd=R(Y(),1);var mH=R(_(),1),FV=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}},Ld=({refValue:e})=>{let[t,n]=(0,Rd.useState)(!1),i=(0,Rd.useRef)(void 0);return(0,Rd.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,mH.jsx)("button",{type:"button","data-testid":"copy-ref",title:`Copy ${e}`,onClick:async r=>{r.stopPropagation(),await FV(e)&&(n(!0),clearTimeout(i.current),i.current=setTimeout(()=>n(!1),1200))},style:{fontFamily:"monospace",fontSize:"inherit",color:t?v.green:v.dim,background:"transparent",border:"none",padding:0,cursor:"pointer",transition:"color 120ms ease"},onMouseEnter:r=>{t||(r.currentTarget.style.color=v.accent)},onMouseLeave:r=>{r.currentTarget.style.color=t?v.green:v.dim},children:t?"copied!":e})};var Ji=R(_(),1),pH=({size:e=14})=>(0,Ji.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round","aria-hidden":"true",children:(0,Ji.jsx)("path",{d:"M8 5.5 19 12 8 18.5Z"})}),gH=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Ji.jsx)("line",{x1:"9",y1:"5.5",x2:"9",y2:"18.5"}),(0,Ji.jsx)("line",{x1:"15",y1:"5.5",x2:"15",y2:"18.5"})]}),yH=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Ji.jsx)("path",{d:"M20 12a8 8 0 1 1-2.6-5.9"}),(0,Ji.jsx)("polyline",{points:"20 3 20 8 15 8"})]}),Xb=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Ji.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,Ji.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]});var dC=R(_(),1),Qb=({size:e=14})=>(0,dC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,dC.jsx)("path",{d:"M4 6h16l-6 7v7l-4-2.5V13z"})});var fC=R(_(),1),bH=({narrowed:e,capped:t,disabled:n,onChange:i})=>(0,fC.jsx)(_e,{testId:"ticket-only",pressed:e,disabled:n,title:e&&t?"Too many events to single out \u2014 show all":e?"Show the whole timeline":"Narrow log and timeline to ticket",onClick:()=>i(!e),children:(0,fC.jsx)(Qb,{size:Ee})});var dm=R(_(),1),vH=({size:e=16})=>(0,dm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,dm.jsx)("polyline",{points:"4 6 9 12 4 18"}),(0,dm.jsx)("polyline",{points:"20 6 15 12 20 18"})]});var fm=R(_(),1),SH=({size:e=16})=>(0,fm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,fm.jsx)("polyline",{points:"9 6 4 12 9 18"}),(0,fm.jsx)("polyline",{points:"15 6 20 12 15 18"})]});var Co=R(Y(),1);var Ad=R(_(),1),_t=({title:e,action:t,children:n,first:i=!1,tone:r})=>(0,Ad.jsxs)("section",{style:{padding:i?"0px 0 20px 0":"20px 0",borderTop:i?"none":`1px solid ${v.line}`},children:[(0,Ad.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[(0,Ad.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:7,color:v.secondary,fontSize:W.label,textTransform:"uppercase",letterSpacing:"0.08em"},children:[r&&(0,Ad.jsx)("span",{"aria-hidden":!0,style:{width:5,height:5,borderRadius:"50%",background:r,flexShrink:0}}),e]}),t]}),n]});var zV="/media/",hC=e=>`${zV}${e}`;var du=R(Y(),1);var xH="image/png,image/jpeg,image/gif,image/webp",PV="rgba(118, 212, 255, 0.08)",Md=e=>e==null?[]:Array.from(e).filter(t=>t.type.startsWith("image/")),BV=(e,t,n)=>{let i=Math.max(0,Math.min(t,e.length)),r=e.slice(0,i),o=e.slice(i),a=r===""||r.endsWith(`
|
|
1384
|
+
)`,mask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",WebkitMask:"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)",maskComposite:"exclude",WebkitMaskComposite:"xor",transition:"opacity 140ms ease"}}),(0,um.jsx)("div",{style:{position:"relative",height:"100%",display:"flex",flexDirection:"column",minHeight:0},children:t})]})};var Pt=R(_(),1),cm={background:v.panel2,border:`1px solid ${v.line}`,borderRadius:6,padding:"2px 6px",color:v.primary},tH=({repoRoot:e,message:t,recentProjects:n=[],onRetry:i,onOpen:r})=>(0,Pt.jsx)("div",{"data-testid":"init-project-screen",style:{height:"100vh",background:v.bg,color:v.primary,fontFamily:_l,display:"flex",alignItems:"center",justifyContent:"center",padding:30},children:(0,Pt.jsx)(zl,{proximityReach:300,style:{width:520,background:v.panel},children:(0,Pt.jsxs)("div",{style:{padding:28,display:"flex",flexDirection:"column",gap:16},children:[(0,Pt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Initialize project"}),(0,Pt.jsx)("h1",{style:{margin:0,fontSize:16,fontWeight:700},children:"This folder is not an epiq project yet"}),(0,Pt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["No ",(0,Pt.jsx)("span",{style:cm,children:".epiq/project.json"})," was found in this directory or any of its parents:"]}),(0,Pt.jsx)("div",{style:{...cm,fontSize:12,padding:"10px 12px",wordBreak:"break-all"},children:e}),(0,Pt.jsxs)("div",{style:{fontSize:12,color:v.secondary,lineHeight:1.7},children:["To start tracking issues here, run ",(0,Pt.jsx)("span",{style:cm,children:"epiq"})," ","in that folder and type ",(0,Pt.jsx)("span",{style:cm,children:":init"}),". That creates, commits and pushes"," ",(0,Pt.jsx)("span",{style:cm,children:".epiq/project.json"}),". Then come back and reload."]}),n.length>0&&(0,Pt.jsxs)("div",{"data-testid":"recent-projects",style:{display:"flex",flexDirection:"column",gap:8},children:[(0,Pt.jsx)("div",{style:{color:v.accent,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Or open a recent project"}),n.map(o=>(0,Pt.jsxs)("div",{"data-testid":"recent-project",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,fontSize:12},children:[(0,Pt.jsxs)("div",{style:{minWidth:0},children:[(0,Pt.jsx)("div",{style:{fontWeight:700},children:o.name}),(0,Pt.jsx)("div",{style:{color:v.dim,fontSize:10,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:o.root,children:o.root})]}),(0,Pt.jsx)(re,{variant:"primary",onClick:()=>r(o.root),"data-testid":"open-recent-project",children:"open"})]},o.projectId))]}),(0,Pt.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginTop:4},children:[(0,Pt.jsx)("span",{style:{fontSize:10,color:v.dim},children:t}),(0,Pt.jsx)(re,{variant:"primary",onClick:i,children:"check again"})]})]})})});var wo=R(Y(),1),iH=R(vs(),1);var xo=(e,t)=>({display:"inline-flex",alignItems:"center",justifyContent:"space-between",gap:6,boxSizing:"border-box",background:"rgba(208, 223, 255, 0.08)",border:"none",color:t?v.dim:e,borderRadius:6,fontFamily:"inherit",fontSize:11,padding:"5px 7px 5px 9px",cursor:t?"not-allowed":"pointer",opacity:t?.4:1}),su={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Pl={position:"absolute",top:"100%",left:0,marginTop:6,display:"flex",flexDirection:"column",gap:7,padding:"10px 14px 10px 10px",minWidth:178,background:"rgba(21, 26, 36, 0.88)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:`1px solid ${v.line}`,borderRadius:8,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.45)",zIndex:30,whiteSpace:"nowrap"};var qb=R(Y(),1),Eo=(e,t,n=[])=>{let i=(0,qb.useRef)(null);return(0,qb.useEffect)(()=>{if(!e)return;let r=a=>{let l=a.target;i.current?.contains(l)||n.some(u=>u.current?.contains(l))||t()},o=a=>{a.key==="Escape"&&t()};return document.addEventListener("mousedown",r),document.addEventListener("keydown",o),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",o)}},[e,t]),i};var sC=R(_(),1),Fn=({size:e=16})=>(0,sC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,sC.jsx)("polyline",{points:"6 9 12 15 18 9"})});var Zi=R(_(),1),nH=200,rH=({value:e,items:t,placeholder:n="Select...",onSelect:i,testId:r})=>{let[o,a]=(0,wo.useState)(!1),l=(0,wo.useId)(),s=(0,wo.useRef)(null),u=(0,wo.useRef)(null),c=Eo(o,()=>a(!1),[s]),[d,f]=(0,wo.useState)(null);return(0,wo.useLayoutEffect)(()=>{if(!o)return;let h=()=>{let m=u.current?.getBoundingClientRect();m&&f({left:m.left,top:m.bottom+6})};return h(),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[o]),(0,Zi.jsxs)("div",{ref:c,style:{position:"relative"},children:[(0,Zi.jsxs)("button",{ref:u,type:"button","data-testid":r,onClick:()=>a(h=>!h),"aria-haspopup":"listbox","aria-controls":o?l:void 0,"aria-expanded":o,title:e?.label,style:{...xo(v.dim,!1),width:nH,fontSize:12,padding:"5px 8px 5px 10px"},children:[(0,Zi.jsx)("span",{style:su,children:e?.label??n}),(0,Zi.jsx)("span",{style:{display:"inline-flex",flexShrink:0},children:(0,Zi.jsx)(Fn,{size:14})})]}),o&&t.length>0&&d?(0,iH.createPortal)((0,Zi.jsx)("div",{ref:s,id:l,role:"listbox",style:{...Pl,position:"fixed",left:d.left,top:d.top,marginTop:0,fontFamily:_l,gap:2,padding:6,minWidth:nH},children:t.map(h=>{let m=h.id===e?.id;return(0,Zi.jsxs)("button",{type:"button",role:"option","aria-selected":m,"data-testid":r?`${r}-option`:void 0,onClick:()=>{a(!1),i(h.id)},style:{width:"100%",display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,border:"none",background:m?v.line:"transparent",color:m?v.accent:v.primary,fontFamily:"inherit",fontSize:11,textAlign:"left",padding:"8px 10px",borderRadius:6,cursor:"pointer"},children:[(0,Zi.jsx)("span",{children:h.label}),(0,Zi.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:10},children:[h.hint?(0,Zi.jsx)("span",{style:{color:v.dim},children:h.hint}):null,(0,Zi.jsx)("span",{"aria-hidden":!m,style:{width:"1ch",textAlign:"right"},children:m?"\u2713":""})]})]},h.id)})}),document.body):null]})};var kd=R(Y(),1),cH=R(vs(),1);var aH=R(Y(),1);var uu=R(_(),1),HV=()=>typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.userAgent),oH=({children:e})=>(0,uu.jsx)("kbd",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:18,height:18,padding:"0 4px",boxSizing:"border-box",borderRadius:4,background:v.panel2,border:`1px solid ${v.line}`,color:v.secondary,font:"inherit",fontSize:W.label,lineHeight:1},children:e}),lH=({onOpen:e})=>{let[t,n]=(0,aH.useState)(!1);return(0,uu.jsxs)("button",{type:"button","data-testid":"command-palette-hint",onClick:e,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),title:"Open the command palette","aria-label":"Open the command palette",style:{display:"inline-flex",alignItems:"center",gap:7,background:t?v.hover:"transparent",border:"none",borderRadius:6,padding:"3px 6px",color:v.dim2,fontSize:W.label,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap"},children:[(0,uu.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[(0,uu.jsx)(oH,{children:HV()?"\u2318":"Ctrl"}),(0,uu.jsx)(oH,{children:"K"})]}),"commands"]})};var sH=R(_(),1),jb=({user:e,index:t,isFocus:n})=>(0,sH.jsx)("span",{title:e.name,style:{width:18,height:18,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",color:e.color,border:`1px solid ${e.color}`,fontSize:11,fontWeight:700,marginLeft:t===0?0:4,flexShrink:0},children:e.name.at(0)?.toUpperCase()},e.id);var uH="1.12.0";var gt=R(_(),1),dH=({state:e,connection:t,onReconnect:n,scrubbing:i,syncStatus:r,onOpenCommands:o,board:a,identity:l})=>{let s=(0,kd.useRef)(null),u=Eo(l.open,l.onDismiss,[s]),[c,d]=(0,kd.useState)(null);(0,kd.useLayoutEffect)(()=>{if(!l.open)return;let m=()=>{let y=u.current?.getBoundingClientRect();y&&d({right:Math.max(8,window.innerWidth-y.right),top:y.bottom+8})};return m(),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0),()=>{window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)}},[l.open,u]);let f=r.status==="synced"?v.green:r.status==="failed"?v.red:r.status==="offline"?v.dim:v.accent,h=t!=="connected"?"Not connected":r.status==="failed"?`Sync failed \u2014 ${r.msg}`:r.msg;return(0,gt.jsx)(zl,{as:"header",borderRadius:0,borderColor:v.line,glowOpacity:.08,style:{height:56,padding:"0 30px",borderLeft:"none",borderRight:"none",borderTop:"none"},children:(0,gt.jsxs)("div",{style:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,gt.jsx)("div",{style:{color:v.accent,fontSize:12,fontWeight:700},children:":epiq"}),(0,gt.jsx)("span",{style:{color:v.dim,fontSize:12},children:"/"}),a,(0,gt.jsx)(lH,{onOpen:o})]}),(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:24},children:[(0,gt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,fontSize:11,whiteSpace:"nowrap"},children:[i&&(0,gt.jsxs)(gt.Fragment,{children:[(0,gt.jsx)("span",{style:{color:v.accent,fontWeight:700},children:"Read-only"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"})]}),(0,gt.jsx)("span",{"data-testid":"sync-dot",title:h,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"5px 7px"},children:(0,gt.jsx)("span",{style:{width:4,height:4,borderRadius:999,background:t==="connected"?f:v.dim}})}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"}),t==="connected"?(0,gt.jsx)("span",{style:{color:v.dim},children:"connected"}):t==="connecting"?(0,gt.jsx)("span",{style:{color:v.dim},children:"connecting\u2026"}):t==="reconnecting"?(0,gt.jsx)("span",{"data-testid":"reconnecting",style:{color:v.accent},children:"reconnecting\u2026"}):(0,gt.jsx)(re,{"data-testid":"connection-lost",variant:"ghost",onClick:n,title:"Not connected \u2014 reconnect now",style:{color:v.red,fontSize:10},children:"reconnect"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"|"}),(0,gt.jsx)("span",{style:{color:v.dim},children:"v"+uH})]}),e?.user&&(0,gt.jsxs)("div",{ref:u,style:{position:"relative"},children:[(0,gt.jsx)("button",{onClick:l.onToggle,"aria-label":"Your identity on this board",style:{background:"transparent",border:"none",cursor:"pointer",display:"flex",padding:0},children:(0,gt.jsx)(jb,{user:e.user})}),l.open&&c&&(0,cH.createPortal)((0,gt.jsx)("div",{ref:s,style:{position:"fixed",right:c.right,top:c.top,zIndex:60,maxHeight:`calc(100vh - ${c.top+16}px)`,display:"flex"},children:l.panel}),document.body)]})]})]})})};var bn=R(Y(),1);var uC=R(Y(),1);var NV="rgba(255, 135, 135, 0.14)",Wb=({armed:e,hovered:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"6px 8px",borderRadius:6,background:e?NV:t?v.line:"transparent",boxShadow:e?`inset 0 0 0 1px ${v.red}`:void 0});var Td=R(_(),1),Yb=({size:e=13})=>(0,Td.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Td.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,Td.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}),(0,Td.jsx)("circle",{cx:"12",cy:"16.5",r:"2.1",fill:"currentColor",stroke:"none"})]});var cu=R(_(),1),Kb=({size:e=14})=>(0,cu.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,cu.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,cu.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,cu.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,cu.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]});var zn=R(_(),1),fH=({contributors:e,onRemove:t,onClose:n})=>{let[i,r]=(0,uC.useState)(null),[o,a]=(0,uC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,zn.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,zn.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,zn.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage external contributors"}),(0,zn.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Remove contributors from the suggestion lists. Locked ones have contributed, so their name is in the immutable log either way."}),(0,zn.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=s.hasAuthoredAnywhere,c=i===s.id;return(0,zn.jsxs)("div",{"data-testid":"manage-contributor-row","data-armed":c?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:Wb({armed:c,hovered:o===s.id}),children:[(0,zn.jsxs)("span",{style:{fontSize:12,color:s.color,opacity:u?.5:1},children:["@",s.name]}),u?(0,zn.jsx)("span",{title:"Has contributed \u2014 their name is in the immutable log either way",style:{display:"flex",color:v.dim,opacity:.7,padding:"3px 6px"},children:(0,zn.jsx)(Yb,{})}):s.isRemoved?(0,zn.jsx)("span",{style:{color:v.dim,fontSize:10},children:"removed"}):(0,zn.jsxs)(re,{variant:"ghost",title:c?`Click again to remove @${s.name}`:`Remove @${s.name}`,onClick:()=>{if(!c)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:c?v.red:v.dim,...c?{border:`1px solid ${v.red}`}:{}},children:[c&&(0,zn.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,zn.jsx)(Kb,{})]})]},s.id)})}),(0,zn.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,zn.jsx)(re,{variant:"ghost",onClick:n,children:"close"})})]})})};var cC=R(Y(),1);var Mi=R(_(),1),hH=({tags:e,onDelete:t,onClose:n})=>{let[i,r]=(0,cC.useState)(null),[o,a]=(0,cC.useState)(null),l=[...e].sort((s,u)=>s.name.localeCompare(u.name));return(0,Mi.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.25)",backdropFilter:"blur(.5px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},onMouseDown:n,children:(0,Mi.jsxs)("div",{onMouseDown:s=>s.stopPropagation(),style:{marginTop:"-100px",width:460,background:v.panel,border:`1px solid ${v.line}`,borderRadius:12,padding:20,display:"flex",flexDirection:"column",gap:14},children:[(0,Mi.jsx)("div",{style:{color:v.secondary,fontSize:10,letterSpacing:1,textTransform:"uppercase"},children:"Manage tags"}),(0,Mi.jsx)("div",{style:{fontSize:12,color:v.secondary},children:"Delete tags across the whole workspace. A deleted tag comes off every ticket at once; its history stays in the log."}),(0,Mi.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:2,maxHeight:260,overflowY:"auto"},children:l.map(s=>{let u=i===s.id,c=o===s.id;return(0,Mi.jsxs)("div",{"data-testid":"manage-tag-row","data-armed":u?"true":"false",onMouseEnter:()=>a(s.id),onMouseLeave:()=>a(d=>d===s.id?null:d),style:Wb({armed:u,hovered:c}),children:[(0,Mi.jsx)("span",{style:{fontSize:12,color:s.color},children:s.name}),(0,Mi.jsxs)(re,{variant:"ghost",testId:"delete-tag",title:u?`Click again to delete "${s.name}" everywhere`:`Delete "${s.name}"`,onClick:()=>{if(!u)return r(s.id);t(s.id),r(null)},style:{display:"flex",alignItems:"center",gap:6,color:u?v.red:v.dim,...u?{border:`1px solid ${v.red}`}:{}},children:[u&&(0,Mi.jsx)("span",{style:{fontSize:10},children:"confirm"}),(0,Mi.jsx)(Kb,{})]})]},s.id)})}),(0,Mi.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,Mi.jsx)(re,{variant:"ghost",onClick:n,children:"close"})})]})})};var Rd=R(Y(),1);var mH=R(_(),1),FV=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{return!1}},Ld=({refValue:e})=>{let[t,n]=(0,Rd.useState)(!1),i=(0,Rd.useRef)(void 0);return(0,Rd.useEffect)(()=>()=>clearTimeout(i.current),[]),(0,mH.jsx)("button",{type:"button","data-testid":"copy-ref",title:`Copy ${e}`,onClick:async r=>{r.stopPropagation(),await FV(e)&&(n(!0),clearTimeout(i.current),i.current=setTimeout(()=>n(!1),1200))},style:{fontFamily:"monospace",fontSize:"inherit",color:t?v.green:v.dim,background:"transparent",border:"none",padding:0,cursor:"pointer",transition:"color 120ms ease"},onMouseEnter:r=>{t||(r.currentTarget.style.color=v.accent)},onMouseLeave:r=>{r.currentTarget.style.color=t?v.green:v.dim},children:t?"copied!":e})};var Ji=R(_(),1),pH=({size:e=14})=>(0,Ji.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round","aria-hidden":"true",children:(0,Ji.jsx)("path",{d:"M8 5.5 19 12 8 18.5Z"})}),gH=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Ji.jsx)("line",{x1:"9",y1:"5.5",x2:"9",y2:"18.5"}),(0,Ji.jsx)("line",{x1:"15",y1:"5.5",x2:"15",y2:"18.5"})]}),yH=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,Ji.jsx)("path",{d:"M20 12a8 8 0 1 1-2.6-5.9"}),(0,Ji.jsx)("polyline",{points:"20 3 20 8 15 8"})]}),Xb=({size:e=14})=>(0,Ji.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[(0,Ji.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),(0,Ji.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]});var dC=R(_(),1),Qb=({size:e=14})=>(0,dC.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,dC.jsx)("path",{d:"M4 6h16l-6 7v7l-4-2.5V13z"})});var fC=R(_(),1),bH=({narrowed:e,capped:t,disabled:n,onChange:i})=>(0,fC.jsx)(_e,{testId:"ticket-only",pressed:e,disabled:n,title:e&&t?"Too many events to single out \u2014 show all":e?"Show the whole timeline":"Narrow log and timeline to ticket",onClick:()=>i(!e),children:(0,fC.jsx)(Qb,{size:Ee})});var dm=R(_(),1),vH=({size:e=16})=>(0,dm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,dm.jsx)("polyline",{points:"4 6 9 12 4 18"}),(0,dm.jsx)("polyline",{points:"20 6 15 12 20 18"})]});var fm=R(_(),1),SH=({size:e=16})=>(0,fm.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,fm.jsx)("polyline",{points:"9 6 4 12 9 18"}),(0,fm.jsx)("polyline",{points:"15 6 20 12 15 18"})]});var Co=R(Y(),1);var Ad=R(_(),1),_t=({title:e,action:t,children:n,first:i=!1,tone:r})=>(0,Ad.jsxs)("section",{style:{padding:i?"0px 0 20px 0":"20px 0",borderTop:i?"none":`1px solid ${v.line}`},children:[(0,Ad.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[(0,Ad.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:7,color:v.secondary,fontSize:W.label,textTransform:"uppercase",letterSpacing:"0.08em"},children:[r&&(0,Ad.jsx)("span",{"aria-hidden":!0,style:{width:5,height:5,borderRadius:"50%",background:r,flexShrink:0}}),e]}),t]}),n]});var zV="/media/",hC=e=>`${zV}${e}`;var du=R(Y(),1);var xH="image/png,image/jpeg,image/gif,image/webp",PV="rgba(118, 212, 255, 0.08)",Md=e=>e==null?[]:Array.from(e).filter(t=>t.type.startsWith("image/")),BV=(e,t,n)=>{let i=Math.max(0,Math.min(t,e.length)),r=e.slice(0,i),o=e.slice(i),a=r===""||r.endsWith(`
|
|
1385
1385
|
`)?"":`
|
|
1386
1386
|
`,l=o===""||o.startsWith(`
|
|
1387
1387
|
`)?"":`
|