@xterm/addon-serialize 0.15.0-beta.14 → 0.15.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/addon-serialize.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SerializeAddon=e():t.SerializeAddon=e()}(globalThis,(()=>(()=>{"use strict";var t={992:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_ANSI_COLORS=void 0;const r=s(993);e.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const t=[r.css.toColor("#2e3436"),r.css.toColor("#cc0000"),r.css.toColor("#4e9a06"),r.css.toColor("#c4a000"),r.css.toColor("#3465a4"),r.css.toColor("#75507b"),r.css.toColor("#06989a"),r.css.toColor("#d3d7cf"),r.css.toColor("#555753"),r.css.toColor("#ef2929"),r.css.toColor("#8ae234"),r.css.toColor("#fce94f"),r.css.toColor("#729fcf"),r.css.toColor("#ad7fa8"),r.css.toColor("#34e2e2"),r.css.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let s=0;s<216;s++){const i=e[s/36%6|0],o=e[s/6%6|0],n=e[s%6];t.push({css:r.channels.toCss(i,o,n),rgba:r.channels.toRgba(i,o,n)})}for(let e=0;e<24;e++){const s=8+10*e;t.push({css:r.channels.toCss(s,s,s),rgba:r.channels.toRgba(s,s,s)})}return t})())},993:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.rgba=e.rgb=e.css=e.color=e.channels=e.NULL_COLOR=void 0,e.toPaddedHex=c,e.contrastRatio=_;let s=0,r=0,i=0,o=0;var n,l,a,u,h;function c(t){const e=t.toString(16);return e.length<2?"0"+e:e}function _(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}e.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(t,e,s,r){return void 0!==r?`#${c(t)}${c(e)}${c(s)}${c(r)}`:`#${c(t)}${c(e)}${c(s)}`},t.toRgba=function(t,e,s,r=255){return(t<<24|e<<16|s<<8|r)>>>0},t.toColor=function(e,s,r,i){return{css:t.toCss(e,s,r,i),rgba:t.toRgba(e,s,r,i)}}}(n||(e.channels=n={})),function(t){function e(t,e){return o=Math.round(255*e),[s,r,i]=h.toChannels(t.rgba),{css:n.toCss(s,r,i,o),rgba:n.toRgba(s,r,i,o)}}t.blend=function(t,e){if(o=(255&e.rgba)/255,1===o)return{css:e.css,rgba:e.rgba};const l=e.rgba>>24&255,a=e.rgba>>16&255,u=e.rgba>>8&255,h=t.rgba>>24&255,c=t.rgba>>16&255,_=t.rgba>>8&255;return s=h+Math.round((l-h)*o),r=c+Math.round((a-c)*o),i=_+Math.round((u-_)*o),{css:n.toCss(s,r,i),rgba:n.toRgba(s,r,i)}},t.isOpaque=function(t){return!(255&~t.rgba)},t.ensureContrastRatio=function(t,e,s){const r=h.ensureContrastRatio(t.rgba,e.rgba,s);if(r)return n.toColor(r>>24&255,r>>16&255,r>>8&255)},t.opaque=function(t){const e=(255|t.rgba)>>>0;return[s,r,i]=h.toChannels(e),{css:n.toCss(s,r,i),rgba:e}},t.opacity=e,t.multiplyOpacity=function(t,s){return o=255&t.rgba,e(t,o*s/255)},t.toColorRGB=function(t){return[t.rgba>>24&255,t.rgba>>16&255,t.rgba>>8&255]}}(l||(e.color=l={})),function(t){let e,l;try{const t=document.createElement("canvas");t.width=1,t.height=1;const s=t.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",l=e.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(t){if(t.match(/#[\da-f]{3,8}/i))switch(t.length){case 4:return s=parseInt(t.slice(1,2).repeat(2),16),r=parseInt(t.slice(2,3).repeat(2),16),i=parseInt(t.slice(3,4).repeat(2),16),n.toColor(s,r,i);case 5:return s=parseInt(t.slice(1,2).repeat(2),16),r=parseInt(t.slice(2,3).repeat(2),16),i=parseInt(t.slice(3,4).repeat(2),16),o=parseInt(t.slice(4,5).repeat(2),16),n.toColor(s,r,i,o);case 7:return{css:t,rgba:(parseInt(t.slice(1),16)<<8|255)>>>0};case 9:return{css:t,rgba:parseInt(t.slice(1),16)>>>0}}const a=t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return s=parseInt(a[1]),r=parseInt(a[2]),i=parseInt(a[3]),o=Math.round(255*(void 0===a[5]?1:parseFloat(a[5]))),n.toColor(s,r,i,o);if(!e||!l)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=l,e.fillStyle=t,"string"!=typeof e.fillStyle)throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[s,r,i,o]=e.getImageData(0,0,1,1).data,255!==o)throw new Error("css.toColor: Unsupported css format");return{rgba:n.toRgba(s,r,i,o),css:t}}}(a||(e.css=a={})),function(t){function e(t,e,s){const r=t/255,i=e/255,o=s/255;return.2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}t.relativeLuminance=function(t){return e(t>>16&255,t>>8&255,255&t)},t.relativeLuminance2=e}(u||(e.rgb=u={})),function(t){function e(t,e,s){const r=t>>24&255,i=t>>16&255,o=t>>8&255;let n=e>>24&255,l=e>>16&255,a=e>>8&255,h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));for(;h<s&&(n>0||l>0||a>0);)n-=Math.max(0,Math.ceil(.1*n)),l-=Math.max(0,Math.ceil(.1*l)),a-=Math.max(0,Math.ceil(.1*a)),h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));return(n<<24|l<<16|a<<8|255)>>>0}function l(t,e,s){const r=t>>24&255,i=t>>16&255,o=t>>8&255;let n=e>>24&255,l=e>>16&255,a=e>>8&255,h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));for(;h<s&&(n<255||l<255||a<255);)n=Math.min(255,n+Math.ceil(.1*(255-n))),l=Math.min(255,l+Math.ceil(.1*(255-l))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));return(n<<24|l<<16|a<<8|255)>>>0}t.blend=function(t,e){if(o=(255&e)/255,1===o)return e;const l=e>>24&255,a=e>>16&255,u=e>>8&255,h=t>>24&255,c=t>>16&255,_=t>>8&255;return s=h+Math.round((l-h)*o),r=c+Math.round((a-c)*o),i=_+Math.round((u-_)*o),n.toRgba(s,r,i)},t.ensureContrastRatio=function(t,s,r){const i=u.relativeLuminance(t>>8),o=u.relativeLuminance(s>>8);if(_(i,o)<r){if(o<i){const o=e(t,s,r),n=_(i,u.relativeLuminance(o>>8));if(n<r){const e=l(t,s,r);return n>_(i,u.relativeLuminance(e>>8))?o:e}return o}const n=l(t,s,r),a=_(i,u.relativeLuminance(n>>8));if(a<r){const o=e(t,s,r);return a>_(i,u.relativeLuminance(o>>8))?n:o}return n}},t.reduceLuminance=e,t.increaseLuminance=l,t.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]}}(h||(e.rgba=h={}))}},e={};function s(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,s),o.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLSerializeHandler=t.SerializeAddon=void 0;const e=s(992);function i(t,e,s){return Math.max(e,Math.min(t,s))}class o{constructor(t){this._buffer=t}serialize(t,e){const s=this._buffer.getNullCell(),r=this._buffer.getNullCell();let i=s;const o=t.start.y,n=t.end.y,l=t.start.x,a=t.end.x;this._beforeSerialize(n-o,o,n);for(let e=o;e<=n;e++){const o=this._buffer.getLine(e);if(o){const n=e===t.start.y?l:0,u=e===t.end.y?a:o.length;for(let t=n;t<u;t++){const n=o.getCell(t,i===s?r:s);n?(this._nextCell(n,i,e,t),i=n):console.warn(`Can't get cell at row=${e}, col=${t}`)}}this._rowEnd(e,e===n)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,s,r){}_rowEnd(t,e){}_beforeSerialize(t,e,s){}_afterSerialize(){}_serializeString(t){return""}}function n(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function l(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function a(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}class u extends o{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,s){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){this._nullCellCount>0&&!l(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`[${this._nullCellCount}X`);let s="";if(!e){t-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);const e=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(r.isWrapped){s="";const i=e.getCell(e.length-1,this._thisRowLastChar),o=e.getCell(e.length-2,this._thisRowLastSecondChar),n=r.getCell(0,this._nextRowFirstChar),a=n.getWidth()>1;let u=!1;(n.getChars()&&a?this._nullCellCount<=1:this._nullCellCount<=0)&&((i.getChars()||0===i.getWidth())&&l(i,n)&&(u=!0),a&&(o.getChars()||0===o.getWidth())&&l(i,n)&&l(o,n)&&(u=!0)),u||(s="-".repeat(this._nullCellCount+1),s+="[1D[1X",this._nullCellCount>0&&(s+="[A",s+=`[${e.length-this._nullCellCount}C`,s+=`[${this._nullCellCount}X`,s+=`[${e.length-this._nullCellCount}D`,s+="[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}else s="\r\n",this._lastCursorRow=t+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=s,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){const s=[],r=!n(t,e),i=!l(t,e),o=!a(t,e);if(r||i||o)if(t.isAttributeDefault())e.isAttributeDefault()||s.push(0);else{if(r){const e=t.getFgColor();t.isFgRGB()?s.push(38,2,e>>>16&255,e>>>8&255,255&e):t.isFgPalette()?e>=16?s.push(38,5,e):s.push(8&e?90+(7&e):30+(7&e)):s.push(39)}if(i){const e=t.getBgColor();t.isBgRGB()?s.push(48,2,e>>>16&255,e>>>8&255,255&e):t.isBgPalette()?e>=16?s.push(48,5,e):s.push(8&e?100+(7&e):40+(7&e)):s.push(49)}o&&(t.isInverse()!==e.isInverse()&&s.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&s.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&s.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&s.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&s.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&s.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&s.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&s.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&s.push(t.isStrikethrough()?9:29))}return s}_nextCell(t,e,s,r){if(0===t.getWidth())return;const i=""===t.getChars(),o=this._diffStyle(t,this._cursorStyle);if(i?!l(this._cursorStyle,t):o.length>0){this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r,this._currentRow+=`[${o.join(";")}m`;const t=this._buffer.getLine(s);void 0!==t&&(t.getCell(r,this._cursorStyle),this._cursorStyleRow=s,this._cursorStyleCol=r)}i?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let s="";for(let t=0;t<e;t++)s+=this._allRows[t],t+1<e&&(s+=this._allRowSeparators[t]);if(!t){const t=this._buffer.baseY+this._buffer.cursorY,e=this._buffer.cursorX,i=t=>{t>0?s+=`[${t}C`:t<0&&(s+=`[${-t}D`)};(t!==this._lastCursorRow||e!==this._lastCursorCol)&&((r=t-this._lastCursorRow)>0?s+=`[${r}B`:r<0&&(s+=`[${-r}A`),i(e-this._lastCursorCol))}var r;const i=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(i,this._cursorStyle);return o.length>0&&(s+=`[${o.join(";")}m`),s}}t.SerializeAddon=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,s){const r=e.length,o=void 0===s?r:i(s+t.rows,0,r);return this._serializeBufferByRange(t,e,{start:r-o,end:r-1},!1)}_serializeBufferByRange(t,e,s,r){return new u(e,t).serialize({start:{x:0,y:"number"==typeof s.start?s.start:s.start.line},end:{x:t.cols,y:"number"==typeof s.end?s.end:s.end.line}},r)}_serializeBufferAsHTML(t,e){const s=t.buffer.active,r=new h(s,t,e),o=e.onlySelection??!1,n=e.range;if(n)return r.serialize({start:{x:n.startCol,y:(n.startLine,n.startLine)},end:{x:t.cols,y:(n.endLine,n.endLine)}});if(!o){const o=s.length,n=e.scrollback,l=void 0===n?o:i(n+t.rows,0,o);return r.serialize({start:{x:0,y:o-l},end:{x:t.cols,y:o-1}})}const l=this._terminal?.getSelectionPosition();return void 0!==l?r.serialize({start:{x:l.start.x,y:l.start.y},end:{x:l.end.x,y:l.end.y}}):""}_serializeModes(t){let e="";const s=t.modes;if(s.applicationCursorKeysMode&&(e+="[?1h"),s.applicationKeypadMode&&(e+="[?66h"),s.bracketedPasteMode&&(e+="[?2004h"),s.insertMode&&(e+="[4h"),s.originMode&&(e+="[?6h"),s.reverseWraparoundMode&&(e+="[?45h"),s.sendFocusMode&&(e+="[?1004h"),!1===s.wraparoundMode&&(e+="[?7l"),"none"!==s.mouseTrackingMode)switch(s.mouseTrackingMode){case"x10":e+="[?9h";break;case"vt200":e+="[?1000h";break;case"drag":e+="[?1002h";break;case"any":e+="[?1003h"}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t?.scrollback);return t?.excludeAltBuffer||"alternate"!==this._terminal.buffer.active.type||(e+=`[?1049h[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),t?.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}};class h extends o{constructor(t,s,r){super(t),this._terminal=s,this._options=r,this._currentRow="",this._htmlContent="",s._core._themeService?this._ansiColors=s._core._themeService.colors.ansi:this._ansiColors=e.DEFAULT_ANSI_COLORS}_padStart(t,e,s){return e|=0,s=s??" ",t.length>e?t:((e-=t.length)>s.length&&(s+=s.repeat(e/s.length)),s.slice(0,e)+t)}_beforeSerialize(t,e,s){this._htmlContent+="<html><body>\x3c!--StartFragment--\x3e<pre>";let r="#000000",i="#ffffff";this._options.includeGlobalBackground&&(r=this._terminal.options.theme?.foreground??"#ffffff",i=this._terminal.options.theme?.background??"#000000");const o=[];o.push("color: "+r+";"),o.push("background-color: "+i+";"),o.push("font-family: "+this._terminal.options.fontFamily+";"),o.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+o.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre>\x3c!--EndFragment--\x3e</body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){const s=e?t.getFgColor():t.getBgColor();return(e?t.isFgRGB():t.isBgRGB())?"#"+[s>>16&255,s>>8&255,255&s].map((t=>this._padStart(t.toString(16),2,"0"))).join(""):(e?t.isFgPalette():t.isBgPalette())?this._ansiColors[s].css:void 0}_diffStyle(t,e){const s=[],r=!n(t,e),i=!l(t,e),o=!a(t,e);if(r||i||o){const e=this._getHexColor(t,!0);e&&s.push("color: "+e+";");const r=this._getHexColor(t,!1);return r&&s.push("background-color: "+r+";"),t.isInverse()&&s.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&s.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?s.push("text-decoration: overline underline;"):t.isUnderline()?s.push("text-decoration: underline;"):t.isOverline()&&s.push("text-decoration: overline;"),t.isBlink()&&s.push("text-decoration: blink;"),t.isInvisible()&&s.push("visibility: hidden;"),t.isItalic()&&s.push("font-style: italic;"),t.isDim()&&s.push("opacity: 0.5;"),t.isStrikethrough()&&s.push("text-decoration: line-through;"),s}}_nextCell(t,e,s,r){if(0===t.getWidth())return;const i=""===t.getChars(),o=this._diffStyle(t,e);o&&(this._currentRow+=0===o.length?"</span><span>":"</span><span style='"+o.join(" ")+"'>"),this._currentRow+=i?" ":function(t){switch(t){case"&":return"&";case"<":return"<"}return t}(t.getChars())}_serializeString(){return this._htmlContent}}t.HTMLSerializeHandler=h})(),r})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SerializeAddon=e():t.SerializeAddon=e()}(globalThis,()=>(()=>{"use strict";var t={992(t,e,s){Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_ANSI_COLORS=void 0;const r=s(993);e.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const t=[r.css.toColor("#2e3436"),r.css.toColor("#cc0000"),r.css.toColor("#4e9a06"),r.css.toColor("#c4a000"),r.css.toColor("#3465a4"),r.css.toColor("#75507b"),r.css.toColor("#06989a"),r.css.toColor("#d3d7cf"),r.css.toColor("#555753"),r.css.toColor("#ef2929"),r.css.toColor("#8ae234"),r.css.toColor("#fce94f"),r.css.toColor("#729fcf"),r.css.toColor("#ad7fa8"),r.css.toColor("#34e2e2"),r.css.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let s=0;s<216;s++){const i=e[s/36%6|0],o=e[s/6%6|0],n=e[s%6];t.push({css:r.channels.toCss(i,o,n),rgba:r.channels.toRgba(i,o,n)})}for(let e=0;e<24;e++){const s=8+10*e;t.push({css:r.channels.toCss(s,s,s),rgba:r.channels.toRgba(s,s,s)})}return t})())},993(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.rgba=e.rgb=e.css=e.color=e.channels=e.NULL_COLOR=void 0,e.toPaddedHex=c,e.contrastRatio=_;let s=0,r=0,i=0,o=0;var n,l,a,u,h;function c(t){const e=t.toString(16);return e.length<2?"0"+e:e}function _(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}e.NULL_COLOR={css:"#00000000",rgba:0},function(t){t.toCss=function(t,e,s,r){return void 0!==r?`#${c(t)}${c(e)}${c(s)}${c(r)}`:`#${c(t)}${c(e)}${c(s)}`},t.toRgba=function(t,e,s,r=255){return(t<<24|e<<16|s<<8|r)>>>0},t.toColor=function(e,s,r,i){return{css:t.toCss(e,s,r,i),rgba:t.toRgba(e,s,r,i)}}}(n||(e.channels=n={})),function(t){function e(t,e){return o=Math.round(255*e),[s,r,i]=h.toChannels(t.rgba),{css:n.toCss(s,r,i,o),rgba:n.toRgba(s,r,i,o)}}t.blend=function(t,e){if(o=(255&e.rgba)/255,1===o)return{css:e.css,rgba:e.rgba};const l=e.rgba>>24&255,a=e.rgba>>16&255,u=e.rgba>>8&255,h=t.rgba>>24&255,c=t.rgba>>16&255,_=t.rgba>>8&255;return s=h+Math.round((l-h)*o),r=c+Math.round((a-c)*o),i=_+Math.round((u-_)*o),{css:n.toCss(s,r,i),rgba:n.toRgba(s,r,i)}},t.isOpaque=function(t){return!(255&~t.rgba)},t.ensureContrastRatio=function(t,e,s){const r=h.ensureContrastRatio(t.rgba,e.rgba,s);if(r)return n.toColor(r>>24&255,r>>16&255,r>>8&255)},t.opaque=function(t){const e=(255|t.rgba)>>>0;return[s,r,i]=h.toChannels(e),{css:n.toCss(s,r,i),rgba:e}},t.opacity=e,t.multiplyOpacity=function(t,s){return o=255&t.rgba,e(t,o*s/255)},t.toColorRGB=function(t){return[t.rgba>>24&255,t.rgba>>16&255,t.rgba>>8&255]}}(l||(e.color=l={})),function(t){let e,l;try{const t=document.createElement("canvas");t.width=1,t.height=1;const s=t.getContext("2d",{willReadFrequently:!0});s&&(e=s,e.globalCompositeOperation="copy",l=e.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(t){if(t.match(/#[\da-f]{3,8}/i))switch(t.length){case 4:return s=parseInt(t.slice(1,2).repeat(2),16),r=parseInt(t.slice(2,3).repeat(2),16),i=parseInt(t.slice(3,4).repeat(2),16),n.toColor(s,r,i);case 5:return s=parseInt(t.slice(1,2).repeat(2),16),r=parseInt(t.slice(2,3).repeat(2),16),i=parseInt(t.slice(3,4).repeat(2),16),o=parseInt(t.slice(4,5).repeat(2),16),n.toColor(s,r,i,o);case 7:return{css:t,rgba:(parseInt(t.slice(1),16)<<8|255)>>>0};case 9:return{css:t,rgba:parseInt(t.slice(1),16)>>>0}}const a=t.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return s=parseInt(a[1]),r=parseInt(a[2]),i=parseInt(a[3]),o=Math.round(255*(void 0===a[5]?1:parseFloat(a[5]))),n.toColor(s,r,i,o);if(!e||!l)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=l,e.fillStyle=t,"string"!=typeof e.fillStyle)throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[s,r,i,o]=e.getImageData(0,0,1,1).data,255!==o)throw new Error("css.toColor: Unsupported css format");return{rgba:n.toRgba(s,r,i,o),css:t}}}(a||(e.css=a={})),function(t){function e(t,e,s){const r=t/255,i=e/255,o=s/255;return.2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))}t.relativeLuminance=function(t){return e(t>>16&255,t>>8&255,255&t)},t.relativeLuminance2=e}(u||(e.rgb=u={})),function(t){function e(t,e,s){const r=t>>24&255,i=t>>16&255,o=t>>8&255;let n=e>>24&255,l=e>>16&255,a=e>>8&255,h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));for(;h<s&&(n>0||l>0||a>0);)n-=Math.max(0,Math.ceil(.1*n)),l-=Math.max(0,Math.ceil(.1*l)),a-=Math.max(0,Math.ceil(.1*a)),h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));return(n<<24|l<<16|a<<8|255)>>>0}function l(t,e,s){const r=t>>24&255,i=t>>16&255,o=t>>8&255;let n=e>>24&255,l=e>>16&255,a=e>>8&255,h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));for(;h<s&&(n<255||l<255||a<255);)n=Math.min(255,n+Math.ceil(.1*(255-n))),l=Math.min(255,l+Math.ceil(.1*(255-l))),a=Math.min(255,a+Math.ceil(.1*(255-a))),h=_(u.relativeLuminance2(n,l,a),u.relativeLuminance2(r,i,o));return(n<<24|l<<16|a<<8|255)>>>0}t.blend=function(t,e){if(o=(255&e)/255,1===o)return e;const l=e>>24&255,a=e>>16&255,u=e>>8&255,h=t>>24&255,c=t>>16&255,_=t>>8&255;return s=h+Math.round((l-h)*o),r=c+Math.round((a-c)*o),i=_+Math.round((u-_)*o),n.toRgba(s,r,i)},t.ensureContrastRatio=function(t,s,r){const i=u.relativeLuminance(t>>8),o=u.relativeLuminance(s>>8);if(_(i,o)<r){if(o<i){const o=e(t,s,r),n=_(i,u.relativeLuminance(o>>8));if(n<r){const e=l(t,s,r);return n>_(i,u.relativeLuminance(e>>8))?o:e}return o}const n=l(t,s,r),a=_(i,u.relativeLuminance(n>>8));if(a<r){const o=e(t,s,r);return a>_(i,u.relativeLuminance(o>>8))?n:o}return n}},t.reduceLuminance=e,t.increaseLuminance=l,t.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]}}(h||(e.rgba=h={}))}},e={};function s(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,s),o.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0}),t.HTMLSerializeHandler=t.SerializeAddon=void 0;const e=s(992);function i(t,e,s){return Math.max(e,Math.min(t,s))}class o{constructor(t){this._buffer=t}serialize(t,e){const s=this._buffer.getNullCell(),r=this._buffer.getNullCell();let i=s;const o=t.start.y,n=t.end.y,l=t.start.x,a=t.end.x;this._beforeSerialize(n-o,o,n);for(let e=o;e<=n;e++){const o=this._buffer.getLine(e);if(o){const n=e===t.start.y?l:0,u=e===t.end.y?a:o.length;for(let t=n;t<u;t++){const n=o.getCell(t,i===s?r:s);n?(this._nextCell(n,i,e,t),i=n):console.warn(`Can't get cell at row=${e}, col=${t}`)}}this._rowEnd(e,e===n)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,s,r){}_rowEnd(t,e){}_beforeSerialize(t,e,s){}_afterSerialize(){}_serializeString(t){return""}}function n(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function l(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function a(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}class u extends o{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,s){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){this._nullCellCount>0&&!l(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`[${this._nullCellCount}X`);let s="";if(!e){t-this._firstRow>=this._terminal.rows&&this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol,this._backgroundCell);const e=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(r.isWrapped){s="";const i=e.getCell(e.length-1,this._thisRowLastChar),o=e.getCell(e.length-2,this._thisRowLastSecondChar),n=r.getCell(0,this._nextRowFirstChar),a=n.getWidth()>1;let u=!1;(n.getChars()&&a?this._nullCellCount<=1:this._nullCellCount<=0)&&((i.getChars()||0===i.getWidth())&&l(i,n)&&(u=!0),a&&(o.getChars()||0===o.getWidth())&&l(i,n)&&l(o,n)&&(u=!0)),u||(s="-".repeat(this._nullCellCount+1),s+="[1D[1X",this._nullCellCount>0&&(s+="[A",s+=`[${e.length-this._nullCellCount}C`,s+=`[${this._nullCellCount}X`,s+=`[${e.length-this._nullCellCount}D`,s+="[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}else s="\r\n",this._lastCursorRow=t+1,this._lastCursorCol=0}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=s,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){const s=[],r=!n(t,e),i=!l(t,e),o=!a(t,e);if(r||i||o)if(t.isAttributeDefault())e.isAttributeDefault()||s.push(0);else{if(r){const e=t.getFgColor();t.isFgRGB()?s.push(38,2,e>>>16&255,e>>>8&255,255&e):t.isFgPalette()?e>=16?s.push(38,5,e):s.push(8&e?90+(7&e):30+(7&e)):s.push(39)}if(i){const e=t.getBgColor();t.isBgRGB()?s.push(48,2,e>>>16&255,e>>>8&255,255&e):t.isBgPalette()?e>=16?s.push(48,5,e):s.push(8&e?100+(7&e):40+(7&e)):s.push(49)}o&&(t.isInverse()!==e.isInverse()&&s.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&s.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&s.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&s.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&s.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&s.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&s.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&s.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&s.push(t.isStrikethrough()?9:29))}return s}_nextCell(t,e,s,r){if(0===t.getWidth())return;const i=""===t.getChars(),o=this._diffStyle(t,this._cursorStyle);if(i?!l(this._cursorStyle,t):o.length>0){this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r,this._currentRow+=`[${o.join(";")}m`;const t=this._buffer.getLine(s);void 0!==t&&(t.getCell(r,this._cursorStyle),this._cursorStyleRow=s,this._cursorStyleCol=r)}i?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(l(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`[${this._nullCellCount}X`),this._currentRow+=`[${this._nullCellCount}C`,this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=s,this._lastContentCursorCol=this._lastCursorCol=r+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let s="";for(let t=0;t<e;t++)s+=this._allRows[t],t+1<e&&(s+=this._allRowSeparators[t]);if(!t){const t=this._buffer.baseY+this._buffer.cursorY,e=this._buffer.cursorX,i=t=>{t>0?s+=`[${t}C`:t<0&&(s+=`[${-t}D`)};(t!==this._lastCursorRow||e!==this._lastCursorCol)&&((r=t-this._lastCursorRow)>0?s+=`[${r}B`:r<0&&(s+=`[${-r}A`),i(e-this._lastCursorCol))}var r;const i=this._terminal._core._inputHandler._curAttrData,o=this._diffStyle(i,this._cursorStyle);return o.length>0&&(s+=`[${o.join(";")}m`),s}}t.SerializeAddon=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,s){const r=e.length,o=void 0===s?r:i(s+t.rows,0,r);return this._serializeBufferByRange(t,e,{start:r-o,end:r-1},!1)}_serializeBufferByRange(t,e,s,r){return new u(e,t).serialize({start:{x:0,y:"number"==typeof s.start?s.start:s.start.line},end:{x:t.cols,y:"number"==typeof s.end?s.end:s.end.line}},r)}_serializeBufferAsHTML(t,e){const s=t.buffer.active,r=new h(s,t,e),o=e.onlySelection??!1,n=e.range;if(n)return r.serialize({start:{x:n.startCol,y:(n.startLine,n.startLine)},end:{x:t.cols,y:(n.endLine,n.endLine)}});if(!o){const o=s.length,n=e.scrollback,l=void 0===n?o:i(n+t.rows,0,o);return r.serialize({start:{x:0,y:o-l},end:{x:t.cols,y:o-1}})}const l=this._terminal?.getSelectionPosition();return void 0!==l?r.serialize({start:{x:l.start.x,y:l.start.y},end:{x:l.end.x,y:l.end.y}}):""}_serializeModes(t){let e="";const s=t.modes;if(s.applicationCursorKeysMode&&(e+="[?1h"),s.applicationKeypadMode&&(e+="[?66h"),s.bracketedPasteMode&&(e+="[?2004h"),s.insertMode&&(e+="[4h"),s.originMode&&(e+="[?6h"),s.reverseWraparoundMode&&(e+="[?45h"),s.sendFocusMode&&(e+="[?1004h"),!1===s.wraparoundMode&&(e+="[?7l"),"none"!==s.mouseTrackingMode)switch(s.mouseTrackingMode){case"x10":e+="[?9h";break;case"vt200":e+="[?1000h";break;case"drag":e+="[?1002h";break;case"any":e+="[?1003h"}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t?.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t?.scrollback);return t?.excludeAltBuffer||"alternate"!==this._terminal.buffer.active.type||(e+=`[?1049h[H${this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0)}`),t?.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}};class h extends o{constructor(t,s,r){super(t),this._terminal=s,this._options=r,this._currentRow="",this._htmlContent="",s._core._themeService?this._ansiColors=s._core._themeService.colors.ansi:this._ansiColors=e.DEFAULT_ANSI_COLORS}_padStart(t,e,s){return e|=0,s=s??" ",t.length>e?t:((e-=t.length)>s.length&&(s+=s.repeat(e/s.length)),s.slice(0,e)+t)}_beforeSerialize(t,e,s){this._htmlContent+="<html><body>\x3c!--StartFragment--\x3e<pre>";let r="#000000",i="#ffffff";this._options.includeGlobalBackground&&(r=this._terminal.options.theme?.foreground??"#ffffff",i=this._terminal.options.theme?.background??"#000000");const o=[];o.push("color: "+r+";"),o.push("background-color: "+i+";"),o.push("font-family: "+this._terminal.options.fontFamily+";"),o.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+o.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre>\x3c!--EndFragment--\x3e</body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){const s=e?t.getFgColor():t.getBgColor();return(e?t.isFgRGB():t.isBgRGB())?"#"+[s>>16&255,s>>8&255,255&s].map(t=>this._padStart(t.toString(16),2,"0")).join(""):(e?t.isFgPalette():t.isBgPalette())?this._ansiColors[s].css:void 0}_diffStyle(t,e){const s=[],r=!n(t,e),i=!l(t,e),o=!a(t,e);if(r||i||o){const e=this._getHexColor(t,!0);e&&s.push("color: "+e+";");const r=this._getHexColor(t,!1);return r&&s.push("background-color: "+r+";"),t.isInverse()&&s.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&s.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?s.push("text-decoration: overline underline;"):t.isUnderline()?s.push("text-decoration: underline;"):t.isOverline()&&s.push("text-decoration: overline;"),t.isBlink()&&s.push("text-decoration: blink;"),t.isInvisible()&&s.push("visibility: hidden;"),t.isItalic()&&s.push("font-style: italic;"),t.isDim()&&s.push("opacity: 0.5;"),t.isStrikethrough()&&s.push("text-decoration: line-through;"),s}}_nextCell(t,e,s,r){if(0===t.getWidth())return;const i=""===t.getChars(),o=this._diffStyle(t,e);o&&(this._currentRow+=0===o.length?"</span><span>":"</span><span style='"+o.join(" ")+"'>"),this._currentRow+=i?" ":function(t){switch(t){case"&":return"&";case"<":return"<"}return t}(t.getChars())}_serializeString(){return this._htmlContent}}t.HTMLSerializeHandler=h})(),r})());
|
|
2
2
|
//# sourceMappingURL=addon-serialize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addon-serialize.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,YAAY,I,sHCDf,eA4Ka,EAAAC,oBAAsBC,OAAOC,OAAO,MAC/C,MAAMC,EAAS,CAEb,EAAAC,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WAEZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,YAKRC,EAAI,CAAC,EAA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jB,IAAK,IAAK,MAAO,OAEnB,OAAOA,CACT,CAypB0BmQ,CAAexI,EAAKmD,WAE5C,CAEU,gBAAApD,GACR,OAAOzB,KAAK6I,YACd,EAjJF,wB","sources":["webpack://SerializeAddon/webpack/universalModuleDefinition","webpack://SerializeAddon/../../src/browser/Types.ts","webpack://SerializeAddon/../../src/common/Color.ts","webpack://SerializeAddon/webpack/bootstrap","webpack://SerializeAddon/./src/SerializeAddon.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SerializeAddon\"] = factory();\n\telse\n\t\troot[\"SerializeAddon\"] = factory();\n})(globalThis, () => {\nreturn ","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, IColor, ICoreTerminal, ITerminalOptions } from 'common/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IDisposable, Terminal as ITerminalApi } from '@xterm/xterm';\nimport { channels, css } from 'common/Color';\nimport type { Event } from 'vs/base/common/event';\n\n/**\n * A portion of the public API that are implemented identially internally and simply passed through.\n */\ntype InternalPassthroughApis = Omit<ITerminalApi, 'buffer' | 'parser' | 'unicode' | 'modes' | 'writeln' | 'loadAddon'>;\n\nexport interface ITerminal extends InternalPassthroughApis, ICoreTerminal {\n screenElement: HTMLElement | undefined;\n browser: IBrowser;\n buffer: IBuffer;\n linkifier: ILinkifier2 | undefined;\n options: Required<ITerminalOptions>;\n\n onBlur: Event<void>;\n onFocus: Event<void>;\n onA11yChar: Event<string>;\n onA11yTab: Event<number>;\n onWillOpen: Event<HTMLElement>;\n\n cancel(ev: MouseEvent | WheelEvent | KeyboardEvent | InputEvent, force?: boolean): boolean | void;\n}\n\nexport type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;\nexport type CustomWheelEventHandler = (event: WheelEvent) => boolean;\n\nexport type LineData = CharData[];\n\nexport interface ICompositionHelper {\n readonly isComposing: boolean;\n compositionstart(): void;\n compositionupdate(ev: CompositionEvent): void;\n compositionend(): void;\n updateCompositionElements(dontRecurse?: boolean): void;\n keydown(ev: KeyboardEvent): boolean;\n}\n\nexport interface IBrowser {\n isNode: boolean;\n userAgent: string;\n platform: string;\n isFirefox: boolean;\n isMac: boolean;\n isIpad: boolean;\n isIphone: boolean;\n isWindows: boolean;\n}\n\nexport interface IColorSet {\n foreground: IColor;\n background: IColor;\n cursor: IColor;\n cursorAccent: IColor;\n selectionForeground: IColor | undefined;\n selectionBackgroundTransparent: IColor;\n /** The selection blended on top of background. */\n selectionBackgroundOpaque: IColor;\n selectionInactiveBackgroundTransparent: IColor;\n selectionInactiveBackgroundOpaque: IColor;\n scrollbarSliderBackground: IColor;\n scrollbarSliderHoverBackground: IColor;\n scrollbarSliderActiveBackground: IColor;\n overviewRulerBorder: IColor;\n ansi: IColor[];\n /** Maps original colors to colors that respect minimum contrast ratio. */\n contrastCache: IColorContrastCache;\n /** Maps original colors to colors that respect _half_ of the minimum contrast ratio. */\n halfContrastCache: IColorContrastCache;\n}\n\nexport type ReadonlyColorSet = Readonly<Omit<IColorSet, 'ansi'>> & { ansi: Readonly<Pick<IColorSet, 'ansi'>['ansi']> };\n\nexport interface IColorContrastCache {\n clear(): void;\n setCss(bg: number, fg: number, value: string | null): void;\n getCss(bg: number, fg: number): string | null | undefined;\n setColor(bg: number, fg: number, value: IColor | null): void;\n getColor(bg: number, fg: number): IColor | null | undefined;\n}\n\nexport interface IPartialColorSet {\n foreground: IColor;\n background: IColor;\n cursor?: IColor;\n cursorAccent?: IColor;\n selectionBackground?: IColor;\n ansi: IColor[];\n}\n\nexport interface IViewport extends IDisposable {\n scrollBarWidth: number;\n readonly onRequestScrollLines: Event<{ amount: number, suppressScrollEvent: boolean }>;\n syncScrollArea(immediate?: boolean, force?: boolean): void;\n getLinesScrolled(ev: WheelEvent): number;\n getBufferElements(startLine: number, endLine?: number): { bufferElements: HTMLElement[], cursorElement?: HTMLElement };\n handleWheel(ev: WheelEvent): boolean;\n handleTouchStart(ev: TouchEvent): void;\n handleTouchMove(ev: TouchEvent): boolean;\n scrollLines(disp: number): void; // todo api name?\n reset(): void;\n}\n\nexport interface ILinkifierEvent {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n cols: number;\n fg: number | undefined;\n}\n\ninterface ILinkState {\n decorations: ILinkDecorations;\n isHovered: boolean;\n}\nexport interface ILinkWithState {\n link: ILink;\n state?: ILinkState;\n}\n\nexport interface ILinkifier2 extends IDisposable {\n onShowLinkUnderline: Event<ILinkifierEvent>;\n onHideLinkUnderline: Event<ILinkifierEvent>;\n readonly currentLink: ILinkWithState | undefined;\n}\n\nexport interface ILink {\n range: IBufferRange;\n text: string;\n decorations?: ILinkDecorations;\n activate(event: MouseEvent, text: string): void;\n hover?(event: MouseEvent, text: string): void;\n leave?(event: MouseEvent, text: string): void;\n dispose?(): void;\n}\n\nexport interface ILinkDecorations {\n pointerCursor: boolean;\n underline: boolean;\n}\n\nexport interface IBufferRange {\n start: IBufferCellPosition;\n end: IBufferCellPosition;\n}\n\nexport interface IBufferCellPosition {\n x: number;\n y: number;\n}\n\nexport type CharacterJoinerHandler = (text: string) => [number, number][];\n\nexport interface ICharacterJoiner {\n id: number;\n handler: CharacterJoinerHandler;\n}\n\nexport interface IRenderDebouncer extends IDisposable {\n refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void;\n}\n\nexport interface IRenderDebouncerWithCallback extends IRenderDebouncer {\n addRefreshCallback(callback: FrameRequestCallback): number;\n}\n\nexport interface IBufferElementProvider {\n provideBufferElements(): DocumentFragment | HTMLElement;\n}\n\n// An IIFE to generate DEFAULT_ANSI_COLORS.\nexport const DEFAULT_ANSI_COLORS = Object.freeze((() => {\n const colors = [\n // dark:\n css.toColor('#2e3436'),\n css.toColor('#cc0000'),\n css.toColor('#4e9a06'),\n css.toColor('#c4a000'),\n css.toColor('#3465a4'),\n css.toColor('#75507b'),\n css.toColor('#06989a'),\n css.toColor('#d3d7cf'),\n // bright:\n css.toColor('#555753'),\n css.toColor('#ef2929'),\n css.toColor('#8ae234'),\n css.toColor('#fce94f'),\n css.toColor('#729fcf'),\n css.toColor('#ad7fa8'),\n css.toColor('#34e2e2'),\n css.toColor('#eeeeec')\n ];\n\n // Fill in the remaining 240 ANSI colors.\n // Generate colors (16-231)\n const v = [0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff];\n for (let i = 0; i < 216; i++) {\n const r = v[(i / 36) % 6 | 0];\n const g = v[(i / 6) % 6 | 0];\n const b = v[i % 6];\n colors.push({\n css: channels.toCss(r, g, b),\n rgba: channels.toRgba(r, g, b)\n });\n }\n\n // Generate greys (232-255)\n for (let i = 0; i < 24; i++) {\n const c = 8 + i * 10;\n colors.push({\n css: channels.toCss(c, c, c),\n rgba: channels.toRgba(c, c, c)\n });\n }\n\n return colors;\n})());\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColor, IColorRGB } from 'common/Types';\n\nlet $r = 0;\nlet $g = 0;\nlet $b = 0;\nlet $a = 0;\n\nexport const NULL_COLOR: IColor = {\n css: '#00000000',\n rgba: 0\n};\n\n/**\n * Helper functions where the source type is \"channels\" (individual color channels as numbers).\n */\nexport namespace channels {\n export function toCss(r: number, g: number, b: number, a?: number): string {\n if (a !== undefined) {\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}${toPaddedHex(a)}`;\n }\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}`;\n }\n\n export function toRgba(r: number, g: number, b: number, a: number = 0xFF): number {\n // Note: The aggregated number is RGBA32 (BE), thus needs to be converted to ABGR32\n // on LE systems, before it can be used for direct 32-bit buffer writes.\n // >>> 0 forces an unsigned int\n return (r << 24 | g << 16 | b << 8 | a) >>> 0;\n }\n\n export function toColor(r: number, g: number, b: number, a?: number): IColor {\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n}\n\n/**\n * Helper functions where the source type is `IColor`.\n */\nexport namespace color {\n export function blend(bg: IColor, fg: IColor): IColor {\n $a = (fg.rgba & 0xFF) / 255;\n if ($a === 1) {\n return {\n css: fg.css,\n rgba: fg.rgba\n };\n }\n const fgR = (fg.rgba >> 24) & 0xFF;\n const fgG = (fg.rgba >> 16) & 0xFF;\n const fgB = (fg.rgba >> 8) & 0xFF;\n const bgR = (bg.rgba >> 24) & 0xFF;\n const bgG = (bg.rgba >> 16) & 0xFF;\n const bgB = (bg.rgba >> 8) & 0xFF;\n $r = bgR + Math.round((fgR - bgR) * $a);\n $g = bgG + Math.round((fgG - bgG) * $a);\n $b = bgB + Math.round((fgB - bgB) * $a);\n const css = channels.toCss($r, $g, $b);\n const rgba = channels.toRgba($r, $g, $b);\n return { css, rgba };\n }\n\n export function isOpaque(color: IColor): boolean {\n return (color.rgba & 0xFF) === 0xFF;\n }\n\n export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {\n const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);\n if (!result) {\n return undefined;\n }\n return channels.toColor(\n (result >> 24 & 0xFF),\n (result >> 16 & 0xFF),\n (result >> 8 & 0xFF)\n );\n }\n\n export function opaque(color: IColor): IColor {\n const rgbaColor = (color.rgba | 0xFF) >>> 0;\n [$r, $g, $b] = rgba.toChannels(rgbaColor);\n return {\n css: channels.toCss($r, $g, $b),\n rgba: rgbaColor\n };\n }\n\n export function opacity(color: IColor, opacity: number): IColor {\n $a = Math.round(opacity * 0xFF);\n [$r, $g, $b] = rgba.toChannels(color.rgba);\n return {\n css: channels.toCss($r, $g, $b, $a),\n rgba: channels.toRgba($r, $g, $b, $a)\n };\n }\n\n export function multiplyOpacity(color: IColor, factor: number): IColor {\n $a = color.rgba & 0xFF;\n return opacity(color, ($a * factor) / 0xFF);\n }\n\n export function toColorRGB(color: IColor): IColorRGB {\n return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];\n }\n}\n\n/**\n * Helper functions where the source type is \"css\" (string: '#rgb', '#rgba', '#rrggbb',\n * '#rrggbbaa').\n */\nexport namespace css {\n // Attempt to set get the shared canvas context\n let $ctx: CanvasRenderingContext2D | undefined;\n let $litmusColor: CanvasGradient | undefined;\n try {\n // This is guaranteed to run in the first window, so document should be correct\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true\n });\n if (ctx) {\n $ctx = ctx;\n $ctx.globalCompositeOperation = 'copy';\n $litmusColor = $ctx.createLinearGradient(0, 0, 1, 1);\n }\n }\n catch {\n // noop\n }\n\n /**\n * Converts a css string to an IColor, this should handle all valid CSS color strings and will\n * throw if it's invalid. The ideal format to use is `#rrggbb[aa]` as it's the fastest to parse.\n *\n * Only `#rgb[a]`, `#rrggbb[aa]`, `rgb()` and `rgba()` formats are supported when run in a Node\n * environment.\n */\n export function toColor(css: string): IColor {\n // Formats: #rgb[a] and #rrggbb[aa]\n if (css.match(/#[\\da-f]{3,8}/i)) {\n switch (css.length) {\n case 4: { // #rgb\n $r = parseInt(css.slice(1, 2).repeat(2), 16);\n $g = parseInt(css.slice(2, 3).repeat(2), 16);\n $b = parseInt(css.slice(3, 4).repeat(2), 16);\n return channels.toColor($r, $g, $b);\n }\n case 5: { // #rgba\n $r = parseInt(css.slice(1, 2).repeat(2), 16);\n $g = parseInt(css.slice(2, 3).repeat(2), 16);\n $b = parseInt(css.slice(3, 4).repeat(2), 16);\n $a = parseInt(css.slice(4, 5).repeat(2), 16);\n return channels.toColor($r, $g, $b, $a);\n }\n case 7: // #rrggbb\n return {\n css,\n rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0\n };\n case 9: // #rrggbbaa\n return {\n css,\n rgba: parseInt(css.slice(1), 16) >>> 0\n };\n }\n }\n\n // Formats: rgb() or rgba()\n const rgbaMatch = css.match(/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*(0|1|\\d?\\.(\\d+))\\s*)?\\)/);\n if (rgbaMatch) {\n $r = parseInt(rgbaMatch[1]);\n $g = parseInt(rgbaMatch[2]);\n $b = parseInt(rgbaMatch[3]);\n $a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);\n return channels.toColor($r, $g, $b, $a);\n }\n\n // Validate the context is available for canvas-based color parsing\n if (!$ctx || !$litmusColor) {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n // Validate the color using canvas fillStyle\n // See https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles\n $ctx.fillStyle = $litmusColor;\n $ctx.fillStyle = css;\n if (typeof $ctx.fillStyle !== 'string') {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n $ctx.fillRect(0, 0, 1, 1);\n [$r, $g, $b, $a] = $ctx.getImageData(0, 0, 1, 1).data;\n\n // Validate the color is non-transparent as color hue gets lost when drawn to the canvas\n if ($a !== 0xFF) {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n // Extract the color from the canvas' fillStyle property which exposes the color value in rgba()\n // format\n // See https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n return {\n rgba: channels.toRgba($r, $g, $b, $a),\n css\n };\n }\n}\n\n/**\n * Helper functions where the source type is \"rgb\" (number: 0xrrggbb).\n */\nexport namespace rgb {\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param rgb The color to use.\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance(rgb: number): number {\n return relativeLuminance2(\n (rgb >> 16) & 0xFF,\n (rgb >> 8 ) & 0xFF,\n (rgb ) & 0xFF);\n }\n\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param r The red channel (0x00 to 0xFF).\n * @param g The green channel (0x00 to 0xFF).\n * @param b The blue channel (0x00 to 0xFF).\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance2(r: number, g: number, b: number): number {\n const rs = r / 255;\n const gs = g / 255;\n const bs = b / 255;\n const rr = rs <= 0.03928 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);\n const rg = gs <= 0.03928 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);\n const rb = bs <= 0.03928 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);\n return rr * 0.2126 + rg * 0.7152 + rb * 0.0722;\n }\n}\n\n/**\n * Helper functions where the source type is \"rgba\" (number: 0xrrggbbaa).\n */\nexport namespace rgba {\n export function blend(bg: number, fg: number): number {\n $a = (fg & 0xFF) / 0xFF;\n if ($a === 1) {\n return fg;\n }\n const fgR = (fg >> 24) & 0xFF;\n const fgG = (fg >> 16) & 0xFF;\n const fgB = (fg >> 8) & 0xFF;\n const bgR = (bg >> 24) & 0xFF;\n const bgG = (bg >> 16) & 0xFF;\n const bgB = (bg >> 8) & 0xFF;\n $r = bgR + Math.round((fgR - bgR) * $a);\n $g = bgG + Math.round((fgG - bgG) * $a);\n $b = bgB + Math.round((fgB - bgB) * $a);\n return channels.toRgba($r, $g, $b);\n }\n\n /**\n * Given a foreground color and a background color, either increase or reduce the luminance of the\n * foreground color until the specified contrast ratio is met. If pure white or black is hit\n * without the contrast ratio being met, go the other direction using the background color as the\n * foreground color and take either the first or second result depending on which has the higher\n * contrast ratio.\n *\n * `undefined` will be returned if the contrast ratio is already met.\n *\n * @param bgRgba The background color in rgba format.\n * @param fgRgba The foreground color in rgba format.\n * @param ratio The contrast ratio to achieve.\n */\n export function ensureContrastRatio(bgRgba: number, fgRgba: number, ratio: number): number | undefined {\n const bgL = rgb.relativeLuminance(bgRgba >> 8);\n const fgL = rgb.relativeLuminance(fgRgba >> 8);\n const cr = contrastRatio(bgL, fgL);\n if (cr < ratio) {\n if (fgL < bgL) {\n const resultA = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n const resultA = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n return undefined;\n }\n\n export function reduceLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to reducing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR > 0 || fgG > 0 || fgB > 0)) {\n // Reduce by 10% until the ratio is hit\n fgR -= Math.max(0, Math.ceil(fgR * 0.1));\n fgG -= Math.max(0, Math.ceil(fgG * 0.1));\n fgB -= Math.max(0, Math.ceil(fgB * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function increaseLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to increasing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR < 0xFF || fgG < 0xFF || fgB < 0xFF)) {\n // Increase by 10% until the ratio is hit\n fgR = Math.min(0xFF, fgR + Math.ceil((255 - fgR) * 0.1));\n fgG = Math.min(0xFF, fgG + Math.ceil((255 - fgG) * 0.1));\n fgB = Math.min(0xFF, fgB + Math.ceil((255 - fgB) * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function toChannels(value: number): [number, number, number, number] {\n return [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF];\n }\n}\n\nexport function toPaddedHex(c: number): string {\n const s = c.toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n\n/**\n * Gets the contrast ratio between two relative luminance values.\n * @param l1 The first relative luminance.\n * @param l2 The first relative luminance.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function contrastRatio(l1: number, l2: number): number {\n if (l1 < l2) {\n return (l2 + 0.05) / (l1 + 0.05);\n }\n return (l1 + 0.05) / (l2 + 0.05);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * (EXPERIMENTAL) This Addon is still under development\n */\n\nimport type { IBuffer, IBufferCell, IBufferRange, ITerminalAddon, Terminal } from '@xterm/xterm';\nimport type { IHTMLSerializeOptions, SerializeAddon as ISerializeApi, ISerializeOptions, ISerializeRange } from '@xterm/addon-serialize';\nimport { IAttributeData, IColor } from 'common/Types';\nimport { DEFAULT_ANSI_COLORS } from 'browser/Types';\n\nfunction constrain(value: number, low: number, high: number): number {\n return Math.max(low, Math.min(value, high));\n}\n\nfunction escapeHTMLChar(c: string): string {\n switch (c) {\n case '&': return '&';\n case '<': return '<';\n }\n return c;\n}\n\n// TODO: Refine this template class later\nabstract class BaseSerializeHandler {\n constructor(\n protected readonly _buffer: IBuffer\n ) {\n }\n\n public serialize(range: IBufferRange, excludeFinalCursorPosition?: boolean): string {\n // we need two of them to flip between old and new cell\n const cell1 = this._buffer.getNullCell();\n const cell2 = this._buffer.getNullCell();\n let oldCell = cell1;\n\n const startRow = range.start.y;\n const endRow = range.end.y;\n const startColumn = range.start.x;\n const endColumn = range.end.x;\n\n this._beforeSerialize(endRow - startRow, startRow, endRow);\n\n for (let row = startRow; row <= endRow; row++) {\n const line = this._buffer.getLine(row);\n if (line) {\n const startLineColumn = row === range.start.y ? startColumn : 0;\n const endLineColumn = row === range.end.y ? endColumn: line.length;\n for (let col = startLineColumn; col < endLineColumn; col++) {\n const c = line.getCell(col, oldCell === cell1 ? cell2 : cell1);\n if (!c) {\n console.warn(`Can't get cell at row=${row}, col=${col}`);\n continue;\n }\n this._nextCell(c, oldCell, row, col);\n oldCell = c;\n }\n }\n this._rowEnd(row, row === endRow);\n }\n\n this._afterSerialize();\n\n return this._serializeString(excludeFinalCursorPosition);\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void { }\n protected _rowEnd(row: number, isLastRow: boolean): void { }\n protected _beforeSerialize(rows: number, startRow: number, endRow: number): void { }\n protected _afterSerialize(): void { }\n protected _serializeString(excludeFinalCursorPosition?: boolean): string { return ''; }\n}\n\nfunction equalFg(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.getFgColorMode() === cell2.getFgColorMode()\n && cell1.getFgColor() === cell2.getFgColor();\n}\n\nfunction equalBg(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.getBgColorMode() === cell2.getBgColorMode()\n && cell1.getBgColor() === cell2.getBgColor();\n}\n\nfunction equalFlags(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.isInverse() === cell2.isInverse()\n && cell1.isBold() === cell2.isBold()\n && cell1.isUnderline() === cell2.isUnderline()\n && cell1.isOverline() === cell2.isOverline()\n && cell1.isBlink() === cell2.isBlink()\n && cell1.isInvisible() === cell2.isInvisible()\n && cell1.isItalic() === cell2.isItalic()\n && cell1.isDim() === cell2.isDim()\n && cell1.isStrikethrough() === cell2.isStrikethrough();\n}\n\nclass StringSerializeHandler extends BaseSerializeHandler {\n private _rowIndex: number = 0;\n private _allRows: string[] = new Array<string>();\n private _allRowSeparators: string[] = new Array<string>();\n private _currentRow: string = '';\n private _nullCellCount: number = 0;\n\n // we can see a full colored cell and a null cell that only have background the same style\n // but the information isn't preserved by null cell itself\n // so wee need to record it when required.\n private _cursorStyle: IBufferCell = this._buffer.getNullCell();\n\n // where exact the cursor styles comes from\n // because we can't copy the cell directly\n // so we remember where the content comes from instead\n private _cursorStyleRow: number = 0;\n private _cursorStyleCol: number = 0;\n\n // this is a null cell for reference for checking whether background is empty or not\n private _backgroundCell: IBufferCell = this._buffer.getNullCell();\n\n private _firstRow: number = 0;\n private _lastCursorRow: number = 0;\n private _lastCursorCol: number = 0;\n private _lastContentCursorRow: number = 0;\n private _lastContentCursorCol: number = 0;\n\n constructor(\n buffer: IBuffer,\n private readonly _terminal: Terminal\n ) {\n super(buffer);\n }\n\n protected _beforeSerialize(rows: number, start: number, end: number): void {\n this._allRows = new Array<string>(rows);\n this._lastContentCursorRow = start;\n this._lastCursorRow = start;\n this._firstRow = start;\n }\n\n private _thisRowLastChar: IBufferCell = this._buffer.getNullCell();\n private _thisRowLastSecondChar: IBufferCell = this._buffer.getNullCell();\n private _nextRowFirstChar: IBufferCell = this._buffer.getNullCell();\n protected _rowEnd(row: number, isLastRow: boolean): void {\n // if there is colorful empty cell at line end, whe must pad it back, or the the color block\n // will missing\n if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) {\n // use clear right to set background.\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n }\n\n let rowSeparator = '';\n\n // handle row separator\n if (!isLastRow) {\n // Enable BCE\n if (row - this._firstRow >= this._terminal.rows) {\n this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell);\n }\n\n // Fetch current line\n const currentLine = this._buffer.getLine(row)!;\n // Fetch next line\n const nextLine = this._buffer.getLine(row + 1)!;\n\n if (!nextLine.isWrapped) {\n // just insert the line break\n rowSeparator = '\\r\\n';\n // we sended the enter\n this._lastCursorRow = row + 1;\n this._lastCursorCol = 0;\n } else {\n rowSeparator = '';\n const thisRowLastChar = currentLine.getCell(currentLine.length - 1, this._thisRowLastChar)!;\n const thisRowLastSecondChar = currentLine.getCell(currentLine.length - 2, this._thisRowLastSecondChar)!;\n const nextRowFirstChar = nextLine.getCell(0, this._nextRowFirstChar)!;\n const isNextRowFirstCharDoubleWidth = nextRowFirstChar.getWidth() > 1;\n\n // validate whether this line wrap is ever possible\n // which mean whether cursor can placed at a overflow position (x === row) naturally\n let isValid = false;\n\n if (\n // you must output character to cause overflow, control sequence can't do this\n nextRowFirstChar.getChars() &&\n isNextRowFirstCharDoubleWidth ? this._nullCellCount <= 1 : this._nullCellCount <= 0\n ) {\n if (\n // the last character can't be null,\n // you can't use control sequence to move cursor to (x === row)\n (thisRowLastChar.getChars() || thisRowLastChar.getWidth() === 0) &&\n // change background of the first wrapped cell also affects BCE\n // so we mark it as invalid to simply the process to determine line separator\n equalBg(thisRowLastChar, nextRowFirstChar)\n ) {\n isValid = true;\n }\n\n if (\n // the second to last character can't be null if the next line starts with CJK,\n // you can't use control sequence to move cursor to (x === row)\n isNextRowFirstCharDoubleWidth &&\n (thisRowLastSecondChar.getChars() || thisRowLastSecondChar.getWidth() === 0) &&\n // change background of the first wrapped cell also affects BCE\n // so we mark it as invalid to simply the process to determine line separator\n equalBg(thisRowLastChar, nextRowFirstChar) &&\n equalBg(thisRowLastSecondChar, nextRowFirstChar)\n ) {\n isValid = true;\n }\n }\n\n if (!isValid) {\n // force the wrap with magic\n // insert enough character to force the wrap\n rowSeparator = '-'.repeat(this._nullCellCount + 1);\n // move back and erase next line head\n rowSeparator += '\\u001b[1D\\u001b[1X';\n\n if (this._nullCellCount > 0) {\n // do these because we filled the last several null slot, which we shouldn't\n rowSeparator += '\\u001b[A';\n rowSeparator += `\\u001b[${currentLine.length - this._nullCellCount}C`;\n rowSeparator += `\\u001b[${this._nullCellCount}X`;\n rowSeparator += `\\u001b[${currentLine.length - this._nullCellCount}D`;\n rowSeparator += '\\u001b[B';\n }\n\n // This is content and need the be serialized even it is invisible.\n // without this, wrap will be missing from outputs.\n this._lastContentCursorRow = row + 1;\n this._lastContentCursorCol = 0;\n\n // force commit the cursor position\n this._lastCursorRow = row + 1;\n this._lastCursorCol = 0;\n }\n }\n }\n\n this._allRows[this._rowIndex] = this._currentRow;\n this._allRowSeparators[this._rowIndex++] = rowSeparator;\n this._currentRow = '';\n this._nullCellCount = 0;\n }\n\n private _diffStyle(cell: IBufferCell | IAttributeData, oldCell: IBufferCell): number[] {\n const sgrSeq: number[] = [];\n const fgChanged = !equalFg(cell, oldCell);\n const bgChanged = !equalBg(cell, oldCell);\n const flagsChanged = !equalFlags(cell, oldCell);\n\n if (fgChanged || bgChanged || flagsChanged) {\n if (cell.isAttributeDefault()) {\n if (!oldCell.isAttributeDefault()) {\n sgrSeq.push(0);\n }\n } else {\n if (fgChanged) {\n const color = cell.getFgColor();\n if (cell.isFgRGB()) { sgrSeq.push(38, 2, (color >>> 16) & 0xFF, (color >>> 8) & 0xFF, color & 0xFF); }\n else if (cell.isFgPalette()) {\n if (color >= 16) { sgrSeq.push(38, 5, color); }\n else { sgrSeq.push(color & 8 ? 90 + (color & 7) : 30 + (color & 7)); }\n }\n else { sgrSeq.push(39); }\n }\n if (bgChanged) {\n const color = cell.getBgColor();\n if (cell.isBgRGB()) { sgrSeq.push(48, 2, (color >>> 16) & 0xFF, (color >>> 8) & 0xFF, color & 0xFF); }\n else if (cell.isBgPalette()) {\n if (color >= 16) { sgrSeq.push(48, 5, color); }\n else { sgrSeq.push(color & 8 ? 100 + (color & 7) : 40 + (color & 7)); }\n }\n else { sgrSeq.push(49); }\n }\n if (flagsChanged) {\n if (cell.isInverse() !== oldCell.isInverse()) { sgrSeq.push(cell.isInverse() ? 7 : 27); }\n if (cell.isBold() !== oldCell.isBold()) { sgrSeq.push(cell.isBold() ? 1 : 22); }\n if (cell.isUnderline() !== oldCell.isUnderline()) { sgrSeq.push(cell.isUnderline() ? 4 : 24); }\n if (cell.isOverline() !== oldCell.isOverline()) { sgrSeq.push(cell.isOverline() ? 53 : 55); }\n if (cell.isBlink() !== oldCell.isBlink()) { sgrSeq.push(cell.isBlink() ? 5 : 25); }\n if (cell.isInvisible() !== oldCell.isInvisible()) { sgrSeq.push(cell.isInvisible() ? 8 : 28); }\n if (cell.isItalic() !== oldCell.isItalic()) { sgrSeq.push(cell.isItalic() ? 3 : 23); }\n if (cell.isDim() !== oldCell.isDim()) { sgrSeq.push(cell.isDim() ? 2 : 22); }\n if (cell.isStrikethrough() !== oldCell.isStrikethrough()) { sgrSeq.push(cell.isStrikethrough() ? 9 : 29); }\n }\n }\n }\n\n return sgrSeq;\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {\n // a width 0 cell don't need to be count because it is just a placeholder after a CJK character;\n const isPlaceHolderCell = cell.getWidth() === 0;\n\n if (isPlaceHolderCell) {\n return;\n }\n\n // this cell don't have content\n const isEmptyCell = cell.getChars() === '';\n\n const sgrSeq = this._diffStyle(cell, this._cursorStyle);\n\n // the empty cell style is only assumed to be changed when background changed, because\n // foreground is always 0.\n const styleChanged = isEmptyCell ? !equalBg(this._cursorStyle, cell) : sgrSeq.length > 0;\n\n /**\n * handles style change\n */\n if (styleChanged) {\n // before update the style, we need to fill empty cell back\n if (this._nullCellCount > 0) {\n // use clear right to set background.\n if (!equalBg(this._cursorStyle, this._backgroundCell)) {\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n }\n // use move right to move cursor.\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n this._nullCellCount = 0;\n }\n\n this._lastContentCursorRow = this._lastCursorRow = row;\n this._lastContentCursorCol = this._lastCursorCol = col;\n\n this._currentRow += `\\u001b[${sgrSeq.join(';')}m`;\n\n // update the last cursor style\n const line = this._buffer.getLine(row);\n if (line !== undefined) {\n line.getCell(col, this._cursorStyle);\n this._cursorStyleRow = row;\n this._cursorStyleCol = col;\n }\n }\n\n /**\n * handles actual content\n */\n if (isEmptyCell) {\n this._nullCellCount += cell.getWidth();\n } else {\n if (this._nullCellCount > 0) {\n // we can just assume we have same style with previous one here\n // because style change is handled by previous stage\n // use move right when background is empty, use clear right when there is background.\n if (equalBg(this._cursorStyle, this._backgroundCell)) {\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n } else {\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n }\n this._nullCellCount = 0;\n }\n\n this._currentRow += cell.getChars();\n\n // update cursor\n this._lastContentCursorRow = this._lastCursorRow = row;\n this._lastContentCursorCol = this._lastCursorCol = col + cell.getWidth();\n }\n }\n\n protected _serializeString(excludeFinalCursorPosition: boolean): string {\n let rowEnd = this._allRows.length;\n\n // the fixup is only required for data without scrollback\n // because it will always be placed at last line otherwise\n if (this._buffer.length - this._firstRow <= this._terminal.rows) {\n rowEnd = this._lastContentCursorRow + 1 - this._firstRow;\n this._lastCursorCol = this._lastContentCursorCol;\n this._lastCursorRow = this._lastContentCursorRow;\n }\n\n let content = '';\n\n for (let i = 0; i < rowEnd; i++) {\n content += this._allRows[i];\n if (i + 1 < rowEnd) {\n content += this._allRowSeparators[i];\n }\n }\n\n // restore the cursor\n if (!excludeFinalCursorPosition) {\n const realCursorRow = this._buffer.baseY + this._buffer.cursorY;\n const realCursorCol = this._buffer.cursorX;\n\n const cursorMoved = (realCursorRow !== this._lastCursorRow || realCursorCol !== this._lastCursorCol);\n\n const moveRight = (offset: number): void => {\n if (offset > 0) {\n content += `\\u001b[${offset}C`;\n } else if (offset < 0) {\n content += `\\u001b[${-offset}D`;\n }\n };\n const moveDown = (offset: number): void => {\n if (offset > 0) {\n content += `\\u001b[${offset}B`;\n } else if (offset < 0) {\n content += `\\u001b[${-offset}A`;\n }\n };\n\n if (cursorMoved) {\n moveDown(realCursorRow - this._lastCursorRow);\n moveRight(realCursorCol - this._lastCursorCol);\n }\n }\n\n // Restore the cursor's current style, see https://github.com/xtermjs/xterm.js/issues/3677\n // HACK: Internal API access since it's awkward to expose this in the API and serialize will\n // likely be the only consumer\n const curAttrData: IAttributeData = (this._terminal as any)._core._inputHandler._curAttrData;\n const sgrSeq = this._diffStyle(curAttrData, this._cursorStyle);\n if (sgrSeq.length > 0) {\n content += `\\u001b[${sgrSeq.join(';')}m`;\n }\n\n return content;\n }\n}\n\nexport class SerializeAddon implements ITerminalAddon , ISerializeApi {\n private _terminal: Terminal | undefined;\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n }\n\n private _serializeBufferByScrollback(terminal: Terminal, buffer: IBuffer, scrollback?: number): string {\n const maxRows = buffer.length;\n const correctRows = (scrollback === undefined) ? maxRows : constrain(scrollback + terminal.rows, 0, maxRows);\n return this._serializeBufferByRange(terminal, buffer, {\n start: maxRows - correctRows,\n end: maxRows - 1\n }, false);\n }\n\n private _serializeBufferByRange(terminal: Terminal, buffer: IBuffer, range: ISerializeRange, excludeFinalCursorPosition: boolean): string {\n const handler = new StringSerializeHandler(buffer, terminal);\n return handler.serialize({\n start: { x: 0, y: typeof range.start === 'number' ? range.start : range.start.line },\n end: { x: terminal.cols, y: typeof range.end === 'number' ? range.end : range.end.line }\n }, excludeFinalCursorPosition);\n }\n\n private _serializeBufferAsHTML(terminal: Terminal, options: Partial<IHTMLSerializeOptions>): string {\n const buffer = terminal.buffer.active;\n const handler = new HTMLSerializeHandler(buffer, terminal, options);\n const onlySelection = options.onlySelection ?? false;\n const range = options.range;\n if (range) {\n return handler.serialize({\n start: { x: range.startCol, y: typeof range.startLine === 'number' ? range.startLine : range.startLine },\n end: { x: terminal.cols, y: typeof range.endLine === 'number' ? range.endLine : range.endLine }\n });\n }\n if (!onlySelection) {\n const maxRows = buffer.length;\n const scrollback = options.scrollback;\n const correctRows = (scrollback === undefined) ? maxRows : constrain(scrollback + terminal.rows, 0, maxRows);\n return handler.serialize({\n start: { x: 0, y: maxRows - correctRows },\n end: { x: terminal.cols, y: maxRows - 1 }\n });\n }\n\n const selection = this._terminal?.getSelectionPosition();\n if (selection !== undefined) {\n return handler.serialize({\n start: { x: selection.start.x, y: selection.start.y },\n end: { x: selection.end.x, y: selection.end.y }\n });\n }\n\n return '';\n }\n\n private _serializeModes(terminal: Terminal): string {\n let content = '';\n const modes = terminal.modes;\n\n // Default: false\n if (modes.applicationCursorKeysMode) content += '\\x1b[?1h';\n if (modes.applicationKeypadMode) content += '\\x1b[?66h';\n if (modes.bracketedPasteMode) content += '\\x1b[?2004h';\n if (modes.insertMode) content += '\\x1b[4h';\n if (modes.originMode) content += '\\x1b[?6h';\n if (modes.reverseWraparoundMode) content += '\\x1b[?45h';\n if (modes.sendFocusMode) content += '\\x1b[?1004h';\n // synchronizedOutputMode doesn't need to be serialized as it's a temporary mode\n\n // Default: true\n if (modes.wraparoundMode === false) content += '\\x1b[?7l';\n\n // Default: 'none'\n if (modes.mouseTrackingMode !== 'none') {\n switch (modes.mouseTrackingMode) {\n case 'x10': content += '\\x1b[?9h'; break;\n case 'vt200': content += '\\x1b[?1000h'; break;\n case 'drag': content += '\\x1b[?1002h'; break;\n case 'any': content += '\\x1b[?1003h'; break;\n }\n }\n\n return content;\n }\n\n public serialize(options?: ISerializeOptions): string {\n // TODO: Add combinedData support\n if (!this._terminal) {\n throw new Error('Cannot use addon until it has been loaded');\n }\n\n // Normal buffer\n let content = options?.range\n ? this._serializeBufferByRange(this._terminal, this._terminal.buffer.normal, options.range, true)\n : this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.normal, options?.scrollback);\n\n // Alternate buffer\n if (!options?.excludeAltBuffer) {\n if (this._terminal.buffer.active.type === 'alternate') {\n const alternativeScreenContent = this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.alternate, undefined);\n content += `\\u001b[?1049h\\u001b[H${alternativeScreenContent}`;\n }\n }\n\n // Modes\n if (!options?.excludeModes) {\n content += this._serializeModes(this._terminal);\n }\n\n return content;\n }\n\n public serializeAsHTML(options?: Partial<IHTMLSerializeOptions>): string {\n if (!this._terminal) {\n throw new Error('Cannot use addon until it has been loaded');\n }\n\n return this._serializeBufferAsHTML(this._terminal, options || {});\n }\n\n public dispose(): void { }\n}\n\nexport class HTMLSerializeHandler extends BaseSerializeHandler {\n private _currentRow: string = '';\n\n private _htmlContent = '';\n\n private _ansiColors: Readonly<IColor[]>;\n\n constructor(\n buffer: IBuffer,\n private readonly _terminal: Terminal,\n private readonly _options: Partial<IHTMLSerializeOptions>\n ) {\n super(buffer);\n\n // For xterm headless: fallback to ansi colors\n if ((_terminal as any)._core._themeService) {\n this._ansiColors = (_terminal as any)._core._themeService.colors.ansi;\n }\n else {\n this._ansiColors = DEFAULT_ANSI_COLORS;\n }\n }\n\n private _padStart(target: string, targetLength: number, padString: string): string {\n targetLength = targetLength >> 0;\n padString = padString ?? ' ';\n if (target.length > targetLength) {\n return target;\n }\n\n targetLength -= target.length;\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + target;\n }\n\n protected _beforeSerialize(rows: number, start: number, end: number): void {\n this._htmlContent += '<html><body><!--StartFragment--><pre>';\n\n let foreground = '#000000';\n let background = '#ffffff';\n if (this._options.includeGlobalBackground ?? false) {\n foreground = this._terminal.options.theme?.foreground ?? '#ffffff';\n background = this._terminal.options.theme?.background ?? '#000000';\n }\n\n const globalStyleDefinitions = [];\n globalStyleDefinitions.push('color: ' + foreground + ';');\n globalStyleDefinitions.push('background-color: ' + background + ';');\n globalStyleDefinitions.push('font-family: ' + this._terminal.options.fontFamily + ';');\n globalStyleDefinitions.push('font-size: ' + this._terminal.options.fontSize + 'px;');\n this._htmlContent += '<div style=\\'' + globalStyleDefinitions.join(' ') + '\\'>';\n }\n\n protected _afterSerialize(): void {\n this._htmlContent += '</div>';\n this._htmlContent += '</pre><!--EndFragment--></body></html>';\n }\n\n protected _rowEnd(row: number, isLastRow: boolean): void {\n this._htmlContent += '<div><span>' + this._currentRow + '</span></div>';\n this._currentRow = '';\n }\n\n private _getHexColor(cell: IBufferCell, isFg: boolean): string | undefined {\n const color = isFg ? cell.getFgColor() : cell.getBgColor();\n if (isFg ? cell.isFgRGB() : cell.isBgRGB()) {\n const rgb = [\n (color >> 16) & 255,\n (color >> 8) & 255,\n (color ) & 255\n ];\n return '#' + rgb.map(x => this._padStart(x.toString(16), 2, '0')).join('');\n }\n if (isFg ? cell.isFgPalette() : cell.isBgPalette()) {\n return this._ansiColors[color].css;\n }\n return undefined;\n }\n\n private _diffStyle(cell: IBufferCell, oldCell: IBufferCell): string[] | undefined {\n const content: string[] = [];\n\n const fgChanged = !equalFg(cell, oldCell);\n const bgChanged = !equalBg(cell, oldCell);\n const flagsChanged = !equalFlags(cell, oldCell);\n\n if (fgChanged || bgChanged || flagsChanged) {\n const fgHexColor = this._getHexColor(cell, true);\n if (fgHexColor) {\n content.push('color: ' + fgHexColor + ';');\n }\n\n const bgHexColor = this._getHexColor(cell, false);\n if (bgHexColor) {\n content.push('background-color: ' + bgHexColor + ';');\n }\n\n if (cell.isInverse()) { content.push('color: #000000; background-color: #BFBFBF;'); }\n if (cell.isBold()) { content.push('font-weight: bold;'); }\n if (cell.isUnderline() && cell.isOverline()) { content.push('text-decoration: overline underline;'); }\n else if (cell.isUnderline()) { content.push('text-decoration: underline;'); }\n else if (cell.isOverline()) { content.push('text-decoration: overline;'); }\n if (cell.isBlink()) { content.push('text-decoration: blink;'); }\n if (cell.isInvisible()) { content.push('visibility: hidden;'); }\n if (cell.isItalic()) { content.push('font-style: italic;'); }\n if (cell.isDim()) { content.push('opacity: 0.5;'); }\n if (cell.isStrikethrough()) { content.push('text-decoration: line-through;'); }\n\n return content;\n }\n\n return undefined;\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {\n // a width 0 cell don't need to be count because it is just a placeholder after a CJK character;\n const isPlaceHolderCell = cell.getWidth() === 0;\n if (isPlaceHolderCell) {\n return;\n }\n\n // this cell don't have content\n const isEmptyCell = cell.getChars() === '';\n\n const styleDefinitions = this._diffStyle(cell, oldCell);\n\n // handles style change\n if (styleDefinitions) {\n this._currentRow += styleDefinitions.length === 0 ?\n '</span><span>' :\n '</span><span style=\\'' + styleDefinitions.join(' ') + '\\'>';\n }\n\n // handles actual content\n if (isEmptyCell) {\n this._currentRow += ' ';\n } else {\n this._currentRow += escapeHTMLChar(cell.getChars());\n }\n }\n\n protected _serializeString(): string {\n return this._htmlContent;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","DEFAULT_ANSI_COLORS","Object","freeze","colors","css","toColor","v","i","r","g","b","push","channels","toCss","rgba","toRgba","c","$r","$g","$b","$a","color","rgb","toPaddedHex","s","toString","length","contrastRatio","l1","l2","NULL_COLOR","a","undefined","opacity","Math","round","toChannels","blend","bg","fg","fgR","fgG","fgB","bgR","bgG","bgB","isOpaque","ensureContrastRatio","ratio","result","opaque","rgbaColor","multiplyOpacity","factor","toColorRGB","$ctx","$litmusColor","canvas","document","createElement","width","height","ctx","getContext","willReadFrequently","globalCompositeOperation","createLinearGradient","match","parseInt","slice","repeat","rgbaMatch","parseFloat","Error","fillStyle","fillRect","getImageData","data","relativeLuminance2","rs","gs","bs","pow","relativeLuminance","reduceLuminance","bgRgba","fgRgba","cr","max","ceil","increaseLuminance","min","bgL","fgL","resultA","resultARatio","resultB","value","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","constrain","low","high","BaseSerializeHandler","constructor","_buffer","serialize","range","excludeFinalCursorPosition","cell1","this","getNullCell","cell2","oldCell","startRow","start","y","endRow","end","startColumn","x","endColumn","_beforeSerialize","row","line","getLine","startLineColumn","endLineColumn","col","getCell","_nextCell","console","warn","_rowEnd","_afterSerialize","_serializeString","cell","isLastRow","rows","equalFg","getFgColorMode","getFgColor","equalBg","getBgColorMode","getBgColor","equalFlags","isInverse","isBold","isUnderline","isOverline","isBlink","isInvisible","isItalic","isDim","isStrikethrough","StringSerializeHandler","buffer","_terminal","super","_rowIndex","_allRows","Array","_allRowSeparators","_currentRow","_nullCellCount","_cursorStyle","_cursorStyleRow","_cursorStyleCol","_backgroundCell","_firstRow","_lastCursorRow","_lastCursorCol","_lastContentCursorRow","_lastContentCursorCol","_thisRowLastChar","_thisRowLastSecondChar","_nextRowFirstChar","rowSeparator","currentLine","nextLine","isWrapped","thisRowLastChar","thisRowLastSecondChar","nextRowFirstChar","isNextRowFirstCharDoubleWidth","getWidth","isValid","getChars","_diffStyle","sgrSeq","fgChanged","bgChanged","flagsChanged","isAttributeDefault","isFgRGB","isFgPalette","isBgRGB","isBgPalette","isEmptyCell","join","rowEnd","content","realCursorRow","baseY","cursorY","realCursorCol","cursorX","moveRight","offset","curAttrData","_core","_inputHandler","_curAttrData","activate","terminal","_serializeBufferByScrollback","scrollback","maxRows","correctRows","_serializeBufferByRange","cols","_serializeBufferAsHTML","options","active","handler","HTMLSerializeHandler","onlySelection","startCol","startLine","endLine","selection","getSelectionPosition","_serializeModes","modes","applicationCursorKeysMode","applicationKeypadMode","bracketedPasteMode","insertMode","originMode","reverseWraparoundMode","sendFocusMode","wraparoundMode","mouseTrackingMode","normal","excludeAltBuffer","type","alternate","excludeModes","serializeAsHTML","dispose","_options","_htmlContent","_themeService","_ansiColors","ansi","_padStart","target","targetLength","padString","foreground","background","includeGlobalBackground","theme","globalStyleDefinitions","fontFamily","fontSize","_getHexColor","isFg","map","fgHexColor","bgHexColor","styleDefinitions","escapeHTMLChar"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"addon-serialize.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAwB,eAAID,IAE5BD,EAAqB,eAAIC,GAC1B,CATD,CASGK,WAAY,I,mHCDf,eA4Ka,EAAAC,oBAAsBC,OAAOC,OAAO,MAC/C,MAAMC,EAAS,CAEb,EAAAC,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WAEZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,WACZ,EAAAD,IAAIC,QAAQ,YAKRC,EAAI,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ACjB,IAAK,IAAK,MAAO,OAEnB,OAAOA,CACT,CAypB0BmQ,CAAexI,EAAKmD,WAE5C,CAEU,gBAAApD,GACR,OAAOzB,KAAK6I,YACd,EAjJF,wB","sources":["webpack://SerializeAddon/webpack/universalModuleDefinition","webpack://SerializeAddon/../../src/browser/Types.ts","webpack://SerializeAddon/../../src/common/Color.ts","webpack://SerializeAddon/webpack/bootstrap","webpack://SerializeAddon/./src/SerializeAddon.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SerializeAddon\"] = factory();\n\telse\n\t\troot[\"SerializeAddon\"] = factory();\n})(globalThis, () => {\nreturn ","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, IColor, ICoreTerminal, ITerminalOptions } from 'common/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IDisposable, Terminal as ITerminalApi } from '@xterm/xterm';\nimport { channels, css } from 'common/Color';\nimport type { Event } from 'vs/base/common/event';\n\n/**\n * A portion of the public API that are implemented identially internally and simply passed through.\n */\ntype InternalPassthroughApis = Omit<ITerminalApi, 'buffer' | 'parser' | 'unicode' | 'modes' | 'writeln' | 'loadAddon'>;\n\nexport interface ITerminal extends InternalPassthroughApis, ICoreTerminal {\n screenElement: HTMLElement | undefined;\n browser: IBrowser;\n buffer: IBuffer;\n linkifier: ILinkifier2 | undefined;\n options: Required<ITerminalOptions>;\n\n onBlur: Event<void>;\n onFocus: Event<void>;\n onA11yChar: Event<string>;\n onA11yTab: Event<number>;\n onWillOpen: Event<HTMLElement>;\n\n cancel(ev: MouseEvent | WheelEvent | KeyboardEvent | InputEvent, force?: boolean): boolean | void;\n}\n\nexport type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;\nexport type CustomWheelEventHandler = (event: WheelEvent) => boolean;\n\nexport type LineData = CharData[];\n\nexport interface ICompositionHelper {\n readonly isComposing: boolean;\n compositionstart(): void;\n compositionupdate(ev: CompositionEvent): void;\n compositionend(): void;\n updateCompositionElements(dontRecurse?: boolean): void;\n keydown(ev: KeyboardEvent): boolean;\n}\n\nexport interface IBrowser {\n isNode: boolean;\n userAgent: string;\n platform: string;\n isFirefox: boolean;\n isMac: boolean;\n isIpad: boolean;\n isIphone: boolean;\n isWindows: boolean;\n}\n\nexport interface IColorSet {\n foreground: IColor;\n background: IColor;\n cursor: IColor;\n cursorAccent: IColor;\n selectionForeground: IColor | undefined;\n selectionBackgroundTransparent: IColor;\n /** The selection blended on top of background. */\n selectionBackgroundOpaque: IColor;\n selectionInactiveBackgroundTransparent: IColor;\n selectionInactiveBackgroundOpaque: IColor;\n scrollbarSliderBackground: IColor;\n scrollbarSliderHoverBackground: IColor;\n scrollbarSliderActiveBackground: IColor;\n overviewRulerBorder: IColor;\n ansi: IColor[];\n /** Maps original colors to colors that respect minimum contrast ratio. */\n contrastCache: IColorContrastCache;\n /** Maps original colors to colors that respect _half_ of the minimum contrast ratio. */\n halfContrastCache: IColorContrastCache;\n}\n\nexport type ReadonlyColorSet = Readonly<Omit<IColorSet, 'ansi'>> & { ansi: Readonly<Pick<IColorSet, 'ansi'>['ansi']> };\n\nexport interface IColorContrastCache {\n clear(): void;\n setCss(bg: number, fg: number, value: string | null): void;\n getCss(bg: number, fg: number): string | null | undefined;\n setColor(bg: number, fg: number, value: IColor | null): void;\n getColor(bg: number, fg: number): IColor | null | undefined;\n}\n\nexport interface IPartialColorSet {\n foreground: IColor;\n background: IColor;\n cursor?: IColor;\n cursorAccent?: IColor;\n selectionBackground?: IColor;\n ansi: IColor[];\n}\n\nexport interface IViewport extends IDisposable {\n scrollBarWidth: number;\n readonly onRequestScrollLines: Event<{ amount: number, suppressScrollEvent: boolean }>;\n syncScrollArea(immediate?: boolean, force?: boolean): void;\n getLinesScrolled(ev: WheelEvent): number;\n getBufferElements(startLine: number, endLine?: number): { bufferElements: HTMLElement[], cursorElement?: HTMLElement };\n handleWheel(ev: WheelEvent): boolean;\n handleTouchStart(ev: TouchEvent): void;\n handleTouchMove(ev: TouchEvent): boolean;\n scrollLines(disp: number): void; // todo api name?\n reset(): void;\n}\n\nexport interface ILinkifierEvent {\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n cols: number;\n fg: number | undefined;\n}\n\ninterface ILinkState {\n decorations: ILinkDecorations;\n isHovered: boolean;\n}\nexport interface ILinkWithState {\n link: ILink;\n state?: ILinkState;\n}\n\nexport interface ILinkifier2 extends IDisposable {\n onShowLinkUnderline: Event<ILinkifierEvent>;\n onHideLinkUnderline: Event<ILinkifierEvent>;\n readonly currentLink: ILinkWithState | undefined;\n}\n\nexport interface ILink {\n range: IBufferRange;\n text: string;\n decorations?: ILinkDecorations;\n activate(event: MouseEvent, text: string): void;\n hover?(event: MouseEvent, text: string): void;\n leave?(event: MouseEvent, text: string): void;\n dispose?(): void;\n}\n\nexport interface ILinkDecorations {\n pointerCursor: boolean;\n underline: boolean;\n}\n\nexport interface IBufferRange {\n start: IBufferCellPosition;\n end: IBufferCellPosition;\n}\n\nexport interface IBufferCellPosition {\n x: number;\n y: number;\n}\n\nexport type CharacterJoinerHandler = (text: string) => [number, number][];\n\nexport interface ICharacterJoiner {\n id: number;\n handler: CharacterJoinerHandler;\n}\n\nexport interface IRenderDebouncer extends IDisposable {\n refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void;\n}\n\nexport interface IRenderDebouncerWithCallback extends IRenderDebouncer {\n addRefreshCallback(callback: FrameRequestCallback): number;\n}\n\nexport interface IBufferElementProvider {\n provideBufferElements(): DocumentFragment | HTMLElement;\n}\n\n// An IIFE to generate DEFAULT_ANSI_COLORS.\nexport const DEFAULT_ANSI_COLORS = Object.freeze((() => {\n const colors = [\n // dark:\n css.toColor('#2e3436'),\n css.toColor('#cc0000'),\n css.toColor('#4e9a06'),\n css.toColor('#c4a000'),\n css.toColor('#3465a4'),\n css.toColor('#75507b'),\n css.toColor('#06989a'),\n css.toColor('#d3d7cf'),\n // bright:\n css.toColor('#555753'),\n css.toColor('#ef2929'),\n css.toColor('#8ae234'),\n css.toColor('#fce94f'),\n css.toColor('#729fcf'),\n css.toColor('#ad7fa8'),\n css.toColor('#34e2e2'),\n css.toColor('#eeeeec')\n ];\n\n // Fill in the remaining 240 ANSI colors.\n // Generate colors (16-231)\n const v = [0x00, 0x5f, 0x87, 0xaf, 0xd7, 0xff];\n for (let i = 0; i < 216; i++) {\n const r = v[(i / 36) % 6 | 0];\n const g = v[(i / 6) % 6 | 0];\n const b = v[i % 6];\n colors.push({\n css: channels.toCss(r, g, b),\n rgba: channels.toRgba(r, g, b)\n });\n }\n\n // Generate greys (232-255)\n for (let i = 0; i < 24; i++) {\n const c = 8 + i * 10;\n colors.push({\n css: channels.toCss(c, c, c),\n rgba: channels.toRgba(c, c, c)\n });\n }\n\n return colors;\n})());\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColor, IColorRGB } from 'common/Types';\n\nlet $r = 0;\nlet $g = 0;\nlet $b = 0;\nlet $a = 0;\n\nexport const NULL_COLOR: IColor = {\n css: '#00000000',\n rgba: 0\n};\n\n/**\n * Helper functions where the source type is \"channels\" (individual color channels as numbers).\n */\nexport namespace channels {\n export function toCss(r: number, g: number, b: number, a?: number): string {\n if (a !== undefined) {\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}${toPaddedHex(a)}`;\n }\n return `#${toPaddedHex(r)}${toPaddedHex(g)}${toPaddedHex(b)}`;\n }\n\n export function toRgba(r: number, g: number, b: number, a: number = 0xFF): number {\n // Note: The aggregated number is RGBA32 (BE), thus needs to be converted to ABGR32\n // on LE systems, before it can be used for direct 32-bit buffer writes.\n // >>> 0 forces an unsigned int\n return (r << 24 | g << 16 | b << 8 | a) >>> 0;\n }\n\n export function toColor(r: number, g: number, b: number, a?: number): IColor {\n return {\n css: channels.toCss(r, g, b, a),\n rgba: channels.toRgba(r, g, b, a)\n };\n }\n}\n\n/**\n * Helper functions where the source type is `IColor`.\n */\nexport namespace color {\n export function blend(bg: IColor, fg: IColor): IColor {\n $a = (fg.rgba & 0xFF) / 255;\n if ($a === 1) {\n return {\n css: fg.css,\n rgba: fg.rgba\n };\n }\n const fgR = (fg.rgba >> 24) & 0xFF;\n const fgG = (fg.rgba >> 16) & 0xFF;\n const fgB = (fg.rgba >> 8) & 0xFF;\n const bgR = (bg.rgba >> 24) & 0xFF;\n const bgG = (bg.rgba >> 16) & 0xFF;\n const bgB = (bg.rgba >> 8) & 0xFF;\n $r = bgR + Math.round((fgR - bgR) * $a);\n $g = bgG + Math.round((fgG - bgG) * $a);\n $b = bgB + Math.round((fgB - bgB) * $a);\n const css = channels.toCss($r, $g, $b);\n const rgba = channels.toRgba($r, $g, $b);\n return { css, rgba };\n }\n\n export function isOpaque(color: IColor): boolean {\n return (color.rgba & 0xFF) === 0xFF;\n }\n\n export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {\n const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);\n if (!result) {\n return undefined;\n }\n return channels.toColor(\n (result >> 24 & 0xFF),\n (result >> 16 & 0xFF),\n (result >> 8 & 0xFF)\n );\n }\n\n export function opaque(color: IColor): IColor {\n const rgbaColor = (color.rgba | 0xFF) >>> 0;\n [$r, $g, $b] = rgba.toChannels(rgbaColor);\n return {\n css: channels.toCss($r, $g, $b),\n rgba: rgbaColor\n };\n }\n\n export function opacity(color: IColor, opacity: number): IColor {\n $a = Math.round(opacity * 0xFF);\n [$r, $g, $b] = rgba.toChannels(color.rgba);\n return {\n css: channels.toCss($r, $g, $b, $a),\n rgba: channels.toRgba($r, $g, $b, $a)\n };\n }\n\n export function multiplyOpacity(color: IColor, factor: number): IColor {\n $a = color.rgba & 0xFF;\n return opacity(color, ($a * factor) / 0xFF);\n }\n\n export function toColorRGB(color: IColor): IColorRGB {\n return [(color.rgba >> 24) & 0xFF, (color.rgba >> 16) & 0xFF, (color.rgba >> 8) & 0xFF];\n }\n}\n\n/**\n * Helper functions where the source type is \"css\" (string: '#rgb', '#rgba', '#rrggbb',\n * '#rrggbbaa').\n */\nexport namespace css {\n // Attempt to set get the shared canvas context\n let $ctx: CanvasRenderingContext2D | undefined;\n let $litmusColor: CanvasGradient | undefined;\n try {\n // This is guaranteed to run in the first window, so document should be correct\n const canvas = document.createElement('canvas');\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext('2d', {\n willReadFrequently: true\n });\n if (ctx) {\n $ctx = ctx;\n $ctx.globalCompositeOperation = 'copy';\n $litmusColor = $ctx.createLinearGradient(0, 0, 1, 1);\n }\n }\n catch {\n // noop\n }\n\n /**\n * Converts a css string to an IColor, this should handle all valid CSS color strings and will\n * throw if it's invalid. The ideal format to use is `#rrggbb[aa]` as it's the fastest to parse.\n *\n * Only `#rgb[a]`, `#rrggbb[aa]`, `rgb()` and `rgba()` formats are supported when run in a Node\n * environment.\n */\n export function toColor(css: string): IColor {\n // Formats: #rgb[a] and #rrggbb[aa]\n if (css.match(/#[\\da-f]{3,8}/i)) {\n switch (css.length) {\n case 4: { // #rgb\n $r = parseInt(css.slice(1, 2).repeat(2), 16);\n $g = parseInt(css.slice(2, 3).repeat(2), 16);\n $b = parseInt(css.slice(3, 4).repeat(2), 16);\n return channels.toColor($r, $g, $b);\n }\n case 5: { // #rgba\n $r = parseInt(css.slice(1, 2).repeat(2), 16);\n $g = parseInt(css.slice(2, 3).repeat(2), 16);\n $b = parseInt(css.slice(3, 4).repeat(2), 16);\n $a = parseInt(css.slice(4, 5).repeat(2), 16);\n return channels.toColor($r, $g, $b, $a);\n }\n case 7: // #rrggbb\n return {\n css,\n rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0\n };\n case 9: // #rrggbbaa\n return {\n css,\n rgba: parseInt(css.slice(1), 16) >>> 0\n };\n }\n }\n\n // Formats: rgb() or rgba()\n const rgbaMatch = css.match(/rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*(0|1|\\d?\\.(\\d+))\\s*)?\\)/);\n if (rgbaMatch) {\n $r = parseInt(rgbaMatch[1]);\n $g = parseInt(rgbaMatch[2]);\n $b = parseInt(rgbaMatch[3]);\n $a = Math.round((rgbaMatch[5] === undefined ? 1 : parseFloat(rgbaMatch[5])) * 0xFF);\n return channels.toColor($r, $g, $b, $a);\n }\n\n // Validate the context is available for canvas-based color parsing\n if (!$ctx || !$litmusColor) {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n // Validate the color using canvas fillStyle\n // See https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles\n $ctx.fillStyle = $litmusColor;\n $ctx.fillStyle = css;\n if (typeof $ctx.fillStyle !== 'string') {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n $ctx.fillRect(0, 0, 1, 1);\n [$r, $g, $b, $a] = $ctx.getImageData(0, 0, 1, 1).data;\n\n // Validate the color is non-transparent as color hue gets lost when drawn to the canvas\n if ($a !== 0xFF) {\n throw new Error('css.toColor: Unsupported css format');\n }\n\n // Extract the color from the canvas' fillStyle property which exposes the color value in rgba()\n // format\n // See https://html.spec.whatwg.org/multipage/canvas.html#serialisation-of-a-color\n return {\n rgba: channels.toRgba($r, $g, $b, $a),\n css\n };\n }\n}\n\n/**\n * Helper functions where the source type is \"rgb\" (number: 0xrrggbb).\n */\nexport namespace rgb {\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param rgb The color to use.\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance(rgb: number): number {\n return relativeLuminance2(\n (rgb >> 16) & 0xFF,\n (rgb >> 8 ) & 0xFF,\n (rgb ) & 0xFF);\n }\n\n /**\n * Gets the relative luminance of an RGB color, this is useful in determining the contrast ratio\n * between two colors.\n * @param r The red channel (0x00 to 0xFF).\n * @param g The green channel (0x00 to 0xFF).\n * @param b The blue channel (0x00 to 0xFF).\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n */\n export function relativeLuminance2(r: number, g: number, b: number): number {\n const rs = r / 255;\n const gs = g / 255;\n const bs = b / 255;\n const rr = rs <= 0.03928 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);\n const rg = gs <= 0.03928 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);\n const rb = bs <= 0.03928 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);\n return rr * 0.2126 + rg * 0.7152 + rb * 0.0722;\n }\n}\n\n/**\n * Helper functions where the source type is \"rgba\" (number: 0xrrggbbaa).\n */\nexport namespace rgba {\n export function blend(bg: number, fg: number): number {\n $a = (fg & 0xFF) / 0xFF;\n if ($a === 1) {\n return fg;\n }\n const fgR = (fg >> 24) & 0xFF;\n const fgG = (fg >> 16) & 0xFF;\n const fgB = (fg >> 8) & 0xFF;\n const bgR = (bg >> 24) & 0xFF;\n const bgG = (bg >> 16) & 0xFF;\n const bgB = (bg >> 8) & 0xFF;\n $r = bgR + Math.round((fgR - bgR) * $a);\n $g = bgG + Math.round((fgG - bgG) * $a);\n $b = bgB + Math.round((fgB - bgB) * $a);\n return channels.toRgba($r, $g, $b);\n }\n\n /**\n * Given a foreground color and a background color, either increase or reduce the luminance of the\n * foreground color until the specified contrast ratio is met. If pure white or black is hit\n * without the contrast ratio being met, go the other direction using the background color as the\n * foreground color and take either the first or second result depending on which has the higher\n * contrast ratio.\n *\n * `undefined` will be returned if the contrast ratio is already met.\n *\n * @param bgRgba The background color in rgba format.\n * @param fgRgba The foreground color in rgba format.\n * @param ratio The contrast ratio to achieve.\n */\n export function ensureContrastRatio(bgRgba: number, fgRgba: number, ratio: number): number | undefined {\n const bgL = rgb.relativeLuminance(bgRgba >> 8);\n const fgL = rgb.relativeLuminance(fgRgba >> 8);\n const cr = contrastRatio(bgL, fgL);\n if (cr < ratio) {\n if (fgL < bgL) {\n const resultA = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n const resultA = increaseLuminance(bgRgba, fgRgba, ratio);\n const resultARatio = contrastRatio(bgL, rgb.relativeLuminance(resultA >> 8));\n if (resultARatio < ratio) {\n const resultB = reduceLuminance(bgRgba, fgRgba, ratio);\n const resultBRatio = contrastRatio(bgL, rgb.relativeLuminance(resultB >> 8));\n return resultARatio > resultBRatio ? resultA : resultB;\n }\n return resultA;\n }\n return undefined;\n }\n\n export function reduceLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to reducing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR > 0 || fgG > 0 || fgB > 0)) {\n // Reduce by 10% until the ratio is hit\n fgR -= Math.max(0, Math.ceil(fgR * 0.1));\n fgG -= Math.max(0, Math.ceil(fgG * 0.1));\n fgB -= Math.max(0, Math.ceil(fgB * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function increaseLuminance(bgRgba: number, fgRgba: number, ratio: number): number {\n // This is a naive but fast approach to increasing luminance as converting to\n // HSL and back is expensive\n const bgR = (bgRgba >> 24) & 0xFF;\n const bgG = (bgRgba >> 16) & 0xFF;\n const bgB = (bgRgba >> 8) & 0xFF;\n let fgR = (fgRgba >> 24) & 0xFF;\n let fgG = (fgRgba >> 16) & 0xFF;\n let fgB = (fgRgba >> 8) & 0xFF;\n let cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n while (cr < ratio && (fgR < 0xFF || fgG < 0xFF || fgB < 0xFF)) {\n // Increase by 10% until the ratio is hit\n fgR = Math.min(0xFF, fgR + Math.ceil((255 - fgR) * 0.1));\n fgG = Math.min(0xFF, fgG + Math.ceil((255 - fgG) * 0.1));\n fgB = Math.min(0xFF, fgB + Math.ceil((255 - fgB) * 0.1));\n cr = contrastRatio(rgb.relativeLuminance2(fgR, fgG, fgB), rgb.relativeLuminance2(bgR, bgG, bgB));\n }\n return (fgR << 24 | fgG << 16 | fgB << 8 | 0xFF) >>> 0;\n }\n\n export function toChannels(value: number): [number, number, number, number] {\n return [(value >> 24) & 0xFF, (value >> 16) & 0xFF, (value >> 8) & 0xFF, value & 0xFF];\n }\n}\n\nexport function toPaddedHex(c: number): string {\n const s = c.toString(16);\n return s.length < 2 ? '0' + s : s;\n}\n\n/**\n * Gets the contrast ratio between two relative luminance values.\n * @param l1 The first relative luminance.\n * @param l2 The first relative luminance.\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n */\nexport function contrastRatio(l1: number, l2: number): number {\n if (l1 < l2) {\n return (l2 + 0.05) / (l1 + 0.05);\n }\n return (l1 + 0.05) / (l2 + 0.05);\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * (EXPERIMENTAL) This Addon is still under development\n */\n\nimport type { IBuffer, IBufferCell, IBufferRange, ITerminalAddon, Terminal } from '@xterm/xterm';\nimport type { IHTMLSerializeOptions, SerializeAddon as ISerializeApi, ISerializeOptions, ISerializeRange } from '@xterm/addon-serialize';\nimport { IAttributeData, IColor } from 'common/Types';\nimport { DEFAULT_ANSI_COLORS } from 'browser/Types';\n\nfunction constrain(value: number, low: number, high: number): number {\n return Math.max(low, Math.min(value, high));\n}\n\nfunction escapeHTMLChar(c: string): string {\n switch (c) {\n case '&': return '&';\n case '<': return '<';\n }\n return c;\n}\n\n// TODO: Refine this template class later\nabstract class BaseSerializeHandler {\n constructor(\n protected readonly _buffer: IBuffer\n ) {\n }\n\n public serialize(range: IBufferRange, excludeFinalCursorPosition?: boolean): string {\n // we need two of them to flip between old and new cell\n const cell1 = this._buffer.getNullCell();\n const cell2 = this._buffer.getNullCell();\n let oldCell = cell1;\n\n const startRow = range.start.y;\n const endRow = range.end.y;\n const startColumn = range.start.x;\n const endColumn = range.end.x;\n\n this._beforeSerialize(endRow - startRow, startRow, endRow);\n\n for (let row = startRow; row <= endRow; row++) {\n const line = this._buffer.getLine(row);\n if (line) {\n const startLineColumn = row === range.start.y ? startColumn : 0;\n const endLineColumn = row === range.end.y ? endColumn: line.length;\n for (let col = startLineColumn; col < endLineColumn; col++) {\n const c = line.getCell(col, oldCell === cell1 ? cell2 : cell1);\n if (!c) {\n console.warn(`Can't get cell at row=${row}, col=${col}`);\n continue;\n }\n this._nextCell(c, oldCell, row, col);\n oldCell = c;\n }\n }\n this._rowEnd(row, row === endRow);\n }\n\n this._afterSerialize();\n\n return this._serializeString(excludeFinalCursorPosition);\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void { }\n protected _rowEnd(row: number, isLastRow: boolean): void { }\n protected _beforeSerialize(rows: number, startRow: number, endRow: number): void { }\n protected _afterSerialize(): void { }\n protected _serializeString(excludeFinalCursorPosition?: boolean): string { return ''; }\n}\n\nfunction equalFg(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.getFgColorMode() === cell2.getFgColorMode()\n && cell1.getFgColor() === cell2.getFgColor();\n}\n\nfunction equalBg(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.getBgColorMode() === cell2.getBgColorMode()\n && cell1.getBgColor() === cell2.getBgColor();\n}\n\nfunction equalFlags(cell1: IBufferCell | IAttributeData, cell2: IBufferCell): boolean {\n return cell1.isInverse() === cell2.isInverse()\n && cell1.isBold() === cell2.isBold()\n && cell1.isUnderline() === cell2.isUnderline()\n && cell1.isOverline() === cell2.isOverline()\n && cell1.isBlink() === cell2.isBlink()\n && cell1.isInvisible() === cell2.isInvisible()\n && cell1.isItalic() === cell2.isItalic()\n && cell1.isDim() === cell2.isDim()\n && cell1.isStrikethrough() === cell2.isStrikethrough();\n}\n\nclass StringSerializeHandler extends BaseSerializeHandler {\n private _rowIndex: number = 0;\n private _allRows: string[] = new Array<string>();\n private _allRowSeparators: string[] = new Array<string>();\n private _currentRow: string = '';\n private _nullCellCount: number = 0;\n\n // we can see a full colored cell and a null cell that only have background the same style\n // but the information isn't preserved by null cell itself\n // so wee need to record it when required.\n private _cursorStyle: IBufferCell = this._buffer.getNullCell();\n\n // where exact the cursor styles comes from\n // because we can't copy the cell directly\n // so we remember where the content comes from instead\n private _cursorStyleRow: number = 0;\n private _cursorStyleCol: number = 0;\n\n // this is a null cell for reference for checking whether background is empty or not\n private _backgroundCell: IBufferCell = this._buffer.getNullCell();\n\n private _firstRow: number = 0;\n private _lastCursorRow: number = 0;\n private _lastCursorCol: number = 0;\n private _lastContentCursorRow: number = 0;\n private _lastContentCursorCol: number = 0;\n\n constructor(\n buffer: IBuffer,\n private readonly _terminal: Terminal\n ) {\n super(buffer);\n }\n\n protected _beforeSerialize(rows: number, start: number, end: number): void {\n this._allRows = new Array<string>(rows);\n this._lastContentCursorRow = start;\n this._lastCursorRow = start;\n this._firstRow = start;\n }\n\n private _thisRowLastChar: IBufferCell = this._buffer.getNullCell();\n private _thisRowLastSecondChar: IBufferCell = this._buffer.getNullCell();\n private _nextRowFirstChar: IBufferCell = this._buffer.getNullCell();\n protected _rowEnd(row: number, isLastRow: boolean): void {\n // if there is colorful empty cell at line end, whe must pad it back, or the the color block\n // will missing\n if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) {\n // use clear right to set background.\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n }\n\n let rowSeparator = '';\n\n // handle row separator\n if (!isLastRow) {\n // Enable BCE\n if (row - this._firstRow >= this._terminal.rows) {\n this._buffer.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell);\n }\n\n // Fetch current line\n const currentLine = this._buffer.getLine(row)!;\n // Fetch next line\n const nextLine = this._buffer.getLine(row + 1)!;\n\n if (!nextLine.isWrapped) {\n // just insert the line break\n rowSeparator = '\\r\\n';\n // we sended the enter\n this._lastCursorRow = row + 1;\n this._lastCursorCol = 0;\n } else {\n rowSeparator = '';\n const thisRowLastChar = currentLine.getCell(currentLine.length - 1, this._thisRowLastChar)!;\n const thisRowLastSecondChar = currentLine.getCell(currentLine.length - 2, this._thisRowLastSecondChar)!;\n const nextRowFirstChar = nextLine.getCell(0, this._nextRowFirstChar)!;\n const isNextRowFirstCharDoubleWidth = nextRowFirstChar.getWidth() > 1;\n\n // validate whether this line wrap is ever possible\n // which mean whether cursor can placed at a overflow position (x === row) naturally\n let isValid = false;\n\n if (\n // you must output character to cause overflow, control sequence can't do this\n nextRowFirstChar.getChars() &&\n isNextRowFirstCharDoubleWidth ? this._nullCellCount <= 1 : this._nullCellCount <= 0\n ) {\n if (\n // the last character can't be null,\n // you can't use control sequence to move cursor to (x === row)\n (thisRowLastChar.getChars() || thisRowLastChar.getWidth() === 0) &&\n // change background of the first wrapped cell also affects BCE\n // so we mark it as invalid to simply the process to determine line separator\n equalBg(thisRowLastChar, nextRowFirstChar)\n ) {\n isValid = true;\n }\n\n if (\n // the second to last character can't be null if the next line starts with CJK,\n // you can't use control sequence to move cursor to (x === row)\n isNextRowFirstCharDoubleWidth &&\n (thisRowLastSecondChar.getChars() || thisRowLastSecondChar.getWidth() === 0) &&\n // change background of the first wrapped cell also affects BCE\n // so we mark it as invalid to simply the process to determine line separator\n equalBg(thisRowLastChar, nextRowFirstChar) &&\n equalBg(thisRowLastSecondChar, nextRowFirstChar)\n ) {\n isValid = true;\n }\n }\n\n if (!isValid) {\n // force the wrap with magic\n // insert enough character to force the wrap\n rowSeparator = '-'.repeat(this._nullCellCount + 1);\n // move back and erase next line head\n rowSeparator += '\\u001b[1D\\u001b[1X';\n\n if (this._nullCellCount > 0) {\n // do these because we filled the last several null slot, which we shouldn't\n rowSeparator += '\\u001b[A';\n rowSeparator += `\\u001b[${currentLine.length - this._nullCellCount}C`;\n rowSeparator += `\\u001b[${this._nullCellCount}X`;\n rowSeparator += `\\u001b[${currentLine.length - this._nullCellCount}D`;\n rowSeparator += '\\u001b[B';\n }\n\n // This is content and need the be serialized even it is invisible.\n // without this, wrap will be missing from outputs.\n this._lastContentCursorRow = row + 1;\n this._lastContentCursorCol = 0;\n\n // force commit the cursor position\n this._lastCursorRow = row + 1;\n this._lastCursorCol = 0;\n }\n }\n }\n\n this._allRows[this._rowIndex] = this._currentRow;\n this._allRowSeparators[this._rowIndex++] = rowSeparator;\n this._currentRow = '';\n this._nullCellCount = 0;\n }\n\n private _diffStyle(cell: IBufferCell | IAttributeData, oldCell: IBufferCell): number[] {\n const sgrSeq: number[] = [];\n const fgChanged = !equalFg(cell, oldCell);\n const bgChanged = !equalBg(cell, oldCell);\n const flagsChanged = !equalFlags(cell, oldCell);\n\n if (fgChanged || bgChanged || flagsChanged) {\n if (cell.isAttributeDefault()) {\n if (!oldCell.isAttributeDefault()) {\n sgrSeq.push(0);\n }\n } else {\n if (fgChanged) {\n const color = cell.getFgColor();\n if (cell.isFgRGB()) { sgrSeq.push(38, 2, (color >>> 16) & 0xFF, (color >>> 8) & 0xFF, color & 0xFF); }\n else if (cell.isFgPalette()) {\n if (color >= 16) { sgrSeq.push(38, 5, color); }\n else { sgrSeq.push(color & 8 ? 90 + (color & 7) : 30 + (color & 7)); }\n }\n else { sgrSeq.push(39); }\n }\n if (bgChanged) {\n const color = cell.getBgColor();\n if (cell.isBgRGB()) { sgrSeq.push(48, 2, (color >>> 16) & 0xFF, (color >>> 8) & 0xFF, color & 0xFF); }\n else if (cell.isBgPalette()) {\n if (color >= 16) { sgrSeq.push(48, 5, color); }\n else { sgrSeq.push(color & 8 ? 100 + (color & 7) : 40 + (color & 7)); }\n }\n else { sgrSeq.push(49); }\n }\n if (flagsChanged) {\n if (cell.isInverse() !== oldCell.isInverse()) { sgrSeq.push(cell.isInverse() ? 7 : 27); }\n if (cell.isBold() !== oldCell.isBold()) { sgrSeq.push(cell.isBold() ? 1 : 22); }\n if (cell.isUnderline() !== oldCell.isUnderline()) { sgrSeq.push(cell.isUnderline() ? 4 : 24); }\n if (cell.isOverline() !== oldCell.isOverline()) { sgrSeq.push(cell.isOverline() ? 53 : 55); }\n if (cell.isBlink() !== oldCell.isBlink()) { sgrSeq.push(cell.isBlink() ? 5 : 25); }\n if (cell.isInvisible() !== oldCell.isInvisible()) { sgrSeq.push(cell.isInvisible() ? 8 : 28); }\n if (cell.isItalic() !== oldCell.isItalic()) { sgrSeq.push(cell.isItalic() ? 3 : 23); }\n if (cell.isDim() !== oldCell.isDim()) { sgrSeq.push(cell.isDim() ? 2 : 22); }\n if (cell.isStrikethrough() !== oldCell.isStrikethrough()) { sgrSeq.push(cell.isStrikethrough() ? 9 : 29); }\n }\n }\n }\n\n return sgrSeq;\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {\n // a width 0 cell don't need to be count because it is just a placeholder after a CJK character;\n const isPlaceHolderCell = cell.getWidth() === 0;\n\n if (isPlaceHolderCell) {\n return;\n }\n\n // this cell don't have content\n const isEmptyCell = cell.getChars() === '';\n\n const sgrSeq = this._diffStyle(cell, this._cursorStyle);\n\n // the empty cell style is only assumed to be changed when background changed, because\n // foreground is always 0.\n const styleChanged = isEmptyCell ? !equalBg(this._cursorStyle, cell) : sgrSeq.length > 0;\n\n /**\n * handles style change\n */\n if (styleChanged) {\n // before update the style, we need to fill empty cell back\n if (this._nullCellCount > 0) {\n // use clear right to set background.\n if (!equalBg(this._cursorStyle, this._backgroundCell)) {\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n }\n // use move right to move cursor.\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n this._nullCellCount = 0;\n }\n\n this._lastContentCursorRow = this._lastCursorRow = row;\n this._lastContentCursorCol = this._lastCursorCol = col;\n\n this._currentRow += `\\u001b[${sgrSeq.join(';')}m`;\n\n // update the last cursor style\n const line = this._buffer.getLine(row);\n if (line !== undefined) {\n line.getCell(col, this._cursorStyle);\n this._cursorStyleRow = row;\n this._cursorStyleCol = col;\n }\n }\n\n /**\n * handles actual content\n */\n if (isEmptyCell) {\n this._nullCellCount += cell.getWidth();\n } else {\n if (this._nullCellCount > 0) {\n // we can just assume we have same style with previous one here\n // because style change is handled by previous stage\n // use move right when background is empty, use clear right when there is background.\n if (equalBg(this._cursorStyle, this._backgroundCell)) {\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n } else {\n this._currentRow += `\\u001b[${this._nullCellCount}X`;\n this._currentRow += `\\u001b[${this._nullCellCount}C`;\n }\n this._nullCellCount = 0;\n }\n\n this._currentRow += cell.getChars();\n\n // update cursor\n this._lastContentCursorRow = this._lastCursorRow = row;\n this._lastContentCursorCol = this._lastCursorCol = col + cell.getWidth();\n }\n }\n\n protected _serializeString(excludeFinalCursorPosition: boolean): string {\n let rowEnd = this._allRows.length;\n\n // the fixup is only required for data without scrollback\n // because it will always be placed at last line otherwise\n if (this._buffer.length - this._firstRow <= this._terminal.rows) {\n rowEnd = this._lastContentCursorRow + 1 - this._firstRow;\n this._lastCursorCol = this._lastContentCursorCol;\n this._lastCursorRow = this._lastContentCursorRow;\n }\n\n let content = '';\n\n for (let i = 0; i < rowEnd; i++) {\n content += this._allRows[i];\n if (i + 1 < rowEnd) {\n content += this._allRowSeparators[i];\n }\n }\n\n // restore the cursor\n if (!excludeFinalCursorPosition) {\n const realCursorRow = this._buffer.baseY + this._buffer.cursorY;\n const realCursorCol = this._buffer.cursorX;\n\n const cursorMoved = (realCursorRow !== this._lastCursorRow || realCursorCol !== this._lastCursorCol);\n\n const moveRight = (offset: number): void => {\n if (offset > 0) {\n content += `\\u001b[${offset}C`;\n } else if (offset < 0) {\n content += `\\u001b[${-offset}D`;\n }\n };\n const moveDown = (offset: number): void => {\n if (offset > 0) {\n content += `\\u001b[${offset}B`;\n } else if (offset < 0) {\n content += `\\u001b[${-offset}A`;\n }\n };\n\n if (cursorMoved) {\n moveDown(realCursorRow - this._lastCursorRow);\n moveRight(realCursorCol - this._lastCursorCol);\n }\n }\n\n // Restore the cursor's current style, see https://github.com/xtermjs/xterm.js/issues/3677\n // HACK: Internal API access since it's awkward to expose this in the API and serialize will\n // likely be the only consumer\n const curAttrData: IAttributeData = (this._terminal as any)._core._inputHandler._curAttrData;\n const sgrSeq = this._diffStyle(curAttrData, this._cursorStyle);\n if (sgrSeq.length > 0) {\n content += `\\u001b[${sgrSeq.join(';')}m`;\n }\n\n return content;\n }\n}\n\nexport class SerializeAddon implements ITerminalAddon , ISerializeApi {\n private _terminal: Terminal | undefined;\n\n public activate(terminal: Terminal): void {\n this._terminal = terminal;\n }\n\n private _serializeBufferByScrollback(terminal: Terminal, buffer: IBuffer, scrollback?: number): string {\n const maxRows = buffer.length;\n const correctRows = (scrollback === undefined) ? maxRows : constrain(scrollback + terminal.rows, 0, maxRows);\n return this._serializeBufferByRange(terminal, buffer, {\n start: maxRows - correctRows,\n end: maxRows - 1\n }, false);\n }\n\n private _serializeBufferByRange(terminal: Terminal, buffer: IBuffer, range: ISerializeRange, excludeFinalCursorPosition: boolean): string {\n const handler = new StringSerializeHandler(buffer, terminal);\n return handler.serialize({\n start: { x: 0, y: typeof range.start === 'number' ? range.start : range.start.line },\n end: { x: terminal.cols, y: typeof range.end === 'number' ? range.end : range.end.line }\n }, excludeFinalCursorPosition);\n }\n\n private _serializeBufferAsHTML(terminal: Terminal, options: Partial<IHTMLSerializeOptions>): string {\n const buffer = terminal.buffer.active;\n const handler = new HTMLSerializeHandler(buffer, terminal, options);\n const onlySelection = options.onlySelection ?? false;\n const range = options.range;\n if (range) {\n return handler.serialize({\n start: { x: range.startCol, y: typeof range.startLine === 'number' ? range.startLine : range.startLine },\n end: { x: terminal.cols, y: typeof range.endLine === 'number' ? range.endLine : range.endLine }\n });\n }\n if (!onlySelection) {\n const maxRows = buffer.length;\n const scrollback = options.scrollback;\n const correctRows = (scrollback === undefined) ? maxRows : constrain(scrollback + terminal.rows, 0, maxRows);\n return handler.serialize({\n start: { x: 0, y: maxRows - correctRows },\n end: { x: terminal.cols, y: maxRows - 1 }\n });\n }\n\n const selection = this._terminal?.getSelectionPosition();\n if (selection !== undefined) {\n return handler.serialize({\n start: { x: selection.start.x, y: selection.start.y },\n end: { x: selection.end.x, y: selection.end.y }\n });\n }\n\n return '';\n }\n\n private _serializeModes(terminal: Terminal): string {\n let content = '';\n const modes = terminal.modes;\n\n // Default: false\n if (modes.applicationCursorKeysMode) content += '\\x1b[?1h';\n if (modes.applicationKeypadMode) content += '\\x1b[?66h';\n if (modes.bracketedPasteMode) content += '\\x1b[?2004h';\n if (modes.insertMode) content += '\\x1b[4h';\n if (modes.originMode) content += '\\x1b[?6h';\n if (modes.reverseWraparoundMode) content += '\\x1b[?45h';\n if (modes.sendFocusMode) content += '\\x1b[?1004h';\n // synchronizedOutputMode doesn't need to be serialized as it's a temporary mode\n\n // Default: true\n if (modes.wraparoundMode === false) content += '\\x1b[?7l';\n\n // Default: 'none'\n if (modes.mouseTrackingMode !== 'none') {\n switch (modes.mouseTrackingMode) {\n case 'x10': content += '\\x1b[?9h'; break;\n case 'vt200': content += '\\x1b[?1000h'; break;\n case 'drag': content += '\\x1b[?1002h'; break;\n case 'any': content += '\\x1b[?1003h'; break;\n }\n }\n\n return content;\n }\n\n public serialize(options?: ISerializeOptions): string {\n // TODO: Add combinedData support\n if (!this._terminal) {\n throw new Error('Cannot use addon until it has been loaded');\n }\n\n // Normal buffer\n let content = options?.range\n ? this._serializeBufferByRange(this._terminal, this._terminal.buffer.normal, options.range, true)\n : this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.normal, options?.scrollback);\n\n // Alternate buffer\n if (!options?.excludeAltBuffer) {\n if (this._terminal.buffer.active.type === 'alternate') {\n const alternativeScreenContent = this._serializeBufferByScrollback(this._terminal, this._terminal.buffer.alternate, undefined);\n content += `\\u001b[?1049h\\u001b[H${alternativeScreenContent}`;\n }\n }\n\n // Modes\n if (!options?.excludeModes) {\n content += this._serializeModes(this._terminal);\n }\n\n return content;\n }\n\n public serializeAsHTML(options?: Partial<IHTMLSerializeOptions>): string {\n if (!this._terminal) {\n throw new Error('Cannot use addon until it has been loaded');\n }\n\n return this._serializeBufferAsHTML(this._terminal, options || {});\n }\n\n public dispose(): void { }\n}\n\nexport class HTMLSerializeHandler extends BaseSerializeHandler {\n private _currentRow: string = '';\n\n private _htmlContent = '';\n\n private _ansiColors: Readonly<IColor[]>;\n\n constructor(\n buffer: IBuffer,\n private readonly _terminal: Terminal,\n private readonly _options: Partial<IHTMLSerializeOptions>\n ) {\n super(buffer);\n\n // For xterm headless: fallback to ansi colors\n if ((_terminal as any)._core._themeService) {\n this._ansiColors = (_terminal as any)._core._themeService.colors.ansi;\n }\n else {\n this._ansiColors = DEFAULT_ANSI_COLORS;\n }\n }\n\n private _padStart(target: string, targetLength: number, padString: string): string {\n targetLength = targetLength >> 0;\n padString = padString ?? ' ';\n if (target.length > targetLength) {\n return target;\n }\n\n targetLength -= target.length;\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + target;\n }\n\n protected _beforeSerialize(rows: number, start: number, end: number): void {\n this._htmlContent += '<html><body><!--StartFragment--><pre>';\n\n let foreground = '#000000';\n let background = '#ffffff';\n if (this._options.includeGlobalBackground ?? false) {\n foreground = this._terminal.options.theme?.foreground ?? '#ffffff';\n background = this._terminal.options.theme?.background ?? '#000000';\n }\n\n const globalStyleDefinitions = [];\n globalStyleDefinitions.push('color: ' + foreground + ';');\n globalStyleDefinitions.push('background-color: ' + background + ';');\n globalStyleDefinitions.push('font-family: ' + this._terminal.options.fontFamily + ';');\n globalStyleDefinitions.push('font-size: ' + this._terminal.options.fontSize + 'px;');\n this._htmlContent += '<div style=\\'' + globalStyleDefinitions.join(' ') + '\\'>';\n }\n\n protected _afterSerialize(): void {\n this._htmlContent += '</div>';\n this._htmlContent += '</pre><!--EndFragment--></body></html>';\n }\n\n protected _rowEnd(row: number, isLastRow: boolean): void {\n this._htmlContent += '<div><span>' + this._currentRow + '</span></div>';\n this._currentRow = '';\n }\n\n private _getHexColor(cell: IBufferCell, isFg: boolean): string | undefined {\n const color = isFg ? cell.getFgColor() : cell.getBgColor();\n if (isFg ? cell.isFgRGB() : cell.isBgRGB()) {\n const rgb = [\n (color >> 16) & 255,\n (color >> 8) & 255,\n (color ) & 255\n ];\n return '#' + rgb.map(x => this._padStart(x.toString(16), 2, '0')).join('');\n }\n if (isFg ? cell.isFgPalette() : cell.isBgPalette()) {\n return this._ansiColors[color].css;\n }\n return undefined;\n }\n\n private _diffStyle(cell: IBufferCell, oldCell: IBufferCell): string[] | undefined {\n const content: string[] = [];\n\n const fgChanged = !equalFg(cell, oldCell);\n const bgChanged = !equalBg(cell, oldCell);\n const flagsChanged = !equalFlags(cell, oldCell);\n\n if (fgChanged || bgChanged || flagsChanged) {\n const fgHexColor = this._getHexColor(cell, true);\n if (fgHexColor) {\n content.push('color: ' + fgHexColor + ';');\n }\n\n const bgHexColor = this._getHexColor(cell, false);\n if (bgHexColor) {\n content.push('background-color: ' + bgHexColor + ';');\n }\n\n if (cell.isInverse()) { content.push('color: #000000; background-color: #BFBFBF;'); }\n if (cell.isBold()) { content.push('font-weight: bold;'); }\n if (cell.isUnderline() && cell.isOverline()) { content.push('text-decoration: overline underline;'); }\n else if (cell.isUnderline()) { content.push('text-decoration: underline;'); }\n else if (cell.isOverline()) { content.push('text-decoration: overline;'); }\n if (cell.isBlink()) { content.push('text-decoration: blink;'); }\n if (cell.isInvisible()) { content.push('visibility: hidden;'); }\n if (cell.isItalic()) { content.push('font-style: italic;'); }\n if (cell.isDim()) { content.push('opacity: 0.5;'); }\n if (cell.isStrikethrough()) { content.push('text-decoration: line-through;'); }\n\n return content;\n }\n\n return undefined;\n }\n\n protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {\n // a width 0 cell don't need to be count because it is just a placeholder after a CJK character;\n const isPlaceHolderCell = cell.getWidth() === 0;\n if (isPlaceHolderCell) {\n return;\n }\n\n // this cell don't have content\n const isEmptyCell = cell.getChars() === '';\n\n const styleDefinitions = this._diffStyle(cell, oldCell);\n\n // handles style change\n if (styleDefinitions) {\n this._currentRow += styleDefinitions.length === 0 ?\n '</span><span>' :\n '</span><span style=\\'' + styleDefinitions.join(' ') + '\\'>';\n }\n\n // handles actual content\n if (isEmptyCell) {\n this._currentRow += ' ';\n } else {\n this._currentRow += escapeHTMLChar(cell.getChars());\n }\n }\n\n protected _serializeString(): string {\n return this._htmlContent;\n }\n}\n"],"names":["root","factory","exports","module","define","amd","globalThis","DEFAULT_ANSI_COLORS","Object","freeze","colors","css","toColor","v","i","r","g","b","push","channels","toCss","rgba","toRgba","c","$r","$g","$b","$a","color","rgb","toPaddedHex","s","toString","length","contrastRatio","l1","l2","NULL_COLOR","a","undefined","opacity","Math","round","toChannels","blend","bg","fg","fgR","fgG","fgB","bgR","bgG","bgB","isOpaque","ensureContrastRatio","ratio","result","opaque","rgbaColor","multiplyOpacity","factor","toColorRGB","$ctx","$litmusColor","canvas","document","createElement","width","height","ctx","getContext","willReadFrequently","globalCompositeOperation","createLinearGradient","match","parseInt","slice","repeat","rgbaMatch","parseFloat","Error","fillStyle","fillRect","getImageData","data","relativeLuminance2","rs","gs","bs","pow","relativeLuminance","reduceLuminance","bgRgba","fgRgba","cr","max","ceil","increaseLuminance","min","bgL","fgL","resultA","resultARatio","resultB","value","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","constrain","low","high","BaseSerializeHandler","constructor","_buffer","serialize","range","excludeFinalCursorPosition","cell1","this","getNullCell","cell2","oldCell","startRow","start","y","endRow","end","startColumn","x","endColumn","_beforeSerialize","row","line","getLine","startLineColumn","endLineColumn","col","getCell","_nextCell","console","warn","_rowEnd","_afterSerialize","_serializeString","cell","isLastRow","rows","equalFg","getFgColorMode","getFgColor","equalBg","getBgColorMode","getBgColor","equalFlags","isInverse","isBold","isUnderline","isOverline","isBlink","isInvisible","isItalic","isDim","isStrikethrough","StringSerializeHandler","buffer","_terminal","super","_rowIndex","_allRows","Array","_allRowSeparators","_currentRow","_nullCellCount","_cursorStyle","_cursorStyleRow","_cursorStyleCol","_backgroundCell","_firstRow","_lastCursorRow","_lastCursorCol","_lastContentCursorRow","_lastContentCursorCol","_thisRowLastChar","_thisRowLastSecondChar","_nextRowFirstChar","rowSeparator","currentLine","nextLine","isWrapped","thisRowLastChar","thisRowLastSecondChar","nextRowFirstChar","isNextRowFirstCharDoubleWidth","getWidth","isValid","getChars","_diffStyle","sgrSeq","fgChanged","bgChanged","flagsChanged","isAttributeDefault","isFgRGB","isFgPalette","isBgRGB","isBgPalette","isEmptyCell","join","rowEnd","content","realCursorRow","baseY","cursorY","realCursorCol","cursorX","moveRight","offset","curAttrData","_core","_inputHandler","_curAttrData","activate","terminal","_serializeBufferByScrollback","scrollback","maxRows","correctRows","_serializeBufferByRange","cols","_serializeBufferAsHTML","options","active","handler","HTMLSerializeHandler","onlySelection","startCol","startLine","endLine","selection","getSelectionPosition","_serializeModes","modes","applicationCursorKeysMode","applicationKeypadMode","bracketedPasteMode","insertMode","originMode","reverseWraparoundMode","sendFocusMode","wraparoundMode","mouseTrackingMode","normal","excludeAltBuffer","type","alternate","excludeModes","serializeAsHTML","dispose","_options","_htmlContent","_themeService","_ansiColors","ansi","_padStart","target","targetLength","padString","foreground","background","includeGlobalBackground","theme","globalStyleDefinitions","fontFamily","fontSize","_getHexColor","isFg","map","fgHexColor","bgHexColor","styleDefinitions","escapeHTMLChar"],"ignoreList":[],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-serialize",
|
|
3
|
-
"version": "0.15.0-beta.
|
|
3
|
+
"version": "0.15.0-beta.16",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"benchmark-baseline": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --baseline out-benchmark/benchmark/*benchmark.js",
|
|
26
26
|
"benchmark-eval": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --eval out-benchmark/benchmark/*benchmark.js"
|
|
27
27
|
},
|
|
28
|
-
"commit": "
|
|
28
|
+
"commit": "2f549d74ae383588e0e9f6f65616bf275c9ea1e5",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
30
|
+
"@xterm/xterm": "^6.1.0-beta.16"
|
|
31
31
|
}
|
|
32
32
|
}
|