paneful 0.8.2 → 0.8.3

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.
@@ -1,4 +1,4 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-\[2px\]{left:-2px}.-top-\[2px\]{top:-2px}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-1\/2{height:50%}.h-16{height:4rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\[4px\]{height:4px}.h-\[8px\]{height:8px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-16{width:4rem}.w-\[380px\]{width:380px}.w-\[400px\]{width:400px}.w-\[440px\]{width:440px}.w-\[4px\]{width:4px}.w-\[8px\]{width:8px}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[24px\]{min-width:24px}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-col-resize{cursor:col-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[var\(--accent\)\]{border-color:var(--accent)}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--danger\)\]{border-color:var(--danger)}.border-transparent{border-color:transparent}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--danger\)\]{background-color:var(--danger)}.bg-\[var\(--success\)\]{background-color:var(--success)}.bg-\[var\(--surface-0\)\]{background-color:var(--surface-0)}.bg-\[var\(--surface-1\)\]{background-color:var(--surface-1)}.bg-\[var\(--surface-2\)\]{background-color:var(--surface-2)}.bg-\[var\(--surface-3\)\]{background-color:var(--surface-3)}.bg-accent{background-color:var(--accent)}.bg-black\/50{background-color:#00000080}.bg-transparent{background-color:transparent}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--danger\)\]{color:var(--danger)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-accent{color:var(--accent)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-400{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_0_var\(--border\)\]{--tw-shadow: 0 1px 0 var(--border);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-\[var\(--accent\)\]{--tw-ring-color: var(--accent)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}:root{--surface-0: #0a0a0f;--surface-1: #111118;--surface-2: #1a1a24;--surface-3: #252532;--border: #2a2a3a;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #3a3a8c;--text-primary: #ececf1;--text-secondary: #a1a1b5;--text-muted: #6b6b80;--danger: #e5484d;--danger-dim: #3c1618;--success: #30a46c}[data-theme=light]{--surface-0: #ffffff;--surface-1: #f5f5f7;--surface-2: #ebebef;--surface-3: #dddde3;--border: #d0d0d8;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #e0e0ff;--text-primary: #1a1a2e;--text-secondary: #555570;--text-muted: #8888a0;--danger: #dc3545;--danger-dim: #fde8ea;--success: #1a8f5c}@media (prefers-color-scheme: light){[data-theme=system]{--surface-0: #ffffff;--surface-1: #f5f5f7;--surface-2: #ebebef;--surface-3: #dddde3;--border: #d0d0d8;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #e0e0ff;--text-primary: #1a1a2e;--text-secondary: #555570;--text-muted: #8888a0;--danger: #dc3545;--danger-dim: #fde8ea;--success: #1a8f5c}}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden;background:var(--surface-0);color:var(--text-primary);font-family:-apple-system,BlinkMacSystemFont,Inter,Segoe UI,sans-serif}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}.xterm{padding:4px 8px}.xterm-viewport::-webkit-scrollbar{width:6px}.xterm-viewport::-webkit-scrollbar-track{background:transparent}.xterm-viewport::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideOut{0%{transform:translate(0)}to{transform:translate(-100%)}}.animate-fade-in{animation:fadeIn .15s ease-out}.placeholder\:text-\[var\(--text-muted\)\]::-moz-placeholder{color:var(--text-muted)}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}.hover\:bg-\[var\(--accent\)\]:hover{background-color:var(--accent)}.hover\:bg-\[var\(--danger-dim\)\]:hover{background-color:var(--danger-dim)}.hover\:bg-\[var\(--surface-2\)\]:hover{background-color:var(--surface-2)}.hover\:bg-\[var\(--surface-3\)\]:hover{background-color:var(--surface-3)}.hover\:bg-green-500\/10:hover{background-color:#22c55e1a}.hover\:text-\[var\(--danger\)\]:hover{color:var(--danger)}.hover\:text-\[var\(--success\)\]:hover{color:var(--success)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}.hover\:text-\[var\(--text-secondary\)\]:hover{color:var(--text-secondary)}.hover\:text-yellow-400:hover{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.focus\:border-\[var\(--danger\)\]:focus{border-color:var(--danger)}.focus\:border-accent:focus{border-color:var(--accent)}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.active\:cursor-grabbing:active{cursor:grabbing}.active\:bg-\[var\(--accent\)\]:active{background-color:var(--accent)}.active\:opacity-60:active{opacity:.6}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.group:hover .group-hover\:flex{display:flex}.group:active .group-active\:bg-accent{background-color:var(--accent)}@media (min-width: 640px){.sm\:inline{display:inline}}/**
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-\[2px\]{left:-2px}.-top-\[2px\]{top:-2px}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-1\/2{height:50%}.h-16{height:4rem}.h-4{height:1rem}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\[4px\]{height:4px}.h-\[8px\]{height:8px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[80vh\]{max-height:80vh}.min-h-0{min-height:0px}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-16{width:4rem}.w-\[380px\]{width:380px}.w-\[400px\]{width:400px}.w-\[440px\]{width:440px}.w-\[4px\]{width:4px}.w-\[8px\]{width:8px}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-0{min-width:0px}.min-w-\[24px\]{min-width:24px}.max-w-lg{max-width:32rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-col-resize{cursor:col-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.cursor-row-resize{cursor:row-resize}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-6{gap:1.5rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-\[var\(--accent\)\]{border-color:var(--accent)}.border-\[var\(--border\)\]{border-color:var(--border)}.border-\[var\(--danger\)\]{border-color:var(--danger)}.border-transparent{border-color:transparent}.bg-\[var\(--border\)\]{background-color:var(--border)}.bg-\[var\(--danger\)\]{background-color:var(--danger)}.bg-\[var\(--success\)\]{background-color:var(--success)}.bg-\[var\(--surface-0\)\]{background-color:var(--surface-0)}.bg-\[var\(--surface-1\)\]{background-color:var(--surface-1)}.bg-\[var\(--surface-2\)\]{background-color:var(--surface-2)}.bg-\[var\(--surface-3\)\]{background-color:var(--surface-3)}.bg-accent{background-color:var(--accent)}.bg-black\/50{background-color:#00000080}.bg-transparent{background-color:transparent}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/10{background-color:#eab3081a}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-relaxed{line-height:1.625}.tracking-tight{letter-spacing:-.025em}.tracking-wider{letter-spacing:.05em}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--danger\)\]{color:var(--danger)}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-\[var\(--text-secondary\)\]{color:var(--text-secondary)}.text-accent{color:var(--accent)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-40{opacity:.4}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_0_var\(--border\)\]{--tw-shadow: 0 1px 0 var(--border);--tw-shadow-colored: 0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-inset{--tw-ring-inset: inset}.ring-\[var\(--accent\)\]{--tw-ring-color: var(--accent)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}:root{--surface-0: #0a0a0f;--surface-1: #111118;--surface-2: #1a1a24;--surface-3: #252532;--border: #2a2a3a;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #3a3a8c;--text-primary: #ececf1;--text-secondary: #a1a1b5;--text-muted: #6b6b80;--danger: #e5484d;--danger-dim: #3c1618;--success: #30a46c}[data-theme=light]{--surface-0: #ffffff;--surface-1: #f5f5f7;--surface-2: #ebebef;--surface-3: #dddde3;--border: #d0d0d8;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #e0e0ff;--text-primary: #1a1a2e;--text-secondary: #555570;--text-muted: #8888a0;--danger: #dc3545;--danger-dim: #fde8ea;--success: #1a8f5c}@media (prefers-color-scheme: light){[data-theme=system]{--surface-0: #ffffff;--surface-1: #f5f5f7;--surface-2: #ebebef;--surface-3: #dddde3;--border: #d0d0d8;--border-focus: #5b5bd6;--accent: #5b5bd6;--accent-dim: #e0e0ff;--text-primary: #1a1a2e;--text-secondary: #555570;--text-muted: #8888a0;--danger: #dc3545;--danger-dim: #fde8ea;--success: #1a8f5c}}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden;background:var(--surface-0);color:var(--text-primary);font-family:-apple-system,BlinkMacSystemFont,Inter,Segoe UI,sans-serif}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-muted)}.xterm{padding:4px 8px}.xterm-viewport::-webkit-scrollbar{width:6px}.xterm-viewport::-webkit-scrollbar-track{background:transparent}.xterm-viewport::-webkit-scrollbar-thumb{background:var(--border);border-radius:3px}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideIn{0%{transform:translate(-100%)}to{transform:translate(0)}}@keyframes slideOut{0%{transform:translate(0)}to{transform:translate(-100%)}}.animate-fade-in{animation:fadeIn .15s ease-out}.placeholder\:text-\[var\(--text-muted\)\]::-moz-placeholder{color:var(--text-muted)}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}.hover\:bg-\[var\(--accent\)\]:hover{background-color:var(--accent)}.hover\:bg-\[var\(--danger-dim\)\]:hover{background-color:var(--danger-dim)}.hover\:bg-\[var\(--surface-2\)\]:hover{background-color:var(--surface-2)}.hover\:bg-\[var\(--surface-3\)\]:hover{background-color:var(--surface-3)}.hover\:bg-green-500\/10:hover{background-color:#22c55e1a}.hover\:text-\[var\(--danger\)\]:hover{color:var(--danger)}.hover\:text-\[var\(--success\)\]:hover{color:var(--success)}.hover\:text-\[var\(--text-primary\)\]:hover{color:var(--text-primary)}.hover\:text-\[var\(--text-secondary\)\]:hover{color:var(--text-secondary)}.hover\:text-yellow-400:hover{--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-40:hover{opacity:.4}.focus\:border-\[var\(--danger\)\]:focus{border-color:var(--danger)}.focus\:border-accent:focus{border-color:var(--accent)}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.active\:cursor-grabbing:active{cursor:grabbing}.active\:bg-\[var\(--accent\)\]:active{background-color:var(--accent)}.active\:opacity-60:active{opacity:.6}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.group:hover .group-hover\:flex{display:flex}.group:active .group-active\:bg-accent{background-color:var(--accent)}@media (min-width: 640px){.sm\:inline{display:inline}}/**
2
2
  * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
3
  * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
4
  * https://github.com/chjj/term.js
@@ -62,7 +62,7 @@ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o)
62
62
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&y&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(y){const b=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&b)&&this._areCoordsInSelection(b,R,M)}isCellInSelection(y,b){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([y,b],R,M)}_areCoordsInSelection(y,b,R){return y[1]>b[1]&&y[1]<R[1]||b[1]===R[1]&&y[1]===b[1]&&y[0]>=b[0]&&y[0]<R[0]||b[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||b[1]<R[1]&&y[1]===b[1]&&y[0]>=b[0]}_selectWordAtCursor(y,b){var B,T;const R=(T=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:T.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(y);return!!M&&(this._selectWordAt(M,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,b){this._model.clearSelection(),y=Math.max(y,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const b=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(y){let b=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=R?0:(b>R&&(b-=R),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(y){return o.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const b=this._getMouseBufferCoords(y);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const b=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,p.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,R=!(!y||!b||y[0]===b[0]&&y[1]===b[1]);R?y&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,b,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,b,R)}_fireOnSelectionChange(y,b,R){this._oldSelectionStart=y,this._oldSelectionEnd=b,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(y,b){let R=b;for(let M=0;b>=M;M++){const B=y.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:B>1&&b!==M&&(R+=B-1)}return R}setSelection(y,b,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,b],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,b,R=!0,M=!0){if(y[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,T=B.lines.get(y[1]);if(!T)return;const N=B.translateBufferLineToString(y[1],!1);let F=this._convertViewportColToCharacterIndex(T,y[0]),K=F;const q=y[0]-F;let j=0,E=0,D=0,P=0;if(N.charAt(F)===" "){for(;F>0&&N.charAt(F-1)===" ";)F--;for(;K<N.length&&N.charAt(K+1)===" ";)K++}else{let V=y[0],J=y[0];T.getWidth(V)===0&&(j++,V--),T.getWidth(J)===2&&(E++,J++);const Z=T.getString(J).length;for(Z>1&&(P+=Z-1,K+=Z-1);V>0&&F>0&&!this._isCharWordSeparator(T.loadCell(V-1,this._workCell));){T.loadCell(V-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,V--):I>1&&(D+=I-1,F-=I-1),F--,V--}for(;J<T.length&&K+1<N.length&&!this._isCharWordSeparator(T.loadCell(J+1,this._workCell));){T.loadCell(J+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,J++):I>1&&(P+=I-1,K+=I-1),K++,J++}}K++;let O=F+q-j+D,W=Math.min(this._bufferService.cols,K-F+j+E-D-P);if(b||N.slice(F,K).trim()!==""){if(R&&O===0&&T.getCodePoint(0)!==32){const V=B.lines.get(y[1]-1);if(V&&T.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(J){const Z=this._bufferService.cols-J.start;O-=Z,W+=Z}}}if(M&&O+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(y[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const J=this._getWordAt([0,y[1]+1],!1,!1,!0);J&&(W+=J.length)}}return{start:O,length:W}}}_selectWordAt(y,b){const R=this._getWordAt(y,b);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[R.start,y[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(y){const b=this._getWordAt(y,!0);if(b){let R=y[1];for(;b.start<0;)b.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const b=this._bufferService.buffer.getWrappedRangeForLine(y),R={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};a.SelectionService=k=f([g(3,_.IBufferService),g(4,_.ICoreService),g(5,w.IMouseService),g(6,_.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],k)},4725:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=c(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(m,a,c){var f=this&&this.__decorate||function(k,y,b,R){var M,B=arguments.length,T=B<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,y,b,R);else for(var N=k.length-1;N>=0;N--)(M=k[N])&&(T=(B<3?M(T):B>3?M(y,b,T):M(y,b))||T);return B>3&&T&&Object.defineProperty(y,b,T),T},g=this&&this.__param||function(k,y){return function(b,R){y(b,R,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),p=c(8055),S=c(8460),w=c(844),v=c(2585),u=p.css.toColor("#ffffff"),o=p.css.toColor("#000000"),s=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=y[b/36%6|0],M=y[b/6%6|0],B=y[b%6];k.push({css:p.channels.toCss(R,M,B),rgba:p.channels.toRgba(R,M,B)})}for(let b=0;b<24;b++){const R=8+10*b;k.push({css:p.channels.toCss(R,R,R),rgba:p.channels.toRgba(R,R,R)})}return k})());let C=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:o,cursor:s,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:p.color.blend(o,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:p.color.blend(o,_),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(k={}){const y=this._colors;if(y.foreground=x(k.foreground,u),y.background=x(k.background,o),y.cursor=x(k.cursor,s),y.cursorAccent=x(k.cursorAccent,l),y.selectionBackgroundTransparent=x(k.selectionBackground,_),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(k.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=k.selectionForeground?x(k.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=a.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(k.black,a.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(k.red,a.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(k.green,a.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(k.yellow,a.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(k.blue,a.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(k.magenta,a.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(k.cyan,a.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(k.white,a.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(k.brightBlack,a.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(k.brightRed,a.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(k.brightGreen,a.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(k.brightYellow,a.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(k.brightBlue,a.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(k.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(k.brightCyan,a.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(k.brightWhite,a.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(y.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<b;R++)y.ansi[R+16]=x(k.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[k]=this._restoreColors.ansi[k]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function x(k,y){if(k!==void 0)try{return p.css.toColor(k)}catch{}return y}a.ThemeService=C=f([g(0,v.IOptionsService)],C)},6349:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const w=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)w[v]=this._array[this._getCyclicIndex(v)];this._array=w,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let w=this._length;w<S;w++)this._array[w]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,w){this._array[this._getCyclicIndex(S)]=w}push(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(S,w,...v){if(w){for(let u=S;u<this._length-w;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let u=this._length-1;u>=S;u--)this._array[this._getCyclicIndex(u+v.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<v.length;u++)this._array[this._getCyclicIndex(S+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:S,amount:v.length}),this._length+v.length>this._maxLength){const u=this._length+v.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=v.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,v){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let o=w-1;o>=0;o--)this.set(S+o+v,this.get(S+o));const u=S+w+v-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<w;u++)this.set(S+u+v,this.get(S+u))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(f,g=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const p in f)d[p]=g<=1?f[p]:f[p]&&c(f[p],g-1);return d}},8055:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,f=0,g=0,d=0;var p,S,w,v,u;function o(l){const _=l.toString(16);return _.length<2?"0"+_:_}function s(l,_){return l<_?(_+.05)/(l+.05):(l+.05)/(_+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(l){l.toCss=function(_,C,x,k){return k!==void 0?`#${o(_)}${o(C)}${o(x)}${o(k)}`:`#${o(_)}${o(C)}${o(x)}`},l.toRgba=function(_,C,x,k=255){return(_<<24|C<<16|x<<8|k)>>>0},l.toColor=function(_,C,x,k){return{css:l.toCss(_,C,x,k),rgba:l.toRgba(_,C,x,k)}}}(p||(a.channels=p={})),function(l){function _(C,x){return d=Math.round(255*x),[c,f,g]=u.toChannels(C.rgba),{css:p.toCss(c,f,g,d),rgba:p.toRgba(c,f,g,d)}}l.blend=function(C,x){if(d=(255&x.rgba)/255,d===1)return{css:x.css,rgba:x.rgba};const k=x.rgba>>24&255,y=x.rgba>>16&255,b=x.rgba>>8&255,R=C.rgba>>24&255,M=C.rgba>>16&255,B=C.rgba>>8&255;return c=R+Math.round((k-R)*d),f=M+Math.round((y-M)*d),g=B+Math.round((b-B)*d),{css:p.toCss(c,f,g),rgba:p.toRgba(c,f,g)}},l.isOpaque=function(C){return(255&C.rgba)==255},l.ensureContrastRatio=function(C,x,k){const y=u.ensureContrastRatio(C.rgba,x.rgba,k);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},l.opaque=function(C){const x=(255|C.rgba)>>>0;return[c,f,g]=u.toChannels(x),{css:p.toCss(c,f,g),rgba:x}},l.opacity=_,l.multiplyOpacity=function(C,x){return d=255&C.rgba,_(C,d*x/255)},l.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(S||(a.color=S={})),function(l){let _,C;try{const x=document.createElement("canvas");x.width=1,x.height=1;const k=x.getContext("2d",{willReadFrequently:!0});k&&(_=k,_.globalCompositeOperation="copy",C=_.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),p.toColor(c,f,g);case 5:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),d=parseInt(x.slice(4,5).repeat(2),16),p.toColor(c,f,g,d);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const k=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return c=parseInt(k[1]),f=parseInt(k[2]),g=parseInt(k[3]),d=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),p.toColor(c,f,g,d);if(!_||!C)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=C,_.fillStyle=x,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[c,f,g,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,f,g,d),css:x}}}(w||(a.css=w={})),function(l){function _(C,x,k){const y=C/255,b=x/255,R=k/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}l.relativeLuminance=function(C){return _(C>>16&255,C>>8&255,255&C)},l.relativeLuminance2=_}(v||(a.rgb=v={})),function(l){function _(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,M));for(;F<y&&(B>0||T>0||N>0);)B-=Math.max(0,Math.ceil(.1*B)),T-=Math.max(0,Math.ceil(.1*T)),N-=Math.max(0,Math.ceil(.1*N)),F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}function C(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,M));for(;F<y&&(B<255||T<255||N<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),T=Math.min(255,T+Math.ceil(.1*(255-T))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}l.blend=function(x,k){if(d=(255&k)/255,d===1)return k;const y=k>>24&255,b=k>>16&255,R=k>>8&255,M=x>>24&255,B=x>>16&255,T=x>>8&255;return c=M+Math.round((y-M)*d),f=B+Math.round((b-B)*d),g=T+Math.round((R-T)*d),p.toRgba(c,f,g)},l.ensureContrastRatio=function(x,k,y){const b=v.relativeLuminance(x>>8),R=v.relativeLuminance(k>>8);if(s(b,R)<y){if(R<b){const T=_(x,k,y),N=s(b,v.relativeLuminance(T>>8));if(N<y){const F=C(x,k,y);return N>s(b,v.relativeLuminance(F>>8))?T:F}return T}const M=C(x,k,y),B=s(b,v.relativeLuminance(M>>8));if(B<y){const T=_(x,k,y);return B>s(b,v.relativeLuminance(T>>8))?M:T}return M}},l.reduceLuminance=_,l.increaseLuminance=C,l.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(u||(a.rgba=u={})),a.toPaddedHex=o,a.contrastRatio=s},8969:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=c(844),g=c(2585),d=c(4348),p=c(7866),S=c(744),w=c(7302),v=c(6975),u=c(8460),o=c(1753),s=c(1480),l=c(7994),_=c(9282),C=c(5435),x=c(5981),k=c(2660);let y=!1;class b extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(M=>{var B;(B=this._onScrollApi)==null||B.fire(M.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(M){for(const B in M)this.optionsService.options[B]=M[B]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new x.WriteBuffer((B,T)=>this._inputHandler.parse(B,T))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,B){this._writeBuffer.write(M,B)}writeSync(M,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(M,B)}input(M,B=!0){this.coreService.triggerDataEvent(M,B)}resize(M,B){isNaN(M)||isNaN(B)||(M=Math.max(M,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(M,B))}scroll(M,B=!1){this._bufferService.scroll(M,B)}scrollLines(M,B,T){this._bufferService.scrollLines(M,B,T)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const B=M-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(M,B){return this._inputHandler.registerEscHandler(M,B)}registerDcsHandler(M,B){return this._inputHandler.registerDcsHandler(M,B)}registerCsiHandler(M,B){return this._inputHandler.registerCsiHandler(M,B)}registerOscHandler(M,B){return this._inputHandler.registerOscHandler(M,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?M=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const B of M)B.dispose()})}}}a.CoreTerminal=b},8460:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,f){return c(g=>f.fire(g))},a.runAndSubscribe=function(c,f){return f(void 0),c(g=>f(g))}},5435:function(m,a,c){var f=this&&this.__decorate||function(j,E,D,P){var O,W=arguments.length,V=W<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,E,D,P);else for(var J=j.length-1;J>=0;J--)(O=j[J])&&(V=(W<3?O(V):W>3?O(E,D,V):O(E,D))||V);return W>3&&V&&Object.defineProperty(E,D,V),V},g=this&&this.__param||function(j,E){return function(D,P){E(D,P,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),p=c(7116),S=c(2015),w=c(844),v=c(482),u=c(8437),o=c(8460),s=c(643),l=c(511),_=c(3734),C=c(2585),x=c(1480),k=c(6242),y=c(6351),b=c(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function B(j,E){if(j>24)return E.setWinLines||!1;switch(j){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var T;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let N=0;class F extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,P,O,W,V,J,Z,I=new S.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=P,this._logService=O,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=J,this._unicodeService=Z,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:U.toArray()})}),this._parser.setEscHandlerFallback(L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})}),this._parser.setExecuteHandlerFallback(L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})}),this._parser.setOscHandlerFallback((L,U,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:U,data:H})}),this._parser.setDcsHandlerFallback((L,U,H)=>{U==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:U,payload:H})}),this._parser.setPrintHandler((L,U,H)=>this.print(L,U,H)),this._parser.registerCsiHandler({final:"@"},L=>this.insertChars(L)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},L=>this.scrollLeft(L)),this._parser.registerCsiHandler({final:"A"},L=>this.cursorUp(L)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},L=>this.scrollRight(L)),this._parser.registerCsiHandler({final:"B"},L=>this.cursorDown(L)),this._parser.registerCsiHandler({final:"C"},L=>this.cursorForward(L)),this._parser.registerCsiHandler({final:"D"},L=>this.cursorBackward(L)),this._parser.registerCsiHandler({final:"E"},L=>this.cursorNextLine(L)),this._parser.registerCsiHandler({final:"F"},L=>this.cursorPrecedingLine(L)),this._parser.registerCsiHandler({final:"G"},L=>this.cursorCharAbsolute(L)),this._parser.registerCsiHandler({final:"H"},L=>this.cursorPosition(L)),this._parser.registerCsiHandler({final:"I"},L=>this.cursorForwardTab(L)),this._parser.registerCsiHandler({final:"J"},L=>this.eraseInDisplay(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},L=>this.eraseInDisplay(L,!0)),this._parser.registerCsiHandler({final:"K"},L=>this.eraseInLine(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},L=>this.eraseInLine(L,!0)),this._parser.registerCsiHandler({final:"L"},L=>this.insertLines(L)),this._parser.registerCsiHandler({final:"M"},L=>this.deleteLines(L)),this._parser.registerCsiHandler({final:"P"},L=>this.deleteChars(L)),this._parser.registerCsiHandler({final:"S"},L=>this.scrollUp(L)),this._parser.registerCsiHandler({final:"T"},L=>this.scrollDown(L)),this._parser.registerCsiHandler({final:"X"},L=>this.eraseChars(L)),this._parser.registerCsiHandler({final:"Z"},L=>this.cursorBackwardTab(L)),this._parser.registerCsiHandler({final:"`"},L=>this.charPosAbsolute(L)),this._parser.registerCsiHandler({final:"a"},L=>this.hPositionRelative(L)),this._parser.registerCsiHandler({final:"b"},L=>this.repeatPrecedingCharacter(L)),this._parser.registerCsiHandler({final:"c"},L=>this.sendDeviceAttributesPrimary(L)),this._parser.registerCsiHandler({prefix:">",final:"c"},L=>this.sendDeviceAttributesSecondary(L)),this._parser.registerCsiHandler({final:"d"},L=>this.linePosAbsolute(L)),this._parser.registerCsiHandler({final:"e"},L=>this.vPositionRelative(L)),this._parser.registerCsiHandler({final:"f"},L=>this.hVPosition(L)),this._parser.registerCsiHandler({final:"g"},L=>this.tabClear(L)),this._parser.registerCsiHandler({final:"h"},L=>this.setMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"h"},L=>this.setModePrivate(L)),this._parser.registerCsiHandler({final:"l"},L=>this.resetMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"l"},L=>this.resetModePrivate(L)),this._parser.registerCsiHandler({final:"m"},L=>this.charAttributes(L)),this._parser.registerCsiHandler({final:"n"},L=>this.deviceStatus(L)),this._parser.registerCsiHandler({prefix:"?",final:"n"},L=>this.deviceStatusPrivate(L)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},L=>this.softReset(L)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},L=>this.setCursorStyle(L)),this._parser.registerCsiHandler({final:"r"},L=>this.setScrollRegion(L)),this._parser.registerCsiHandler({final:"s"},L=>this.saveCursor(L)),this._parser.registerCsiHandler({final:"t"},L=>this.windowOptions(L)),this._parser.registerCsiHandler({final:"u"},L=>this.restoreCursor(L)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},L=>this.insertColumns(L)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},L=>this.deleteColumns(L)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},L=>this.selectProtected(L)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},L=>this.requestMode(L,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},L=>this.requestMode(L,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new k.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new k.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new k.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new k.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new k.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new k.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new k.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new k.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new k.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new k.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new k.OscHandler(L=>this.restoreCursorColor(L))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const L in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},()=>this.selectCharset("("+L)),this._parser.registerEscHandler({intermediates:")",final:L},()=>this.selectCharset(")"+L)),this._parser.registerEscHandler({intermediates:"*",final:L},()=>this.selectCharset("*"+L)),this._parser.registerEscHandler({intermediates:"+",final:L},()=>this.selectCharset("+"+L)),this._parser.registerEscHandler({intermediates:"-",final:L},()=>this.selectCharset("-"+L)),this._parser.registerEscHandler({intermediates:".",final:L},()=>this.selectCharset("."+L)),this._parser.registerEscHandler({intermediates:"/",final:L},()=>this.selectCharset("/"+L));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(L=>(this._logService.error("Parsing error: ",L),L)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler((L,U)=>this.requestStatusString(L,U)))}_preserveStack(E,D,P,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=P,this._parseStack.position=O}_logSlowResolvingAsync(E){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let P,O=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(P),P;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>M&&(V=this._parseStack.position+M)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,L=>String.fromCharCode(L)).join("")}"`),typeof E=="string"?E.split("").map(L=>L.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(E.length,M))),J||this._dirtyRowTracker.clearRange(),E.length>M)for(let L=V;L<E.length;L+=M){const U=L+M<E.length?L+M:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(L,U),this._parseBuffer):this._utf8Decoder.decode(E.subarray(L,U),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,H))return this._preserveStack(O,W,H,L),this._logSlowResolvingAsync(P),P}else if(!J){const L=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,L))return this._preserveStack(O,W,L,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(E,D,P){let O,W;const V=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,U=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let X=this._parser.precedingJoinState;for(let G=D;G<P;++G){if(O=E[G],O<127&&V){const ne=V[String.fromCharCode(O)];ne&&(O=ne.charCodeAt(0))}const se=this._unicodeService.charProperties(O,X);W=x.UnicodeService.extractWidth(se);const z=x.UnicodeService.extractShouldJoin(se),re=z?x.UnicodeService.extractWidth(X):0;if(X=se,J&&this._onA11yChar.fire((0,v.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-re>Z){if(I){const ne=H;let ee=this._activeBuffer.x-re;for(this._activeBuffer.x=re,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),re>0&&H instanceof u.BufferLine&&H.copyCellsFrom(ne,ee,0,re,!1);ee<Z;)ne.setCellFromCodepoint(ee++,0,1,U)}else if(this._activeBuffer.x=Z-1,W===2)continue}if(z&&this._activeBuffer.x){const ne=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ne,O,W);for(let ee=W-re;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(L&&(H.insertCells(this._activeBuffer.x,W-re,this._activeBuffer.getNullCell(U)),H.getWidth(Z-1)===2&&H.setCellFromCodepoint(Z-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,U)),H.setCellFromCodepoint(this._activeBuffer.x++,O,W,U),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=X,this._activeBuffer.x<Z&&P-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,U),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,P=>!B(P.params[0],this._optionsService.rawOptions.windowOptions)||D(P))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new y.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var E;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(E,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,P,O=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);V.replaceCells(D,P,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(V.isWrapped=!1)}_resetBufferLine(E,D=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,D=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);P<this._bufferService.rows;P++)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;D--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;D--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(E){let D=E.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){const D=this._parser.precedingJoinState;if(!D)return!0;const P=E.params[0]||1,O=x.UnicodeService.extractWidth(D),W=this._activeBuffer.x-O,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),J=new Uint32Array(V.length*P);let Z=0;for(let L=0;L<V.length;){const U=V.codePointAt(L)||0;J[Z++]=U,L+=U>65535?2:1}let I=Z;for(let L=1;L<P;++L)J.copyWithin(I,0,Z),I+=Z;return this.print(J,0,I),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),E.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(E,D){const P=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:J,cols:Z}=this._bufferService,{active:I,alt:L}=J,U=this._optionsService.rawOptions,H=z=>z?1:2,X=E.params[0];return G=X,se=D?X===2?4:X===4?H(V.modes.insertMode):X===12?3:X===20?H(U.convertEol):0:X===1?H(P.applicationCursorKeys):X===3?U.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:X===6?H(P.origin):X===7?H(P.wraparound):X===8?3:X===9?H(O==="X10"):X===12?H(U.cursorBlink):X===25?H(!V.isCursorHidden):X===45?H(P.reverseWraparound):X===66?H(P.applicationKeypad):X===67?4:X===1e3?H(O==="VT200"):X===1002?H(O==="DRAG"):X===1003?H(O==="ANY"):X===1004?H(P.sendFocus):X===1005?4:X===1006?H(W==="SGR"):X===1015?4:X===1016?H(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?H(I===L):X===2004?H(P.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${D?"":"?"}${G};${se}$y`),!0;var G,se}_updateAttrColor(E,D,P,O,W){return D===2?(E|=50331648,E&=-16777216,E|=_.AttributeData.fromColorRGB([P,O,W])):D===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,D,P){const O=[0,0,-1,0,0,0];let W=0,V=0;do{if(O[V+W]=E.params[D+V],E.hasSubParams(D+V)){const J=E.getSubParams(D+V);let Z=0;do O[1]===5&&(W=1),O[V+Z+1+W]=J[Z];while(++Z<J.length&&Z+V+1+W<O.length);break}if(O[1]===5&&V+W>=2||O[1]===2&&V+W>=5)break;O[1]&&(W=1)}while(++V+D<E.length&&V+W<O.length);for(let J=2;J<O.length;++J)O[J]===-1&&(O[J]=0);switch(O[0]){case 38:P.fg=this._updateAttrColor(P.fg,O[1],O[3],O[4],O[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,O[1],O[3],O[4],O[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,O[1],O[3],O[4],O[5])}return V}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=E.length;let P;const O=this._curAttrData;for(let W=0;W<D;W++)P=E.params[W],P>=30&&P<=37?(O.fg&=-50331904,O.fg|=16777216|P-30):P>=40&&P<=47?(O.bg&=-50331904,O.bg|=16777216|P-40):P>=90&&P<=97?(O.fg&=-50331904,O.fg|=16777224|P-90):P>=100&&P<=107?(O.bg&=-50331904,O.bg|=16777224|P-100):P===0?this._processSGR0(O):P===1?O.fg|=134217728:P===3?O.bg|=67108864:P===4?(O.fg|=268435456,this._processUnderline(E.hasSubParams(W)?E.getSubParams(W)[0]:1,O)):P===5?O.fg|=536870912:P===7?O.fg|=67108864:P===8?O.fg|=1073741824:P===9?O.fg|=2147483648:P===2?O.bg|=134217728:P===21?this._processUnderline(2,O):P===22?(O.fg&=-134217729,O.bg&=-134217729):P===23?O.bg&=-67108865:P===24?(O.fg&=-268435457,this._processUnderline(0,O)):P===25?O.fg&=-536870913:P===27?O.fg&=-67108865:P===28?O.fg&=-1073741825:P===29?O.fg&=2147483647:P===39?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):P===49?(O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?W+=this._extractColor(E,W,O):P===53?O.bg|=1073741824:P===55?O.bg&=-1073741825:P===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):P===100?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${D};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${D};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(E){const D=E.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=D%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const D=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!B(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(E){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const D=[],P=E.split(";");for(;P.length>1;){const O=P.shift(),W=P.shift();if(/^\d+$/.exec(O)){const V=parseInt(O);if(q(V))if(W==="?")D.push({type:0,index:V});else{const J=(0,b.parseColor)(W);J&&D.push({type:1,index:V,color:J})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let O;const W=P.findIndex(V=>V.startsWith("id="));return W!==-1&&(O=P[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const P=E.split(";");for(let O=0;O<P.length&&!(D>=this._specialColors.length);++O,++D)if(P[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,b.parseColor)(P[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const D=[],P=E.split(";");for(let O=0;O<P.length;++O)if(/^\d+$/.exec(P[O])){const W=parseInt(P[O]);q(W)&&D.push({type:2,index:W})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(R[E[0]],p.CHARSETS[E[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new l.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const P=this._activeBuffer.ybase+this._activeBuffer.y+D,O=this._activeBuffer.lines.get(P);O&&(O.fill(E),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const P=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}a.InputHandler=F;let K=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(j){return 0<=j&&j<256}K=f([g(0,C.IBufferService)],K)},844:(m,a)=>{function c(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=c,a.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,p){this._data[g]||(this._data[g]={}),this._data[g][d]=p}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(f,g,d,p,S){this._data.get(f,g)||this._data.set(f,g,new c),this._data.get(f,g).set(d,p,S)}get(f,g,d,p){var S;return(S=this._data.get(f,g))==null?void 0:S.get(d,p)}clear(){this._data.clear()}}},6114:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,g){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let g=0,d=this._array.length-1;for(;d>=g;){let p=g+d>>1;const S=this._getKey(this._array[p]);if(S>f)d=p-1;else{if(!(S<f)){for(;p>0&&this._getKey(this._array[p-1])===f;)p--;return p}g=p+1}}return g}}},7226:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let w=0,v=0,u=S.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),v=Math.max(w,v),o=S.timeRemaining(),1.5*v>o)return u-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-w))}ms`),void this._start();u=o}this.clear()}}class d extends g{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&p&&(S.isWrapped=p[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&p[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=c(6349),g=c(7226),d=c(3734),p=c(8437),S=c(4634),w=c(511),v=c(643),u=c(4863),o=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(s,l,_){this._hasScrollback=s,this._optionsService=l,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(s),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const l=s+this._optionsService.rawOptions.scrollback;return l>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:l}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=0;const x=this._getCorrectBufferLength(l);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let y=0;y<this.lines.length;y++)C+=+this.lines.get(y).resize(s,_);let k=0;if(this._rows<l)for(let y=this._rows;y<l;y++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(s,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(s,_)));else for(let y=this._rows;y>l;y--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const y=this.lines.length-x;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,l-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(s,l),this._cols>s))for(let k=0;k<this.lines.length;k++)C+=+this.lines.get(k).resize(s,_);this._cols=s,this._rows=l,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,l){this._cols!==s&&(s>this._cols?this._reflowLarger(s,l):this._reflowSmaller(s,l))}_reflowLarger(s,l){const _=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(_.length>0){const C=(0,S.reflowLargerCreateNewLayout)(this.lines,_);(0,S.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(s,l,C.countRemoved)}}_reflowLargerAdjustViewport(s,l,_){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=_;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(s,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(s,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA),C=[];let x=0;for(let k=this.lines.length-1;k>=0;k--){let y=this.lines.get(k);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const b=[y];for(;y.isWrapped&&k>0;)y=this.lines.get(--k),b.unshift(y);const R=this.ybase+this.y;if(R>=k&&R<k+b.length)continue;const M=b[b.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(b,this._cols,s),T=B.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const F=[];for(let P=0;P<T;P++){const O=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(O)}F.length>0&&(C.push({start:k+b.length+x,newLines:F}),x+=F.length),b.push(...F);let K=B.length-1,q=B[K];q===0&&(K--,q=B[K]);let j=b.length-T-1,E=M;for(;j>=0;){const P=Math.min(E,q);if(b[K]===void 0)break;if(b[K].copyCellsFrom(b[j],E-P,q-P,P,!0),q-=P,q===0&&(K--,q=B[K]),E-=P,E===0){j--;const O=Math.max(j,0);E=(0,S.getWrappedLineTrimmedLength)(b,O,this._cols)}}for(let P=0;P<b.length;P++)B[P]<s&&b[P].setCell(B[P],_);let D=T-N;for(;D-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+l-1)}if(C.length>0){const k=[],y=[];for(let K=0;K<this.lines.length;K++)y.push(this.lines.get(K));const b=this.lines.length;let R=b-1,M=0,B=C[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let T=0;for(let K=Math.min(this.lines.maxLength-1,b+x-1);K>=0;K--)if(B&&B.start>R+T){for(let q=B.newLines.length-1;q>=0;q--)this.lines.set(K--,B.newLines[q]);K++,k.push({index:R+1,amount:B.newLines.length}),T+=B.newLines.length,B=C[++M]}else this.lines.set(K,y[R--]);let N=0;for(let K=k.length-1;K>=0;K--)k[K].index+=N,this.lines.onInsertEmitter.fire(k[K]),N+=k[K].amount;const F=Math.max(0,b+x-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(s,l,_=0,C){const x=this.lines.get(s);return x?x.translateToString(l,_,C):""}getWrappedRangeForLine(s){let l=s,_=s;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:l,last:_}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===s&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const l=new u.Marker(s);return this.markers.push(l),l.register(this.lines.onTrim(_=>{l.line-=_,l.line<0&&l.dispose()})),l.register(this.lines.onInsert(_=>{l.line>=_.index&&(l.line+=_.amount)})),l.register(this.lines.onDelete(_=>{l.line>=_.index&&l.line<_.index+_.amount&&l.dispose(),l.line>_.index&&(l.line-=_.amount)})),l.register(l.onDispose(()=>this._removeMarker(l))),l}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=c(3734),g=c(511),d=c(643),p=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class w{constructor(u,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const l=o||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let _=0;_<u;++_)this.setCell(_,l);this.length=u}get(u){const o=this._data[3*u+0],s=2097151&o;return[this._data[3*u+1],2097152&o?this._combined[u]:s?(0,p.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,o){this._data[3*u+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=o[1],this._data[3*u+0]=2097152|u|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&o}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u]:2097151&o?(0,p.stringFromCodePoint)(2097151&o):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,o){return S=3*u,o.content=this._data[S+0],o.fg=this._data[S+1],o.bg=this._data[S+2],2097152&o.content&&(o.combinedData=this._combined[u]),268435456&o.bg&&(o.extended=this._extendedAttrs[u]),o}setCell(u,o){2097152&o.content&&(this._combined[u]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[u]=o.extended),this._data[3*u+0]=o.content,this._data[3*u+1]=o.fg,this._data[3*u+2]=o.bg}setCellFromCodepoint(u,o,s,l){268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=o|s<<22,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}addCodepointToCell(u,o,s){let l=this._data[3*u+0];2097152&l?this._combined[u]+=(0,p.stringFromCodePoint)(o):2097151&l?(this._combined[u]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,s&&(l&=-12582913,l|=s<<22),this._data[3*u+0]=l}insertCells(u,o,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length-u){const l=new g.CellData;for(let _=this.length-u-o-1;_>=0;--_)this.setCell(u+o+_,this.loadCell(u+_,l));for(let _=0;_<o;++_)this.setCell(u+_,s)}else for(let l=u;l<this.length;++l)this.setCell(l,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,o,s){if(u%=this.length,o<this.length-u){const l=new g.CellData;for(let _=0;_<this.length-u-o;++_)this.setCell(u+_,this.loadCell(u+o+_,l));for(let _=this.length-o;_<this.length;++_)this.setCell(_,s)}else for(let l=u;l<this.length;++l)this.setCell(l,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,o,s,l=!1){if(l)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.setCell(u++,s)}resize(u,o){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const l=new Uint32Array(s);l.set(this._data),this._data=l}for(let l=this.length;l<u;++l)this.setCell(l,o)}else{this._data=this._data.subarray(0,s);const l=Object.keys(this._combined);for(let C=0;C<l.length;C++){const x=parseInt(l[C],10);x>=u&&delete this._combined[x]}const _=Object.keys(this._extendedAttrs);for(let C=0;C<_.length;C++){const x=parseInt(_[C],10);x>=u&&delete this._extendedAttrs[x]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const o in u._combined)this._combined[o]=u._combined[o];this._extendedAttrs={};for(const o in u._extendedAttrs)this._extendedAttrs[o]=u._extendedAttrs[o];this.isWrapped=u.isWrapped}clone(){const u=new w(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const o in this._combined)u._combined[o]=this._combined[o];for(const o in this._extendedAttrs)u._extendedAttrs[o]=this._extendedAttrs[o];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,o,s,l,_){const C=u._data;if(_)for(let k=l-1;k>=0;k--){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}else for(let k=0;k<l;k++){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}const x=Object.keys(u._combined);for(let k=0;k<x.length;k++){const y=parseInt(x[k],10);y>=o&&(this._combined[y-o+s]=u._combined[y])}}translateToString(u,o,s,l){o=o??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),l&&(l.length=0);let _="";for(;o<s;){const C=this._data[3*o+0],x=2097151&C,k=2097152&C?this._combined[o]:x?(0,p.stringFromCodePoint)(x):d.WHITESPACE_CELL_CHAR;if(_+=k,l)for(let y=0;y<k.length;++y)l.push(o);o+=C>>22||1}return l&&l.push(o),_}}a.BufferLine=w},4841:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(m,a)=>{function c(f,g,d){if(g===f.length-1)return f[g].getTrimmedLength();const p=!f[g].hasContent(d-1)&&f[g].getWidth(d-1)===1,S=f[g+1].getWidth(0)===2;return p&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,g,d,p,S){const w=[];for(let v=0;v<f.length-1;v++){let u=v,o=f.get(++u);if(!o.isWrapped)continue;const s=[f.get(v)];for(;u<f.length&&o.isWrapped;)s.push(o),o=f.get(++u);if(p>=v&&p<u){v+=s.length-1;continue}let l=0,_=c(s,l,g),C=1,x=0;for(;C<s.length;){const y=c(s,C,g),b=y-x,R=d-_,M=Math.min(b,R);s[l].copyCellsFrom(s[C],x,_,M,!1),_+=M,_===d&&(l++,_=0),x+=M,x===y&&(C++,x=0),_===0&&l!==0&&s[l-1].getWidth(d-1)===2&&(s[l].copyCellsFrom(s[l-1],d-1,_++,1,!1),s[l-1].setCell(d-1,S))}s[l].replaceCells(_,d,S);let k=0;for(let y=s.length-1;y>0&&(y>l||s[y].getTrimmedLength()===0);y--)k++;k>0&&(w.push(v+s.length-k),w.push(k)),v+=s.length-1}return w},a.reflowLargerCreateNewLayout=function(f,g){const d=[];let p=0,S=g[p],w=0;for(let v=0;v<f.length;v++)if(S===v){const u=g[++p];f.onDeleteEmitter.fire({index:v-w,amount:u}),v+=u-1,w+=u,S=g[++p]}else d.push(v);return{layout:d,countRemoved:w}},a.reflowLargerApplyNewLayout=function(f,g){const d=[];for(let p=0;p<g.length;p++)d.push(f.get(g[p]));for(let p=0;p<d.length;p++)f.set(p,d[p]);f.length=g.length},a.reflowSmallerGetNewLineLengths=function(f,g,d){const p=[],S=f.map((o,s)=>c(f,s,g)).reduce((o,s)=>o+s);let w=0,v=0,u=0;for(;u<S;){if(S-u<d){p.push(S-u);break}w+=d;const o=c(f,v,g);w>o&&(w-=o,v++);const s=f[v].getWidth(w-1)===2;s&&w--;const l=s?d-1:d;p.push(l),u+=l}return p},a.getWrappedLineTrimmedLength=c},5295:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=c(8460),g=c(844),d=c(9092);class p extends g.Disposable{constructor(w,v){super(),this._optionsService=w,this._bufferService=v,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,v){this._normal.resize(w,v),this._alt.resize(w,v),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=p},511:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=c(482),g=c(643),d=c(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const v=new p;return v.setFromCharData(w),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const u=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(u-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=p},643:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=c(8460),g=c(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,a)=>{var c,f,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
63
63
  `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(a.C0=c={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(f||(a.C1=f={})),function(d){d.ST=`${c.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(d,p,S,w){const v={type:0,cancel:!1,key:void 0},u=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?v.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?v.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?v.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(v.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:v.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(v.key=f.C0.ESC+v.key);break;case 9:if(d.shiftKey){v.key=f.C0.ESC+"[Z";break}v.key=f.C0.HT,v.cancel=!0;break;case 13:v.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,v.cancel=!0;break;case 27:v.key=f.C0.ESC,d.altKey&&(v.key=f.C0.ESC+f.C0.ESC),v.cancel=!0;break;case 37:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"D",v.key===f.C0.ESC+"[1;3D"&&(v.key=f.C0.ESC+(S?"b":"[1;5D"))):v.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"C",v.key===f.C0.ESC+"[1;3C"&&(v.key=f.C0.ESC+(S?"f":"[1;5C"))):v.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"A",S||v.key!==f.C0.ESC+"[1;3A"||(v.key=f.C0.ESC+"[1;5A")):v.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"B",S||v.key!==f.C0.ESC+"[1;3B"||(v.key=f.C0.ESC+"[1;5B")):v.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(v.key=f.C0.ESC+"[2~");break;case 46:v.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:v.key=u?f.C0.ESC+"[1;"+(u+1)+"H":p?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:v.key=u?f.C0.ESC+"[1;"+(u+1)+"F":p?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?v.type=2:d.ctrlKey?v.key=f.C0.ESC+"[5;"+(u+1)+"~":v.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?v.type=3:d.ctrlKey?v.key=f.C0.ESC+"[6;"+(u+1)+"~":v.key=f.C0.ESC+"[6~";break;case 112:v.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:v.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:v.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:v.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:v.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:v.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:v.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:v.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:v.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:v.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:v.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:v.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!w||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?v.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(v.key=f.C0.US),d.key==="@"&&(v.key=f.C0.NUL)):d.keyCode===65&&(v.type=1);else{const o=g[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)v.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const l=d.ctrlKey?d.keyCode-64:d.keyCode+32;let _=String.fromCharCode(l);d.shiftKey&&(_=_.toUpperCase()),v.key=f.C0.ESC+_}else if(d.keyCode===32)v.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let l=d.code.slice(3,4);d.shiftKey||(l=l.toLowerCase()),v.key=f.C0.ESC+l,v.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?v.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?v.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?v.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?v.key=f.C0.DEL:d.keyCode===219?v.key=f.C0.ESC:d.keyCode===220?v.key=f.C0.FS:d.keyCode===221&&(v.key=f.C0.GS)}return v}},482:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,f=0,g=c.length){let d="";for(let p=f;p<g;++p){let S=c[p];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const g=c.length;if(!g)return 0;let d=0,p=0;if(this._interim){const S=c.charCodeAt(p++);56320<=S&&S<=57343?f[d++]=1024*(this._interim-55296)+S-56320+65536:(f[d++]=this._interim,f[d++]=S),this._interim=0}for(let S=p;S<g;++S){const w=c.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=g)return this._interim=w,d;const v=c.charCodeAt(S);56320<=v&&v<=57343?f[d++]=1024*(w-55296)+v-56320+65536:(f[d++]=w,f[d++]=v)}else w!==65279&&(f[d++]=w)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const g=c.length;if(!g)return 0;let d,p,S,w,v=0,u=0,o=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let x,k=0;for(;(x=63&this.interim[++k])&&k<4;)C<<=6,C|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=y-k;for(;o<b;){if(o>=g)return 0;if(x=c[o++],(192&x)!=128){o--,_=!0;break}this.interim[k++]=x,C<<=6,C|=63&x}_||(y===2?C<128?o--:f[v++]=C:y===3?C<2048||C>=55296&&C<=57343||C===65279||(f[v++]=C):C<65536||C>1114111||(f[v++]=C)),this.interim.fill(0)}const s=g-4;let l=o;for(;l<g;){for(;!(!(l<s)||128&(d=c[l])||128&(p=c[l+1])||128&(S=c[l+2])||128&(w=c[l+3]));)f[v++]=d,f[v++]=p,f[v++]=S,f[v++]=w,l+=4;if(d=c[l++],d<128)f[v++]=d;else if((224&d)==192){if(l>=g)return this.interim[0]=d,v;if(p=c[l++],(192&p)!=128){l--;continue}if(u=(31&d)<<6|63&p,u<128){l--;continue}f[v++]=u}else if((240&d)==224){if(l>=g)return this.interim[0]=d,v;if(p=c[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,v;if(S=c[l++],(192&S)!=128){l--;continue}if(u=(15&d)<<12|(63&p)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[v++]=u}else if((248&d)==240){if(l>=g)return this.interim[0]=d,v;if(p=c[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,v;if(S=c[l++],(192&S)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=S,v;if(w=c[l++],(192&w)!=128){l--;continue}if(u=(7&d)<<18|(63&p)<<12|(63&S)<<6|63&w,u<65536||u>1114111)continue;f[v++]=u}}return v}}},225:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=c(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;a.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<g.length;++S)p.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:function(w,v){let u,o=0,s=v.length-1;if(w<v[0][0]||w>v[s][1])return!1;for(;s>=o;)if(u=o+s>>1,w>v[u][1])o=u+1;else{if(!(w<v[u][0]))return!0;s=u-1}return!1}(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let v=this.wcwidth(S),u=v===0&&w!==0;if(u){const o=f.UnicodeService.extractWidth(w);o===0?u=!1:o>v&&(v=o)}return f.UnicodeService.createPropertyValue(0,v,u)}}},5981:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w)}_innerWrite(S=0,w=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],o=this._action(u,w);if(o){const l=_=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(v,_);return void o.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(l)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=d},5941:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function g(d,p){const S=d.toString(16),w=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=c.exec(p);if(S){const w=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/w*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/w*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),f.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,w=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(p.slice(S*v,S*v+S),16);w[v]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return w}},a.toRgbString=function(d,p=16){const[S,w,v]=d;return`rgb:${g(S,p)}/${g(w,p)}/${g(v,p)}`}},5770:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=c(482),g=c(8742),d=c(5770),p=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,v){this._handlers[w]===void 0&&(this._handlers[w]=[]);const u=this._handlers[w];return u.push(v),{dispose:()=>{const o=u.indexOf(v);o!==-1&&u.splice(o,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,v){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(w,v,u){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,v,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,v,u))}unhook(w,v=!0){if(this._active.length){let u=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,u=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;o>=0&&(u=this._active[o].unhook(w),u!==!0);o--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,u;o--}for(;o>=0;o--)if(u=this._active[o].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const S=new g.Params;S.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=S,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():S,this._data="",this._hitLimit=!1}put(w,v,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,v,u),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let v=!1;if(this._hitLimit)v=!1;else if(w&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=c(844),g=c(8742),d=c(6242),p=c(6351);class S{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,l,_){this.table[s<<8|o]=l<<4|_}addMany(o,s,l,_){for(let C=0;C<o.length;C++)this.table[s<<8|o[C]]=l<<4|_}}a.TransitionTable=S;const w=160;a.VT500_TRANSITION_TABLE=function(){const u=new S(4095),o=Array.apply(null,Array(256)).map((k,y)=>y),s=(k,y)=>o.slice(k,y),l=s(32,127),_=s(0,24);_.push(25),_.push.apply(_,s(28,32));const C=s(0,14);let x;for(x in u.setDefault(1,0),u.addMany(l,0,2,0),C)u.addMany([24,26,153,154],x,3,0),u.addMany(s(128,144),x,3,0),u.addMany(s(144,152),x,3,0),u.add(156,x,0,0),u.add(27,x,11,1),u.add(157,x,4,8),u.addMany([152,158,159],x,0,7),u.add(155,x,11,3),u.add(144,x,11,9);return u.addMany(_,0,3,0),u.addMany(_,1,3,1),u.add(127,1,0,1),u.addMany(_,8,0,8),u.addMany(_,3,3,3),u.add(127,3,0,3),u.addMany(_,4,3,4),u.add(127,4,0,4),u.addMany(_,6,3,6),u.addMany(_,5,3,5),u.add(127,5,0,5),u.addMany(_,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(l,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(l,7,0,7),u.addMany(_,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(_,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(_,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(_,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(_,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(_,13,13,13),u.addMany(l,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(w,0,2,0),u.add(w,8,5,8),u.add(w,6,0,6),u.add(w,11,0,11),u.add(w,13,13,13),u}();class v extends f.Disposable{constructor(o=a.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,l,_)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,l)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let l=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=o.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<o.intermediates.length;++C){const x=o.intermediates.charCodeAt(C);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const _=o.final.charCodeAt(0);if(s[0]>_||_>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return l<<=8,l|=_,l}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const l=this._identifier(o,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const _=this._escHandlers[l];return _.push(s),{dispose:()=>{const C=_.indexOf(s);C!==-1&&_.splice(C,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const l=this._identifier(o);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const _=this._csiHandlers[l];return _.push(s),{dispose:()=>{const C=_.indexOf(s);C!==-1&&_.splice(C,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,l,_,C){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=l,this._parseStack.transition=_,this._parseStack.chunkPos=C}parse(o,s,l){let _,C=0,x=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&b>-1){for(;b>=0&&(_=y[b](this._params),_!==!0);b--)if(_ instanceof Promise)return this._parseStack.handlerPos=b,_}this._parseStack.handlers=[];break;case 4:if(l===!1&&b>-1){for(;b>=0&&(_=y[b](),_!==!0);b--)if(_ instanceof Promise)return this._parseStack.handlerPos=b,_}this._parseStack.handlers=[];break;case 6:if(C=o[this._parseStack.chunkPos],_=this._dcsParser.unhook(C!==24&&C!==26,l),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=o[this._parseStack.chunkPos],_=this._oscParser.end(C!==24&&C!==26,l),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=k;y<s;++y){switch(C=o[y],x=this._transitions.table[this.currentState<<8|(C<160?C:w)],x>>4){case 2:for(let T=y+1;;++T){if(T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|C];let R=b?b.length-1:-1;for(;R>=0&&(_=b[R](this._params),_!==!0);R--)if(_ instanceof Promise)return this._preserveStack(3,b,R,x,y),_;R<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++y<s&&(C=o[y])>47&&C<60);y--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const M=this._escHandlers[this._collect<<8|C];let B=M?M.length-1:-1;for(;B>=0&&(_=M[B](),_!==!0);B--)if(_ instanceof Promise)return this._preserveStack(4,M,B,x,y),_;B<0&&this._escHandlerFb(this._collect<<8|C),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|C,this._params);break;case 13:for(let T=y+1;;++T)if(T>=s||(C=o[T])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(o,y,T),y=T-1;break}break;case 14:if(_=this._dcsParser.unhook(C!==24&&C!==26),_)return this._preserveStack(6,[],0,x,y),_;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let T=y+1;;T++)if(T>=s||(C=o[T])<32||C>127&&C<w){this._oscParser.put(o,y,T),y=T-1;break}break;case 6:if(_=this._oscParser.end(C!==24&&C!==26),_)return this._preserveStack(5,[],0,x,y),_;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}a.EscapeSequenceParser=v},6242:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(S),{dispose:()=>{const v=w.indexOf(S);v!==-1&&w.splice(v,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,w){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(p,S,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,S,w))}start(){this.reset(),this._state=1}put(p,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const v=p[S++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&w-S>0&&this._put(p,S,w)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,w=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&w===!1){for(;v>=0&&(w=this._active[v].end(p),w!==!0);v--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,w;v--}for(;v>=0;v--)if(w=this._active[v].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,S,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(S=this._handler(this._data),S instanceof Promise))return S.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,S}}},8742:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class f{static fromArray(d){const p=new f;if(!d.length)return p;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const w=d[S];if(Array.isArray(w))for(let v=0;v<w.length;++v)p.addSubParam(w[v]);else p.addParam(w)}return p}constructor(d=32,p=32){if(this.maxLength=d,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p<this.length;++p){d.push(this.params[p]);const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const d={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&(d[p]=this._subParams.slice(S,w))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[p-1];S[p-1]=~w?Math.min(10*w+d,c):d}}a.Params=f},5741:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=c(3785),g=c(511);a.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new f.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new f.CellData)}translateToString(g,d,p){return this._line.translateToString(g,d,p)}}},8285:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=c(8771),g=c(8460),d=c(844);class p extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=p},7975:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,g=>f(g.toArray()))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,(g,d)=>f(g,d.toArray()))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(m,a,c){var f=this&&this.__decorate||function(u,o,s,l){var _,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,o,s,l);else for(var k=u.length-1;k>=0;k--)(_=u[k])&&(x=(C<3?_(x):C>3?_(o,s,x):_(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(u,o){return function(s,l){o(s,l,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),p=c(844),S=c(5295),w=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let v=a.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(u,this))}resize(u,o){this.cols=u,this.rows=o,this.buffers.resize(u,o),this._onResize.fire({cols:u,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,o=!1){const s=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===u.fg&&l.getBg(0)===u.bg||(l=s.getBlankLine(u,o),this._cachedBlankLine=l),l.isWrapped=o;const _=s.ybase+s.scrollTop,C=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;C===s.lines.length-1?x?s.lines.recycle().copyFrom(l):s.lines.push(l.clone()):s.lines.splice(C+1,0,l.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=C-_+1;s.lines.shiftElements(_+1,x-1,-1),s.lines.set(C,l.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,o,s){const l=this.buffer;if(u<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else u+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const _=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+u,l.ybase),0),_!==l.ydisp&&(o||this._onScroll.fire(l.ydisp))}};a.BufferService=v=f([g(0,w.IOptionsService)],v)},7994:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(m,a,c){var f=this&&this.__decorate||function(l,_,C,x){var k,y=arguments.length,b=y<3?_:x===null?x=Object.getOwnPropertyDescriptor(_,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,_,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(_,C,b):k(_,C))||b);return y>3&&b&&Object.defineProperty(_,C,b),b},g=this&&this.__param||function(l,_){return function(C,x){_(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),p=c(8460),S=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function v(l,_){let C=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(C|=64,C|=l.action):(C|=3&l.button,4&l.button&&(C|=64),8&l.button&&(C|=128),l.action===32?C|=32:l.action!==0||_||(C|=3)),C}const u=String.fromCharCode,o={DEFAULT:l=>{const _=[v(l,!1)+32,l.col+32,l.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${u(_[0])}${u(_[1])}${u(_[2])}`},SGR:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.col};${l.row}${_}`},SGR_PIXELS:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.x};${l.y}${_}`}};let s=a.CoreMouseService=class extends S.Disposable{constructor(l,_){super(),this._bufferService=l,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(o))this.addEncoding(C,o[C]);this.reset()}addProtocol(l,_){this._protocols[l]=_}addEncoding(l,_){this._encodings[l]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const _=this._encodings[this._activeEncoding](l);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,_,C){if(C){if(l.x!==_.x||l.y!==_.y)return!1}else if(l.col!==_.col||l.row!==_.row)return!1;return l.button===_.button&&l.action===_.action&&l.ctrl===_.ctrl&&l.alt===_.alt&&l.shift===_.shift}};a.CoreMouseService=s=f([g(0,d.IBufferService),g(1,d.ICoreService)],s)},6975:function(m,a,c){var f=this&&this.__decorate||function(s,l,_,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,_,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,_,y):x(l,_))||y);return k>3&&y&&Object.defineProperty(l,_,y),y},g=this&&this.__param||function(s,l){return function(_,C){l(_,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),p=c(8460),S=c(844),w=c(2585),v=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=a.CoreService=class extends S.Disposable{constructor(s,l,_){super(),this._bufferService=s,this._logService=l,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(v),this.decPrivateModes=(0,d.clone)(u)}reset(){this.modes=(0,d.clone)(v),this.decPrivateModes=(0,d.clone)(u)}triggerDataEvent(s,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(C=>C.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(l=>l.charCodeAt(0))),this._onBinary.fire(s))}};a.CoreService=o=f([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],o)},9074:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=c(8055),g=c(8460),d=c(844),p=c(6106);let S=0,w=0;class v extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const l=new u(s);if(l){const _=l.marker.onDispose(()=>l.dispose());l.onDispose(()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),_.dispose())}),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,l,_){let C=0,x=0;for(const k of this._decorations.getKeyIterator(l))C=k.options.x??0,x=C+(k.options.width??1),s>=C&&s<x&&(!_||(k.options.layer??"bottom")===_)&&(yield k)}forEachDecorationAtCell(s,l,_,C){this._decorations.forEachByKey(l,x=>{S=x.options.x??0,w=S+(x.options.width??1),s>=S&&s<w&&(!_||(x.options.layer??"bottom")===_)&&C(x)})}}a.DecorationService=v;class u extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=c(2585),g=c(8343);class d{constructor(...S){this._entries=new Map;for(const[w,v]of S)this.set(w,v)}set(S,w){const v=this._entries.get(S);return this._entries.set(S,w),v}forEach(S){for(const[w,v]of this._entries.entries())S(w,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const w=(0,g.getServiceDependencies)(p).sort((o,s)=>o.index-s.index),v=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${o.id}.`);v.push(s)}const u=w.length>0?w[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new p(...S,...v)}}},7866:function(m,a,c){var f=this&&this.__decorate||function(u,o,s,l){var _,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,o,s,l);else for(var k=u.length-1;k>=0;k--)(_=u[k])&&(x=(C<3?_(x):C>3?_(o,s,x):_(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(u,o){return function(s,l){o(s,l,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),p=c(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,v=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let o=0;o<u.length;o++)typeof u[o]=="function"&&(u[o]=u[o]())}_log(u,o,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(u,...o){var s;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,o)}debug(u,...o){var s;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,o)}info(u,...o){var s;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,o)}warn(u,...o){var s;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,o)}error(u,...o){var s;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,o)}};a.LogService=v=f([g(0,p.IOptionsService)],v),a.setTraceLogger=function(u){w=u},a.traceCall=function(u,o,s){if(typeof s.value!="function")throw new Error("not supported");const l=s.value;s.value=function(..._){if(w.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,_);w.trace(`GlyphRenderer#${l.name}(${_.map(x=>JSON.stringify(x)).join(", ")})`);const C=l.apply(this,_);return w.trace(`GlyphRenderer#${l.name} return`,C),C}}},7302:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=c(8460),g=c(844),d=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(v){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...a.DEFAULT_OPTIONS};for(const o in v)if(o in u)try{const s=v[o];u[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,u){return this.onOptionChange(o=>{o===v&&u(this.rawOptions[v])})}onMultipleOptionChange(v,u){return this.onOptionChange(o=>{v.indexOf(o)!==-1&&u()})}_setupOptions(){const v=o=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},u=(o,s)=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:v.bind(this,o),set:u.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(v,u){switch(v){case"cursorStyle":if(u||(u=a.DEFAULT_OPTIONS[v]),!function(o){return o==="block"||o==="underline"||o==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${v}`);break;case"wordSeparator":u||(u=a.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=p.includes(u)?u:a.DEFAULT_OPTIONS[v];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${v} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${v} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}a.OptionsService=S},2660:function(m,a,c){var f=this&&this.__decorate||function(S,w,v,u){var o,s=arguments.length,l=s<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,w,v,u);else for(var _=S.length-1;_>=0;_--)(o=S[_])&&(l=(s<3?o(l):s>3?o(w,v,l):o(w,v))||l);return s>3&&l&&Object.defineProperty(w,v,l),l},g=this&&this.__param||function(S,w){return function(v,u){w(v,u,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let p=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const w=this._bufferService.buffer;if(S.id===void 0){const _=w.addMarker(w.ybase+w.y),C={data:S,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(C,_)),this._dataByLinkId.set(C.id,C),C.id}const v=S,u=this._getEntryIdKey(v),o=this._entriesWithId.get(u);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),l={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(l,s)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,w){const v=this._dataByLinkId.get(S);if(v&&v.lines.every(u=>u.line!==w)){const u=this._bufferService.buffer.addMarker(w);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(S){var w;return(w=this._dataByLinkId.get(S))==null?void 0:w.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,w){const v=S.lines.indexOf(w);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=p=f([g(0,d.IBufferService)],p)},8343:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(p,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,u,o){u[c]===u?u[f].push({id:v,index:o}):(u[f]=[{id:v,index:o}],u[c]=u)})(d,p,w)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=c(8343);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=c(8460),g=c(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,v=!1){return(16777215&S)<<3|(3&w)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,v=0;const u=S.length;for(let o=0;o<u;++o){let s=S.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=u)return w+this.wcwidth(s);const C=S.charCodeAt(o);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:w+=this.wcwidth(C)}const l=this.charProperties(s,v);let _=d.extractWidth(l);d.extractShouldJoin(l)&&(_-=d.extractWidth(v)),w+=_,v=l}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}a.UnicodeService=d}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var c=i[m]={exports:{}};return r[m].call(c.exports,c,c.exports,n),c.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const a=n(9042),c=n(3236),f=n(844),g=n(5741),d=n(8285),p=n(7975),S=n(7090),w=["cols","rows"];class v extends f.Disposable{constructor(o){super(),this._core=this.register(new c.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const s=_=>this._core.options[_],l=(_,C)=>{this._checkReadonlyOptions(_),this._core.options[_]=C};for(const _ in this._core.options){const C={get:s.bind(this,_),set:l.bind(this,_)};Object.defineProperty(this._publicOptions,_,C)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,s=!0){this._core.input(o,s)}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,l){this._verifyIntegers(o,s,l),this._core.select(o,s,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
64
64
  `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return a}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}m.Terminal=v})(),h})())})(Dh);var qp=Dh.exports,Th={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(p/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Th);var sc=Th.exports,Ph={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(m,a)=>{function c(g){try{const d=new URL(g),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,p,S={}){this._terminal=g,this._regex=d,this._handler=p,this._options=S}provideLinks(g,d){const p=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(p,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(p,S,w)}},d))}};class f{static computeLink(d,p,S,w){const v=new RegExp(p.source,(p.flags||"")+"g"),[u,o]=f._getWindowedLineStrings(d-1,S),s=u.join("");let l;const _=[];for(;l=v.exec(s);){const C=l[0];if(!c(C))continue;const[x,k]=f._mapStrIdx(S,o,0,l.index),[y,b]=f._mapStrIdx(S,x,k,C.length);if(x===-1||k===-1||y===-1||b===-1)continue;const R={start:{x:k+1,y:x+1},end:{x:b,y:y+1}};_.push({range:R,text:C,activate:w})}return _}static _getWindowedLineStrings(d,p){let S,w=d,v=d,u=0,o="";const s=[];if(S=p.buffer.active.getLine(d)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(u=0;(S=p.buffer.active.getLine(--w))&&u<2048&&(o=S.translateToString(!0),u+=o.length,s.push(o),S.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(l),u=0;(S=p.buffer.active.getLine(++v))&&S.isWrapped&&u<2048&&(o=S.translateToString(!0),u+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,p,S,w){const v=d.buffer.active,u=v.getNullCell();let o=S;for(;w;){const s=v.getLine(p);if(!s)return[-1,-1];for(let l=o;l<s.length;++l){s.getCell(l,u);const _=u.getChars();if(u.getWidth()&&(w-=_.length||1,l===s.length-1&&_==="")){const C=v.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,u),u.getWidth()===2&&(w+=1))}if(w<0)return[p,l]}p++,o=0}return[p,o]}}a.LinkComputer=f}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var c=i[m]={exports:{}};return r[m](c,c.exports,n),c.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.WebLinksAddon=void 0;const a=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}m.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,p=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(Ph);var Gp=Ph.exports;function nc(){const e=te.getState().theme;return Vp(e)==="light"?Wp:zp}const zo=new Set,Wo=new Map,Uo=new Map;function Xp(e,t){Uo.set(e,t)}function Qp(e){const t=Uo.get(e);return t!==void 0?(Uo.delete(e),t):null}function Yp({terminalId:e,projectId:t,cwd:r}){const i=Q.useRef(null),n=Q.useRef(null),h=Q.useRef(null),m=Q.useRef(null),a=Re(p=>p.setTerminalInstance),c=Re(p=>p.createSession),f=te(p=>p.setFocusedTerminal);Q.useEffect(()=>{const p=i.current;if(!p)return;p.innerHTML="";const S=Re.getState().sessions[e],w=Wo.get(e);if(S!=null&&S.terminal&&w){const s=S.terminal;n.current=s,p.appendChild(w);const l=new sc.FitAddon;return s.loadAddon(l),h.current=l,requestAnimationFrame(()=>{try{l.fit(),s.scrollToBottom();const{cols:_,rows:C}=s;m.current={cols:_,rows:C},De({type:"pty:resize",terminalId:e,cols:_,rows:C})}catch{}}),()=>{}}const v=new qp.Terminal({theme:nc(),fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),u=new sc.FitAddon,o=new Gp.WebLinksAddon;return v.loadAddon(u),v.loadAddon(o),v.open(p),n.current=v,h.current=u,v.element&&Wo.set(e,v.element),c(e,t),a(e,v),v.attachCustomKeyEventHandler(s=>{if(s.key==="Enter"&&s.shiftKey)return s.type==="keydown"&&De({type:"pty:input",terminalId:e,data:`
65
- `}),!1;if(s.metaKey&&!s.altKey&&!s.ctrlKey&&!s.shiftKey&&s.type==="keydown"){if(s.key==="ArrowLeft")return De({type:"pty:input",terminalId:e,data:""}),!1;if(s.key==="ArrowRight")return De({type:"pty:input",terminalId:e,data:""}),!1;if(s.key==="Backspace")return De({type:"pty:input",terminalId:e,data:""}),!1}return!(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(s.key)&&s.shiftKey&&!s.metaKey&&!s.altKey)}),v.onData(s=>{De({type:"pty:input",terminalId:e,data:s})}),v.onTitleChange(s=>{Re.getState().setTitle(e,s)}),zo.has(e)||(zo.add(e),requestAnimationFrame(()=>{try{u.fit()}catch{}De({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),De({type:"pty:resize",terminalId:e,cols:v.cols,rows:v.rows}),m.current={cols:v.cols,rows:v.rows},v.focus(),f(e)})),()=>{}},[e,t,r,c,a]),Q.useEffect(()=>{const p=()=>{const o=n.current;o&&(o.options.theme=nc())};let S=te.getState().theme;const w=te.subscribe(o=>{o.theme!==S&&(S=o.theme,p())}),v=window.matchMedia("(prefers-color-scheme: light)"),u=()=>{te.getState().theme==="system"&&p()};return v.addEventListener("change",u),()=>{w(),v.removeEventListener("change",u)}},[]);const g=Q.useCallback(()=>{const p=h.current,S=n.current;if(!(!p||!S))try{p.fit(),S.scrollToBottom();const{cols:w,rows:v}=S,u=m.current;(!u||u.cols!==w||u.rows!==v)&&(m.current={cols:w,rows:v},De({type:"pty:resize",terminalId:e,cols:w,rows:v}))}catch{}},[e]),d=Q.useCallback(()=>{var p;(p=n.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function hn(e){zo.delete(e),Wo.delete(e)}let Ze=null;function Jp(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function De(e){(Ze==null?void 0:Ze.readyState)===WebSocket.OPEN&&Ze.send(JSON.stringify(e))}function Zp(){const e=te(h=>h.setConnectionStatus),t=de(h=>h.addProject),r=de(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((Ze==null?void 0:Ze.readyState)===WebSocket.OPEN||(Ze==null?void 0:Ze.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(Jp());Ze=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,c,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=Re.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const p=Qp(g.terminalId);p&&De({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=Re.getState().sessions[d],S=p==null?void 0:p.projectId;if((c=p==null?void 0:p.terminal)==null||c.dispose(),Re.getState().removeSession(d),hn(d),S){oe.getState().removePaneFromProject(S,d),de.getState().removeTerminalFromProject(S,d);const w=ye(oe.getState().getLayout(S)),v=te.getState().focusedTerminalId;if(v===d&&w.length>0){const u=w[0];te.getState().setFocusedTerminal(u);const o=Re.getState().sessions[u];(f=o==null?void 0:o.terminal)==null||f.focus()}else v===d&&te.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(de.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="editor:active"){if(!te.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=de.getState(),S=Object.values(d).find(w=>{const v=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||v===g.projectName});S&&S.id!==p&&r(S.id)}}catch{}},h.onclose=()=>{e("disconnected"),Ze=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const e_=new Set(["n","w","t","d","r"]);function t_(){const e=te(r=>r.toggleSidebar),t=te(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var p,S,w;const n=i.key.toLowerCase();if(i.ctrlKey&&i.shiftKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=de.getState().activeProjectId;if(!v)return;const u=oe.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=ic(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(l){t(l);const _=Re.getState().sessions[l];(p=_==null?void 0:_.terminal)==null||p.focus()}return}if(i.shiftKey&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=de.getState().activeProjectId;if(!v)return;const u=oe.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=ic(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&oe.getState().swapPanesInProject(v,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;if((n==="="||n==="+"||n==="-"||n==="0")&&!i.shiftKey){const v=parseFloat(document.documentElement.style.zoom||"1");n==="="||n==="+"?document.documentElement.style.zoom=String(Math.min(v+.1,2)):n==="-"?document.documentElement.style.zoom=String(Math.max(v-.1,.5)):document.documentElement.style.zoom="1",window.dispatchEvent(new Event("resize"));return}(e_.has(n)||n>="1"&&n<="9")&&(i.preventDefault(),i.stopPropagation());const a=de.getState().activeProjectId;if(!a)return;const c=oe.getState().getLayout(a),f=te.getState().focusedTerminalId,g=de.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const v=crypto.randomUUID(),u=ye(c);if(u.length>0){const o=f??u[u.length-1],s=i.shiftKey?"horizontal":"vertical";oe.getState().addPaneToProject(a,o,v,s)}else oe.getState().setLayout(a,{type:"leaf",terminalId:v});de.getState().addTerminalToProject(a,v),t(v);return}if(n==="w"&&!i.shiftKey){if(!f||!c)return;De({type:"pty:kill",terminalId:f}),oe.getState().removePaneFromProject(a,f),de.getState().removeTerminalFromProject(a,f);const v=Re.getState().sessions[f];(S=v==null?void 0:v.terminal)==null||S.dispose(),Re.getState().removeSession(f),hn(f);const u=ye(oe.getState().getLayout(a));t(u[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const v=ye(c);v.length>0&&oe.getState().cyclePreset(a,v);return}if(n==="r"&&!i.shiftKey){const v=ye(c);if(v.length===0)return;let u;v.length<=2?u="even-vertical":v.length===3?u="main-left":u="grid";const o=Oi(v,u);o&&oe.getState().setLayout(a,o);return}const d=parseInt(n);if(d>=1&&d<=9){const u=ye(c)[d-1];if(u){t(u);const o=Re.getState().sessions[u];(w=o==null?void 0:o.terminal)==null||w.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}const Er=Fi()((e,t)=>({favourites:{},addFavourite:r=>{e(i=>({favourites:{...i.favourites,[r.id]:r}})),_i({favourites:{...t().favourites}})},updateFavourite:(r,i)=>{e(n=>{const h=n.favourites[r];return h?{favourites:{...n.favourites,[r]:{...h,...i}}}:n}),_i({favourites:{...t().favourites}})},removeFavourite:r=>{e(i=>{const{[r]:n,...h}=i.favourites;return{favourites:h}}),_i({favourites:{...t().favourites}})},hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();i.favourites&&e({favourites:i.favourites})}catch{}}}));/**
65
+ `}),!1;if(s.metaKey&&!s.altKey&&!s.ctrlKey&&!s.shiftKey&&s.type==="keydown"){if(s.key==="ArrowLeft")return De({type:"pty:input",terminalId:e,data:""}),!1;if(s.key==="ArrowRight")return De({type:"pty:input",terminalId:e,data:""}),!1;if(s.key==="Backspace")return De({type:"pty:input",terminalId:e,data:""}),!1}return!(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(s.key)&&s.shiftKey&&!s.metaKey&&!s.altKey)}),v.onData(s=>{De({type:"pty:input",terminalId:e,data:s})}),v.onTitleChange(s=>{Re.getState().setTitle(e,s)}),zo.has(e)||(zo.add(e),requestAnimationFrame(()=>{try{u.fit()}catch{}De({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),De({type:"pty:resize",terminalId:e,cols:v.cols,rows:v.rows}),m.current={cols:v.cols,rows:v.rows},v.focus(),f(e)})),()=>{}},[e,t,r,c,a]),Q.useEffect(()=>{const p=()=>{const o=n.current;o&&(o.options.theme=nc())};let S=te.getState().theme;const w=te.subscribe(o=>{o.theme!==S&&(S=o.theme,p())}),v=window.matchMedia("(prefers-color-scheme: light)"),u=()=>{te.getState().theme==="system"&&p()};return v.addEventListener("change",u),()=>{w(),v.removeEventListener("change",u)}},[]);const g=Q.useCallback(()=>{const p=h.current,S=n.current;if(!(!p||!S))try{p.fit(),S.scrollToBottom();const{cols:w,rows:v}=S,u=m.current;(!u||u.cols!==w||u.rows!==v)&&(m.current={cols:w,rows:v},De({type:"pty:resize",terminalId:e,cols:w,rows:v}))}catch{}},[e]),d=Q.useCallback(()=>{var p;(p=n.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function hn(e){zo.delete(e),Wo.delete(e)}let Ze=null;function Jp(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function De(e){(Ze==null?void 0:Ze.readyState)===WebSocket.OPEN&&Ze.send(JSON.stringify(e))}function Zp(){const e=te(h=>h.setConnectionStatus),t=de(h=>h.addProject),r=de(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((Ze==null?void 0:Ze.readyState)===WebSocket.OPEN||(Ze==null?void 0:Ze.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(Jp());Ze=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,c,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=Re.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const p=Qp(g.terminalId);p&&De({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=Re.getState().sessions[d],S=p==null?void 0:p.projectId;if((c=p==null?void 0:p.terminal)==null||c.dispose(),Re.getState().removeSession(d),hn(d),S){oe.getState().removePaneFromProject(S,d),de.getState().removeTerminalFromProject(S,d);const w=ye(oe.getState().getLayout(S)),v=te.getState().focusedTerminalId;if(v===d&&w.length>0){const u=w[0];te.getState().setFocusedTerminal(u);const o=Re.getState().sessions[u];(f=o==null?void 0:o.terminal)==null||f.focus()}else v===d&&te.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(de.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="editor:active"){if(!te.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=de.getState(),S=Object.values(d).find(w=>{const v=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||v===g.projectName});S&&S.id!==p&&r(S.id)}}catch{}},h.onclose=()=>{e("disconnected"),Ze=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const e_=new Set(["n","w","t","d","r"]);function t_(){const e=te(r=>r.toggleSidebar),t=te(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var p,S,w;const n=i.key.toLowerCase();if(i.ctrlKey&&i.shiftKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=de.getState().activeProjectId;if(!v)return;const u=oe.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=ic(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(l){t(l);const _=Re.getState().sessions[l];(p=_==null?void 0:_.terminal)==null||p.focus()}return}if(i.shiftKey&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=de.getState().activeProjectId;if(!v)return;const u=oe.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=ic(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&oe.getState().swapPanesInProject(v,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;if((n==="="||n==="+"||n==="-"||n==="0")&&!i.shiftKey&&!("chrome"in window)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent)){i.preventDefault(),i.stopPropagation();const u=parseFloat(document.documentElement.style.zoom||"1");n==="="||n==="+"?document.documentElement.style.zoom=String(Math.min(u+.1,2)):n==="-"?document.documentElement.style.zoom=String(Math.max(u-.1,.5)):document.documentElement.style.zoom="1",window.dispatchEvent(new Event("resize"));return}(e_.has(n)||n>="1"&&n<="9")&&(i.preventDefault(),i.stopPropagation());const a=de.getState().activeProjectId;if(!a)return;const c=oe.getState().getLayout(a),f=te.getState().focusedTerminalId,g=de.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const v=crypto.randomUUID(),u=ye(c);if(u.length>0){const o=f??u[u.length-1],s=i.shiftKey?"horizontal":"vertical";oe.getState().addPaneToProject(a,o,v,s)}else oe.getState().setLayout(a,{type:"leaf",terminalId:v});de.getState().addTerminalToProject(a,v),t(v);return}if(n==="w"&&!i.shiftKey){if(!f||!c)return;De({type:"pty:kill",terminalId:f}),oe.getState().removePaneFromProject(a,f),de.getState().removeTerminalFromProject(a,f);const v=Re.getState().sessions[f];(S=v==null?void 0:v.terminal)==null||S.dispose(),Re.getState().removeSession(f),hn(f);const u=ye(oe.getState().getLayout(a));t(u[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const v=ye(c);v.length>0&&oe.getState().cyclePreset(a,v);return}if(n==="r"&&!i.shiftKey){const v=ye(c);if(v.length===0)return;let u;v.length<=2?u="even-vertical":v.length===3?u="main-left":u="grid";const o=Oi(v,u);o&&oe.getState().setLayout(a,o);return}const d=parseInt(n);if(d>=1&&d<=9){const u=ye(c)[d-1];if(u){t(u);const o=Re.getState().sessions[u];(w=o==null?void 0:o.terminal)==null||w.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}const Er=Fi()((e,t)=>({favourites:{},addFavourite:r=>{e(i=>({favourites:{...i.favourites,[r.id]:r}})),_i({favourites:{...t().favourites}})},updateFavourite:(r,i)=>{e(n=>{const h=n.favourites[r];return h?{favourites:{...n.favourites,[r]:{...h,...i}}}:n}),_i({favourites:{...t().favourites}})},removeFavourite:r=>{e(i=>{const{[r]:n,...h}=i.favourites;return{favourites:h}}),_i({favourites:{...t().favourites}})},hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();i.favourites&&e({favourites:i.favourites})}catch{}}}));/**
66
66
  * @license lucide-react v0.400.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
@@ -300,7 +300,7 @@ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o)
300
300
  bg-accent hover:bg-accent/80
301
301
  text-white rounded-lg transition-colors
302
302
  `,children:"Launch"})]})]})]})}):null}function T_(){const[e,t]=Q.useState(!1),[r,i]=Q.useState(!1),[n,h]=Q.useState(!1),[m,a]=Q.useState(null),[c,f]=Q.useState(null),[g,d]=Q.useState(null),[p,S]=Q.useState(!1),[w,v]=Q.useState(null);Q.useEffect(()=>{fetch("/api/version").then(z=>z.json()).then(z=>{z.latest&&P_(z.latest,z.current)&&v({current:z.current,latest:z.latest})}).catch(()=>{})},[]);const u=de(z=>z.projects),o=de(z=>z.activeProjectId),s=de(z=>z.setActiveProject),l=de(z=>z.addProject),_=de(z=>z.removeProject),C=de(z=>z.addTerminalToProject),x=te(z=>z.sidebarOpen),k=te(z=>z.sidebarWidth),y=te(z=>z.setSidebarWidth),b=te(z=>z.toggleSidebar),R=te(z=>z.connectionStatus),M=Q.useRef(!1),B=te(z=>z.editorSyncEnabled),T=te(z=>z.toggleEditorSync),N=te(z=>z.theme),F=te(z=>z.cycleTheme),K=Er(z=>z.favourites);Er(z=>z.addFavourite);const q=Er(z=>z.updateFavourite),j=Er(z=>z.removeFavourite),E=(z,re)=>{const ne=Object.values(u).find(Fe=>Fe.cwd===re);if(ne){s(ne.id);return}const ee=crypto.randomUUID();l({id:ee,name:z,cwd:re,terminalIds:[]}),De({type:"project:create",projectId:ee,name:z,cwd:re}),s(ee)},D=z=>{oc(z)},P=z=>{D(z),De({type:"project:remove",projectId:z}),oe.getState().removeProjectLayout(z),_(z)},O=z=>{if(!o||!u[o])return;oc(o);const ne=z.slots.map(()=>crypto.randomUUID());z.slots.forEach((Fe,Ur)=>{Fe.command.trim()&&Xp(ne[Ur],Fe.command+`
303
- `)});const ee=Oi(ne,z.preset);oe.getState().setLayout(o,ee),ne.forEach(Fe=>{C(o,Fe)}),ne.length>0&&te.getState().setFocusedTerminal(ne[0])},W=z=>{if(!o)return;const re=oe.getState().getLayout(o);ye(re).length>0?(f(z),h(!0)):O(z)},V=z=>{a(z),i(!0)},J=(z,re,ne)=>{m&&q(m.id,{name:z,preset:re,slots:ne}),a(null)},Z=Q.useCallback(z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),z.dataTransfer.dropEffect="copy",S(!0))},[]),I=Q.useCallback(z=>{z.currentTarget.contains(z.relatedTarget)||S(!1)},[]),L=Q.useCallback(z=>{z.preventDefault(),M.current=!0;const re=ee=>{y(ee.clientX)},ne=()=>{M.current=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",ne),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",re),window.addEventListener("mouseup",ne)},[y]),U=Q.useCallback(z=>{if(S(!1),!z.dataTransfer.types.includes("Files")||z.dataTransfer.files.length===0)return;z.preventDefault(),z.stopPropagation();const re=z.dataTransfer.files[0];fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:re.name,size:re.size,lastModified:re.lastModified})}).then(ne=>ne.json()).then(ne=>{if(!ne.path||!ne.isDirectory)return;const ee=ne.path,Fe=ee.split("/").pop()||re.name;d({name:Fe,cwd:ee}),t(!0)}).catch(()=>{})},[]);if(!x)return null;const H=Object.values(u),X=Object.values(K),se=(o?u[o]:null)?ye(oe.getState().getLayout(o)).length:0;return A.jsxs("div",{className:`relative flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full ${p?"ring-2 ring-inset ring-[var(--accent)]":""}`,style:{width:k},onDragOver:Z,onDragLeave:I,onDrop:U,children:[A.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize z-10 hover:bg-[var(--accent)] active:bg-[var(--accent)] opacity-0 hover:opacity-40 active:opacity-60 transition-opacity",onMouseDown:L}),A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),A.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${R==="connected"?"bg-[var(--success)]":R==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:R})]}),A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx("button",{onClick:F,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:`Theme: ${N}. Click to cycle.`,children:N==="light"?A.jsx(w_,{size:14}):N==="dark"?A.jsx(v_,{size:14}):A.jsx(__,{size:14})}),A.jsx("button",{onClick:T,className:`p-1 rounded transition-colors ${B?"text-[var(--accent)] hover:bg-[var(--surface-3)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]"}`,title:B?"Editor sync ON — auto-switches project based on your active editor. Click to disable.":"Editor sync OFF — click to enable. Requires: (1) Paneful (or Terminal, if running from CLI) in System Settings → Privacy & Security → Accessibility, (2) Editor window title includes folder name (default in VS Code/Cursor). Note: after updating paneful, you may need to remove and re-add it in Accessibility settings.",children:A.jsx(p_,{size:14})}),A.jsx("button",{onClick:b,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:A.jsx(g_,{size:14})})]})]}),A.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:H.length===0&&X.length===0?A.jsx("div",{className:"px-4 py-8 text-center",children:A.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):A.jsxs(A.Fragment,{children:[H.map(z=>A.jsx(x_,{project:z,isActive:z.id===o,onClick:()=>s(z.id),onKill:()=>D(z.id),onRemove:()=>P(z.id)},z.id)),A.jsx(L_,{favourites:X,onLaunch:W,onEdit:V,onDelete:j})]})}),A.jsxs("div",{className:"mx-3 mb-2 px-3 py-2.5 rounded-lg bg-[var(--surface-2)] text-[10px] text-[var(--text-muted)] leading-relaxed flex flex-col items-center gap-1.5 text-center",children:[A.jsx(f_,{size:12,className:"text-yellow-400"}),"Drag a folder into this sidebar to create a project"]}),A.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:A.jsxs("button",{onClick:()=>t(!0),className:`
303
+ `)});const ee=Oi(ne,z.preset);oe.getState().setLayout(o,ee),ne.forEach(Fe=>{C(o,Fe)}),ne.length>0&&te.getState().setFocusedTerminal(ne[0])},W=z=>{if(!o)return;const re=oe.getState().getLayout(o);ye(re).length>0?(f(z),h(!0)):O(z)},V=z=>{a(z),i(!0)},J=(z,re,ne)=>{m&&q(m.id,{name:z,preset:re,slots:ne}),a(null)},Z=Q.useCallback(z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),z.dataTransfer.dropEffect="copy",S(!0))},[]),I=Q.useCallback(z=>{z.currentTarget.contains(z.relatedTarget)||S(!1)},[]),L=Q.useCallback(z=>{z.preventDefault(),M.current=!0;const re=ee=>{y(ee.clientX)},ne=()=>{M.current=!1,window.removeEventListener("mousemove",re),window.removeEventListener("mouseup",ne),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",re),window.addEventListener("mouseup",ne)},[y]),U=Q.useCallback(z=>{if(S(!1),!z.dataTransfer.types.includes("Files")||z.dataTransfer.files.length===0)return;z.preventDefault(),z.stopPropagation();const re=z.dataTransfer.files[0];fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:re.name,size:re.size,lastModified:re.lastModified})}).then(ne=>ne.json()).then(ne=>{if(!ne.path||!ne.isDirectory)return;const ee=ne.path,Fe=ee.split("/").pop()||re.name;d({name:Fe,cwd:ee}),t(!0)}).catch(()=>{})},[]);if(!x)return null;const H=Object.values(u),X=Object.values(K),se=(o?u[o]:null)?ye(oe.getState().getLayout(o)).length:0;return A.jsxs("div",{className:`relative flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full ${p?"ring-2 ring-inset ring-[var(--accent)]":""}`,style:{width:k},onDragOver:Z,onDragLeave:I,onDrop:U,children:[A.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize z-10 hover:bg-[var(--accent)] active:bg-[var(--accent)] opacity-0 hover:opacity-40 active:opacity-60 transition-opacity",onMouseDown:L}),A.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[A.jsxs("div",{className:"flex items-center gap-2",children:[A.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),A.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${R==="connected"?"bg-[var(--success)]":R==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:R})]}),A.jsxs("div",{className:"flex items-center gap-1",children:[A.jsx("button",{onClick:F,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:`Theme: ${N}. Click to cycle.`,children:N==="light"?A.jsx(w_,{size:14}):N==="dark"?A.jsx(v_,{size:14}):A.jsx(__,{size:14})}),A.jsx("button",{onClick:T,className:`p-1 rounded transition-colors ${B?"text-[var(--accent)] hover:bg-[var(--surface-3)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]"}`,title:B?"Editor sync ON — auto-switches project based on your active editor. Click to disable.":"Editor sync OFF — click to enable. Requires: (1) Paneful (or Terminal, if running from CLI) in System Settings → Privacy & Security → Accessibility, (2) Editor window title includes folder name (default in VS Code/Cursor). Note: after updating paneful, you may need to remove and re-add it in Accessibility settings.",children:A.jsx(p_,{size:14})}),A.jsx("button",{onClick:b,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:A.jsx(g_,{size:14})})]})]}),A.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:H.length===0&&X.length===0?A.jsx("div",{className:"px-4 py-8 text-center",children:A.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):A.jsxs(A.Fragment,{children:[H.map(z=>A.jsx(x_,{project:z,isActive:z.id===o,onClick:()=>s(z.id),onKill:()=>D(z.id),onRemove:()=>P(z.id)},z.id)),A.jsx(L_,{favourites:X,onLaunch:W,onEdit:V,onDelete:j})]})}),A.jsxs("div",{className:"mx-3 mb-2 px-3 py-2.5 rounded-lg bg-[var(--surface-2)] text-[10px] text-[var(--text-muted)] leading-relaxed flex flex-col items-center gap-1.5 text-center",children:[A.jsx(f_,{size:12,className:"text-yellow-500"}),"Drag a folder into this sidebar to create a project"]}),A.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:A.jsxs("button",{onClick:()=>t(!0),className:`
304
304
  w-full flex items-center justify-center gap-1.5
305
305
  px-3 py-2 text-xs
306
306
  text-[var(--text-secondary)] hover:text-[var(--text-primary)]
@@ -14,8 +14,8 @@
14
14
  document.documentElement.setAttribute('data-theme', t);
15
15
  })();
16
16
  </script>
17
- <script type="module" crossorigin src="/assets/index-CoI7fA_K.js"></script>
18
- <link rel="stylesheet" crossorigin href="/assets/index-B4-CUyGw.css">
17
+ <script type="module" crossorigin src="/assets/index-DSsnA6Av.js"></script>
18
+ <link rel="stylesheet" crossorigin href="/assets/index-CHLTIy23.css">
19
19
  </head>
20
20
  <body>
21
21
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paneful",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Browser-based terminal multiplexer with tmux-style pane management",
5
5
  "type": "module",
6
6
  "bin": {