@serve.zone/dcrouter 7.4.0 → 7.4.1
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_serve/bundle.js +4 -4
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.dcrouter.js +49 -103
- package/dist_ts/monitoring/classes.metricsmanager.d.ts +1 -1
- package/dist_ts/monitoring/classes.metricsmanager.js +8 -7
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/ops-view-logs.js +14 -1
- package/package.json +2 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.dcrouter.ts +53 -107
- package/ts/monitoring/classes.metricsmanager.ts +9 -8
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/ops-view-logs.ts +11 -0
package/dist_serve/bundle.js
CHANGED
|
@@ -14590,7 +14590,7 @@ body > div[style*="top: -50000px"][style*="width: 50000px"] {
|
|
|
14590
14590
|
</div>
|
|
14591
14591
|
`:""}
|
|
14592
14592
|
</div>
|
|
14593
|
-
`}async firstUpdated(){if(this.domtoolsInstance=await this.domtoolsPromise,await this.initializeTerminal(),this.logEntries.length>0)for(let H of this.logEntries)this.writeLogEntry(H)}async initializeTerminal(){let H=E2.getInstance(),[he,_e,W]=await Promise.all([H.loadXterm(),H.loadXtermFitAddon(),H.loadXtermSearchAddon()]);await this.injectXtermStylesIntoShadow(),this.terminal=new he.Terminal({cursorBlink:!1,disableStdin:!0,fontSize:12,fontFamily:"'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace",theme:this.getTerminalTheme(),scrollback:this.maxEntries,convertEol:!0}),this.fitAddon=new _e.FitAddon,this.searchAddon=new W.SearchAddon,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(this.searchAddon);let D=this.shadowRoot.querySelector(".terminal-container");this.terminal.open(D),await new Promise(R=>requestAnimationFrame(R)),this.fitAddon.fit(),this.resizeObserver=new ResizeObserver(()=>{this.fitAddon?.fit()}),this.resizeObserver.observe(D),this.terminalThemeSubscription=this.domtoolsInstance.themeManager.themeObservable.subscribe(()=>{this.terminal&&(this.terminal.options.theme=this.getTerminalTheme())}),this.rateInterval=setInterval(()=>this.calculateRate(),1e3),this.terminalReady=!0}getTerminalTheme(){return this.domtoolsInstance?.themeManager?.isDarkMode??!0?{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0",selectionBackground:"#404040",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}:{background:"#ffffff",foreground:"#333333",cursor:"#333333",selectionBackground:"#add6ff",black:"#000000",red:"#cd3131",green:"#00bc00",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"}}async injectXtermStylesIntoShadow(){let H="xterm-shadow-styles";if(this.shadowRoot.getElementById(H))return;let he=`${ta}/xterm@${ir.xterm}/css/xterm.css`,W=await(await fetch(he)).text(),D=document.createElement("style");D.id=H,D.textContent=W,this.shadowRoot.appendChild(D)}addLog(H,he,_e){let W={timestamp:new Date().toISOString(),level:H,message:he,source:_e};this.logBuffer.push(W),this.logBuffer.length>this.maxEntries&&this.logBuffer.shift(),!this.filterMode||!this.searchQuery?this.writeLogEntry(W):this.entryMatchesFilter(W)?(this.trailingHiddenCount=0,this.writeLogEntry(W)):this.updateTrailingPlaceholder(),this.updateMetrics(W.level)}updateLog(H){if(H)for(let he of H)this.logBuffer.push(he),this.logBuffer.length>this.maxEntries&&this.logBuffer.shift(),!this.filterMode||!this.searchQuery?this.writeLogEntry(he):this.entryMatchesFilter(he)?(this.trailingHiddenCount=0,this.writeLogEntry(he)):this.updateTrailingPlaceholder(),this.updateMetrics(he.level)}updateTrailingPlaceholder(){this.terminal&&(this.trailingHiddenCount>0&&this.terminal.write("\x1B[1A\x1B[2K\r"),this.trailingHiddenCount++,this.writeHiddenPlaceholder(this.trailingHiddenCount),this.autoScroll&&this.terminal.scrollToBottom())}entryMatchesFilter(H){if(!this.searchQuery)return!0;let he=this.searchQuery.toLowerCase();return H.message.toLowerCase().includes(he)||H.level.toLowerCase().includes(he)||(H.source?.toLowerCase().includes(he)??!1)}writeLogEntry(H){if(!this.terminal)return;let he=this.formatLogEntry(H);this.terminal.writeln(he),this.autoScroll&&this.terminal.scrollToBottom()}formatLogEntry(H){let he=this.formatTimestamp(H.timestamp),_e={debug:"\x1B[90m",info:"\x1B[36m",warn:"\x1B[33m",error:"\x1B[31m",success:"\x1B[32m"},W="\x1B[0m",D="\x1B[2m",R=`${_e[H.level]}[${H.level.toUpperCase().padEnd(7)}]${W}`,Z=H.source?`${D}[${H.source}]${W} `:"",Y=this.applyHighlights(H.message);return`${D}${he}${W} ${R} ${Z}${Y}`}formatTimestamp(H){return new Date(H).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}applyHighlights(H){let he=[...this.highlightKeywords];if(this.filterMode&&this.searchQuery&&he.push(this.searchQuery),he.length===0)return H;let _e=H;for(let W of he){let D=W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`(${D})`,"gi");_e=_e.replace(R,"\x1B[43m\x1B[30m$1\x1B[0m")}return _e}writeRaw(H){this.terminal&&(this.terminal.write(H),this.recordLogEvent(),this.autoScroll&&this.terminal.scrollToBottom())}writelnRaw(H){this.terminal&&(this.terminal.writeln(H),this.recordLogEvent(),this.autoScroll&&this.terminal.scrollToBottom())}handleSearchInput(H){let _e=H.target.value,W=this.searchQuery!==_e;this.searchQuery=_e,this.filterMode&&W?this.reRenderFilteredLogs():this.searchQuery&&this.searchAddon?.findNext(this.searchQuery)}handleSearchKeydown(H){H.key==="Enter"?H.shiftKey?this.searchPrevious():this.searchNext():H.key==="Escape"&&(this.searchQuery="",H.target.value="")}search(H){this.searchQuery=H,this.searchAddon?.findNext(H)}searchNext(){this.searchQuery&&this.searchAddon?.findNext(this.searchQuery)}searchPrevious(){this.searchQuery&&this.searchAddon?.findPrevious(this.searchQuery)}toggleAutoScroll(){this.autoScroll=!this.autoScroll,this.autoScroll&&this.terminal&&this.terminal.scrollToBottom()}toggleFilterMode(){this.filterMode=!this.filterMode,this.reRenderFilteredLogs()}reRenderFilteredLogs(){if(this.terminal){if(this.terminal.clear(),this.trailingHiddenCount=0,!this.filterMode||!this.searchQuery)for(let H of this.logBuffer){let he=this.formatLogEntry(H);this.terminal.writeln(he)}else{let H=0;for(let he of this.logBuffer)if(this.entryMatchesFilter(he)){H>0&&(this.writeHiddenPlaceholder(H),H=0);let _e=this.formatLogEntry(he);this.terminal.writeln(_e)}else H++;H>0&&(this.writeHiddenPlaceholder(H),this.trailingHiddenCount=H)}this.autoScroll&&this.terminal.scrollToBottom()}}writeHiddenPlaceholder(H){let he="\x1B[2m",_e="\x1B[0m",W=H===1?"[1 log line hidden by filter ...]":`[${H} log lines hidden by filter ...]`;this.terminal?.writeln(`${he}${W}${_e}`)}clearLogs(){this.terminal?.clear(),this.logBuffer=[],this.trailingHiddenCount=0,this.resetMetrics()}scrollToBottom(){this.terminal?.scrollToBottom()}updateMetrics(H){this.metrics={...this.metrics,[H]:this.metrics[H]+1,total:this.metrics.total+1},this.recordLogEvent()}recordLogEvent(){this.rateBuffer.push(Date.now())}calculateRate(){let H=Date.now();this.rateBuffer=this.rateBuffer.filter(_e=>H-_e<1e4);let he=this.rateBuffer.length/10;he!==this.metrics.rate&&(this.metrics={...this.metrics,rate:he})}resetMetrics(){this.metrics={debug:0,info:0,warn:0,error:0,success:0,total:0,rate:0},this.rateBuffer=[]}async disconnectedCallback(){await super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect(),this.terminalThemeSubscription&&this.terminalThemeSubscription.unsubscribe(),this.rateInterval&&clearInterval(this.rateInterval),this.terminal&&this.terminal.dispose()}static{T1(i,a)}};return we=i})()});var gmt=v(()=>{mmt()});var bmt=v(()=>{umt();gmt()});var vmt,ymt=v(()=>{pe();vmt=()=>w`
|
|
14593
|
+
`}async firstUpdated(){if(this.domtoolsInstance=await this.domtoolsPromise,await this.initializeTerminal(),this.logEntries.length>0)for(let H of this.logEntries)this.writeLogEntry(H)}async initializeTerminal(){let H=E2.getInstance(),[he,_e,W]=await Promise.all([H.loadXterm(),H.loadXtermFitAddon(),H.loadXtermSearchAddon()]);await this.injectXtermStylesIntoShadow(),this.terminal=new he.Terminal({cursorBlink:!1,disableStdin:!0,fontSize:12,fontFamily:"'SF Mono', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace",theme:this.getTerminalTheme(),scrollback:this.maxEntries,convertEol:!0}),this.fitAddon=new _e.FitAddon,this.searchAddon=new W.SearchAddon,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(this.searchAddon);let D=this.shadowRoot.querySelector(".terminal-container");this.terminal.open(D),await new Promise(R=>requestAnimationFrame(R)),this.fitAddon.fit(),this.resizeObserver=new ResizeObserver(()=>{this.fitAddon?.fit()}),this.resizeObserver.observe(D),this.terminalThemeSubscription=this.domtoolsInstance.themeManager.themeObservable.subscribe(()=>{this.terminal&&(this.terminal.options.theme=this.getTerminalTheme())}),this.rateInterval=setInterval(()=>this.calculateRate(),1e3),this.terminalReady=!0;for(let R of this.logBuffer)this.writeLogEntry(R)}updated(H){super.updated(H),H.has("logEntries")&&this.terminalReady&&this.logEntries.length>0&&(this.logBuffer=[...this.logEntries],this.reRenderFilteredLogs())}getTerminalTheme(){return this.domtoolsInstance?.themeManager?.isDarkMode??!0?{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0",selectionBackground:"#404040",black:"#000000",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#6272a4",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}:{background:"#ffffff",foreground:"#333333",cursor:"#333333",selectionBackground:"#add6ff",black:"#000000",red:"#cd3131",green:"#00bc00",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"}}async injectXtermStylesIntoShadow(){let H="xterm-shadow-styles";if(this.shadowRoot.getElementById(H))return;let he=`${ta}/xterm@${ir.xterm}/css/xterm.css`,W=await(await fetch(he)).text(),D=document.createElement("style");D.id=H,D.textContent=W,this.shadowRoot.appendChild(D)}addLog(H,he,_e){let W={timestamp:new Date().toISOString(),level:H,message:he,source:_e};this.logBuffer.push(W),this.logBuffer.length>this.maxEntries&&this.logBuffer.shift(),!this.filterMode||!this.searchQuery?this.writeLogEntry(W):this.entryMatchesFilter(W)?(this.trailingHiddenCount=0,this.writeLogEntry(W)):this.updateTrailingPlaceholder(),this.updateMetrics(W.level)}updateLog(H){if(H)for(let he of H)this.logBuffer.push(he),this.logBuffer.length>this.maxEntries&&this.logBuffer.shift(),!this.filterMode||!this.searchQuery?this.writeLogEntry(he):this.entryMatchesFilter(he)?(this.trailingHiddenCount=0,this.writeLogEntry(he)):this.updateTrailingPlaceholder(),this.updateMetrics(he.level)}updateTrailingPlaceholder(){this.terminal&&(this.trailingHiddenCount>0&&this.terminal.write("\x1B[1A\x1B[2K\r"),this.trailingHiddenCount++,this.writeHiddenPlaceholder(this.trailingHiddenCount),this.autoScroll&&this.terminal.scrollToBottom())}entryMatchesFilter(H){if(!this.searchQuery)return!0;let he=this.searchQuery.toLowerCase();return H.message.toLowerCase().includes(he)||H.level.toLowerCase().includes(he)||(H.source?.toLowerCase().includes(he)??!1)}writeLogEntry(H){if(!this.terminal)return;let he=this.formatLogEntry(H);this.terminal.writeln(he),this.autoScroll&&this.terminal.scrollToBottom()}formatLogEntry(H){let he=this.formatTimestamp(H.timestamp),_e={debug:"\x1B[90m",info:"\x1B[36m",warn:"\x1B[33m",error:"\x1B[31m",success:"\x1B[32m"},W="\x1B[0m",D="\x1B[2m",R=`${_e[H.level]}[${H.level.toUpperCase().padEnd(7)}]${W}`,Z=H.source?`${D}[${H.source}]${W} `:"",Y=this.applyHighlights(H.message);return`${D}${he}${W} ${R} ${Z}${Y}`}formatTimestamp(H){return new Date(H).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}applyHighlights(H){let he=[...this.highlightKeywords];if(this.filterMode&&this.searchQuery&&he.push(this.searchQuery),he.length===0)return H;let _e=H;for(let W of he){let D=W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),R=new RegExp(`(${D})`,"gi");_e=_e.replace(R,"\x1B[43m\x1B[30m$1\x1B[0m")}return _e}writeRaw(H){this.terminal&&(this.terminal.write(H),this.recordLogEvent(),this.autoScroll&&this.terminal.scrollToBottom())}writelnRaw(H){this.terminal&&(this.terminal.writeln(H),this.recordLogEvent(),this.autoScroll&&this.terminal.scrollToBottom())}handleSearchInput(H){let _e=H.target.value,W=this.searchQuery!==_e;this.searchQuery=_e,this.filterMode&&W?this.reRenderFilteredLogs():this.searchQuery&&this.searchAddon?.findNext(this.searchQuery)}handleSearchKeydown(H){H.key==="Enter"?H.shiftKey?this.searchPrevious():this.searchNext():H.key==="Escape"&&(this.searchQuery="",H.target.value="")}search(H){this.searchQuery=H,this.searchAddon?.findNext(H)}searchNext(){this.searchQuery&&this.searchAddon?.findNext(this.searchQuery)}searchPrevious(){this.searchQuery&&this.searchAddon?.findPrevious(this.searchQuery)}toggleAutoScroll(){this.autoScroll=!this.autoScroll,this.autoScroll&&this.terminal&&this.terminal.scrollToBottom()}toggleFilterMode(){this.filterMode=!this.filterMode,this.reRenderFilteredLogs()}reRenderFilteredLogs(){if(this.terminal){if(this.terminal.clear(),this.trailingHiddenCount=0,!this.filterMode||!this.searchQuery)for(let H of this.logBuffer){let he=this.formatLogEntry(H);this.terminal.writeln(he)}else{let H=0;for(let he of this.logBuffer)if(this.entryMatchesFilter(he)){H>0&&(this.writeHiddenPlaceholder(H),H=0);let _e=this.formatLogEntry(he);this.terminal.writeln(_e)}else H++;H>0&&(this.writeHiddenPlaceholder(H),this.trailingHiddenCount=H)}this.autoScroll&&this.terminal.scrollToBottom()}}writeHiddenPlaceholder(H){let he="\x1B[2m",_e="\x1B[0m",W=H===1?"[1 log line hidden by filter ...]":`[${H} log lines hidden by filter ...]`;this.terminal?.writeln(`${he}${W}${_e}`)}clearLogs(){this.terminal?.clear(),this.logBuffer=[],this.trailingHiddenCount=0,this.resetMetrics()}scrollToBottom(){this.terminal?.scrollToBottom()}updateMetrics(H){this.metrics={...this.metrics,[H]:this.metrics[H]+1,total:this.metrics.total+1},this.recordLogEvent()}recordLogEvent(){this.rateBuffer.push(Date.now())}calculateRate(){let H=Date.now();this.rateBuffer=this.rateBuffer.filter(_e=>H-_e<1e4);let he=this.rateBuffer.length/10;he!==this.metrics.rate&&(this.metrics={...this.metrics,rate:he})}resetMetrics(){this.metrics={debug:0,info:0,warn:0,error:0,success:0,total:0,rate:0},this.rateBuffer=[]}async disconnectedCallback(){await super.disconnectedCallback(),this.resizeObserver&&this.resizeObserver.disconnect(),this.terminalThemeSubscription&&this.terminalThemeSubscription.unsubscribe(),this.rateInterval&&clearInterval(this.rateInterval),this.terminal&&this.terminal.dispose()}static{T1(i,a)}};return we=i})()});var gmt=v(()=>{mmt()});var bmt=v(()=>{umt();gmt()});var vmt,ymt=v(()=>{pe();vmt=()=>w`
|
|
14594
14594
|
<style>
|
|
14595
14595
|
.demoWrapper {
|
|
14596
14596
|
box-sizing: border-box;
|
|
@@ -29133,7 +29133,7 @@ html\`<dees-button>Click me</dees-button>\`</code></pre>
|
|
|
29133
29133
|
<h1>Markdown Preview</h1>
|
|
29134
29134
|
<p>Content will appear here when markdown is parsed.</p>
|
|
29135
29135
|
</div>
|
|
29136
|
-
`}async firstUpdated(n){await super.firstUpdated(n),this.outlet=this.shadowRoot.querySelector(".outlet")}async updateHtmlText(n){await this.updateComplete,this.outlet||(this.outlet=this.shadowRoot.querySelector(".outlet")),this.outlet.innerHTML=n}static{lWt(i,a)}};return s=i})()});var twt=v(()=>{ewt()});var awt=v(()=>{Oj()});var iwt=v(()=>{Hj()});var rwt=v(()=>{qxt();Vxt();jxt();Wxt();Gxt();Xxt();twt();awt();iwt()});var swt=v(()=>{});var nwt=v(()=>{swt()});var owt=v(()=>{pe()});var lwt=v(()=>{owt()});var cwt=v(()=>{zi();Ve();Uft();amt();bmt();Lmt();tgt();rgt();hbt();avt();hyt();Myt();Pw();vxt();Nxt();rwt();nwt();lwt()});var dwt,uwt=v(()=>{dwt={name:"@design.estate/dees-catalog",version:"3.43.0",description:"A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."}});var sa={};Qe(sa,{CanvasPool:()=>jl,DeesActionbar:()=>$mt,DeesAppui:()=>Pft,DeesAppuiActivitylog:()=>Pht,DeesAppuiBar:()=>Zht,DeesAppuiBottombar:()=>Jht,DeesAppuiMaincontent:()=>Eft,DeesAppuiMainmenu:()=>Cft,DeesAppuiProfileDropdown:()=>Yht,DeesAppuiSecondarymenu:()=>Lft,DeesAppuiTabs:()=>Dft,DeesAudioViewer:()=>cvt,DeesBadge:()=>Nmt,DeesButton:()=>xft,DeesButtonExit:()=>Yft,DeesButtonGroup:()=>Jft,DeesChartArea:()=>dmt,DeesChartLog:()=>fmt,DeesChips:()=>gbt,DeesContextmenu:()=>Wt,DeesDashboardgrid:()=>Nbt,DeesDataviewCodebox:()=>xmt,DeesDataviewStatusobject:()=>kmt,DeesForm:()=>bft,DeesFormSubmit:()=>Zx,DeesFormattingMenu:()=>gw,DeesHeading:()=>Hbt,DeesHint:()=>Hmt,DeesIcon:()=>_ht,DeesImageViewer:()=>svt,DeesInputBase:()=>Ze,DeesInputCheckbox:()=>Ox,DeesInputCode:()=>Vx,DeesInputDatepicker:()=>jx,DeesInputDropdown:()=>Xx,DeesInputFileupload:()=>Kx,DeesInputIban:()=>tw,DeesInputList:()=>pgt,DeesInputMultitoggle:()=>aw,DeesInputPhone:()=>rw,DeesInputProfilePicture:()=>pbt,DeesInputQuantitySelector:()=>Wx,DeesInputRadiogroup:()=>Gx,DeesInputRichtext:()=>kgt,DeesInputTags:()=>Dgt,DeesInputText:()=>Ux,DeesInputToggle:()=>sw,DeesInputTypelist:()=>nw,DeesInputWysiwyg:()=>qV,DeesLabel:()=>f9t,DeesMobilenavigation:()=>qft,DeesModal:()=>l1,DeesPagination:()=>Gbt,DeesPanel:()=>r9t,DeesPdf:()=>Tvt,DeesPdfPreview:()=>Pvt,DeesPdfViewer:()=>yvt,DeesPreview:()=>zvt,DeesProgressbar:()=>Gmt,DeesSearchbar:()=>zxt,DeesShoppingProductcard:()=>C9t,DeesSimpleAppDash:()=>cxt,DeesSimpleLogin:()=>mxt,DeesSlashMenu:()=>fw,DeesSpeechbubble:()=>vyt,DeesSpinner:()=>Zmt,DeesStatsGrid:()=>wft,DeesStepper:()=>Jbt,DeesTable:()=>lw,DeesTheme:()=>_xt,DeesTileAudio:()=>Yvt,DeesTileBase:()=>Ma,DeesTileFolder:()=>dyt,DeesTileImage:()=>Vvt,DeesTileNote:()=>ryt,DeesTilePdf:()=>xw,DeesTileVideo:()=>Jvt,DeesToast:()=>Ht,DeesUpdater:()=>Nw,DeesVideoViewer:()=>hvt,DeesWindowControls:()=>Ght,DeesWindowLayer:()=>Si,DeesWorkspace:()=>Bxt,DeesWorkspaceBottombar:()=>Rxt,DeesWorkspaceDiffEditor:()=>Oxt,DeesWorkspaceFiletree:()=>Ixt,DeesWorkspaceMarkdown:()=>Yxt,DeesWorkspaceMarkdownoutlet:()=>Jxt,DeesWorkspaceMonaco:()=>m9t,DeesWorkspaceTerminal:()=>$j,DeesWorkspaceTerminalPreview:()=>Fxt,DeesWysiwygBlock:()=>sbt,PROGRAMMING_LANGUAGES:()=>I8,PdfManager:()=>Yr,PerformanceMonitor:()=>Ul,TerminalTabManager:()=>ld,TypeScriptIntelliSenseManager:()=>hd,ViewRegistry:()=>A8,WebContainerEnvironment:()=>x4,WysiwygBlockOperations:()=>F8,WysiwygBlocks:()=>N2,WysiwygConverters:()=>$i,WysiwygDragDropHandler:()=>Q8,WysiwygFormatting:()=>Ws,WysiwygHistory:()=>K8,WysiwygInputHandler:()=>Z8,WysiwygKeyboardHandler:()=>X8,WysiwygModalManager:()=>Y8,WysiwygSelection:()=>Be,WysiwygShortcuts:()=>W1,ZIndexRegistry:()=>Lf,colors:()=>Q0,commitinfo:()=>dwt,componentZIndex:()=>tHt,debounce:()=>kUt,formatFileSize:()=>TUt,getZIndex:()=>eHt,icons:()=>Ix,isInViewport:()=>_Ut,registerAllBlockHandlers:()=>ebt,themeDefaultStyles:()=>ke,themeDefaults:()=>ro,throttle:()=>CUt,tileBaseStyles:()=>ra,wysiwygStyles:()=>PV,zIndexLayers:()=>c2,zIndexRegistry:()=>p1});var ka=v(()=>{cwt();Ci();uwt()});var pwt=pt(t2=>{"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.getFirstTrueOrFalse=t2.timeoutAndContinue=t2.timeoutWrap=t2.map=t2.rejectedPromise=t2.resolvedPromise=t2.defer=t2.Deferred=void 0;var Fw=class{constructor(){this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status="fulfilled",this.stoppedAt=Date.now(),e(i)},this.reject=i=>{this.status="rejected",this.stoppedAt=Date.now(),a(i)},this.startedAt=Date.now(),this.status="pending"})}get duration(){return this.stoppedAt?this.stoppedAt-this.startedAt:Date.now()-this.startedAt}};t2.Deferred=Fw,t2.defer=()=>new Fw,t2.resolvedPromise=t=>Promise.resolve(t),t2.rejectedPromise=t=>Promise.reject(t),t2.map=async(t,e)=>{let a=[],i=[];for(let r of t){let s=e(r);a.push(s),s.then(n=>{i.push(n)})}return await Promise.all(a),i},t2.timeoutWrap=async(t,e,a=!0)=>new Promise((i,r)=>{setTimeout(()=>{a?r(new Error("timeout")):i(null)},e),t.then(i,r)}),t2.timeoutAndContinue=async(t,e=6e4)=>t2.timeoutWrap(t,e,!1),t2.getFirstTrueOrFalse=async t=>{let e=t2.defer();for(let a of t)a.then(i=>{i===!0&&e.resolve(!0)});return Promise.all(t).then(()=>{e.resolve(!1)}),e.promise}});var Jl={};Qe(Jl,{TypedSocket:()=>Wj});var jj={};Qe(jj,{sha256FromString:()=>pWt});var md={};Qe(md,{Smartenv:()=>Vj});var qj=B1(pwt(),1);var Vj=class{constructor(){this.loadedScripts=[]}async getEnvAwareModule(e){if(this.isNode)return await this.getSafeNodeModule(e.nodeModuleName);if(this.isBrowser)return await this.getSafeWebModule(e.webUrlArg,e.getFunction);console.error("platform for loading not supported by smartenv")}async getSafeNodeModule(e){if(!this.isNode){console.error(`You tried to load a node module in a wrong context: ${e}`);return}return new Function(`return import('${e}')`)()}async getSafeWebModule(e,a){if(!this.isBrowser){console.error("You tried to load a web module in a wrong context");return}if(this.loadedScripts.includes(e))return a();this.loadedScripts.push(e);let i=qj.defer();if(globalThis.importScripts)globalThis.importScripts(e),i.resolve();else{let r=document.createElement("script");r.onload=()=>{i.resolve()},r.src=e,document.head.appendChild(r)}return await i.promise,a()}get runtimeEnv(){return typeof process<"u"?"node":"browser"}get isBrowser(){return!this.isNode}get userAgent(){return this.isBrowser?navigator.userAgent:"undefined"}get isNode(){return this.runtimeEnv==="node"}get nodeVersion(){return process.version}get isCI(){return this.isNode?!!process.env.CI:!1}async isMacAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="darwin":!1}async isWindowsAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="win32":!1}async isLinuxAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="linux":!1}async printEnv(){this.isNode?(console.log("running on NODE"),console.log("node version is "+this.nodeVersion)):(console.log("running on BROWSER"),console.log("browser is "+this.userAgent))}};var uWt=t=>{let e=[],a=new DataView(t);for(let i=0;i<a.byteLength;i+=4){let s=a.getUint32(i).toString(16),n="00000000",o=(n+s).slice(-n.length);e.push(o)}return e.join("")},pWt=async t=>{let e=new md.Smartenv;if(e.isBrowser){let a=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",a);return uWt(i)}else if(e.isNode)return await(await e.getSafeNodeModule("@pushrocks/smarthash")).sha256FromString(t)};_3();B4();Ri();l0();a2();pi();i0();X9();var Uj="__typedsocket_tag__";function fWt(t){return{peer:t,async getTagById(e){if(!t.tags.has(e))return;let a=t.data.get(`${Uj}${e}`);return{id:e,payload:a}}}}var Wj=class t{static async createClient(e,a,i={}){let s={...{autoReconnect:!0,maxRetries:100,initialBackoffMs:1e3,maxBackoffMs:6e4},...i},n=new t("client",e);return n.clientOptions=s,n.serverUrl=a,n.currentBackoff=s.initialBackoffMs,await n.connect(),n}static{this.useWindowLocationOriginUrl=()=>yi.Smarturl.createFromUrl(globalThis.location.origin).toString()}static fromSmartServe(e,a){let i=new Map;t.registerTagHandlers(a);let r=new t("server",a);return r.smartServeRef=e,r.smartServeConnectionWrappers=i,r}static registerTagHandlers(e){e.addTypedHandler(new P1.TypedHandler("__typedsocket_setTag",async(a,i)=>{let r=i?.localData?.peer;return r?(r.tags.add(a.name),r.data.set(`${Uj}${a.name}`,a.payload),{success:!0}):(console.warn("setTag: No peer found in request context"),{success:!1})})),e.addTypedHandler(new P1.TypedHandler("__typedsocket_removeTag",async(a,i)=>{let r=i?.localData?.peer;return r?(r.tags.delete(a.name),r.data.delete(`${Uj}${a.name}`),{success:!0}):(console.warn("removeTag: No peer found in request context"),{success:!1})}))}constructor(e,a){this.statusSubject=new yt.rxjs.Subject,this.connectionStatus="new",this.websocket=null,this.clientOptions=null,this.serverUrl="",this.retryCount=0,this.currentBackoff=1e3,this.pendingRequests=new Map,this.smartServeRef=null,this.smartServeConnectionWrappers=new Map,this.side=e,this.typedrouter=a}async connect(){let e=He.defer();this.updateStatus("connecting");let a=this.toWebSocketUrl(this.serverUrl);console.log(`TypedSocket connecting to ${a}...`),this.websocket=new WebSocket(a);let i=setTimeout(()=>{this.connectionStatus!=="connected"&&(console.warn("TypedSocket connection timeout"),this.websocket?.close(),e.reject(new Error("Connection timeout")))},1e4);this.websocket.onopen=()=>{clearTimeout(i),console.log("TypedSocket connected!"),this.updateStatus("connected"),this.retryCount=0,this.currentBackoff=this.clientOptions?.initialBackoffMs??1e3,e.resolve()},this.websocket.onmessage=async r=>{await this.handleMessage(r.data)},this.websocket.onclose=()=>{clearTimeout(i),this.handleDisconnect()},this.websocket.onerror=r=>{console.error("TypedSocket WebSocket error:",r)};try{await e.promise}catch(r){if(clearTimeout(i),this.clientOptions?.autoReconnect)await this.scheduleReconnect();else throw r}}toWebSocketUrl(e){let a=new URL(e);return`${a.protocol==="https:"?"wss:":"ws:"}//${a.host}${a.pathname}`}async handleMessage(e){try{let a=typeof e=="string"?e:new TextDecoder().decode(e),i=Bt.parse(a);if(i.correlation?.id&&this.pendingRequests.has(i.correlation.id)){let s=this.pendingRequests.get(i.correlation.id);this.pendingRequests.delete(i.correlation.id),s.resolve(i);return}let r=await this.typedrouter.routeAndAddResponse(i);r&&this.websocket?.readyState===WebSocket.OPEN&&this.websocket.send(Bt.stringify(r))}catch(a){console.error("TypedSocket failed to process message:",a)}}handleDisconnect(){this.connectionStatus!=="disconnected"&&(this.updateStatus("disconnected"),this.clientOptions?.autoReconnect&&this.retryCount<this.clientOptions.maxRetries&&this.scheduleReconnect())}async scheduleReconnect(){if(!this.clientOptions)return;this.updateStatus("reconnecting"),this.retryCount++;let e=this.currentBackoff*.2*(Math.random()*2-1),a=Math.min(this.currentBackoff+e,this.clientOptions.maxBackoffMs);console.log(`TypedSocket reconnecting in ${Math.round(a)}ms (attempt ${this.retryCount}/${this.clientOptions.maxRetries})`),await rt.delayFor(a),this.currentBackoff=Math.min(this.currentBackoff*2,this.clientOptions.maxBackoffMs);try{await this.connect()}catch(i){console.error("TypedSocket reconnection failed:",i)}}updateStatus(e){this.connectionStatus!==e&&(this.connectionStatus=e,this.statusSubject.next(e))}async sendRequest(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");return new Promise((a,i)=>{let r=setTimeout(()=>{this.pendingRequests.delete(e.correlation.id),i(new Error("Request timeout"))},3e4);this.pendingRequests.set(e.correlation.id,{resolve:s=>{clearTimeout(r),a(s)},reject:s=>{clearTimeout(r),i(s)}}),this.websocket.send(Bt.stringify(e))})}createTypedRequest(e,a){let i=async r=>{if(this.side==="client")return this.sendRequest(r);if(!this.smartServeRef)throw new Error("Server not initialized");let s=a;if(!s){let o=this.smartServeRef.getWebSocketConnections();if(o.length===1){let l=o[0];s=this.getOrCreateWrapper(l)}else throw o.length===0?new Error("No WebSocket connections available"):new Error("Multiple connections available - specify targetConnection")}let n=await this.typedrouter.fireEventInterestMap.addInterest(r.correlation.id,r);return s.peer.send(Bt.stringify(r)),await n.interestFullfilled};return new P1.TypedRequest(new P1.TypedTarget({postMethod:i}),e)}getStatus(){return this.connectionStatus}async stop(){this.side==="client"?(this.clientOptions&&(this.clientOptions.autoReconnect=!1),this.websocket&&(this.websocket.close(),this.websocket=null),this.pendingRequests.clear()):this.smartServeConnectionWrappers.clear()}async setTag(e,a){if(this.side!=="client")throw new Error("setTag is only available on clients");if(!(await this.createTypedRequest("__typedsocket_setTag").fire({name:e,payload:a})).success)throw new Error("Failed to set tag on server")}async removeTag(e){if(this.side!=="client")throw new Error("removeTag is only available on clients");if(!(await this.createTypedRequest("__typedsocket_removeTag").fire({name:e})).success)throw new Error("Failed to remove tag on server")}getOrCreateWrapper(e){let a=this.smartServeConnectionWrappers.get(e.id);return a||(a=fWt(e),this.smartServeConnectionWrappers.set(e.id,a)),a}async findAllTargetConnections(e){if(this.side!=="server"||!this.smartServeRef)throw new Error("findAllTargetConnections is only available on servers");let a=[];for(let i of this.smartServeRef.getWebSocketConnections()){let r=this.getOrCreateWrapper(i);await e(r)&&a.push(r)}return a}async findTargetConnection(e){return(await this.findAllTargetConnections(e))[0]}async findAllTargetConnectionsByTag(e,a){if(this.side!=="server"||!this.smartServeRef)throw new Error("findAllTargetConnectionsByTag is only available on servers");let i=this.smartServeRef.getWebSocketConnectionsByTag(e),r=[];for(let s of i){let n=this.getOrCreateWrapper(s);if(a!==void 0){let o=await n.getTagById(e);if(Bt.stringify(o?.payload)!==Bt.stringify(a))continue}r.push(n)}return r}async findTargetConnectionByTag(e,a){return(await this.findAllTargetConnectionsByTag(e,a))[0]}};pe();ka();var Ft=st;B4();var hwt={};var fwt={};var tn=new Ft.plugins.smartstate.Smartstate,ni=await tn.getStatePart("login",{identity:null,isLoggedIn:!1},"persistent"),f2=await tn.getStatePart("stats",{serverStats:null,emailStats:null,dnsStats:null,securityMetrics:null,lastUpdated:0,isLoading:!1,error:null},"soft"),Qr=await tn.getStatePart("config",{config:null,isLoading:!1,error:null}),mWt=()=>{let t=typeof window<"u"?window.location.pathname:"/",e=["overview","network","emails","logs","configuration","security","certificates","remoteingress"],i=t.split("/").filter(Boolean)[0];return e.includes(i)?i:"overview"},Oa=await tn.getStatePart("ui",{activeView:mWt(),sidebarCollapsed:!1,autoRefresh:!0,refreshInterval:1e3,theme:"light"}),an=await tn.getStatePart("logs",{recentLogs:[],isStreaming:!1,filters:{}},"soft"),Xr=await tn.getStatePart("network",{connections:[],connectionsByIP:{},throughputRate:{bytesInPerSecond:0,bytesOutPerSecond:0},totalBytes:{in:0,out:0},topIPs:[],throughputByIP:[],throughputHistory:[],requestsPerSecond:0,requestsTotal:0,lastUpdated:0,isLoading:!1,error:null},"soft"),$1=await tn.getStatePart("emailOps",{currentView:"queued",queuedEmails:[],sentEmails:[],failedEmails:[],securityIncidents:[],bounceRecords:[],suppressionList:[],selectedEmailId:null,isLoading:!1,error:null,lastUpdated:0},"soft"),F2=await tn.getStatePart("certificates",{certificates:[],summary:{total:0,valid:0,expiring:0,expired:0,failed:0,unknown:0},isLoading:!1,error:null,lastUpdated:0},"soft"),L1=await tn.getStatePart("remoteIngress",{edges:[],statuses:[],selectedEdgeId:null,newEdgeId:null,isLoading:!1,error:null,lastUpdated:0},"soft"),S1=()=>({identity:ni.getState().identity}),bwt=ni.createAction(async(t,e)=>{let a=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","adminLoginWithUsernameAndPassword");try{let i=await a.fire({username:e.username,password:e.password});return i.identity?{identity:i.identity,isLoggedIn:!0}:t.getState()}catch(i){return console.error("Login failed:",i),t.getState()}}),Zj=ni.createAction(async t=>{let e=S1();if(!e.identity)return t.getState();let a=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","adminLogout");try{await a.fire({identity:e.identity})}catch(i){console.error("Logout error:",i)}return{identity:null,isLoggedIn:!1}}),ec=f2.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCombinedMetrics").fire({identity:e.identity,sections:{server:!0,email:!0,dns:!0,security:!0,network:!1}});return{serverStats:r.metrics.server||a.serverStats,emailStats:r.metrics.email||a.emailStats,dnsStats:r.metrics.dns||a.dnsStats,securityMetrics:r.metrics.security||a.securityMetrics,lastUpdated:Date.now(),isLoading:!1,error:null}}catch(i){return{...a,isLoading:!1,error:i.message||"Failed to fetch statistics"}}}),tc=Qr.createAction(async t=>{let e=S1(),a=t.getState();try{return{config:(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getConfiguration").fire({identity:e.identity})).config,isLoading:!1,error:null}}catch(i){return{...a,isLoading:!1,error:i.message||"Failed to fetch configuration"}}}),Rw=an.createAction(async(t,e)=>{let a=S1(),r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRecentLogs").fire({identity:a.identity,limit:e.limit||100,level:e.level,category:e.category});return{...t.getState(),recentLogs:r.logs}}),xf2=Oa.createAction(async t=>{let e=t.getState();return{...e,autoRefresh:!e.autoRefresh}}),wf2=Oa.createAction(async(t,e)=>{let a=t.getState();return e==="network"&&a.activeView!=="network"&&setTimeout(()=>{Xr.dispatchAction(Xj,null)},100),e==="certificates"&&a.activeView!=="certificates"&&setTimeout(()=>{F2.dispatchAction(Co,null)},100),e==="remoteingress"&&a.activeView!=="remoteingress"&&setTimeout(()=>{L1.dispatchAction(S4,null)},100),{...a,activeView:e}}),Xj=Xr.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getActiveConnections").fire({identity:e.identity}),n=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getNetworkStats").fire({identity:e.identity}),o={};return n.connectionsByIP&&Array.isArray(n.connectionsByIP)?n.connectionsByIP.forEach(l=>{o[l.ip]=l.count}):r.connections.forEach(l=>{let d=l.remoteAddress;o[d]=(o[d]||0)+1}),{connections:r.connections,connectionsByIP:o,throughputRate:n.throughputRate||{bytesInPerSecond:0,bytesOutPerSecond:0},totalBytes:n.totalDataTransferred?{in:n.totalDataTransferred.bytesIn,out:n.totalDataTransferred.bytesOut}:{in:0,out:0},topIPs:n.topIPs||[],throughputByIP:n.throughputByIP||[],throughputHistory:n.throughputHistory||[],requestsPerSecond:n.requestsPerSecond||0,requestsTotal:n.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null}}catch(i){return console.error("Failed to fetch network stats:",i),{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch network stats"}}}),Mf2=$1.createAction(async(t,e)=>({...t.getState(),currentView:e})),Qj=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getQueuedEmails").fire({identity:e.identity,status:"pending",limit:100});return{...a,queuedEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch queued emails"}}}),vwt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getSentEmails").fire({identity:e.identity,limit:100});return{...a,sentEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch sent emails"}}}),Kj=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getFailedEmails").fire({identity:e.identity,limit:100});return{...a,failedEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch failed emails"}}}),ywt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getSecurityIncidents").fire({identity:e.identity,limit:100});return{...a,securityIncidents:r.incidents,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch security incidents"}}}),gWt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getBounceRecords").fire({identity:e.identity,limit:100});return{...a,bounceRecords:r.records,suppressionList:r.suppressionList,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch bounce records"}}}),xwt=$1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","resendEmail").fire({identity:a.identity,emailId:e})).success&&(await $1.dispatchAction(Kj,null),await $1.dispatchAction(Qj,null)),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to resend email"}}}),zf2=$1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","removeFromSuppressionList").fire({identity:a.identity,email:e})).success&&await $1.dispatchAction(gWt,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to remove from suppression list"}}}),Co=F2.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCertificateOverview").fire({identity:e.identity});return{certificates:r.certificates,summary:r.summary,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch certificate overview"}}}),wwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","reprovisionCertificateDomain").fire({identity:a.identity,domain:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to reprovision certificate"}}}),Mwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","deleteCertificate").fire({identity:a.identity,domain:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to delete certificate"}}}),zwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","importCertificate").fire({identity:a.identity,cert:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to import certificate"}}});async function Swt(t){let e=S1();return new Ft.plugins.typedrequest.TypedRequest("/typedrequest","exportCertificate").fire({identity:e.identity,domain:t})}async function Jj(t){let e=S1();return new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngressConnectionToken").fire({identity:e.identity,edgeId:t})}var S4=L1.createAction(async t=>{let e=S1(),a=t.getState();try{let i=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngresses"),r=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngressStatus"),[s,n]=await Promise.all([i.fire({identity:e.identity}),r.fire({identity:e.identity})]);return{...a,edges:s.edges,statuses:n.statuses,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch remote ingress data"}}}),kwt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{let s=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","createRemoteIngress").fire({identity:a.identity,name:e.name,listenPorts:e.listenPorts,autoDerivePorts:e.autoDerivePorts,tags:e.tags});return s.success?(await L1.dispatchAction(S4,null),{...t.getState(),newEdgeId:s.edge.id}):i}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to create edge"}}}),Cwt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","deleteRemoteIngress").fire({identity:a.identity,id:e}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to delete edge"}}}),Twt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","updateRemoteIngress").fire({identity:a.identity,id:e.id,name:e.name,listenPorts:e.listenPorts,autoDerivePorts:e.autoDerivePorts,tags:e.tags}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to update edge"}}}),_wt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","regenerateRemoteIngressSecret").fire({identity:a.identity,id:e})).success?{...i,newEdgeId:e}:i}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to regenerate secret"}}}),Lwt=L1.createAction(async t=>({...t.getState(),newEdgeId:null})),eU=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","updateRemoteIngress").fire({identity:a.identity,id:e.id,enabled:e.enabled}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to toggle edge"}}}),z4=null,mwt=new Ft.plugins.typedrequest.TypedRouter;mwt.addTypedHandler(new Ft.plugins.typedrequest.TypedHandler("pushLogEntry",async t=>{let e=an.getState(),a=[...e.recentLogs,t.entry];return a.length>2e3&&a.splice(0,a.length-2e3),an.setState({...e,recentLogs:a}),{}}));async function gwt(){if(!z4)try{z4=await Jl.TypedSocket.createClient(mwt,Jl.TypedSocket.useWindowLocationOriginUrl()),await z4.setTag("role","ops_dashboard")}catch(t){console.error("TypedSocket connection failed:",t),z4=null}}async function bWt(){if(z4){try{await z4.stop()}catch{}z4=null}}async function vWt(){let t=S1(),e=Oa.getState().activeView;try{let i=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCombinedMetrics").fire({identity:t.identity,sections:{server:!0,email:!0,dns:!0,security:!0,network:e==="network"}});if(f2.setState({...f2.getState(),serverStats:i.metrics.server||f2.getState().serverStats,emailStats:i.metrics.email||f2.getState().emailStats,dnsStats:i.metrics.dns||f2.getState().dnsStats,securityMetrics:i.metrics.security||f2.getState().securityMetrics,lastUpdated:Date.now(),isLoading:!1,error:null}),i.metrics.network&&e==="network"){let r=i.metrics.network,s={};r.connectionDetails.forEach(n=>{s[n.remoteAddress]=(s[n.remoteAddress]||0)+1});try{let o=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getActiveConnections").fire({identity:t.identity});Xr.setState({...Xr.getState(),connections:o.connections,connectionsByIP:s,throughputRate:{bytesInPerSecond:r.totalBandwidth.in,bytesOutPerSecond:r.totalBandwidth.out},totalBytes:r.totalBytes||{in:0,out:0},topIPs:r.topEndpoints.map(l=>({ip:l.endpoint,count:l.requests})),throughputByIP:r.topEndpoints.map(l=>({ip:l.endpoint,in:l.bandwidth?.in||0,out:l.bandwidth?.out||0})),throughputHistory:r.throughputHistory||[],requestsPerSecond:r.requestsPerSecond||0,requestsTotal:r.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null})}catch(n){console.error("Failed to fetch connections:",n),Xr.setState({...Xr.getState(),connections:[],connectionsByIP:s,throughputRate:{bytesInPerSecond:r.totalBandwidth.in,bytesOutPerSecond:r.totalBandwidth.out},totalBytes:r.totalBytes||{in:0,out:0},topIPs:r.topEndpoints.map(o=>({ip:o.endpoint,count:o.requests})),throughputByIP:r.topEndpoints.map(o=>({ip:o.endpoint,in:o.bandwidth?.in||0,out:o.bandwidth?.out||0})),throughputHistory:r.throughputHistory||[],requestsPerSecond:r.requestsPerSecond||0,requestsTotal:r.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null})}}if(e==="certificates")try{await F2.dispatchAction(Co,null)}catch(r){console.error("Certificate refresh failed:",r)}}catch(a){console.error("Combined refresh failed:",a)}}var gd=null,Yj=1e3;(()=>{let t=()=>{let s=Oa.getState(),n=ni.getState();s.autoRefresh&&n.isLoggedIn?(!gd||Yj!==s.refreshInterval)&&(e(),Yj=s.refreshInterval,gd=setInterval(()=>{vWt()},s.refreshInterval)):e()},e=()=>{gd&&(clearInterval(gd),gd=null,Yj=0)},a=Oa.getState().autoRefresh,i=Oa.getState().refreshInterval,r=ni.getState().isLoggedIn;Oa.state.subscribe(s=>{(s.autoRefresh!==a||s.refreshInterval!==i)&&(a=s.autoRefresh,i=s.refreshInterval,t())}),ni.state.subscribe(s=>{s.isLoggedIn!==r&&(r=s.isLoggedIn,t(),s.isLoggedIn?gwt():bWt())}),t(),ni.getState().isLoggedIn&&gwt()})();var yWt=Ft.plugins.smartrouter.SmartRouter,tU=["overview","network","emails","logs","configuration","security","certificates","remoteingress"],aU=["queued","sent","failed","security"],iU=class{router;initialized=!1;suppressStateUpdate=!1;constructor(){this.router=new yWt({debug:!1})}init(){this.initialized||(this.setupRoutes(),this.setupStateSync(),this.handleInitialRoute(),this.initialized=!0)}setupRoutes(){for(let e of tU)e==="emails"?(this.router.on("/emails",async()=>{this.updateViewState("emails"),this.updateEmailFolder("queued")}),this.router.on("/emails/:folder",async a=>{let i=a.params.folder;aU.includes(i)?(this.updateViewState("emails"),this.updateEmailFolder(i)):this.navigateTo("/emails/queued")})):this.router.on(`/${e}`,async()=>{this.updateViewState(e)});this.router.on("/",async()=>{this.navigateTo("/overview")})}setupStateSync(){Oa.state.subscribe(e=>{if(this.suppressStateUpdate)return;let a=window.location.pathname,i=this.getExpectedPath(e.activeView);if(!a.startsWith(i)){if(this.suppressStateUpdate=!0,e.activeView==="emails"){let r=$1.getState();this.router.pushUrl(`/emails/${r.currentView}`)}else this.router.pushUrl(`/${e.activeView}`);this.suppressStateUpdate=!1}})}getExpectedPath(e){return e==="emails"?"/emails":`/${e}`}handleInitialRoute(){let e=window.location.pathname;if(!e||e==="/")this.router.pushUrl("/overview");else{let a=e.split("/").filter(Boolean),i=a[0];if(tU.includes(i))if(this.updateViewState(i),i==="emails"&&a[1]){let r=a[1];aU.includes(r)?this.updateEmailFolder(r):this.updateEmailFolder("queued")}else i==="emails"&&this.updateEmailFolder("queued");else this.router.pushUrl("/overview")}}updateViewState(e){this.suppressStateUpdate=!0;let a=Oa.getState();a.activeView!==e&&Oa.setState({...a,activeView:e}),this.suppressStateUpdate=!1}updateEmailFolder(e){this.suppressStateUpdate=!0;let a=$1.getState();a.currentView!==e&&$1.setState({...a,currentView:e}),this.suppressStateUpdate=!1}navigateTo(e){this.router.pushUrl(e)}navigateToView(e){tU.includes(e)?this.navigateTo(`/${e}`):this.navigateTo("/overview")}navigateToEmailFolder(e){aU.includes(e)?this.navigateTo(`/emails/${e}`):this.navigateTo("/emails/queued")}getCurrentView(){return Oa.getState().activeView}getCurrentEmailFolder(){return $1.getState().currentView}destroy(){this.router.destroy(),this.initialized=!1}},ac=new iU;pe();var na=X`
|
|
29136
|
+
`}async firstUpdated(n){await super.firstUpdated(n),this.outlet=this.shadowRoot.querySelector(".outlet")}async updateHtmlText(n){await this.updateComplete,this.outlet||(this.outlet=this.shadowRoot.querySelector(".outlet")),this.outlet.innerHTML=n}static{lWt(i,a)}};return s=i})()});var twt=v(()=>{ewt()});var awt=v(()=>{Oj()});var iwt=v(()=>{Hj()});var rwt=v(()=>{qxt();Vxt();jxt();Wxt();Gxt();Xxt();twt();awt();iwt()});var swt=v(()=>{});var nwt=v(()=>{swt()});var owt=v(()=>{pe()});var lwt=v(()=>{owt()});var cwt=v(()=>{zi();Ve();Uft();amt();bmt();Lmt();tgt();rgt();hbt();avt();hyt();Myt();Pw();vxt();Nxt();rwt();nwt();lwt()});var dwt,uwt=v(()=>{dwt={name:"@design.estate/dees-catalog",version:"3.43.1",description:"A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."}});var sa={};Qe(sa,{CanvasPool:()=>jl,DeesActionbar:()=>$mt,DeesAppui:()=>Pft,DeesAppuiActivitylog:()=>Pht,DeesAppuiBar:()=>Zht,DeesAppuiBottombar:()=>Jht,DeesAppuiMaincontent:()=>Eft,DeesAppuiMainmenu:()=>Cft,DeesAppuiProfileDropdown:()=>Yht,DeesAppuiSecondarymenu:()=>Lft,DeesAppuiTabs:()=>Dft,DeesAudioViewer:()=>cvt,DeesBadge:()=>Nmt,DeesButton:()=>xft,DeesButtonExit:()=>Yft,DeesButtonGroup:()=>Jft,DeesChartArea:()=>dmt,DeesChartLog:()=>fmt,DeesChips:()=>gbt,DeesContextmenu:()=>Wt,DeesDashboardgrid:()=>Nbt,DeesDataviewCodebox:()=>xmt,DeesDataviewStatusobject:()=>kmt,DeesForm:()=>bft,DeesFormSubmit:()=>Zx,DeesFormattingMenu:()=>gw,DeesHeading:()=>Hbt,DeesHint:()=>Hmt,DeesIcon:()=>_ht,DeesImageViewer:()=>svt,DeesInputBase:()=>Ze,DeesInputCheckbox:()=>Ox,DeesInputCode:()=>Vx,DeesInputDatepicker:()=>jx,DeesInputDropdown:()=>Xx,DeesInputFileupload:()=>Kx,DeesInputIban:()=>tw,DeesInputList:()=>pgt,DeesInputMultitoggle:()=>aw,DeesInputPhone:()=>rw,DeesInputProfilePicture:()=>pbt,DeesInputQuantitySelector:()=>Wx,DeesInputRadiogroup:()=>Gx,DeesInputRichtext:()=>kgt,DeesInputTags:()=>Dgt,DeesInputText:()=>Ux,DeesInputToggle:()=>sw,DeesInputTypelist:()=>nw,DeesInputWysiwyg:()=>qV,DeesLabel:()=>f9t,DeesMobilenavigation:()=>qft,DeesModal:()=>l1,DeesPagination:()=>Gbt,DeesPanel:()=>r9t,DeesPdf:()=>Tvt,DeesPdfPreview:()=>Pvt,DeesPdfViewer:()=>yvt,DeesPreview:()=>zvt,DeesProgressbar:()=>Gmt,DeesSearchbar:()=>zxt,DeesShoppingProductcard:()=>C9t,DeesSimpleAppDash:()=>cxt,DeesSimpleLogin:()=>mxt,DeesSlashMenu:()=>fw,DeesSpeechbubble:()=>vyt,DeesSpinner:()=>Zmt,DeesStatsGrid:()=>wft,DeesStepper:()=>Jbt,DeesTable:()=>lw,DeesTheme:()=>_xt,DeesTileAudio:()=>Yvt,DeesTileBase:()=>Ma,DeesTileFolder:()=>dyt,DeesTileImage:()=>Vvt,DeesTileNote:()=>ryt,DeesTilePdf:()=>xw,DeesTileVideo:()=>Jvt,DeesToast:()=>Ht,DeesUpdater:()=>Nw,DeesVideoViewer:()=>hvt,DeesWindowControls:()=>Ght,DeesWindowLayer:()=>Si,DeesWorkspace:()=>Bxt,DeesWorkspaceBottombar:()=>Rxt,DeesWorkspaceDiffEditor:()=>Oxt,DeesWorkspaceFiletree:()=>Ixt,DeesWorkspaceMarkdown:()=>Yxt,DeesWorkspaceMarkdownoutlet:()=>Jxt,DeesWorkspaceMonaco:()=>m9t,DeesWorkspaceTerminal:()=>$j,DeesWorkspaceTerminalPreview:()=>Fxt,DeesWysiwygBlock:()=>sbt,PROGRAMMING_LANGUAGES:()=>I8,PdfManager:()=>Yr,PerformanceMonitor:()=>Ul,TerminalTabManager:()=>ld,TypeScriptIntelliSenseManager:()=>hd,ViewRegistry:()=>A8,WebContainerEnvironment:()=>x4,WysiwygBlockOperations:()=>F8,WysiwygBlocks:()=>N2,WysiwygConverters:()=>$i,WysiwygDragDropHandler:()=>Q8,WysiwygFormatting:()=>Ws,WysiwygHistory:()=>K8,WysiwygInputHandler:()=>Z8,WysiwygKeyboardHandler:()=>X8,WysiwygModalManager:()=>Y8,WysiwygSelection:()=>Be,WysiwygShortcuts:()=>W1,ZIndexRegistry:()=>Lf,colors:()=>Q0,commitinfo:()=>dwt,componentZIndex:()=>tHt,debounce:()=>kUt,formatFileSize:()=>TUt,getZIndex:()=>eHt,icons:()=>Ix,isInViewport:()=>_Ut,registerAllBlockHandlers:()=>ebt,themeDefaultStyles:()=>ke,themeDefaults:()=>ro,throttle:()=>CUt,tileBaseStyles:()=>ra,wysiwygStyles:()=>PV,zIndexLayers:()=>c2,zIndexRegistry:()=>p1});var ka=v(()=>{cwt();Ci();uwt()});var pwt=pt(t2=>{"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.getFirstTrueOrFalse=t2.timeoutAndContinue=t2.timeoutWrap=t2.map=t2.rejectedPromise=t2.resolvedPromise=t2.defer=t2.Deferred=void 0;var Fw=class{constructor(){this.promise=new Promise((e,a)=>{this.resolve=i=>{this.status="fulfilled",this.stoppedAt=Date.now(),e(i)},this.reject=i=>{this.status="rejected",this.stoppedAt=Date.now(),a(i)},this.startedAt=Date.now(),this.status="pending"})}get duration(){return this.stoppedAt?this.stoppedAt-this.startedAt:Date.now()-this.startedAt}};t2.Deferred=Fw,t2.defer=()=>new Fw,t2.resolvedPromise=t=>Promise.resolve(t),t2.rejectedPromise=t=>Promise.reject(t),t2.map=async(t,e)=>{let a=[],i=[];for(let r of t){let s=e(r);a.push(s),s.then(n=>{i.push(n)})}return await Promise.all(a),i},t2.timeoutWrap=async(t,e,a=!0)=>new Promise((i,r)=>{setTimeout(()=>{a?r(new Error("timeout")):i(null)},e),t.then(i,r)}),t2.timeoutAndContinue=async(t,e=6e4)=>t2.timeoutWrap(t,e,!1),t2.getFirstTrueOrFalse=async t=>{let e=t2.defer();for(let a of t)a.then(i=>{i===!0&&e.resolve(!0)});return Promise.all(t).then(()=>{e.resolve(!1)}),e.promise}});var Jl={};Qe(Jl,{TypedSocket:()=>Wj});var jj={};Qe(jj,{sha256FromString:()=>pWt});var md={};Qe(md,{Smartenv:()=>Vj});var qj=B1(pwt(),1);var Vj=class{constructor(){this.loadedScripts=[]}async getEnvAwareModule(e){if(this.isNode)return await this.getSafeNodeModule(e.nodeModuleName);if(this.isBrowser)return await this.getSafeWebModule(e.webUrlArg,e.getFunction);console.error("platform for loading not supported by smartenv")}async getSafeNodeModule(e){if(!this.isNode){console.error(`You tried to load a node module in a wrong context: ${e}`);return}return new Function(`return import('${e}')`)()}async getSafeWebModule(e,a){if(!this.isBrowser){console.error("You tried to load a web module in a wrong context");return}if(this.loadedScripts.includes(e))return a();this.loadedScripts.push(e);let i=qj.defer();if(globalThis.importScripts)globalThis.importScripts(e),i.resolve();else{let r=document.createElement("script");r.onload=()=>{i.resolve()},r.src=e,document.head.appendChild(r)}return await i.promise,a()}get runtimeEnv(){return typeof process<"u"?"node":"browser"}get isBrowser(){return!this.isNode}get userAgent(){return this.isBrowser?navigator.userAgent:"undefined"}get isNode(){return this.runtimeEnv==="node"}get nodeVersion(){return process.version}get isCI(){return this.isNode?!!process.env.CI:!1}async isMacAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="darwin":!1}async isWindowsAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="win32":!1}async isLinuxAsync(){return this.isNode?(await this.getSafeNodeModule("os")).platform()==="linux":!1}async printEnv(){this.isNode?(console.log("running on NODE"),console.log("node version is "+this.nodeVersion)):(console.log("running on BROWSER"),console.log("browser is "+this.userAgent))}};var uWt=t=>{let e=[],a=new DataView(t);for(let i=0;i<a.byteLength;i+=4){let s=a.getUint32(i).toString(16),n="00000000",o=(n+s).slice(-n.length);e.push(o)}return e.join("")},pWt=async t=>{let e=new md.Smartenv;if(e.isBrowser){let a=new TextEncoder().encode(t),i=await crypto.subtle.digest("SHA-256",a);return uWt(i)}else if(e.isNode)return await(await e.getSafeNodeModule("@pushrocks/smarthash")).sha256FromString(t)};_3();B4();Ri();l0();a2();pi();i0();X9();var Uj="__typedsocket_tag__";function fWt(t){return{peer:t,async getTagById(e){if(!t.tags.has(e))return;let a=t.data.get(`${Uj}${e}`);return{id:e,payload:a}}}}var Wj=class t{static async createClient(e,a,i={}){let s={...{autoReconnect:!0,maxRetries:100,initialBackoffMs:1e3,maxBackoffMs:6e4},...i},n=new t("client",e);return n.clientOptions=s,n.serverUrl=a,n.currentBackoff=s.initialBackoffMs,await n.connect(),n}static{this.useWindowLocationOriginUrl=()=>yi.Smarturl.createFromUrl(globalThis.location.origin).toString()}static fromSmartServe(e,a){let i=new Map;t.registerTagHandlers(a);let r=new t("server",a);return r.smartServeRef=e,r.smartServeConnectionWrappers=i,r}static registerTagHandlers(e){e.addTypedHandler(new P1.TypedHandler("__typedsocket_setTag",async(a,i)=>{let r=i?.localData?.peer;return r?(r.tags.add(a.name),r.data.set(`${Uj}${a.name}`,a.payload),{success:!0}):(console.warn("setTag: No peer found in request context"),{success:!1})})),e.addTypedHandler(new P1.TypedHandler("__typedsocket_removeTag",async(a,i)=>{let r=i?.localData?.peer;return r?(r.tags.delete(a.name),r.data.delete(`${Uj}${a.name}`),{success:!0}):(console.warn("removeTag: No peer found in request context"),{success:!1})}))}constructor(e,a){this.statusSubject=new yt.rxjs.Subject,this.connectionStatus="new",this.websocket=null,this.clientOptions=null,this.serverUrl="",this.retryCount=0,this.currentBackoff=1e3,this.pendingRequests=new Map,this.smartServeRef=null,this.smartServeConnectionWrappers=new Map,this.side=e,this.typedrouter=a}async connect(){let e=He.defer();this.updateStatus("connecting");let a=this.toWebSocketUrl(this.serverUrl);console.log(`TypedSocket connecting to ${a}...`),this.websocket=new WebSocket(a);let i=setTimeout(()=>{this.connectionStatus!=="connected"&&(console.warn("TypedSocket connection timeout"),this.websocket?.close(),e.reject(new Error("Connection timeout")))},1e4);this.websocket.onopen=()=>{clearTimeout(i),console.log("TypedSocket connected!"),this.updateStatus("connected"),this.retryCount=0,this.currentBackoff=this.clientOptions?.initialBackoffMs??1e3,e.resolve()},this.websocket.onmessage=async r=>{await this.handleMessage(r.data)},this.websocket.onclose=()=>{clearTimeout(i),this.handleDisconnect()},this.websocket.onerror=r=>{console.error("TypedSocket WebSocket error:",r)};try{await e.promise}catch(r){if(clearTimeout(i),this.clientOptions?.autoReconnect)await this.scheduleReconnect();else throw r}}toWebSocketUrl(e){let a=new URL(e);return`${a.protocol==="https:"?"wss:":"ws:"}//${a.host}${a.pathname}`}async handleMessage(e){try{let a=typeof e=="string"?e:new TextDecoder().decode(e),i=Bt.parse(a);if(i.correlation?.id&&this.pendingRequests.has(i.correlation.id)){let s=this.pendingRequests.get(i.correlation.id);this.pendingRequests.delete(i.correlation.id),s.resolve(i);return}let r=await this.typedrouter.routeAndAddResponse(i);r&&this.websocket?.readyState===WebSocket.OPEN&&this.websocket.send(Bt.stringify(r))}catch(a){console.error("TypedSocket failed to process message:",a)}}handleDisconnect(){this.connectionStatus!=="disconnected"&&(this.updateStatus("disconnected"),this.clientOptions?.autoReconnect&&this.retryCount<this.clientOptions.maxRetries&&this.scheduleReconnect())}async scheduleReconnect(){if(!this.clientOptions)return;this.updateStatus("reconnecting"),this.retryCount++;let e=this.currentBackoff*.2*(Math.random()*2-1),a=Math.min(this.currentBackoff+e,this.clientOptions.maxBackoffMs);console.log(`TypedSocket reconnecting in ${Math.round(a)}ms (attempt ${this.retryCount}/${this.clientOptions.maxRetries})`),await rt.delayFor(a),this.currentBackoff=Math.min(this.currentBackoff*2,this.clientOptions.maxBackoffMs);try{await this.connect()}catch(i){console.error("TypedSocket reconnection failed:",i)}}updateStatus(e){this.connectionStatus!==e&&(this.connectionStatus=e,this.statusSubject.next(e))}async sendRequest(e){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");return new Promise((a,i)=>{let r=setTimeout(()=>{this.pendingRequests.delete(e.correlation.id),i(new Error("Request timeout"))},3e4);this.pendingRequests.set(e.correlation.id,{resolve:s=>{clearTimeout(r),a(s)},reject:s=>{clearTimeout(r),i(s)}}),this.websocket.send(Bt.stringify(e))})}createTypedRequest(e,a){let i=async r=>{if(this.side==="client")return this.sendRequest(r);if(!this.smartServeRef)throw new Error("Server not initialized");let s=a;if(!s){let o=this.smartServeRef.getWebSocketConnections();if(o.length===1){let l=o[0];s=this.getOrCreateWrapper(l)}else throw o.length===0?new Error("No WebSocket connections available"):new Error("Multiple connections available - specify targetConnection")}let n=await this.typedrouter.fireEventInterestMap.addInterest(r.correlation.id,r);return s.peer.send(Bt.stringify(r)),await n.interestFullfilled};return new P1.TypedRequest(new P1.TypedTarget({postMethod:i}),e)}getStatus(){return this.connectionStatus}async stop(){this.side==="client"?(this.clientOptions&&(this.clientOptions.autoReconnect=!1),this.websocket&&(this.websocket.close(),this.websocket=null),this.pendingRequests.clear()):this.smartServeConnectionWrappers.clear()}async setTag(e,a){if(this.side!=="client")throw new Error("setTag is only available on clients");if(!(await this.createTypedRequest("__typedsocket_setTag").fire({name:e,payload:a})).success)throw new Error("Failed to set tag on server")}async removeTag(e){if(this.side!=="client")throw new Error("removeTag is only available on clients");if(!(await this.createTypedRequest("__typedsocket_removeTag").fire({name:e})).success)throw new Error("Failed to remove tag on server")}getOrCreateWrapper(e){let a=this.smartServeConnectionWrappers.get(e.id);return a||(a=fWt(e),this.smartServeConnectionWrappers.set(e.id,a)),a}async findAllTargetConnections(e){if(this.side!=="server"||!this.smartServeRef)throw new Error("findAllTargetConnections is only available on servers");let a=[];for(let i of this.smartServeRef.getWebSocketConnections()){let r=this.getOrCreateWrapper(i);await e(r)&&a.push(r)}return a}async findTargetConnection(e){return(await this.findAllTargetConnections(e))[0]}async findAllTargetConnectionsByTag(e,a){if(this.side!=="server"||!this.smartServeRef)throw new Error("findAllTargetConnectionsByTag is only available on servers");let i=this.smartServeRef.getWebSocketConnectionsByTag(e),r=[];for(let s of i){let n=this.getOrCreateWrapper(s);if(a!==void 0){let o=await n.getTagById(e);if(Bt.stringify(o?.payload)!==Bt.stringify(a))continue}r.push(n)}return r}async findTargetConnectionByTag(e,a){return(await this.findAllTargetConnectionsByTag(e,a))[0]}};pe();ka();var Ft=st;B4();var hwt={};var fwt={};var tn=new Ft.plugins.smartstate.Smartstate,ni=await tn.getStatePart("login",{identity:null,isLoggedIn:!1},"persistent"),f2=await tn.getStatePart("stats",{serverStats:null,emailStats:null,dnsStats:null,securityMetrics:null,lastUpdated:0,isLoading:!1,error:null},"soft"),Qr=await tn.getStatePart("config",{config:null,isLoading:!1,error:null}),mWt=()=>{let t=typeof window<"u"?window.location.pathname:"/",e=["overview","network","emails","logs","configuration","security","certificates","remoteingress"],i=t.split("/").filter(Boolean)[0];return e.includes(i)?i:"overview"},Oa=await tn.getStatePart("ui",{activeView:mWt(),sidebarCollapsed:!1,autoRefresh:!0,refreshInterval:1e3,theme:"light"}),an=await tn.getStatePart("logs",{recentLogs:[],isStreaming:!1,filters:{}},"soft"),Xr=await tn.getStatePart("network",{connections:[],connectionsByIP:{},throughputRate:{bytesInPerSecond:0,bytesOutPerSecond:0},totalBytes:{in:0,out:0},topIPs:[],throughputByIP:[],throughputHistory:[],requestsPerSecond:0,requestsTotal:0,lastUpdated:0,isLoading:!1,error:null},"soft"),$1=await tn.getStatePart("emailOps",{currentView:"queued",queuedEmails:[],sentEmails:[],failedEmails:[],securityIncidents:[],bounceRecords:[],suppressionList:[],selectedEmailId:null,isLoading:!1,error:null,lastUpdated:0},"soft"),F2=await tn.getStatePart("certificates",{certificates:[],summary:{total:0,valid:0,expiring:0,expired:0,failed:0,unknown:0},isLoading:!1,error:null,lastUpdated:0},"soft"),L1=await tn.getStatePart("remoteIngress",{edges:[],statuses:[],selectedEdgeId:null,newEdgeId:null,isLoading:!1,error:null,lastUpdated:0},"soft"),S1=()=>({identity:ni.getState().identity}),bwt=ni.createAction(async(t,e)=>{let a=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","adminLoginWithUsernameAndPassword");try{let i=await a.fire({username:e.username,password:e.password});return i.identity?{identity:i.identity,isLoggedIn:!0}:t.getState()}catch(i){return console.error("Login failed:",i),t.getState()}}),Zj=ni.createAction(async t=>{let e=S1();if(!e.identity)return t.getState();let a=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","adminLogout");try{await a.fire({identity:e.identity})}catch(i){console.error("Logout error:",i)}return{identity:null,isLoggedIn:!1}}),ec=f2.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCombinedMetrics").fire({identity:e.identity,sections:{server:!0,email:!0,dns:!0,security:!0,network:!1}});return{serverStats:r.metrics.server||a.serverStats,emailStats:r.metrics.email||a.emailStats,dnsStats:r.metrics.dns||a.dnsStats,securityMetrics:r.metrics.security||a.securityMetrics,lastUpdated:Date.now(),isLoading:!1,error:null}}catch(i){return{...a,isLoading:!1,error:i.message||"Failed to fetch statistics"}}}),tc=Qr.createAction(async t=>{let e=S1(),a=t.getState();try{return{config:(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getConfiguration").fire({identity:e.identity})).config,isLoading:!1,error:null}}catch(i){return{...a,isLoading:!1,error:i.message||"Failed to fetch configuration"}}}),Rw=an.createAction(async(t,e)=>{let a=S1(),r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRecentLogs").fire({identity:a.identity,limit:e.limit||100,level:e.level,category:e.category});return{...t.getState(),recentLogs:r.logs}}),xf2=Oa.createAction(async t=>{let e=t.getState();return{...e,autoRefresh:!e.autoRefresh}}),wf2=Oa.createAction(async(t,e)=>{let a=t.getState();return e==="network"&&a.activeView!=="network"&&setTimeout(()=>{Xr.dispatchAction(Xj,null)},100),e==="certificates"&&a.activeView!=="certificates"&&setTimeout(()=>{F2.dispatchAction(Co,null)},100),e==="remoteingress"&&a.activeView!=="remoteingress"&&setTimeout(()=>{L1.dispatchAction(S4,null)},100),{...a,activeView:e}}),Xj=Xr.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getActiveConnections").fire({identity:e.identity}),n=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getNetworkStats").fire({identity:e.identity}),o={};return n.connectionsByIP&&Array.isArray(n.connectionsByIP)?n.connectionsByIP.forEach(l=>{o[l.ip]=l.count}):r.connections.forEach(l=>{let d=l.remoteAddress;o[d]=(o[d]||0)+1}),{connections:r.connections,connectionsByIP:o,throughputRate:n.throughputRate||{bytesInPerSecond:0,bytesOutPerSecond:0},totalBytes:n.totalDataTransferred?{in:n.totalDataTransferred.bytesIn,out:n.totalDataTransferred.bytesOut}:{in:0,out:0},topIPs:n.topIPs||[],throughputByIP:n.throughputByIP||[],throughputHistory:n.throughputHistory||[],requestsPerSecond:n.requestsPerSecond||0,requestsTotal:n.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null}}catch(i){return console.error("Failed to fetch network stats:",i),{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch network stats"}}}),Mf2=$1.createAction(async(t,e)=>({...t.getState(),currentView:e})),Qj=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getQueuedEmails").fire({identity:e.identity,status:"pending",limit:100});return{...a,queuedEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch queued emails"}}}),vwt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getSentEmails").fire({identity:e.identity,limit:100});return{...a,sentEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch sent emails"}}}),Kj=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getFailedEmails").fire({identity:e.identity,limit:100});return{...a,failedEmails:r.items,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch failed emails"}}}),ywt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getSecurityIncidents").fire({identity:e.identity,limit:100});return{...a,securityIncidents:r.incidents,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch security incidents"}}}),gWt=$1.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getBounceRecords").fire({identity:e.identity,limit:100});return{...a,bounceRecords:r.records,suppressionList:r.suppressionList,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch bounce records"}}}),xwt=$1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","resendEmail").fire({identity:a.identity,emailId:e})).success&&(await $1.dispatchAction(Kj,null),await $1.dispatchAction(Qj,null)),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to resend email"}}}),zf2=$1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","removeFromSuppressionList").fire({identity:a.identity,email:e})).success&&await $1.dispatchAction(gWt,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to remove from suppression list"}}}),Co=F2.createAction(async t=>{let e=S1(),a=t.getState();try{let r=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCertificateOverview").fire({identity:e.identity});return{certificates:r.certificates,summary:r.summary,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch certificate overview"}}}),wwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","reprovisionCertificateDomain").fire({identity:a.identity,domain:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to reprovision certificate"}}}),Mwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","deleteCertificate").fire({identity:a.identity,domain:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to delete certificate"}}}),zwt=F2.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","importCertificate").fire({identity:a.identity,cert:e}),await F2.dispatchAction(Co,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to import certificate"}}});async function Swt(t){let e=S1();return new Ft.plugins.typedrequest.TypedRequest("/typedrequest","exportCertificate").fire({identity:e.identity,domain:t})}async function Jj(t){let e=S1();return new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngressConnectionToken").fire({identity:e.identity,edgeId:t})}var S4=L1.createAction(async t=>{let e=S1(),a=t.getState();try{let i=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngresses"),r=new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getRemoteIngressStatus"),[s,n]=await Promise.all([i.fire({identity:e.identity}),r.fire({identity:e.identity})]);return{...a,edges:s.edges,statuses:n.statuses,isLoading:!1,error:null,lastUpdated:Date.now()}}catch(i){return{...a,isLoading:!1,error:i instanceof Error?i.message:"Failed to fetch remote ingress data"}}}),kwt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{let s=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","createRemoteIngress").fire({identity:a.identity,name:e.name,listenPorts:e.listenPorts,autoDerivePorts:e.autoDerivePorts,tags:e.tags});return s.success?(await L1.dispatchAction(S4,null),{...t.getState(),newEdgeId:s.edge.id}):i}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to create edge"}}}),Cwt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","deleteRemoteIngress").fire({identity:a.identity,id:e}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to delete edge"}}}),Twt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","updateRemoteIngress").fire({identity:a.identity,id:e.id,name:e.name,listenPorts:e.listenPorts,autoDerivePorts:e.autoDerivePorts,tags:e.tags}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to update edge"}}}),_wt=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return(await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","regenerateRemoteIngressSecret").fire({identity:a.identity,id:e})).success?{...i,newEdgeId:e}:i}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to regenerate secret"}}}),Lwt=L1.createAction(async t=>({...t.getState(),newEdgeId:null})),eU=L1.createAction(async(t,e)=>{let a=S1(),i=t.getState();try{return await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","updateRemoteIngress").fire({identity:a.identity,id:e.id,enabled:e.enabled}),await L1.dispatchAction(S4,null),t.getState()}catch(r){return{...i,error:r instanceof Error?r.message:"Failed to toggle edge"}}}),z4=null,mwt=new Ft.plugins.typedrequest.TypedRouter;mwt.addTypedHandler(new Ft.plugins.typedrequest.TypedHandler("pushLogEntry",async t=>{let e=an.getState(),a=[...e.recentLogs,t.entry];return a.length>2e3&&a.splice(0,a.length-2e3),an.setState({...e,recentLogs:a}),{}}));async function gwt(){if(!z4)try{z4=await Jl.TypedSocket.createClient(mwt,Jl.TypedSocket.useWindowLocationOriginUrl()),await z4.setTag("role","ops_dashboard")}catch(t){console.error("TypedSocket connection failed:",t),z4=null}}async function bWt(){if(z4){try{await z4.stop()}catch{}z4=null}}async function vWt(){let t=S1(),e=Oa.getState().activeView;try{let i=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getCombinedMetrics").fire({identity:t.identity,sections:{server:!0,email:!0,dns:!0,security:!0,network:e==="network"}});if(f2.setState({...f2.getState(),serverStats:i.metrics.server||f2.getState().serverStats,emailStats:i.metrics.email||f2.getState().emailStats,dnsStats:i.metrics.dns||f2.getState().dnsStats,securityMetrics:i.metrics.security||f2.getState().securityMetrics,lastUpdated:Date.now(),isLoading:!1,error:null}),i.metrics.network&&e==="network"){let r=i.metrics.network,s={};r.connectionDetails.forEach(n=>{s[n.remoteAddress]=(s[n.remoteAddress]||0)+1});try{let o=await new Ft.plugins.typedrequest.TypedRequest("/typedrequest","getActiveConnections").fire({identity:t.identity});Xr.setState({...Xr.getState(),connections:o.connections,connectionsByIP:s,throughputRate:{bytesInPerSecond:r.totalBandwidth.in,bytesOutPerSecond:r.totalBandwidth.out},totalBytes:r.totalBytes||{in:0,out:0},topIPs:r.topEndpoints.map(l=>({ip:l.endpoint,count:l.requests})),throughputByIP:r.topEndpoints.map(l=>({ip:l.endpoint,in:l.bandwidth?.in||0,out:l.bandwidth?.out||0})),throughputHistory:r.throughputHistory||[],requestsPerSecond:r.requestsPerSecond||0,requestsTotal:r.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null})}catch(n){console.error("Failed to fetch connections:",n),Xr.setState({...Xr.getState(),connections:[],connectionsByIP:s,throughputRate:{bytesInPerSecond:r.totalBandwidth.in,bytesOutPerSecond:r.totalBandwidth.out},totalBytes:r.totalBytes||{in:0,out:0},topIPs:r.topEndpoints.map(o=>({ip:o.endpoint,count:o.requests})),throughputByIP:r.topEndpoints.map(o=>({ip:o.endpoint,in:o.bandwidth?.in||0,out:o.bandwidth?.out||0})),throughputHistory:r.throughputHistory||[],requestsPerSecond:r.requestsPerSecond||0,requestsTotal:r.requestsTotal||0,lastUpdated:Date.now(),isLoading:!1,error:null})}}if(e==="certificates")try{await F2.dispatchAction(Co,null)}catch(r){console.error("Certificate refresh failed:",r)}}catch(a){console.error("Combined refresh failed:",a)}}var gd=null,Yj=1e3;(()=>{let t=()=>{let s=Oa.getState(),n=ni.getState();s.autoRefresh&&n.isLoggedIn?(!gd||Yj!==s.refreshInterval)&&(e(),Yj=s.refreshInterval,gd=setInterval(()=>{vWt()},s.refreshInterval)):e()},e=()=>{gd&&(clearInterval(gd),gd=null,Yj=0)},a=Oa.getState().autoRefresh,i=Oa.getState().refreshInterval,r=ni.getState().isLoggedIn;Oa.state.subscribe(s=>{(s.autoRefresh!==a||s.refreshInterval!==i)&&(a=s.autoRefresh,i=s.refreshInterval,t())}),ni.state.subscribe(s=>{s.isLoggedIn!==r&&(r=s.isLoggedIn,t(),s.isLoggedIn?gwt():bWt())}),t(),ni.getState().isLoggedIn&&gwt()})();var yWt=Ft.plugins.smartrouter.SmartRouter,tU=["overview","network","emails","logs","configuration","security","certificates","remoteingress"],aU=["queued","sent","failed","security"],iU=class{router;initialized=!1;suppressStateUpdate=!1;constructor(){this.router=new yWt({debug:!1})}init(){this.initialized||(this.setupRoutes(),this.setupStateSync(),this.handleInitialRoute(),this.initialized=!0)}setupRoutes(){for(let e of tU)e==="emails"?(this.router.on("/emails",async()=>{this.updateViewState("emails"),this.updateEmailFolder("queued")}),this.router.on("/emails/:folder",async a=>{let i=a.params.folder;aU.includes(i)?(this.updateViewState("emails"),this.updateEmailFolder(i)):this.navigateTo("/emails/queued")})):this.router.on(`/${e}`,async()=>{this.updateViewState(e)});this.router.on("/",async()=>{this.navigateTo("/overview")})}setupStateSync(){Oa.state.subscribe(e=>{if(this.suppressStateUpdate)return;let a=window.location.pathname,i=this.getExpectedPath(e.activeView);if(!a.startsWith(i)){if(this.suppressStateUpdate=!0,e.activeView==="emails"){let r=$1.getState();this.router.pushUrl(`/emails/${r.currentView}`)}else this.router.pushUrl(`/${e.activeView}`);this.suppressStateUpdate=!1}})}getExpectedPath(e){return e==="emails"?"/emails":`/${e}`}handleInitialRoute(){let e=window.location.pathname;if(!e||e==="/")this.router.pushUrl("/overview");else{let a=e.split("/").filter(Boolean),i=a[0];if(tU.includes(i))if(this.updateViewState(i),i==="emails"&&a[1]){let r=a[1];aU.includes(r)?this.updateEmailFolder(r):this.updateEmailFolder("queued")}else i==="emails"&&this.updateEmailFolder("queued");else this.router.pushUrl("/overview")}}updateViewState(e){this.suppressStateUpdate=!0;let a=Oa.getState();a.activeView!==e&&Oa.setState({...a,activeView:e}),this.suppressStateUpdate=!1}updateEmailFolder(e){this.suppressStateUpdate=!0;let a=$1.getState();a.currentView!==e&&$1.setState({...a,currentView:e}),this.suppressStateUpdate=!1}navigateTo(e){this.router.pushUrl(e)}navigateToView(e){tU.includes(e)?this.navigateTo(`/${e}`):this.navigateTo("/overview")}navigateToEmailFolder(e){aU.includes(e)?this.navigateTo(`/emails/${e}`):this.navigateTo("/emails/queued")}getCurrentView(){return Oa.getState().activeView}getCurrentEmailFolder(){return $1.getState().currentView}destroy(){this.router.destroy(),this.initialized=!1}},ac=new iU;pe();var na=X`
|
|
29137
29137
|
:host {
|
|
29138
29138
|
display: block;
|
|
29139
29139
|
margin: auto;
|
|
@@ -29888,7 +29888,7 @@ ${JSON.stringify(a.details,null,2)}
|
|
|
29888
29888
|
.maxEntries=${2e3}
|
|
29889
29889
|
.showMetrics=${!0}
|
|
29890
29890
|
></dees-chart-log>
|
|
29891
|
-
`}async connectedCallback(){super.connectedCallback(),this.lastPushedCount=0,this.logState.recentLogs.length===0&&this.fetchLogs()}async updated(a){super.updated(a),a.has("logState")&&this.pushLogsToChart()}async pushLogsToChart(){let a=this.shadowRoot?.querySelector("dees-chart-log");if(!a)return;await a.updateComplete;let i=this.getMappedLogEntries();if(this.lastPushedCount===0&&i.length>0)a.updateLog(i),this.lastPushedCount=i.length;else if(i.length>this.lastPushedCount){let r=i.slice(this.lastPushedCount);a.updateLog(r),this.lastPushedCount=i.length}}getMappedLogEntries(){return this.logState.recentLogs.map(a=>({timestamp:new Date(a.timestamp).toISOString(),level:a.level,message:a.message,source:a.category}))}async fetchLogs(){await an.dispatchAction(Rw,{limit:this.filterLimit,level:this.filterLevel,category:this.filterCategory})}updateFilter(a,i){let r=i==="all"?void 0:i;switch(a){case"level":this.filterLevel=r;break;case"category":this.filterCategory=r;break;case"limit":this.filterLimit=r?parseInt(r,10):100;break}this.fetchLogs()}};Ca=Y1(sMt),zU=new WeakMap,SU=new WeakMap,kU=new WeakMap,CU=new WeakMap,dt(Ca,4,"logState",rMt,Di,zU),dt(Ca,4,"filterLevel",iMt,Di,SU),dt(Ca,4,"filterCategory",aMt,Di,kU),dt(Ca,4,"filterLimit",tMt,Di,CU),Di=dt(Ca,0,"OpsViewLogs",nMt,Di),i1(Di,"styles",[p.defaultStyles,na,X`
|
|
29891
|
+
`}async connectedCallback(){super.connectedCallback(),this.lastPushedCount=0,this.logState.recentLogs.length===0&&this.fetchLogs()}async updated(a){super.updated(a),a.has("logState")&&this.pushLogsToChart()}async pushLogsToChart(){let a=this.shadowRoot?.querySelector("dees-chart-log");if(!a)return;await a.updateComplete,a.terminalReady||await new Promise(r=>{let s=()=>{if(a.terminalReady){r();return}setTimeout(s,50)};s()});let i=this.getMappedLogEntries();if(this.lastPushedCount===0&&i.length>0)a.updateLog(i),this.lastPushedCount=i.length;else if(i.length>this.lastPushedCount){let r=i.slice(this.lastPushedCount);a.updateLog(r),this.lastPushedCount=i.length}}getMappedLogEntries(){return this.logState.recentLogs.map(a=>({timestamp:new Date(a.timestamp).toISOString(),level:a.level,message:a.message,source:a.category}))}async fetchLogs(){await an.dispatchAction(Rw,{limit:this.filterLimit,level:this.filterLevel,category:this.filterCategory})}updateFilter(a,i){let r=i==="all"?void 0:i;switch(a){case"level":this.filterLevel=r;break;case"category":this.filterCategory=r;break;case"limit":this.filterLimit=r?parseInt(r,10):100;break}this.fetchLogs()}};Ca=Y1(sMt),zU=new WeakMap,SU=new WeakMap,kU=new WeakMap,CU=new WeakMap,dt(Ca,4,"logState",rMt,Di,zU),dt(Ca,4,"filterLevel",iMt,Di,SU),dt(Ca,4,"filterCategory",aMt,Di,kU),dt(Ca,4,"filterLimit",tMt,Di,CU),Di=dt(Ca,0,"OpsViewLogs",nMt,Di),i1(Di,"styles",[p.defaultStyles,na,X`
|
|
29892
29892
|
.controls {
|
|
29893
29893
|
display: flex;
|
|
29894
29894
|
gap: 16px;
|
|
@@ -30841,4 +30841,4 @@ ibantools/jsnext/ibantools.js:
|
|
|
30841
30841
|
* @preferred
|
|
30842
30842
|
*)
|
|
30843
30843
|
*/
|
|
30844
|
-
//# sourceMappingURL=bundle-
|
|
30844
|
+
//# sourceMappingURL=bundle-1771697609861.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@serve.zone/dcrouter',
|
|
6
|
-
version: '7.4.
|
|
6
|
+
version: '7.4.1',
|
|
7
7
|
description: 'A multifaceted routing service handling mail and SMS delivery functions.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSxzQkFBc0I7SUFDNUIsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLDBFQUEwRTtDQUN4RixDQUFBIn0=
|