"use strict";(self.webpackChunkdvls=self.webpackChunkdvls||[]).push([[1777],{71777:(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,{a:()=>m});var t,n,c={exports:{}};self,c.exports=(t=n={},Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{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 u=0===this._terminal.options.scrollback?0:e.viewport.scrollBarWidth,p=window.getComputedStyle(this._terminal.element.parentElement),g=parseInt(p.getPropertyValue("height")),f=Math.max(0,parseInt(p.getPropertyValue("width"))),i=window.getComputedStyle(this._terminal.element),_=g-(parseInt(i.getPropertyValue("padding-top"))+parseInt(i.getPropertyValue("padding-bottom"))),w=f-(parseInt(i.getPropertyValue("padding-right"))+parseInt(i.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(w/r.css.cell.width)),rows:Math.max(1,Math.floor(_/r.css.cell.height))}}},n);const m=d({__proto__:null},[c.exports])}}]);