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