"use strict";(self.webpackChunkdvls=self.webpackChunkdvls||[]).push([[9941],{89941:(y,l,a)=>{function d(s,o){for(var n=0;n<o.length;n++){const t=o[n];if("string"!=typeof t&&!Array.isArray(t))for(const e in t)if("default"!==e&&!(e in s)){const r=Object.getOwnPropertyDescriptor(t,e);r&&Object.defineProperty(s,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}a.r(l),a.d(l,{x:()=>u});var t,n,c={exports:{}};self,c.exports=(t=n={},Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{constructor(){}activate(e){this._terminal=e}dispose(){}fit(){const e=this.proposeDimensions();e&&this._terminal&&!isNaN(e.cols)&&!isNaN(e.rows)&&(this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(this._terminal._core._renderService.clear(),this._terminal.resize(e.cols,e.rows)))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const e=this._terminal._core,r=e._renderService.dimensions;if(0===r.css.cell.width||0===r.css.cell.height)return;const m=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,p=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(p.getPropertyValue("height")),g=Math.max(0,parseInt(p.getPropertyValue("width"))),i=window.getComputedStyle(this._terminal.element),_=f-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),w=g-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(w/r.css.cell.width)),rows:Math.max(1,Math.floor(_/r.css.cell.height))}}},n);const u=d({__proto__:null},[c.exports])}}]);