websoft9/cockpit/myapps/build/static/js/769.3b95354d.chunk.js.map
2023-06-02 14:02:20 +08:00

1 line
1.9 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"static/js/769.3b95354d.chunk.js","mappings":";sIAIYA,gCCHZ,GACE,MAAS,aACT,OAAU,cACV,YAAe,qBACf,WAAc,oBACd,eAAkB,wBAClB,UAAa,CACX,OAAU,cACV,MAAS,aACT,MAAS,aACT,QAAW,eACX,UAAa,kBACb,UAAa,iBACb,SAAY,gBACZ,KAAQ,YACR,OAAU,cACV,OAAU,cACV,OAAU,cACV,QAAW,eACX,QAAW,eACX,SAAY,gBACZ,MAAS,aACT,SAAY,gBACZ,aAAgB,qBAChB,SAAY,gBACZ,WAAc,mBACd,MAAS,aACT,IAAO,WACP,aAAgB,sBAElB,QAAW,eACX,UAAa,2BC/Bf,GACE,UAAa,CACX,OAAU,cACV,GAAM,UACN,GAAM,UACN,GAAM,UACN,GAAM,WAER,QAAW,eACX,eAAkB,wBAClB,gBAAmB,0BACnB,YAAe,qBACf,gBAAmB,4BFTrB,SAAYA,GACVA,EAAA,QACAA,EAAA,QACAA,EAAA,QACAA,EAAA,OACD,CALD,CAAYA,IAAAA,EAAW,KA0BhB,IAAMC,EAAiD,SAACC,SAS5BA,EAPjCC,UAAAA,OAAS,IAAAC,EAAG,GAAEA,EAAAC,EAOmBH,EANjCI,KAAAA,OAAI,IAAAD,EAAG,KAAIA,EAAAE,EAMsBL,EALjC,kBAAkBM,OAAa,IAAAD,EAAG,aAAYA,EAAAE,EAKbP,EAJjCQ,MAAAA,OAAK,IAAAD,GAAQA,EACbE,EAGiCT,EAHjCS,SAAQC,EAGyBV,EAFjCW,SAAAA,OAAQ,IAAAD,GAAQA,EACFE,EACmBZ,EADjC,cACmBa,EAAcb,EAAjC,mBACGc,GAAKC,EAAAA,EAAAA,IAAAf,EAVqD,oGAYvD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sBACf,cAAiB,uBACjB,gBAAmB,yBACnB,cAAiB,uBACjB,cAAiB,uBACjB,cAAiB,uBACjB,cAAiB,uBACjB,gBAAmB,yBAErB,WAAc,kBACd,QAAW,eACX,eAAkB,wBAClB,sBAAyB,gCACzB,qBAAwB,gCACxB,yBAA4B,mCAC5B,aAAgB,sBAChB,YAAe,qBACf,cAAiB","sources":["../node_modules/@patternfly/react-core/src/components/Spinner/Spinner.tsx","../node_modules/@patternfly/react-styles/css/components/Button/button.mjs","../node_modules/@patternfly/react-styles/css/components/Spinner/spinner.mjs","../node_modules/@patternfly/react-core/src/components/Button/Button.tsx","../node_modules/@patternfly/react-styles/css/components/Badge/badge.mjs","../node_modules/@patternfly/react-core/src/components/Badge/Badge.tsx","../node_modules/@patternfly/react-core/src/components/FormSelect/FormSelect.tsx","../node_modules/@patternfly/react-core/src/components/FormSelect/FormSelectOption.tsx","../node_modules/@patternfly/react-styles/css/components/Backdrop/backdrop.mjs","../node_modules/tabbable/src/index.js","../node_modules/focus-trap/index.js","../node_modules/@patternfly/react-core/src/helpers/FocusTrap/FocusTrap.tsx","../node_modules/@patternfly/react-styles/css/components/ModalBox/modal-box.mjs","../node_modules/@patternfly/react-styles/css/layouts/Bullseye/bullseye.mjs","../node_modules/@patternfly/react-core/src/components/Backdrop/Backdrop.tsx","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxBody.tsx","../node_modules/@patternfly/react-icons/dist/esm/icons/times-icon.js","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxCloseButton.tsx","../node_modules/@patternfly/react-tokens/dist/esm/c_modal_box_m_align_top_spacer.js","../node_modules/@patternfly/react-core/src/components/Modal/ModalBox.tsx","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxFooter.tsx","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxDescription.tsx","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxHeader.tsx","../node_modules/@patternfly/react-styles/css/utilities/Accessibility/accessibility.mjs","../node_modules/@patternfly/react-styles/css/components/Tooltip/tooltip.mjs","../node_modules/@patternfly/react-core/src/components/Tooltip/TooltipContent.tsx","../node_modules/@patternfly/react-core/src/components/Tooltip/TooltipArrow.tsx","../node_modules/@patternfly/react-tokens/dist/esm/c_tooltip_MaxWidth.js","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getBoundingClientRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getWindow.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScroll.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/instanceOf.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeName.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentElement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getWindowScrollBarX.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getComputedStyle.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/isScrollParent.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getCompositeRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getNodeScroll.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getHTMLElementScroll.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getLayoutRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getParentNode.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getScrollParent.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/listScrollParents.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/isTableElement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getOffsetParent.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/enums.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/orderModifiers.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/debounce.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/index.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/mergeByName.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/eventListeners.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getBasePlacement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getVariation.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getMainAxisFromPlacement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/computeOffsets.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/popperOffsets.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/computeStyles.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/offset.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getOppositePlacement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getOppositeVariationPlacement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/contains.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/rectToClientRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getClippingRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getViewportRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/dom-utils/getDocumentRect.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/mergePaddingObject.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getFreshSideObject.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/expandToHashMap.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/detectOverflow.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/flip.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/computeAutoPlacement.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/within.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/preventOverflow.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/utils/getAltAxis.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/arrow.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/hide.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/popper.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/popper-core/modifiers/applyStyles.ts","../node_modules/@patternfly/react-core/src/helpers/useIsomorphicLayout.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/thirdparty/react-popper/usePopper.ts","../node_modules/@patternfly/react-core/src/helpers/Popper/FindRefWrapper.tsx","../node_modules/@patternfly/react-core/src/helpers/Popper/Popper.tsx","../node_modules/@patternfly/react-core/src/components/Tooltip/Tooltip.tsx","../node_modules/@patternfly/react-icons/dist/esm/icons/check-circle-icon.js","../node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon.js","../node_modules/@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon.js","../node_modules/@patternfly/react-icons/dist/esm/icons/info-circle-icon.js","../node_modules/@patternfly/react-icons/dist/esm/icons/bell-icon.js","../node_modules/@patternfly/react-core/src/components/Modal/ModalBoxTitle.tsx","../node_modules/@patternfly/react-core/src/components/Modal/ModalContent.tsx","../node_modules/@patternfly/react-core/src/components/Modal/Modal.tsx","../node_modules/@patternfly/react-core/src/components/TextArea/TextArea.tsx","../node_modules/@patternfly/react-styles/css/components/NumberInput/number-input.mjs","../node_modules/@patternfly/react-icons/dist/esm/icons/minus-icon.js","../node_modules/@patternfly/react-icons/dist/esm/icons/plus-icon.js","../node_modules/@patternfly/react-styles/css/components/InputGroup/input-group.mjs","../node_modules/@patternfly/react-tokens/dist/esm/c_form_control_textarea_Height.js","../node_modules/@patternfly/react-core/src/components/TextInput/TextInput.tsx","../node_modules/@patternfly/react-core/src/helpers/resizeObserver.tsx","../node_modules/@patternfly/react-core/src/components/InputGroup/InputGroup.tsx","../node_modules/@patternfly/react-core/src/components/NumberInput/NumberInput.tsx","../node_modules/@patternfly/react-core/src/components/Page/PageContext.tsx","../node_modules/@patternfly/react-core/src/helpers/GenerateId/GenerateId.ts","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarChipGroupContent.tsx","../node_modules/@patternfly/react-core/src/components/Toolbar/Toolbar.tsx","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarExpandableContent.tsx","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarContent.tsx","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarGroup.tsx","../node_modules/@patternfly/react-core/src/components/Divider/Divider.tsx","../node_modules/@patternfly/react-styles/css/components/Divider/divider.mjs","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarItem.tsx","../node_modules/@patternfly/react-core/src/components/Toolbar/ToolbarUtils.tsx","../node_modules/@patternfly/react-core/src/helpers/OUIA/ouia.ts","../node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_sm.js","../node_modules/@patternfly/react-core/src/helpers/constants.ts","../node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_sm.js","../node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_md.js","../node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_lg.js","../node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_xl.js","../node_modules/@patternfly/react-tokens/dist/esm/global_height_breakpoint_2xl.js","../node_modules/@patternfly/react-core/src/helpers/util.ts","../node_modules/@patternfly/react-icons/src/createIcon.tsx","../node_modules/@patternfly/react-styles/src/index.ts","../node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_2xl.js","../node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_lg.js","../node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_md.js","../node_modules/@patternfly/react-tokens/dist/esm/global_breakpoint_xl.js","../CanvasAddon/webpack/universalModuleDefinition","../CanvasAddon/src/BaseRenderLayer.ts","../CanvasAddon/src/CanvasRenderer.ts","../CanvasAddon/src/CursorRenderLayer.ts","../CanvasAddon/src/GridCache.ts","../CanvasAddon/src/LinkRenderLayer.ts","../CanvasAddon/src/SelectionRenderLayer.ts","../CanvasAddon/src/TextRenderLayer.ts","../CanvasAddon/src/browser/Dom.ts","../CanvasAddon/src/browser/renderer/shared/CellColorResolver.ts","../CanvasAddon/src/browser/renderer/shared/CharAtlasCache.ts","../CanvasAddon/src/browser/renderer/shared/CharAtlasUtils.ts","../CanvasAddon/src/browser/renderer/shared/Constants.ts","../CanvasAddon/src/browser/renderer/shared/CustomGlyphs.ts","../CanvasAddon/src/browser/renderer/shared/DevicePixelObserver.ts","../CanvasAddon/src/browser/renderer/shared/RendererUtils.ts","../CanvasAddon/src/browser/renderer/shared/SelectionRenderModel.ts","../CanvasAddon/src/browser/renderer/shared/TextureAtlas.ts","../CanvasAddon/src/browser/services/CharacterJoinerService.ts","../CanvasAddon/src/common/Color.ts","../CanvasAddon/src/common/EventEmitter.ts","../CanvasAddon/src/common/Lifecycle.ts","../CanvasAddon/src/common/MultiKeyMap.ts","../CanvasAddon/src/common/Platform.ts","../CanvasAddon/src/common/TaskQueue.ts","../CanvasAddon/src/common/buffer/AttributeData.ts","../CanvasAddon/src/common/buffer/CellData.ts","../CanvasAddon/src/common/buffer/Constants.ts","../CanvasAddon/src/common/input/TextDecoder.ts","../CanvasAddon/src/common/services/ServiceRegistry.ts","../CanvasAddon/src/common/services/Services.ts","../CanvasAddon/webpack/bootstrap","../CanvasAddon/src/CanvasAddon.ts","../xterm/webpack/universalModuleDefinition","../xterm/src/browser/AccessibilityManager.ts","../xterm/src/browser/Clipboard.ts","../xterm/src/browser/ColorContrastCache.ts","../xterm/src/browser/Dom.ts","../xterm/src/browser/Lifecycle.ts","../xterm/src/browser/Linkifier2.ts","../xterm/src/browser/LocalizableStrings.ts","../xterm/src/browser/OscLinkProvider.ts","../xterm/src/browser/RenderDebouncer.ts","../xterm/src/browser/ScreenDprMonitor.ts","../xterm/src/browser/Terminal.ts","../xterm/src/browser/TimeBasedDebouncer.ts","../xterm/src/browser/Viewport.ts","../xterm/src/browser/decorations/BufferDecorationRenderer.ts","../xterm/src/browser/decorations/ColorZoneStore.ts","../xterm/src/browser/decorations/OverviewRulerRenderer.ts","../xterm/src/browser/input/CompositionHelper.ts","../xterm/src/browser/input/Mouse.ts","../xterm/src/browser/input/MoveToCell.ts","../xterm/src/browser/renderer/dom/DomRenderer.ts","../xterm/src/browser/renderer/dom/DomRendererRowFactory.ts","../xterm/src/browser/renderer/shared/Constants.ts","../xterm/src/browser/renderer/shared/RendererUtils.ts","../xterm/src/browser/selection/SelectionModel.ts","../xterm/src/browser/services/CharSizeService.ts","../xterm/src/browser/services/CharacterJoinerService.ts","../xterm/src/browser/services/CoreBrowserService.ts","../xterm/src/browser/services/MouseService.ts","../xterm/src/browser/services/RenderService.ts","../xterm/src/browser/services/SelectionService.ts","../xterm/src/browser/services/Services.ts","../xterm/src/browser/services/ThemeService.ts","../xterm/src/common/CircularList.ts","../xterm/src/common/Clone.ts","../xterm/src/common/Color.ts","../xterm/src/common/CoreTerminal.ts","../xterm/src/common/EventEmitter.ts","../xterm/src/common/InputHandler.ts","../xterm/src/common/Lifecycle.ts","../xterm/src/common/MultiKeyMap.ts","../xterm/src/common/Platform.ts","../xterm/src/common/SortedList.ts","../xterm/src/common/TaskQueue.ts","../xterm/src/common/WindowsMode.ts","../xterm/src/common/buffer/AttributeData.ts","../xterm/src/common/buffer/Buffer.ts","../xterm/src/common/buffer/BufferLine.ts","../xterm/src/common/buffer/BufferRange.ts","../xterm/src/common/buffer/BufferReflow.ts","../xterm/src/common/buffer/BufferSet.ts","../xterm/src/common/buffer/CellData.ts","../xterm/src/common/buffer/Constants.ts","../xterm/src/common/buffer/Marker.ts","../xterm/src/common/data/Charsets.ts","../xterm/src/common/data/EscapeSequences.ts","../xterm/src/common/input/Keyboard.ts","../xterm/src/common/input/TextDecoder.ts","../xterm/src/common/input/UnicodeV6.ts","../xterm/src/common/input/WriteBuffer.ts","../xterm/src/common/input/XParseColor.ts","../xterm/src/common/parser/Constants.ts","../xterm/src/common/parser/DcsParser.ts","../xterm/src/common/parser/EscapeSequenceParser.ts","../xterm/src/common/parser/OscParser.ts","../xterm/src/common/parser/Params.ts","../xterm/src/common/public/AddonManager.ts","../xterm/src/common/public/BufferApiView.ts","../xterm/src/common/public/BufferLineApiView.ts","../xterm/src/common/public/BufferNamespaceApi.ts","../xterm/src/common/public/ParserApi.ts","../xterm/src/common/public/UnicodeApi.ts","../xterm/src/common/services/BufferService.ts","../xterm/src/common/services/CharsetService.ts","../xterm/src/common/services/CoreMouseService.ts","../xterm/src/common/services/CoreService.ts","../xterm/src/common/services/DecorationService.ts","../xterm/src/common/services/InstantiationService.ts","../xterm/src/common/services/LogService.ts","../xterm/src/common/services/OptionsService.ts","../xterm/src/common/services/OscLinkService.ts","../xterm/src/common/services/ServiceRegistry.ts","../xterm/src/common/services/Services.ts","../xterm/src/common/services/UnicodeService.ts","../xterm/webpack/bootstrap","../xterm/src/browser/public/Terminal.ts","../node_modules/@babel/runtime/helpers/arrayLikeToArray.js","../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/construct.js","../node_modules/@babel/runtime/helpers/createClass.js","../node_modules/@babel/runtime/helpers/createForOfIteratorHelper.js","../node_modules/@babel/runtime/helpers/createSuper.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js","../node_modules/@babel/runtime/helpers/iterableToArray.js","../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../node_modules/@babel/runtime/helpers/nonIterableRest.js","../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/regeneratorRuntime.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/slicedToArray.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/@babel/runtime/helpers/toConsumableArray.js","../node_modules/@babel/runtime/helpers/toPrimitive.js","../node_modules/@babel/runtime/helpers/toPropertyKey.js","../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js","../node_modules/@patternfly/react-styles/css/components/FormControl/form-control.mjs","../node_modules/@patternfly/react-styles/css/components/Toolbar/toolbar.mjs"],"sourcesContent":["import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Spinner/spinner';\nimport { css } from '@patternfly/react-styles';\n\nexport enum spinnerSize {\n sm = 'sm',\n md = 'md',\n lg = 'lg',\n xl = 'xl'\n}\n\nexport interface SpinnerProps extends Omit<React.HTMLProps<HTMLSpanElement>, 'size'> {\n /** Additional classes added to the Spinner. */\n className?: string;\n /** Size variant of progress. */\n size?: 'sm' | 'md' | 'lg' | 'xl';\n /** Text describing that current loading status or progress */\n 'aria-valuetext'?: string;\n /** Whether to use an SVG (new) rather than a span (old) */\n isSVG?: boolean;\n /** Diameter of spinner set as CSS variable */\n diameter?: string;\n /** @beta Indicates the spinner is inline and the size should inherit the text font size. This will override the size prop. */\n isInline?: boolean;\n /** Accessible label to describe what is loading */\n 'aria-label'?: string;\n /** Id of element which describes what is being loaded */\n 'aria-labelledBy'?: string;\n}\n\nexport const Spinner: React.FunctionComponent<SpinnerProps> = ({\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n className = '',\n size = 'xl',\n 'aria-valuetext': ariaValueText = 'Loading...',\n isSVG = false,\n diameter,\n isInline = false,\n 'aria-label': ariaLabel,\n 'aria-labelledBy': ariaLabelledBy,\n ...props\n}: SpinnerProps) => {\n const Component = isSVG ? 'svg' : ('span' as any);\n\n return (\n <Component\n className={css(styles.spinner, isInline ? styles.modifiers.inline : styles.modifiers[size], className)}\n role=\"progressbar\"\n aria-valuetext={ariaValueText}\n {...(isSVG && { viewBox: '0 0 100 100' })}\n {...(diameter && { style: { '--pf-c-spinner--diameter': diameter } })}\n {...(ariaLabel && { 'aria-label': ariaLabel })}\n {...(ariaLabelledBy && { 'aria-labelledBy': ariaLabelledBy })}\n {...(!ariaLabel && !ariaLabelledBy && { 'aria-label': 'Contents' })}\n {...props}\n >\n {isSVG ? (\n <circle className={styles.spinnerPath} cx=\"50\" cy=\"50\" r=\"45\" fill=\"none\" />\n ) : (\n <React.Fragment>\n <span className={css(styles.spinnerClipper)} />\n <span className={css(styles.spinnerLeadBall)} />\n <span className={css(styles.spinnerTailBall)} />\n </React.Fragment>\n )}\n </Component>\n );\n};\nSpinner.displayName = 'Spinner';\n","import './button.css';\nexport default {\n \"badge\": \"pf-c-badge\",\n \"button\": \"pf-c-button\",\n \"buttonCount\": \"pf-c-button__count\",\n \"buttonIcon\": \"pf-c-button__icon\",\n \"buttonProgress\": \"pf-c-button__progress\",\n \"modifiers\": {\n \"active\": \"pf-m-active\",\n \"block\": \"pf-m-block\",\n \"small\": \"pf-m-small\",\n \"primary\": \"pf-m-primary\",\n \"displayLg\": \"pf-m-display-lg\",\n \"secondary\": \"pf-m-secondary\",\n \"tertiary\": \"pf-m-tertiary\",\n \"link\": \"pf-m-link\",\n \"unread\": \"pf-m-unread\",\n \"inline\": \"pf-m-inline\",\n \"danger\": \"pf-m-danger\",\n \"warning\": \"pf-m-warning\",\n \"control\": \"pf-m-control\",\n \"expanded\": \"pf-m-expanded\",\n \"plain\": \"pf-m-plain\",\n \"disabled\": \"pf-m-disabled\",\n \"ariaDisabled\": \"pf-m-aria-disabled\",\n \"progress\": \"pf-m-progress\",\n \"inProgress\": \"pf-m-in-progress\",\n \"start\": \"pf-m-start\",\n \"end\": \"pf-m-end\",\n \"overpassFont\": \"pf-m-overpass-font\"\n },\n \"spinner\": \"pf-c-spinner\",\n \"themeDark\": \"pf-theme-dark\"\n};","import './spinner.css';\nexport default {\n \"modifiers\": {\n \"inline\": \"pf-m-inline\",\n \"sm\": \"pf-m-sm\",\n \"md\": \"pf-m-md\",\n \"lg\": \"pf-m-lg\",\n \"xl\": \"pf-m-xl\"\n },\n \"spinner\": \"pf-c-spinner\",\n \"spinnerClipper\": \"pf-c-spinner__clipper\",\n \"spinnerLeadBall\": \"pf-c-spinner__lead-ball\",\n \"spinnerPath\": \"pf-c-spinner__path\",\n \"spinnerTailBall\": \"pf-c-spinner__tail-ball\"\n};","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Button/button';\nimport { css } from '@patternfly/react-styles';\nimport { Spinner, spinnerSize } from '../Spinner';\nimport { useOUIAProps, OUIAProps } from '../../helpers';\nimport { Badge } from '../Badge';\n\nexport enum ButtonVariant {\n primary = 'primary',\n secondary = 'secondary',\n tertiary = 'tertiary',\n danger = 'danger',\n warning = 'warning',\n link = 'link',\n plain = 'plain',\n control = 'control'\n}\n\nexport enum ButtonType {\n button = 'button',\n submit = 'submit',\n reset = 'reset'\n}\n\nexport interface BadgeCountObject {\n /** Adds styling to the badge to indicate it has been read */\n isRead?: boolean;\n /** Adds count number right of button */\n count?: number;\n /** Additional classes added to the badge count */\n className?: string;\n}\n\nexport interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'ref'>, OUIAProps {\n /** Content rendered inside the button */\n children?: React.ReactNode;\n /** Additional classes added to the button */\n className?: string;\n /** Sets the base component to render. defaults to button */\n component?: React.ElementType<any> | React.ComponentType<any>;\n /** Adds active styling to button. */\n isActive?: boolean;\n /** Adds block styling to button */\n isBlock?: boolean;\n /** Adds disabled styling and disables the button using the disabled html attribute */\n isDisabled?: boolean;\n /** Adds disabled styling and communicates that the button is disabled using the aria-disabled html attribute */\n isAriaDisabled?: boolean;\n /** Adds progress styling to button */\n isLoading?: boolean;\n /** Text describing that current loading status or progress */\n spinnerAriaValueText?: string;\n /** Accessible label for the spinner to describe what is loading */\n spinnerAriaLabel?: string;\n /** Id of element which describes what is being loaded */\n spinnerAriaLabelledBy?: string;\n /** Events to prevent when the button is in an aria-disabled state */\n inoperableEvents?: string[];\n /** Adds inline styling to a link button */\n isInline?: boolean;\n /** Sets button type */\n type?: 'button' | 'submit' | 'reset';\n /** Adds button variant styles */\n variant?: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'warning' | 'link' | 'plain' | 'control';\n /** Sets position of the link icon */\n iconPosition?: 'left' | 'right';\n /** Adds accessible text to the button. */\n 'aria-label'?: string;\n /** Icon for the button. Usable by all variants except for plain. */\n icon?: React.ReactNode | null;\n /** Sets the button tabindex. */\n tabIndex?: number;\n /** Adds small styling to the button */\n isSmall?: boolean;\n /** Adds large styling to the button */\n isLarge?: boolean;\n /** Adds danger styling to secondary or link button variants */\n isDanger?: boolean;\n /** Forwarded ref */\n innerRef?: React.Ref<any>;\n /** Adds count number to button */\n countOptions?: BadgeCountObject;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\nconst ButtonBase: React.FunctionComponent<ButtonProps> = ({\n children = null,\n className = '',\n component = 'button',\n isActive = false,\n isBlock = false,\n isDisabled = false,\n isAriaDisabled = false,\n isLoading = null,\n isDanger = false,\n spinnerAriaValueText,\n spinnerAriaLabelledBy,\n spinnerAriaLabel,\n isSmall = false,\n isLarge = false,\n inoperableEvents = ['onClick', 'onKeyPress'],\n isInline = false,\n type = ButtonType.button,\n variant = ButtonVariant.primary,\n iconPosition = 'left',\n 'aria-label': ariaLabel = null,\n icon = null,\n ouiaId,\n ouiaSafe = true,\n tabIndex = null,\n innerRef,\n countOptions,\n ...props\n}: ButtonProps) => {\n const ouiaProps = useOUIAProps(Button.displayName, ouiaId, ouiaSafe, variant);\n const Component = component as any;\n const isButtonElement = Component === 'button';\n const isInlineSpan = isInline && Component === 'span';\n\n const preventedEvents = inoperableEvents.reduce(\n (handlers, eventToPrevent) => ({\n ...handlers,\n [eventToPrevent]: (event: React.SyntheticEvent<HTMLButtonElement>) => {\n event.preventDefault();\n }\n }),\n {}\n );\n\n const getDefaultTabIdx = () => {\n if (isDisabled) {\n return isButtonElement ? null : -1;\n } else if (isAriaDisabled) {\n return null;\n } else if (isInlineSpan) {\n return 0;\n }\n };\n\n return (\n <Component\n {...props}\n {...(isAriaDisabled ? preventedEvents : null)}\n aria-disabled={isDisabled || isAriaDisabled}\n aria-label={ariaLabel}\n className={css(\n styles.button,\n styles.modifiers[variant],\n isBlock && styles.modifiers.block,\n isDisabled && styles.modifiers.disabled,\n isAriaDisabled && styles.modifiers.ariaDisabled,\n isActive && styles.modifiers.active,\n isInline && variant === ButtonVariant.link && styles.modifiers.inline,\n isDanger && (variant === ButtonVariant.secondary || variant === ButtonVariant.link) && styles.modifiers.danger,\n isLoading !== null && children !== null && styles.modifiers.progress,\n isLoading && styles.modifiers.inProgress,\n isSmall && styles.modifiers.small,\n isLarge && styles.modifiers.displayLg,\n className\n )}\n disabled={isButtonElement ? isDisabled : null}\n tabIndex={tabIndex !== null ? tabIndex : getDefaultTabIdx()}\n type={isButtonElement || isInlineSpan ? type : null}\n role={isInlineSpan ? 'button' : null}\n ref={innerRef}\n {...ouiaProps}\n >\n {isLoading && (\n <span className={css(styles.buttonProgress)}>\n <Spinner\n size={spinnerSize.md}\n isInline={isInline}\n aria-valuetext={spinnerAriaValueText}\n aria-label={spinnerAriaLabel}\n aria-labelledby={spinnerAriaLabelledBy}\n />\n </span>\n )}\n {variant === ButtonVariant.plain && children === null && icon ? icon : null}\n {variant !== ButtonVariant.plain && icon && iconPosition === 'left' && (\n <span className={css(styles.buttonIcon, styles.modifiers.start)}>{icon}</span>\n )}\n {children}\n {variant !== ButtonVariant.plain && icon && iconPosition === 'right' && (\n <span className={css(styles.buttonIcon, styles.modifiers.end)}>{icon}</span>\n )}\n {countOptions && (\n <span className={css(styles.buttonCount, countOptions.className)}>\n <Badge isRead={countOptions.isRead}>{countOptions.count}</Badge>\n </span>\n )}\n </Component>\n );\n};\n\nexport const Button = React.forwardRef((props: ButtonProps, ref: React.Ref<any>) => (\n <ButtonBase innerRef={ref} {...props} />\n));\n\nButton.displayName = 'Button';\n","import './badge.css';\nexport default {\n \"badge\": \"pf-c-badge\",\n \"modifiers\": {\n \"read\": \"pf-m-read\",\n \"unread\": \"pf-m-unread\"\n },\n \"themeDark\": \"pf-theme-dark\"\n};","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/Badge/badge';\n\nexport interface BadgeProps extends React.HTMLProps<HTMLSpanElement> {\n /** Text announced by screen readers to indicate the current content/status of the badge. */\n screenReaderText?: string;\n /** Adds styling to the badge to indicate it has been read */\n isRead?: boolean;\n /** content rendered inside the Badge */\n children?: React.ReactNode;\n /** additional classes added to the Badge */\n className?: string;\n}\n\nexport const Badge: React.FunctionComponent<BadgeProps> = ({\n isRead = false,\n className = '',\n children = '',\n screenReaderText,\n ...props\n}: BadgeProps) => (\n <span\n {...props}\n className={css(styles.badge, (isRead ? styles.modifiers.read : styles.modifiers.unread) as any, className)}\n >\n {children}\n {screenReaderText && <span className=\"pf-screen-reader\">{screenReaderText}</span>}\n </span>\n);\nBadge.displayName = 'Badge';\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/FormControl/form-control';\nimport { css } from '@patternfly/react-styles';\nimport { PickOptional } from '../../helpers/typeUtils';\nimport { ValidatedOptions } from '../../helpers/constants';\nimport { getOUIAProps, OUIAProps, getDefaultOUIAId } from '../../helpers';\n\nexport interface FormSelectProps\n extends Omit<React.HTMLProps<HTMLSelectElement>, 'onChange' | 'onBlur' | 'onFocus' | 'disabled'>,\n OUIAProps {\n /** content rendered inside the FormSelect */\n children: React.ReactNode;\n /** additional classes added to the FormSelect control */\n className?: string;\n /** value of selected option */\n value?: any;\n /** Value to indicate if the select is modified to show that validation state.\n * If set to success, select will be modified to indicate valid state.\n * If set to error, select will be modified to indicate error state.\n */\n validated?: 'success' | 'warning' | 'error' | 'default';\n /** Flag indicating the FormSelect is disabled */\n isDisabled?: boolean;\n /** Sets the FormSelect required. */\n isRequired?: boolean;\n /** Use the external file instead of a data URI */\n isIconSprite?: boolean;\n /** Optional callback for updating when selection loses focus */\n onBlur?: (event: React.FormEvent<HTMLSelectElement>) => void;\n /** Optional callback for updating when selection gets focus */\n onFocus?: (event: React.FormEvent<HTMLSelectElement>) => void;\n /** Optional callback for updating when selection changes */\n onChange?: (value: string, event: React.FormEvent<HTMLSelectElement>) => void;\n /** Custom flag to show that the FormSelect requires an associated id or aria-label. */\n 'aria-label'?: string;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\nexport class FormSelect extends React.Component<FormSelectProps, { ouiaStateId: string }> {\n static displayName = 'FormSelect';\n constructor(props: FormSelectProps) {\n super(props);\n if (!props.id && !props['aria-label']) {\n // eslint-disable-next-line no-console\n console.error('FormSelect requires either an id or aria-label to be specified');\n }\n this.state = {\n ouiaStateId: getDefaultOUIAId(FormSelect.displayName, props.validated)\n };\n }\n\n static defaultProps: PickOptional<FormSelectProps> = {\n className: '',\n value: '',\n validated: 'default',\n isDisabled: false,\n isRequired: false,\n isIconSprite: false,\n onBlur: (): any => undefined,\n onFocus: (): any => undefined,\n onChange: (): any => undefined,\n ouiaSafe: true\n };\n\n handleChange = (event: any) => {\n this.props.onChange(event.currentTarget.value, event);\n };\n\n render() {\n const {\n children,\n className,\n value,\n validated,\n isDisabled,\n isRequired,\n isIconSprite,\n ouiaId,\n ouiaSafe,\n ...props\n } = this.props;\n /* find selected option and get placeholder flag */\n const selectedOption = React.Children.toArray(children).find((option: any) => option.props.value === value) as any;\n const isSelectedPlaceholder = selectedOption && selectedOption.props.isPlaceholder;\n return (\n <select\n {...props}\n className={css(\n styles.formControl,\n isIconSprite && styles.modifiers.iconSprite,\n className,\n validated === ValidatedOptions.success && styles.modifiers.success,\n validated === ValidatedOptions.warning && styles.modifiers.warning,\n isSelectedPlaceholder && styles.modifiers.placeholder\n )}\n aria-invalid={validated === ValidatedOptions.error}\n {...getOUIAProps(FormSelect.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}\n onChange={this.handleChange}\n disabled={isDisabled}\n required={isRequired}\n value={value}\n >\n {children}\n </select>\n );\n }\n}\n","import * as React from 'react';\n\nexport interface FormSelectOptionProps extends Omit<React.HTMLProps<HTMLOptionElement>, 'disabled'> {\n /** additional classes added to the Select Option */\n className?: string;\n /** the value for the option */\n value?: any;\n /** the label for the option */\n label: string;\n /** flag indicating if the option is disabled */\n isDisabled?: boolean;\n /** flag indicating if option will have placeholder styling applied when selected **/\n isPlaceholder?: boolean;\n}\n\nexport const FormSelectOption: React.FunctionComponent<FormSelectOptionProps> = ({\n className = '',\n value = '',\n isDisabled = false,\n label,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isPlaceholder = false,\n ...props\n}: FormSelectOptionProps) => (\n <option {...props} className={className} value={value} disabled={isDisabled}>\n {label}\n </option>\n);\nFormSelectOption.displayName = 'FormSelectOption';\n","import './backdrop.css';\nexport default {\n \"backdrop\": \"pf-c-backdrop\",\n \"backdropOpen\": \"pf-c-backdrop__open\"\n};","const candidateSelectors = [\n 'input',\n 'select',\n 'textarea',\n 'a[href]',\n 'button',\n '[tabindex]:not(slot)',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'details>summary:first-of-type',\n 'details',\n];\nconst candidateSelector = /* #__PURE__ */ candidateSelectors.join(',');\n\nconst NoElement = typeof Element === 'undefined';\n\nconst matches = NoElement\n ? function () {}\n : Element.prototype.matches ||\n Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nconst getRootNode =\n !NoElement && Element.prototype.getRootNode\n ? (element) => element.getRootNode()\n : (element) => element.ownerDocument;\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nconst getCandidates = function (el, includeContainer, filter) {\n let candidates = Array.prototype.slice.apply(\n el.querySelectorAll(candidateSelector)\n );\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidatesScope\n * @property {Element} scope contains inner candidates\n * @property {Element[]} candidates\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidatesScope>}\n */\nconst getCandidatesIteratively = function (\n elements,\n includeContainer,\n options\n) {\n const candidates = [];\n const elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n const element = elementsToCheck.shift();\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n const assigned = element.assignedElements();\n const content = assigned.length ? assigned : element.children;\n const nestedCandidates = getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // check candidate element\n const validCandidate = matches.call(element, candidateSelector);\n if (\n validCandidate &&\n options.filter(element) &&\n (includeContainer || !elements.includes(element))\n ) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n const shadowRoot =\n element.shadowRoot ||\n // check for an undisclosed shadow\n (typeof options.getShadowRoot === 'function' &&\n options.getShadowRoot(element));\n\n const validShadowRoot =\n !options.shadowRootFilter || options.shadowRootFilter(element);\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n const nestedCandidates = getCandidatesIteratively(\n shadowRoot === true ? element.children : shadowRoot.children,\n true,\n options\n );\n\n if (options.flatten) {\n candidates.push(...nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates,\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift(...element.children);\n }\n }\n }\n return candidates;\n};\n\nconst getTabindex = function (node, isScope) {\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n //\n // isScope is positive for custom element with shadow root or slot that by default\n // have tabIndex -1, but need to be sorted by document order in order for their\n // content to be inserted in the correct position\n if (\n (isScope ||\n /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) ||\n node.isContentEditable) &&\n isNaN(parseInt(node.getAttribute('tabindex'), 10))\n ) {\n return 0;\n }\n }\n\n return node.tabIndex;\n};\n\nconst sortOrderedTabbables = function (a, b) {\n return a.tabIndex === b.tabIndex\n ? a.documentOrder - b.documentOrder\n : a.tabIndex - b.tabIndex;\n};\n\nconst isInput = function (node) {\n return node.tagName === 'INPUT';\n};\n\nconst isHiddenInput = function (node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nconst isDetailsWithSummary = function (node) {\n const r =\n node.tagName === 'DETAILS' &&\n Array.prototype.slice\n .apply(node.children)\n .some((child) => child.tagName === 'SUMMARY');\n return r;\n};\n\nconst getCheckedRadio = function (nodes, form) {\n for (let i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nconst isTabbableRadio = function (node) {\n if (!node.name) {\n return true;\n }\n const radioScope = node.form || getRootNode(node);\n const queryRadios = function (name) {\n return radioScope.querySelectorAll(\n 'input[type=\"radio\"][name=\"' + name + '\"]'\n );\n };\n\n let radioSet;\n if (\n typeof window !== 'undefined' &&\n typeof window.CSS !== 'undefined' &&\n typeof window.CSS.escape === 'function'\n ) {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error(\n 'Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s',\n err.message\n );\n return false;\n }\n }\n\n const checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nconst isRadio = function (node) {\n return isInput(node) && node.type === 'radio';\n};\n\nconst isNonTabbableRadio = function (node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nconst isZeroArea = function (node) {\n const { width, height } = node.getBoundingClientRect();\n return width === 0 && height === 0;\n};\nconst isHidden = function (node, { displayCheck, getShadowRoot }) {\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n const isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n const nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n\n // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n const nodeRootHost = getRootNode(node).host;\n const nodeIsAttached =\n nodeRootHost?.ownerDocument.contains(nodeRootHost) ||\n node.ownerDocument.contains(node);\n\n if (!displayCheck || displayCheck === 'full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n const originalNode = node;\n while (node) {\n const parentElement = node.parentElement;\n const rootNode = getRootNode(node);\n if (\n parentElement &&\n !parentElement.shadowRoot &&\n getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n\n node = originalNode;\n }\n // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n if (nodeIsAttached) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n }\n\n // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n }\n\n // visible, as far as we can tell, or per current `displayCheck` mode\n return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\nconst isDisabledFromFieldset = function (node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n let parentNode = node.parentElement;\n // check if `node` is contained in a disabled <fieldset>\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (let i = 0; i < parentNode.children.length; i++) {\n const child = parentNode.children.item(i);\n // when the first <legend> (in document order) is found\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *')\n ? true\n : !child.contains(node);\n }\n }\n // the disabled <fieldset> containing `node` has no <legend>\n return true;\n }\n parentNode = parentNode.parentElement;\n }\n }\n\n // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n return false;\n};\n\nconst isNodeMatchingSelectorFocusable = function (options, node) {\n if (\n node.disabled ||\n isHiddenInput(node) ||\n isHidden(node, options) ||\n // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) ||\n isDisabledFromFieldset(node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isNodeMatchingSelectorTabbable = function (options, node) {\n if (\n isNonTabbableRadio(node) ||\n getTabindex(node) < 0 ||\n !isNodeMatchingSelectorFocusable(options, node)\n ) {\n return false;\n }\n return true;\n};\n\nconst isValidShadowRootTabbable = function (shadowHostNode) {\n const tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n }\n // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n return false;\n};\n\n/**\n * @param {Array.<Element|CandidatesScope>} candidates\n * @returns Element[]\n */\nconst sortByOrder = function (candidates) {\n const regularTabbables = [];\n const orderedTabbables = [];\n candidates.forEach(function (item, i) {\n const isScope = !!item.scope;\n const element = isScope ? item.scope : item;\n const candidateTabindex = getTabindex(element, isScope);\n const elements = isScope ? sortByOrder(item.candidates) : element;\n if (candidateTabindex === 0) {\n isScope\n ? regularTabbables.push(...elements)\n : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements,\n });\n }\n });\n\n return orderedTabbables\n .sort(sortOrderedTabbables)\n .reduce((acc, sortable) => {\n sortable.isScope\n ? acc.push(...sortable.content)\n : acc.push(sortable.content);\n return acc;\n }, [])\n .concat(regularTabbables);\n};\n\nconst tabbable = function (el, options) {\n options = options || {};\n\n let candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isValidShadowRootTabbable,\n });\n } else {\n candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorTabbable.bind(null, options)\n );\n }\n return sortByOrder(candidates);\n};\n\nconst focusable = function (el, options) {\n options = options || {};\n\n let candidates;\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot,\n });\n } else {\n candidates = getCandidates(\n el,\n options.includeContainer,\n isNodeMatchingSelectorFocusable.bind(null, options)\n );\n }\n\n return candidates;\n};\n\nconst isTabbable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nconst focusableCandidateSelector = /* #__PURE__ */ candidateSelectors\n .concat('iframe')\n .join(',');\n\nconst isFocusable = function (node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { tabbable, focusable, isTabbable, isFocusable };\n","import { tabbable, focusable, isFocusable, isTabbable } from 'tabbable';\n\nconst activeFocusTraps = (function () {\n const trapQueue = [];\n return {\n activateTrap(trap) {\n if (trapQueue.length > 0) {\n const activeTrap = trapQueue[trapQueue.length - 1];\n if (activeTrap !== trap) {\n activeTrap.pause();\n }\n }\n\n const trapIndex = trapQueue.indexOf(trap);\n if (trapIndex === -1) {\n trapQueue.push(trap);\n } else {\n // move this existing trap to the front of the queue\n trapQueue.splice(trapIndex, 1);\n trapQueue.push(trap);\n }\n },\n\n deactivateTrap(trap) {\n const trapIndex = trapQueue.indexOf(trap);\n if (trapIndex !== -1) {\n trapQueue.splice(trapIndex, 1);\n }\n\n if (trapQueue.length > 0) {\n trapQueue[trapQueue.length - 1].unpause();\n }\n },\n };\n})();\n\nconst isSelectableInput = function (node) {\n return (\n node.tagName &&\n node.tagName.toLowerCase() === 'input' &&\n typeof node.select === 'function'\n );\n};\n\nconst isEscapeEvent = function (e) {\n return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;\n};\n\nconst isTabEvent = function (e) {\n return e.key === 'Tab' || e.keyCode === 9;\n};\n\nconst delay = function (fn) {\n return setTimeout(fn, 0);\n};\n\n// Array.find/findIndex() are not supported on IE; this replicates enough\n// of Array.findIndex() for our needs\nconst findIndex = function (arr, fn) {\n let idx = -1;\n\n arr.every(function (value, i) {\n if (fn(value)) {\n idx = i;\n return false; // break\n }\n\n return true; // next\n });\n\n return idx;\n};\n\n/**\n * Get an option's value when it could be a plain value, or a handler that provides\n * the value.\n * @param {*} value Option's value to check.\n * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.\n * @returns {*} The `value`, or the handler's returned value.\n */\nconst valueOrHandler = function (value, ...params) {\n return typeof value === 'function' ? value(...params) : value;\n};\n\nconst getActualTarget = function (event) {\n // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the\n // shadow host. However, event.target.composedPath() will be an array of\n // nodes \"clicked\" from inner-most (the actual element inside the shadow) to\n // outer-most (the host HTML document). If we have access to composedPath(),\n // then use its first element; otherwise, fall back to event.target (and\n // this only works for an _open_ shadow DOM; otherwise,\n // composedPath()[0] === event.target always).\n return event.target.shadowRoot && typeof event.composedPath === 'function'\n ? event.composedPath()[0]\n : event.target;\n};\n\nconst createFocusTrap = function (elements, userOptions) {\n // SSR: a live trap shouldn't be created in this type of environment so this\n // should be safe code to execute if the `document` option isn't specified\n const doc = userOptions?.document || document;\n\n const config = {\n returnFocusOnDeactivate: true,\n escapeDeactivates: true,\n delayInitialFocus: true,\n ...userOptions,\n };\n\n const state = {\n // containers given to createFocusTrap()\n // @type {Array<HTMLElement>}\n containers: [],\n\n // list of objects identifying tabbable nodes in `containers` in the trap\n // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap\n // is active, but the trap should never get to a state where there isn't at least one group\n // with at least one tabbable node in it (that would lead to an error condition that would\n // result in an error being thrown)\n // @type {Array<{\n // container: HTMLElement,\n // tabbableNodes: Array<HTMLElement>, // empty if none\n // focusableNodes: Array<HTMLElement>, // empty if none\n // firstTabbableNode: HTMLElement|null,\n // lastTabbableNode: HTMLElement|null,\n // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined\n // }>}\n containerGroups: [], // same order/length as `containers` list\n\n // references to objects in `containerGroups`, but only those that actually have\n // tabbable nodes in them\n // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__\n // the same length\n tabbableGroups: [],\n\n nodeFocusedBeforeActivation: null,\n mostRecentlyFocusedNode: null,\n active: false,\n paused: false,\n\n // timer ID for when delayInitialFocus is true and initial focus in this trap\n // has been delayed during activation\n delayInitialFocusTimer: undefined,\n };\n\n let trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later\n\n /**\n * Gets a configuration option value.\n * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,\n * value will be taken from this object. Otherwise, value will be taken from base configuration.\n * @param {string} optionName Name of the option whose value is sought.\n * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`\n * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.\n */\n const getOption = (configOverrideOptions, optionName, configOptionName) => {\n return configOverrideOptions &&\n configOverrideOptions[optionName] !== undefined\n ? configOverrideOptions[optionName]\n : config[configOptionName || optionName];\n };\n\n /**\n * Finds the index of the container that contains the element.\n * @param {HTMLElement} element\n * @returns {number} Index of the container in either `state.containers` or\n * `state.containerGroups` (the order/length of these lists are the same); -1\n * if the element isn't found.\n */\n const findContainerIndex = function (element) {\n // NOTE: search `containerGroups` because it's possible a group contains no tabbable\n // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)\n // and we still need to find the element in there\n return state.containerGroups.findIndex(\n ({ container, tabbableNodes }) =>\n container.contains(element) ||\n // fall back to explicit tabbable search which will take into consideration any\n // web components if the `tabbableOptions.getShadowRoot` option was used for\n // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't\n // look inside web components even if open)\n tabbableNodes.find((node) => node === element)\n );\n };\n\n /**\n * Gets the node for the given option, which is expected to be an option that\n * can be either a DOM node, a string that is a selector to get a node, `false`\n * (if a node is explicitly NOT given), or a function that returns any of these\n * values.\n * @param {string} optionName\n * @returns {undefined | false | HTMLElement | SVGElement} Returns\n * `undefined` if the option is not specified; `false` if the option\n * resolved to `false` (node explicitly not given); otherwise, the resolved\n * DOM node.\n * @throws {Error} If the option is set, not `false`, and is not, or does not\n * resolve to a node.\n */\n const getNodeForOption = function (optionName, ...params) {\n let optionValue = config[optionName];\n\n if (typeof optionValue === 'function') {\n optionValue = optionValue(...params);\n }\n\n if (optionValue === true) {\n optionValue = undefined; // use default value\n }\n\n if (!optionValue) {\n if (optionValue === undefined || optionValue === false) {\n return optionValue;\n }\n // else, empty string (invalid), null (invalid), 0 (invalid)\n\n throw new Error(\n `\\`${optionName}\\` was specified but was not a node, or did not return a node`\n );\n }\n\n let node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point\n\n if (typeof optionValue === 'string') {\n node = doc.querySelector(optionValue); // resolve to node, or null if fails\n if (!node) {\n throw new Error(\n `\\`${optionName}\\` as selector refers to no known node`\n );\n }\n }\n\n return node;\n };\n\n const getInitialFocusNode = function () {\n let node = getNodeForOption('initialFocus');\n\n // false explicitly indicates we want no initialFocus at all\n if (node === false) {\n return false;\n }\n\n if (node === undefined) {\n // option not specified: use fallback options\n if (findContainerIndex(doc.activeElement) >= 0) {\n node = doc.activeElement;\n } else {\n const firstTabbableGroup = state.tabbableGroups[0];\n const firstTabbableNode =\n firstTabbableGroup && firstTabbableGroup.firstTabbableNode;\n\n // NOTE: `fallbackFocus` option function cannot return `false` (not supported)\n node = firstTabbableNode || getNodeForOption('fallbackFocus');\n }\n }\n\n if (!node) {\n throw new Error(\n 'Your focus-trap needs to have at least one focusable element'\n );\n }\n\n return node;\n };\n\n const updateTabbableNodes = function () {\n state.containerGroups = state.containers.map((container) => {\n const tabbableNodes = tabbable(container, config.tabbableOptions);\n\n // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes\n // are a superset of tabbable nodes\n const focusableNodes = focusable(container, config.tabbableOptions);\n\n return {\n container,\n tabbableNodes,\n focusableNodes,\n firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,\n lastTabbableNode:\n tabbableNodes.length > 0\n ? tabbableNodes[tabbableNodes.length - 1]\n : null,\n\n /**\n * Finds the __tabbable__ node that follows the given node in the specified direction,\n * in this container, if any.\n * @param {HTMLElement} node\n * @param {boolean} [forward] True if going in forward tab order; false if going\n * in reverse.\n * @returns {HTMLElement|undefined} The next tabbable node, if any.\n */\n nextTabbableNode(node, forward = true) {\n // NOTE: If tabindex is positive (in order to manipulate the tab order separate\n // from the DOM order), this __will not work__ because the list of focusableNodes,\n // while it contains tabbable nodes, does not sort its nodes in any order other\n // than DOM order, because it can't: Where would you place focusable (but not\n // tabbable) nodes in that order? They have no order, because they aren't tabbale...\n // Support for positive tabindex is already broken and hard to manage (possibly\n // not supportable, TBD), so this isn't going to make things worse than they\n // already are, and at least makes things better for the majority of cases where\n // tabindex is either 0/unset or negative.\n // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375\n const nodeIdx = focusableNodes.findIndex((n) => n === node);\n if (nodeIdx < 0) {\n return undefined;\n }\n\n if (forward) {\n return focusableNodes\n .slice(nodeIdx + 1)\n .find((n) => isTabbable(n, config.tabbableOptions));\n }\n\n return focusableNodes\n .slice(0, nodeIdx)\n .reverse()\n .find((n) => isTabbable(n, config.tabbableOptions));\n },\n };\n });\n\n state.tabbableGroups = state.containerGroups.filter(\n (group) => group.tabbableNodes.length > 0\n );\n\n // throw if no groups have tabbable nodes and we don't have a fallback focus node either\n if (\n state.tabbableGroups.length <= 0 &&\n !getNodeForOption('fallbackFocus') // returning false not supported for this option\n ) {\n throw new Error(\n 'Your focus-trap must have at least one container with at least one tabbable node in it at all times'\n );\n }\n };\n\n const tryFocus = function (node) {\n if (node === false) {\n return;\n }\n\n if (node === doc.activeElement) {\n return;\n }\n\n if (!node || !node.focus) {\n tryFocus(getInitialFocusNode());\n return;\n }\n\n node.focus({ preventScroll: !!config.preventScroll });\n state.mostRecentlyFocusedNode = node;\n\n if (isSelectableInput(node)) {\n node.select();\n }\n };\n\n const getReturnFocusNode = function (previousActiveElement) {\n const node = getNodeForOption('setReturnFocus', previousActiveElement);\n return node ? node : node === false ? false : previousActiveElement;\n };\n\n // This needs to be done on mousedown and touchstart instead of click\n // so that it precedes the focus event.\n const checkPointerDown = function (e) {\n const target = getActualTarget(e);\n\n if (findContainerIndex(target) >= 0) {\n // allow the click since it ocurred inside the trap\n return;\n }\n\n if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n // immediately deactivate the trap\n trap.deactivate({\n // if, on deactivation, we should return focus to the node originally-focused\n // when the trap was activated (or the configured `setReturnFocus` node),\n // then assume it's also OK to return focus to the outside node that was\n // just clicked, causing deactivation, as long as that node is focusable;\n // if it isn't focusable, then return focus to the original node focused\n // on activation (or the configured `setReturnFocus` node)\n // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,\n // which will result in the outside click setting focus to the node\n // that was clicked, whether it's focusable or not; by setting\n // `returnFocus: true`, we'll attempt to re-focus the node originally-focused\n // on activation (or the configured `setReturnFocus` node)\n returnFocus:\n config.returnFocusOnDeactivate &&\n !isFocusable(target, config.tabbableOptions),\n });\n return;\n }\n\n // This is needed for mobile devices.\n // (If we'll only let `click` events through,\n // then on mobile they will be blocked anyways if `touchstart` is blocked.)\n if (valueOrHandler(config.allowOutsideClick, e)) {\n // allow the click outside the trap to take place\n return;\n }\n\n // otherwise, prevent the click\n e.preventDefault();\n };\n\n // In case focus escapes the trap for some strange reason, pull it back in.\n const checkFocusIn = function (e) {\n const target = getActualTarget(e);\n const targetContained = findContainerIndex(target) >= 0;\n\n // In Firefox when you Tab out of an iframe the Document is briefly focused.\n if (targetContained || target instanceof Document) {\n if (targetContained) {\n state.mostRecentlyFocusedNode = target;\n }\n } else {\n // escaped! pull it back in to where it just left\n e.stopImmediatePropagation();\n tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());\n }\n };\n\n // Hijack Tab events on the first and last focusable nodes of the trap,\n // in order to prevent focus from escaping. If it escapes for even a\n // moment it can end up scrolling the page and causing confusion so we\n // kind of need to capture the action at the keydown phase.\n const checkTab = function (e) {\n const target = getActualTarget(e);\n updateTabbableNodes();\n\n let destinationNode = null;\n\n if (state.tabbableGroups.length > 0) {\n // make sure the target is actually contained in a group\n // NOTE: the target may also be the container itself if it's focusable\n // with tabIndex='-1' and was given initial focus\n const containerIndex = findContainerIndex(target);\n const containerGroup =\n containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;\n\n if (containerIndex < 0) {\n // target not found in any group: quite possible focus has escaped the trap,\n // so bring it back in to...\n if (e.shiftKey) {\n // ...the last node in the last group\n destinationNode =\n state.tabbableGroups[state.tabbableGroups.length - 1]\n .lastTabbableNode;\n } else {\n // ...the first node in the first group\n destinationNode = state.tabbableGroups[0].firstTabbableNode;\n }\n } else if (e.shiftKey) {\n // REVERSE\n\n // is the target the first tabbable node in a group?\n let startOfGroupIndex = findIndex(\n state.tabbableGroups,\n ({ firstTabbableNode }) => target === firstTabbableNode\n );\n\n if (\n startOfGroupIndex < 0 &&\n (containerGroup.container === target ||\n (isFocusable(target, config.tabbableOptions) &&\n !isTabbable(target, config.tabbableOptions) &&\n !containerGroup.nextTabbableNode(target, false)))\n ) {\n // an exception case where the target is either the container itself, or\n // a non-tabbable node that was given focus (i.e. tabindex is negative\n // and user clicked on it or node was programmatically given focus)\n // and is not followed by any other tabbable node, in which\n // case, we should handle shift+tab as if focus were on the container's\n // first tabbable node, and go to the last tabbable node of the LAST group\n startOfGroupIndex = containerIndex;\n }\n\n if (startOfGroupIndex >= 0) {\n // YES: then shift+tab should go to the last tabbable node in the\n // previous group (and wrap around to the last tabbable node of\n // the LAST group if it's the first tabbable node of the FIRST group)\n const destinationGroupIndex =\n startOfGroupIndex === 0\n ? state.tabbableGroups.length - 1\n : startOfGroupIndex - 1;\n\n const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n destinationNode = destinationGroup.lastTabbableNode;\n }\n } else {\n // FORWARD\n\n // is the target the last tabbable node in a group?\n let lastOfGroupIndex = findIndex(\n state.tabbableGroups,\n ({ lastTabbableNode }) => target === lastTabbableNode\n );\n\n if (\n lastOfGroupIndex < 0 &&\n (containerGroup.container === target ||\n (isFocusable(target, config.tabbableOptions) &&\n !isTabbable(target, config.tabbableOptions) &&\n !containerGroup.nextTabbableNode(target)))\n ) {\n // an exception case where the target is the container itself, or\n // a non-tabbable node that was given focus (i.e. tabindex is negative\n // and user clicked on it or node was programmatically given focus)\n // and is not followed by any other tabbable node, in which\n // case, we should handle tab as if focus were on the container's\n // last tabbable node, and go to the first tabbable node of the FIRST group\n lastOfGroupIndex = containerIndex;\n }\n\n if (lastOfGroupIndex >= 0) {\n // YES: then tab should go to the first tabbable node in the next\n // group (and wrap around to the first tabbable node of the FIRST\n // group if it's the last tabbable node of the LAST group)\n const destinationGroupIndex =\n lastOfGroupIndex === state.tabbableGroups.length - 1\n ? 0\n : lastOfGroupIndex + 1;\n\n const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n destinationNode = destinationGroup.firstTabbableNode;\n }\n }\n } else {\n // NOTE: the fallbackFocus option does not support returning false to opt-out\n destinationNode = getNodeForOption('fallbackFocus');\n }\n\n if (destinationNode) {\n e.preventDefault();\n tryFocus(destinationNode);\n }\n // else, let the browser take care of [shift+]tab and move the focus\n };\n\n const checkKey = function (e) {\n if (\n isEscapeEvent(e) &&\n valueOrHandler(config.escapeDeactivates, e) !== false\n ) {\n e.preventDefault();\n trap.deactivate();\n return;\n }\n\n if (isTabEvent(e)) {\n checkTab(e);\n return;\n }\n };\n\n const checkClick = function (e) {\n const target = getActualTarget(e);\n\n if (findContainerIndex(target) >= 0) {\n return;\n }\n\n if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n return;\n }\n\n if (valueOrHandler(config.allowOutsideClick, e)) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n };\n\n //\n // EVENT LISTENERS\n //\n\n const addListeners = function () {\n if (!state.active) {\n return;\n }\n\n // There can be only one listening focus trap at a time\n activeFocusTraps.activateTrap(trap);\n\n // Delay ensures that the focused element doesn't capture the event\n // that caused the focus trap activation.\n state.delayInitialFocusTimer = config.delayInitialFocus\n ? delay(function () {\n tryFocus(getInitialFocusNode());\n })\n : tryFocus(getInitialFocusNode());\n\n doc.addEventListener('focusin', checkFocusIn, true);\n doc.addEventListener('mousedown', checkPointerDown, {\n capture: true,\n passive: false,\n });\n doc.addEventListener('touchstart', checkPointerDown, {\n capture: true,\n passive: false,\n });\n doc.addEventListener('click', checkClick, {\n capture: true,\n passive: false,\n });\n doc.addEventListener('keydown', checkKey, {\n capture: true,\n passive: false,\n });\n\n return trap;\n };\n\n const removeListeners = function () {\n if (!state.active) {\n return;\n }\n\n doc.removeEventListener('focusin', checkFocusIn, true);\n doc.removeEventListener('mousedown', checkPointerDown, true);\n doc.removeEventListener('touchstart', checkPointerDown, true);\n doc.removeEventListener('click', checkClick, true);\n doc.removeEventListener('keydown', checkKey, true);\n\n return trap;\n };\n\n //\n // TRAP DEFINITION\n //\n\n trap = {\n get active() {\n return state.active;\n },\n\n get paused() {\n return state.paused;\n },\n\n activate(activateOptions) {\n if (state.active) {\n return this;\n }\n\n const onActivate = getOption(activateOptions, 'onActivate');\n const onPostActivate = getOption(activateOptions, 'onPostActivate');\n const checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');\n\n if (!checkCanFocusTrap) {\n updateTabbableNodes();\n }\n\n state.active = true;\n state.paused = false;\n state.nodeFocusedBeforeActivation = doc.activeElement;\n\n if (onActivate) {\n onActivate();\n }\n\n const finishActivation = () => {\n if (checkCanFocusTrap) {\n updateTabbableNodes();\n }\n addListeners();\n if (onPostActivate) {\n onPostActivate();\n }\n };\n\n if (checkCanFocusTrap) {\n checkCanFocusTrap(state.containers.concat()).then(\n finishActivation,\n finishActivation\n );\n return this;\n }\n\n finishActivation();\n return this;\n },\n\n deactivate(deactivateOptions) {\n if (!state.active) {\n return this;\n }\n\n const options = {\n onDeactivate: config.onDeactivate,\n onPostDeactivate: config.onPostDeactivate,\n checkCanReturnFocus: config.checkCanReturnFocus,\n ...deactivateOptions,\n };\n\n clearTimeout(state.delayInitialFocusTimer); // noop if undefined\n state.delayInitialFocusTimer = undefined;\n\n removeListeners();\n state.active = false;\n state.paused = false;\n\n activeFocusTraps.deactivateTrap(trap);\n\n const onDeactivate = getOption(options, 'onDeactivate');\n const onPostDeactivate = getOption(options, 'onPostDeactivate');\n const checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');\n const returnFocus = getOption(\n options,\n 'returnFocus',\n 'returnFocusOnDeactivate'\n );\n\n if (onDeactivate) {\n onDeactivate();\n }\n\n const finishDeactivation = () => {\n delay(() => {\n if (returnFocus) {\n tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));\n }\n if (onPostDeactivate) {\n onPostDeactivate();\n }\n });\n };\n\n if (returnFocus && checkCanReturnFocus) {\n checkCanReturnFocus(\n getReturnFocusNode(state.nodeFocusedBeforeActivation)\n ).then(finishDeactivation, finishDeactivation);\n return this;\n }\n\n finishDeactivation();\n return this;\n },\n\n pause() {\n if (state.paused || !state.active) {\n return this;\n }\n\n state.paused = true;\n removeListeners();\n\n return this;\n },\n\n unpause() {\n if (!state.paused || !state.active) {\n return this;\n }\n\n state.paused = false;\n updateTabbableNodes();\n addListeners();\n\n return this;\n },\n\n updateContainerElements(containerElements) {\n const elementsAsArray = [].concat(containerElements).filter(Boolean);\n\n state.containers = elementsAsArray.map((element) =>\n typeof element === 'string' ? doc.querySelector(element) : element\n );\n\n if (state.active) {\n updateTabbableNodes();\n }\n\n return this;\n },\n };\n\n // initialize container elements\n trap.updateContainerElements(elements);\n\n return trap;\n};\n\nexport { createFocusTrap };\n","import * as React from 'react';\nimport { createFocusTrap, Options as FocusTrapOptions, FocusTrap as IFocusTrap } from 'focus-trap';\n\ninterface FocusTrapProps extends Omit<React.HTMLProps<HTMLDivElement>, 'ref'> {\n children: React.ReactNode;\n className?: string;\n active?: boolean;\n paused?: boolean;\n focusTrapOptions?: FocusTrapOptions;\n /** Prevent from scrolling to the previously focused element on deactivation */\n preventScrollOnDeactivate?: boolean;\n /** @hide Forwarded ref */\n innerRef?: React.Ref<HTMLDivElement>;\n}\n\nclass FocusTrapBase extends React.Component<FocusTrapProps> {\n static displayName = 'FocusTrap';\n previouslyFocusedElement: HTMLElement;\n focusTrap: IFocusTrap;\n divRef = (this.props.innerRef as React.RefObject<HTMLDivElement>) || React.createRef<HTMLDivElement>();\n\n static defaultProps = {\n active: true,\n paused: false,\n focusTrapOptions: {},\n preventScrollOnDeactivate: false\n };\n\n constructor(props: FocusTrapProps) {\n super(props);\n\n if (typeof document !== 'undefined') {\n this.previouslyFocusedElement = document.activeElement as HTMLElement;\n }\n }\n\n componentDidMount() {\n // We need to hijack the returnFocusOnDeactivate option,\n // because React can move focus into the element before we arrived at\n // this lifecycle hook (e.g. with autoFocus inputs). So the component\n // captures the previouslyFocusedElement in componentWillMount,\n // then (optionally) returns focus to it in componentWillUnmount.\n this.focusTrap = createFocusTrap(this.divRef.current, {\n ...this.props.focusTrapOptions,\n returnFocusOnDeactivate: false\n });\n if (this.props.active) {\n this.focusTrap.activate();\n }\n if (this.props.paused) {\n this.focusTrap.pause();\n }\n }\n\n componentDidUpdate(prevProps: FocusTrapProps) {\n if (prevProps.active && !this.props.active) {\n this.focusTrap.deactivate();\n } else if (!prevProps.active && this.props.active) {\n this.focusTrap.activate();\n }\n\n if (prevProps.paused && !this.props.paused) {\n this.focusTrap.unpause();\n } else if (!prevProps.paused && this.props.paused) {\n this.focusTrap.pause();\n }\n }\n\n componentWillUnmount() {\n this.focusTrap.deactivate();\n if (\n this.props.focusTrapOptions.returnFocusOnDeactivate !== false &&\n this.previouslyFocusedElement &&\n this.previouslyFocusedElement.focus\n ) {\n this.previouslyFocusedElement.focus({ preventScroll: this.props.preventScrollOnDeactivate });\n }\n }\n\n render() {\n const {\n children,\n className,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n focusTrapOptions,\n active,\n paused,\n preventScrollOnDeactivate,\n innerRef,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...rest\n } = this.props;\n return (\n <div ref={this.divRef} className={className} {...rest}>\n {children}\n </div>\n );\n }\n}\n\nexport const FocusTrap = React.forwardRef((props: FocusTrapProps, ref: React.Ref<any>) => (\n <FocusTrapBase innerRef={ref} {...props} />\n));\n","import './modal-box.css';\nexport default {\n \"button\": \"pf-c-button\",\n \"modalBox\": \"pf-c-modal-box\",\n \"modalBoxBody\": \"pf-c-modal-box__body\",\n \"modalBoxDescription\": \"pf-c-modal-box__description\",\n \"modalBoxFooter\": \"pf-c-modal-box__footer\",\n \"modalBoxHeader\": \"pf-c-modal-box__header\",\n \"modalBoxHeaderMain\": \"pf-c-modal-box__header-main\",\n \"modalBoxTitle\": \"pf-c-modal-box__title\",\n \"modalBoxTitleIcon\": \"pf-c-modal-box__title-icon\",\n \"modalBoxTitleText\": \"pf-c-modal-box__title-text\",\n \"modifiers\": {\n \"sm\": \"pf-m-sm\",\n \"md\": \"pf-m-md\",\n \"lg\": \"pf-m-lg\",\n \"alignTop\": \"pf-m-align-top\",\n \"danger\": \"pf-m-danger\",\n \"warning\": \"pf-m-warning\",\n \"success\": \"pf-m-success\",\n \"default\": \"pf-m-default\",\n \"info\": \"pf-m-info\",\n \"help\": \"pf-m-help\",\n \"icon\": \"pf-m-icon\"\n },\n \"themeDark\": \"pf-theme-dark\"\n};","import './bullseye.css';\nexport default {\n \"bullseye\": \"pf-l-bullseye\"\n};","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/Backdrop/backdrop';\n\nexport interface BackdropProps extends React.HTMLProps<HTMLDivElement> {\n /** content rendered inside the backdrop */\n children?: React.ReactNode;\n /** additional classes added to the button */\n className?: string;\n}\n\nexport const Backdrop: React.FunctionComponent<BackdropProps> = ({\n children = null,\n className = '',\n ...props\n}: BackdropProps) => (\n <div {...props} className={css(styles.backdrop, className)}>\n {children}\n </div>\n);\nBackdrop.displayName = 'Backdrop';\n","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\n\nexport interface ModalBoxBodyProps extends React.HTMLProps<HTMLDivElement> {\n /** Content rendered inside the modal box body. */\n children?: React.ReactNode;\n /** Additional classes added to the modal box body. */\n className?: string;\n}\n\nexport const ModalBoxBody: React.FunctionComponent<ModalBoxBodyProps> = ({\n children = null,\n className = '',\n ...props\n}: ModalBoxBodyProps) => (\n <div {...props} className={css(styles.modalBoxBody, className)}>\n {children}\n </div>\n);\nModalBoxBody.displayName = 'ModalBoxBody';\n","import { createIcon } from '../createIcon';\n\nexport const TimesIconConfig = {\n name: 'TimesIcon',\n height: 512,\n width: 352,\n svgPath: 'M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const TimesIcon = createIcon(TimesIconConfig);\n\nexport default TimesIcon;","import * as React from 'react';\nimport { Button } from '../Button';\nimport TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';\nimport { OUIAProps } from '../../helpers';\n\nexport interface ModalBoxCloseButtonProps extends OUIAProps {\n /** Additional classes added to the close button. */\n className?: string;\n /** A callback for when the close button is clicked. */\n onClose?: () => void;\n /** Value to set the data-ouia-component-id.*/\n ouiaId?: number | string;\n}\n\nexport const ModalBoxCloseButton: React.FunctionComponent<ModalBoxCloseButtonProps> = ({\n className = '',\n onClose = () => undefined as any,\n ouiaId,\n ...props\n}: ModalBoxCloseButtonProps) => (\n <Button\n className={className}\n variant=\"plain\"\n onClick={onClose}\n aria-label=\"Close\"\n {...(ouiaId && { ouiaId: `${ouiaId}-${ModalBoxCloseButton.displayName}` })}\n {...props}\n >\n <TimesIcon />\n </Button>\n);\nModalBoxCloseButton.displayName = 'ModalBoxCloseButton';\n","export const c_modal_box_m_align_top_spacer = {\n \"name\": \"--pf-c-modal-box--m-align-top--spacer\",\n \"value\": \"0.5rem\",\n \"var\": \"var(--pf-c-modal-box--m-align-top--spacer)\"\n};\nexport default c_modal_box_m_align_top_spacer;","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\nimport topSpacer from '@patternfly/react-tokens/dist/esm/c_modal_box_m_align_top_spacer';\n\nexport interface ModalBoxProps extends React.HTMLProps<HTMLDivElement> {\n /** Id to use for the modal box description. */\n 'aria-describedby': string;\n /** Accessible descriptor of the modal. */\n 'aria-label'?: string;\n /** Id to use for the modal box label. */\n 'aria-labelledby'?: string;\n /** Content rendered inside the modal box. */\n children: React.ReactNode;\n /** Additional classes added to the modal box. */\n className?: string;\n /** Alternate position of the modal. */\n position?: 'top';\n /** Offset from alternate position. Can be any valid CSS length/percentage. */\n positionOffset?: string;\n /** Variant of the modal. */\n variant?: 'small' | 'medium' | 'large' | 'default';\n}\n\nexport const ModalBox: React.FunctionComponent<ModalBoxProps> = ({\n children,\n className = '',\n variant = 'default',\n position,\n positionOffset,\n 'aria-labelledby': ariaLabelledby,\n 'aria-label': ariaLabel = '',\n 'aria-describedby': ariaDescribedby,\n style,\n ...props\n}: ModalBoxProps) => {\n if (positionOffset) {\n style = style || {};\n (style as any)[topSpacer.name] = positionOffset;\n }\n return (\n <div\n {...props}\n role=\"dialog\"\n aria-label={ariaLabel || null}\n aria-labelledby={ariaLabelledby || null}\n aria-describedby={ariaDescribedby}\n aria-modal=\"true\"\n className={css(\n styles.modalBox,\n className,\n position === 'top' && styles.modifiers.alignTop,\n variant === 'large' && styles.modifiers.lg,\n variant === 'small' && styles.modifiers.sm,\n variant === 'medium' && styles.modifiers.md\n )}\n style={style}\n >\n {children}\n </div>\n );\n};\nModalBox.displayName = 'ModalBox';\n","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\n\nexport interface ModalBoxFooterProps {\n /** Content rendered inside the modal box footer. */\n children?: React.ReactNode;\n /** Additional classes added to the modal box footer. */\n className?: string;\n}\n\nexport const ModalBoxFooter: React.FunctionComponent<ModalBoxFooterProps> = ({\n children = null,\n className = '',\n ...props\n}: ModalBoxFooterProps) => (\n <footer {...props} className={css(styles.modalBoxFooter, className)}>\n {children}\n </footer>\n);\nModalBoxFooter.displayName = 'ModalBoxFooter';\n","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\n\nexport interface ModalBoxDescriptionProps {\n /** Content rendered inside the description. */\n children?: React.ReactNode;\n /** Additional classes added to the description. */\n className?: string;\n /** Id of the description. */\n id?: string;\n}\n\nexport const ModalBoxDescription: React.FunctionComponent<ModalBoxDescriptionProps> = ({\n children = null,\n className = '',\n id = '',\n ...props\n}: ModalBoxDescriptionProps) => (\n <div {...props} id={id} className={css(styles.modalBoxDescription, className)}>\n {children}\n </div>\n);\nModalBoxDescription.displayName = 'ModalBoxDescription';\n","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\n\nexport interface ModalBoxHeaderProps {\n /** Content rendered inside the modal box header. */\n children?: React.ReactNode;\n /** Additional classes added to the modal box header. */\n className?: string;\n /** Optional help section for the modal box header. */\n help?: React.ReactNode;\n}\n\nexport const ModalBoxHeader: React.FunctionComponent<ModalBoxHeaderProps> = ({\n children = null,\n className = '',\n help = null,\n ...props\n}: ModalBoxHeaderProps) => (\n <header className={css(styles.modalBoxHeader, help && styles.modifiers.help, className)} {...props}>\n {help && (\n <React.Fragment>\n <div className={css(styles.modalBoxHeaderMain)}>{children}</div>\n <div className=\"pf-c-modal-box__header-help\">{help}</div>\n </React.Fragment>\n )}\n {!help && children}\n </header>\n);\nModalBoxHeader.displayName = 'ModalBoxHeader';\n","import './accessibility.css';\nexport default {\n \"hidden\": \"pf-u-hidden\",\n \"hiddenOnLg\": \"pf-u-hidden-on-lg\",\n \"hiddenOnMd\": \"pf-u-hidden-on-md\",\n \"hiddenOnSm\": \"pf-u-hidden-on-sm\",\n \"hiddenOnXl\": \"pf-u-hidden-on-xl\",\n \"hiddenOn_2xl\": \"pf-u-hidden-on-2xl\",\n \"screenReader\": \"pf-u-screen-reader\",\n \"screenReaderOnLg\": \"pf-u-screen-reader-on-lg\",\n \"screenReaderOnMd\": \"pf-u-screen-reader-on-md\",\n \"screenReaderOnSm\": \"pf-u-screen-reader-on-sm\",\n \"screenReaderOnXl\": \"pf-u-screen-reader-on-xl\",\n \"screenReaderOn_2xl\": \"pf-u-screen-reader-on-2xl\",\n \"visible\": \"pf-u-visible\",\n \"visibleOnLg\": \"pf-u-visible-on-lg\",\n \"visibleOnMd\": \"pf-u-visible-on-md\",\n \"visibleOnSm\": \"pf-u-visible-on-sm\",\n \"visibleOnXl\": \"pf-u-visible-on-xl\",\n \"visibleOn_2xl\": \"pf-u-visible-on-2xl\"\n};","import './tooltip.css';\nexport default {\n \"modifiers\": {\n \"top\": \"pf-m-top\",\n \"topLeft\": \"pf-m-top-left\",\n \"topRight\": \"pf-m-top-right\",\n \"bottom\": \"pf-m-bottom\",\n \"bottomLeft\": \"pf-m-bottom-left\",\n \"bottomRight\": \"pf-m-bottom-right\",\n \"left\": \"pf-m-left\",\n \"leftTop\": \"pf-m-left-top\",\n \"leftBottom\": \"pf-m-left-bottom\",\n \"right\": \"pf-m-right\",\n \"rightTop\": \"pf-m-right-top\",\n \"rightBottom\": \"pf-m-right-bottom\",\n \"textAlignLeft\": \"pf-m-text-align-left\"\n },\n \"themeDark\": \"pf-theme-dark\",\n \"tooltip\": \"pf-c-tooltip\",\n \"tooltipArrow\": \"pf-c-tooltip__arrow\",\n \"tooltipContent\": \"pf-c-tooltip__content\"\n};","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Tooltip/tooltip';\nimport { css } from '@patternfly/react-styles';\n\nexport interface TooltipContentProps extends React.HTMLProps<HTMLDivElement> {\n /** PopoverContent additional class */\n className?: string;\n /** PopoverContent content */\n children: React.ReactNode;\n /** Flag to align text to the left */\n isLeftAligned?: boolean;\n}\n\nexport const TooltipContent: React.FunctionComponent<TooltipContentProps> = ({\n className,\n children,\n isLeftAligned,\n ...props\n}: TooltipContentProps) => (\n <div className={css(styles.tooltipContent, isLeftAligned && styles.modifiers.textAlignLeft, className)} {...props}>\n {children}\n </div>\n);\nTooltipContent.displayName = 'TooltipContent';\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Tooltip/tooltip';\nimport { css } from '@patternfly/react-styles';\n\nexport interface TooltipArrowProps extends React.HTMLProps<HTMLDivElement> {\n /** className */\n className?: string;\n}\n\nexport const TooltipArrow: React.FunctionComponent<TooltipArrowProps> = ({\n className,\n ...props\n}: TooltipArrowProps) => <div className={css(styles.tooltipArrow, className)} {...props} />;\nTooltipArrow.displayName = 'TooltipArrow';\n","export const c_tooltip_MaxWidth = {\n \"name\": \"--pf-c-tooltip--MaxWidth\",\n \"value\": \"18.75rem\",\n \"var\": \"var(--pf-c-tooltip--MaxWidth)\"\n};\nexport default c_tooltip_MaxWidth;","// @ts-nocheck\nimport { ClientRectObject, VirtualElement } from '../types';\n\n/**\n * @param element\n */\nexport default function getBoundingClientRect(element: Element | VirtualElement): ClientRectObject {\n const rect = element.getBoundingClientRect();\n\n return {\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n y: rect.top\n };\n}\n","// @ts-nocheck\n\n/* :: import type { Window } from '../types'; */\n\n/* :: declare function getWindow(node: Node | Window): Window; */\n\n/**\n * @param node\n */\nexport default function getWindow(node) {\n if (node.toString() !== '[object Window]') {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n }\n\n return node;\n}\n","// @ts-nocheck\nimport getWindow from './getWindow';\nimport { Window } from '../types';\n\n/**\n * @param node\n */\nexport default function getWindowScroll(node: Node | Window) {\n const win = getWindow(node);\n const scrollLeft = win.pageXOffset;\n const scrollTop = win.pageYOffset;\n\n return {\n scrollLeft,\n scrollTop\n };\n}\n","// @ts-nocheck\nimport getWindow from './getWindow';\n\n/* :: declare function isElement(node: mixed): boolean %checks(node instanceof\n Element); */\n/**\n * @param node\n */\nfunction isElement(node) {\n const OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\n/* :: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement); */\n/**\n * @param node\n */\nfunction isHTMLElement(node) {\n const OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nexport { isElement, isHTMLElement };\n","// @ts-nocheck\nimport { Window } from '../types';\n\n/**\n * @param element\n */\nexport default function getNodeName(element: (Node | null | undefined) | Window): string | null | undefined {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n","// @ts-nocheck\nimport { isElement } from './instanceOf';\nimport { Window } from '../types';\n\n/**\n * @param element\n */\nexport default function getDocumentElement(element: Element | Window): HTMLElement {\n // $FlowFixMe: assume body is always available\n return (isElement(element) ? element.ownerDocument : element.document).documentElement;\n}\n","// @ts-nocheck\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScroll from './getWindowScroll';\n\n/**\n * @param element\n */\nexport default function getWindowScrollBarX(element: Element): number {\n // If <html> has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on <html>\n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}\n","// @ts-nocheck\nimport getWindow from './getWindow';\n\n/**\n * @param element\n */\nexport default function getComputedStyle(element: Element): CSSStyleDeclaration {\n return getWindow(element).getComputedStyle(element);\n}\n","// @ts-nocheck\nimport getComputedStyle from './getComputedStyle';\n\n/**\n * @param element\n */\nexport default function isScrollParent(element: HTMLElement): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n","// @ts-nocheck\nimport { Rect, VirtualElement, Window } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getNodeScroll from './getNodeScroll';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getDocumentElement from './getDocumentElement';\nimport isScrollParent from './isScrollParent';\n\n// Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n/**\n * @param elementOrVirtualElement\n * @param offsetParent\n * @param isFixed\n */\nexport default function getCompositeRect(\n elementOrVirtualElement: Element | VirtualElement,\n offsetParent: Element | Window,\n isFixed: boolean = false\n): Rect {\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(elementOrVirtualElement);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n\n let scroll = { scrollLeft: 0, scrollTop: 0 };\n let offsets = { x: 0, y: 0 };\n\n if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {\n if (\n getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)\n ) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}\n","// @ts-nocheck\nimport getWindowScroll from './getWindowScroll';\nimport getWindow from './getWindow';\nimport { isHTMLElement } from './instanceOf';\nimport getHTMLElementScroll from './getHTMLElementScroll';\nimport { Window } from '../types';\n\n/**\n * @param node\n */\nexport default function getNodeScroll(node: Node | Window) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n","// @ts-nocheck\n\n/**\n * @param element\n */\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}\n","// @ts-nocheck\nimport { Rect } from '../types';\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n/**\n * @param element\n */\nexport default function getLayoutRect(element: HTMLElement): Rect {\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n}\n","// @ts-nocheck\nimport getNodeName from './getNodeName';\nimport getDocumentElement from './getDocumentElement';\n\n/**\n * @param element\n */\nexport default function getParentNode(element: Node | ShadowRoot): Node {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (\n // $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n // $FlowFixMe: need a better way to handle this...\n element.host || // ShadowRoot detected\n // $FlowFixMe: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}\n","// @ts-nocheck\nimport getParentNode from './getParentNode';\nimport isScrollParent from './isScrollParent';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\n\n/**\n * @param node\n */\nexport default function getScrollParent(node: Node): HTMLElement {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n","// @ts-nocheck\nimport getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getNodeName from './getNodeName';\nimport getWindow from './getWindow';\nimport { Window, VisualViewport } from '../types';\nimport isScrollParent from './isScrollParent';\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the \nreference element's position.\n*/\n/**\n * @param element\n * @param list\n */\nexport default function listScrollParents(\n element: Node,\n list: (Element | Window)[] = []\n): (Element | Window | VisualViewport)[] {\n const scrollParent = getScrollParent(element);\n const isBody = getNodeName(scrollParent) === 'body';\n const win = getWindow(scrollParent);\n const target = isBody\n ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : [])\n : scrollParent;\n const updatedList = list.concat(target);\n\n return isBody\n ? updatedList // $FlowFixMe: isBody tells us target will be an HTMLElement here\n : updatedList.concat(listScrollParents(getParentNode(target)));\n}\n","// @ts-nocheck\nimport getNodeName from './getNodeName';\n\n/**\n * @param element\n */\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @ts-nocheck\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement } from './instanceOf';\nimport isTableElement from './isTableElement';\nimport getParentNode from './getParentNode';\nimport getDocumentElement from './getDocumentElement';\n\n/**\n * @param element\n */\nfunction getTrueOffsetParent(element: Element): Element | null | undefined {\n if (\n !isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed'\n ) {\n return null;\n }\n\n const offsetParent = element.offsetParent;\n\n if (offsetParent) {\n const html = getDocumentElement(offsetParent);\n\n if (\n getNodeName(offsetParent) === 'body' &&\n getComputedStyle(offsetParent).position === 'static' &&\n getComputedStyle(html).position !== 'static'\n ) {\n return html;\n }\n }\n\n return offsetParent;\n}\n\n// `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n/**\n * @param element\n */\nfunction getContainingBlock(element: Element) {\n let currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n const css = getComputedStyle(currentNode);\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n if (css.transform !== 'none' || css.perspective !== 'none' || (css.willChange && css.willChange !== 'auto')) {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n/**\n * @param element\n */\nexport default function getOffsetParent(element: Element) {\n const window = getWindow(element);\n\n let offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n","// @ts-nocheck\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement = typeof top | typeof bottom | typeof right | typeof left;\nexport const basePlacements: BasePlacement[] = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = HTMLElement | HTMLElement[] | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: VariationPlacement[] = basePlacements.reduce(\n (acc: VariationPlacement[], placement: BasePlacement) =>\n acc.concat([`${placement}-${start}` as any, `${placement}-${end}` as any]),\n []\n);\nexport const placements: Placement[] = [...basePlacements, auto].reduce(\n (acc: Placement[], placement: BasePlacement | typeof auto): Placement[] =>\n acc.concat([placement, `${placement}-${start}` as any, `${placement}-${end}` as any]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: ModifierPhases[] = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n","// @ts-nocheck\nimport { Modifier } from '../types';\nimport { modifierPhases } from '../enums';\n\n// source: https://stackoverflow.com/questions/49875255\n/**\n * @param modifiers\n */\nfunction order(modifiers) {\n const map = new Map();\n const visited = new Set();\n const result = [];\n\n modifiers.forEach(modifier => {\n map.set(modifier.name, modifier);\n });\n\n // On visiting object, check for its dependencies and visit them recursively\n /**\n * @param modifier\n */\n function sort(modifier: Modifier<any, any>) {\n visited.add(modifier.name);\n\n const requires = [...(modifier.requires || []), ...(modifier.requiresIfExists || [])];\n\n requires.forEach(dep => {\n if (!visited.has(dep)) {\n const depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n\n result.push(modifier);\n }\n\n modifiers.forEach(modifier => {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n\n return result;\n}\n\n/**\n * @param modifiers\n */\nexport default function orderModifiers(modifiers: Modifier<any, any>[]): Modifier<any, any>[] {\n // order based on dependencies\n const orderedModifiers = order(modifiers);\n\n // order based on phase\n return modifierPhases.reduce(\n (acc, phase) => acc.concat(orderedModifiers.filter(modifier => modifier.phase === phase)),\n []\n );\n}\n","// @ts-nocheck\n\n/**\n * @param fn\n */\nexport default function debounce<T>(fn: Function): () => Promise<T> {\n let pending;\n return () => {\n if (!pending) {\n pending = new Promise<T>(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n","// @ts-nocheck\nimport { State, OptionsGeneric, Modifier, Instance, VirtualElement } from './types';\nimport getCompositeRect from './dom-utils/getCompositeRect';\nimport getLayoutRect from './dom-utils/getLayoutRect';\nimport listScrollParents from './dom-utils/listScrollParents';\nimport getOffsetParent from './dom-utils/getOffsetParent';\nimport getComputedStyle from './dom-utils/getComputedStyle';\nimport orderModifiers from './utils/orderModifiers';\nimport debounce from './utils/debounce';\nimport validateModifiers from './utils/validateModifiers';\nimport uniqueBy from './utils/uniqueBy';\nimport getBasePlacement from './utils/getBasePlacement';\nimport mergeByName from './utils/mergeByName';\nimport detectOverflow from './utils/detectOverflow';\nimport { isElement } from './dom-utils/instanceOf';\nimport { auto } from './enums';\n\nexport * from './types';\nexport * from './enums';\n\nconst INVALID_ELEMENT_ERROR =\n 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nconst INFINITE_LOOP_ERROR =\n 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\n\nconst DEFAULT_OPTIONS: OptionsGeneric<any> = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\ninterface PopperGeneratorArgs {\n defaultModifiers?: Modifier<any, any>[];\n defaultOptions?: Partial<OptionsGeneric<any>>;\n}\n\n/**\n * @param args\n */\nfunction areValidElements(...args: any[]): boolean {\n return !args.some(element => !(element && typeof element.getBoundingClientRect === 'function'));\n}\n\n/**\n * @param generatorOptions\n */\nexport function popperGenerator(generatorOptions: PopperGeneratorArgs = {}) {\n const { defaultModifiers = [], defaultOptions = DEFAULT_OPTIONS } = generatorOptions;\n\n return function createPopper<TModifier extends Partial<Modifier<any, any>>>(\n reference: Element | VirtualElement,\n popper: HTMLElement,\n options: Partial<OptionsGeneric<TModifier>> = defaultOptions\n ): Instance {\n let state: Partial<State> = {\n placement: 'bottom',\n orderedModifiers: [],\n options: { ...DEFAULT_OPTIONS, ...defaultOptions },\n modifiersData: {},\n elements: {\n reference,\n popper\n },\n attributes: {},\n styles: {}\n };\n\n let effectCleanupFns: (() => void)[] = [];\n let isDestroyed = false;\n\n const instance = {\n state,\n setOptions(options) {\n cleanupModifierEffects();\n\n state.options = {\n // $FlowFixMe\n ...defaultOptions,\n ...state.options,\n ...options\n };\n\n state.scrollParents = {\n reference: isElement(reference)\n ? listScrollParents(reference)\n : reference.contextElement\n ? listScrollParents(reference.contextElement)\n : [],\n popper: listScrollParents(popper)\n };\n\n // Orders the modifiers based on their dependencies and `phase`\n // properties\n const orderedModifiers = orderModifiers(mergeByName([...defaultModifiers, ...state.options.modifiers]));\n\n // Strip out disabled modifiers\n state.orderedModifiers = orderedModifiers.filter(m => m.enabled);\n\n // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n if (false /* __DEV__*/) {\n const modifiers = uniqueBy([...orderedModifiers, ...state.options.modifiers], ({ name }) => name);\n\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n const flipModifier = state.orderedModifiers.find(({ name }) => name === 'flip');\n\n if (!flipModifier) {\n console.error(\n ['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' ')\n );\n }\n }\n\n const { marginTop, marginRight, marginBottom, marginLeft } = getComputedStyle(popper);\n\n // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n if ([marginTop, marginRight, marginBottom, marginLeft].some(margin => parseFloat(margin))) {\n console.warn(\n [\n 'Popper: CSS \"margin\" styles cannot be used to apply padding',\n 'between the popper and its reference element or boundary.',\n 'To replicate margin, use the `offset` modifier, as well as',\n 'the `padding` option in the `preventOverflow` and `flip`',\n 'modifiers.'\n ].join(' ')\n );\n }\n }\n\n runModifierEffects();\n\n return instance.update();\n },\n\n // Sync update it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n const { reference, popper } = state.elements;\n\n // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n if (!areValidElements(reference, popper)) {\n if (false /* __DEV__*/) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return;\n }\n\n // Store the reference and popper rects to be read by modifiers\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n };\n\n // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n state.reset = false;\n\n state.placement = state.options.placement;\n\n // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n state.orderedModifiers.forEach(\n modifier =>\n (state.modifiersData[modifier.name] = {\n ...modifier.data\n })\n );\n\n let __debug_loops__ = 0;\n for (let index = 0; index < state.orderedModifiers.length; index++) {\n if (false /* __DEV__*/) {\n __debug_loops__ += 1;\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n const { fn, options = {}, name } = state.orderedModifiers[index];\n\n if (typeof fn === 'function') {\n state = fn({ state, options, name, instance }) || state;\n }\n }\n },\n\n // Async and optimistically optimized update it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce<Partial<State>>(\n () =>\n new Promise<Partial<State>>(resolve => {\n instance.forceUpdate();\n resolve(state);\n })\n ),\n\n destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (false /* __DEV__*/) {\n console.error(INVALID_ELEMENT_ERROR);\n }\n return instance;\n }\n\n instance.setOptions(options).then(state => {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n });\n\n // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n /**\n *\n */\n function runModifierEffects() {\n state.orderedModifiers.forEach(({ name, options = {}, effect }) => {\n if (typeof effect === 'function') {\n const cleanupFn = effect({ state, name, instance, options });\n const noopFn = () => {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n /**\n *\n */\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(fn => fn());\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nexport const createPopper = popperGenerator();\n\n// eslint-disable-next-line import/no-unused-modules\nexport { detectOverflow };\n","// @ts-nocheck\nimport { Modifier } from '../types';\n\n/**\n * @param modifiers\n */\nexport default function mergeByName(modifiers: Partial<Modifier<any, any>>[]): Partial<Modifier<any, any>>[] {\n const merged = modifiers.reduce((merged, current) => {\n const existing = merged[current.name];\n merged[current.name] = existing\n ? {\n ...existing,\n ...current,\n options: { ...existing.options, ...current.options },\n data: { ...existing.data, ...current.data }\n }\n : current;\n return merged;\n }, {});\n\n // IE11 does not support Object.values\n return Object.keys(merged).map(key => merged[key]);\n}\n","// @ts-nocheck\nimport { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n scroll: boolean;\n resize: boolean;\n}\n\nconst passive = { passive: true };\n\n/**\n *\n */\nfunction effect({ state, instance, options }: ModifierArguments<Options>) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [...state.scrollParents.reference, ...state.scrollParents.popper];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {}\n} as EventListenersModifier;\n","// @ts-nocheck\nimport { BasePlacement, Placement, auto } from '../enums';\n\n/**\n * @param placement\n */\nexport default function getBasePlacement(placement: Placement | typeof auto): BasePlacement {\n return placement.split('-')[0] as any;\n}\n","// @ts-nocheck\nimport { Variation, Placement } from '../enums';\n\n/**\n * @param placement\n */\nexport default function getVariation(placement: Placement): Variation | null | undefined {\n return placement.split('-')[1] as any;\n}\n","// @ts-nocheck\nimport { Placement } from '../enums';\n\n/**\n * @param placement\n */\nexport default function getMainAxisFromPlacement(placement: Placement): 'x' | 'y' {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n","// @ts-nocheck\nimport getBasePlacement from './getBasePlacement';\nimport getVariation from './getVariation';\nimport getMainAxisFromPlacement from './getMainAxisFromPlacement';\nimport { Rect, PositioningStrategy, Offsets, ClientRectObject } from '../types';\nimport { top, right, bottom, left, start, end, Placement } from '../enums';\n\n/**\n *\n */\nexport default function computeOffsets({\n reference,\n element,\n placement\n}: {\n reference: Rect | ClientRectObject;\n element: Rect | ClientRectObject;\n strategy: PositioningStrategy;\n placement?: Placement;\n}): Offsets {\n const basePlacement = placement ? getBasePlacement(placement) : null;\n const variation = placement ? getVariation(placement) : null;\n const commonX = reference.x + reference.width / 2 - element.width / 2;\n const commonY = reference.y + reference.height / 2 - element.height / 2;\n\n let offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n const mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n\n return offsets;\n}\n","// @ts-nocheck\nimport { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\n/**\n *\n */\nfunction popperOffsets({ state, name }: ModifierArguments<{}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {}>;\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n} as PopperOffsetsModifier;\n","// @ts-nocheck\nimport { PositioningStrategy, Offsets, Modifier, ModifierArguments, Rect, Window } from '../types';\nimport { BasePlacement, top, left, right, bottom } from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n gpuAcceleration: boolean;\n adaptive: boolean;\n}\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n/**\n *\n */\nfunction roundOffsets({ x, y }): Offsets {\n const win: Window = window;\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: Math.round(x * dpr) / dpr || 0,\n y: Math.round(y * dpr) / dpr || 0\n };\n}\n\n/**\n *\n */\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n offsets,\n position,\n gpuAcceleration,\n adaptive\n}: {\n popper: HTMLElement;\n popperRect: Rect;\n placement: BasePlacement;\n offsets: Partial<{ x: number; y: number; centerOffset: number }>;\n position: PositioningStrategy;\n gpuAcceleration: boolean;\n adaptive: boolean;\n}) {\n let { x, y } = roundOffsets(offsets);\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n }\n\n // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n /* :: offsetParent = (offsetParent: Element); */\n\n if (placement === top) {\n sideY = bottom;\n y -= offsetParent.clientHeight - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left) {\n sideX = right;\n x -= offsetParent.clientWidth - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides)\n };\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform: (win.devicePixelRatio || 1) < 2 ? `translate(${x}px, ${y}px)` : `translate3d(${x}px, ${y}px, 0)`\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: ''\n };\n}\n\n/**\n *\n */\nfunction computeStyles({ state, options }: ModifierArguments<Options>) {\n const { gpuAcceleration = true, adaptive = true } = options;\n\n if (false /* __DEV__*/) {\n const transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (\n adaptive &&\n ['transform', 'top', 'right', 'bottom', 'left'].some(property => transitionProperty.indexOf(property) >= 0)\n ) {\n console.warn(\n [\n 'Popper: Detected CSS transitions on at least one of the following',\n 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".',\n '\\n\\n',\n 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow',\n 'for smooth transitions, or remove these properties from the CSS',\n 'transition declaration on the popper element if only transitioning',\n 'opacity or background-color for example.',\n '\\n\\n',\n 'We recommend using the popper element as a wrapper around an inner',\n 'element that can have any CSS property transitioned for animations.'\n ].join(' ')\n );\n }\n }\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive\n })\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false\n })\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n} as ComputeStylesModifier;\n","// @ts-nocheck\nimport { Placement } from '../enums';\nimport { ModifierArguments, Modifier, Rect, Offsets } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport { top, left, right, placements } from '../enums';\n\ntype OffsetsFunction = (arg0: {\n popper: Rect;\n reference: Rect;\n placement: Placement;\n}) => [number | null | undefined, number | null | undefined];\n\ntype Offset = OffsetsFunction | [number | null | undefined, number | null | undefined];\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n offset: Offset;\n}\n\n/**\n * @param placement\n * @param rects\n * @param offset\n */\nexport function distanceAndSkiddingToXY(\n placement: Placement,\n rects: { popper: Rect; reference: Rect },\n offset: Offset\n): Offsets {\n const basePlacement = getBasePlacement(placement);\n const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n let [skidding, distance] =\n typeof offset === 'function'\n ? offset({\n ...rects,\n placement\n })\n : offset;\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n\n return [left, right].indexOf(basePlacement) >= 0 ? { x: distance, y: skidding } : { x: skidding, y: distance };\n}\n\n/**\n *\n */\nfunction offset({ state, options, name }: ModifierArguments<Options>) {\n const { offset = [0, 0] } = options;\n\n const data = placements.reduce((acc, placement) => {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n\n const { x, y } = data[state.placement];\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetModifier = Modifier<'offset', Options>;\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n} as OffsetModifier;\n","// @ts-nocheck\nimport { Placement } from '../enums';\n\nconst hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\n/**\n * @param placement\n */\nexport default function getOppositePlacement(placement: Placement): Placement {\n return placement.replace(/left|right|bottom|top/g, matched => hash[matched]) as any;\n}\n","// @ts-nocheck\nimport { Placement } from '../enums';\n\nconst hash = { start: 'end', end: 'start' };\n\n/**\n * @param placement\n */\nexport default function getOppositeVariationPlacement(placement: Placement): Placement {\n return placement.replace(/start|end/g, matched => hash[matched]) as any;\n}\n","// @ts-nocheck\n/**\n * @param parent\n * @param child\n */\nexport default function contains(parent: Element, child: Element) {\n // $FlowFixMe: hasOwnProperty doesn't seem to work in tests\n const isShadow = Boolean(child.getRootNode && child.getRootNode().host);\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (isShadow) {\n let next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n }\n // $FlowFixMe: need a better way to handle this...\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n","// @ts-nocheck\nimport { Rect, ClientRectObject } from '../types';\n\n/**\n * @param rect\n */\nexport default function rectToClientRect(rect: Rect): ClientRectObject {\n return {\n ...rect,\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n };\n}\n","// @ts-nocheck\nimport { ClientRectObject } from '../types';\nimport { Boundary, RootBoundary } from '../enums';\nimport { viewport } from '../enums';\nimport getViewportRect from './getViewportRect';\nimport getDocumentRect from './getDocumentRect';\nimport listScrollParents from './listScrollParents';\nimport getOffsetParent from './getOffsetParent';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getParentNode from './getParentNode';\nimport contains from './contains';\nimport getNodeName from './getNodeName';\nimport rectToClientRect from '../utils/rectToClientRect';\n\n/**\n * @param element\n */\nfunction getInnerBoundingClientRect(element: Element) {\n const rect = getBoundingClientRect(element);\n\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n\n return rect;\n}\n\n/**\n * @param element\n * @param clippingParent\n */\nfunction getClientRectFromMixedType(element: Element, clippingParent: Element | RootBoundary): ClientRectObject {\n return clippingParent === viewport\n ? rectToClientRect(getViewportRect(element))\n : isHTMLElement(clippingParent)\n ? getInnerBoundingClientRect(clippingParent)\n : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n/**\n * @param element\n */\nfunction getClippingParents(element: Element): Element[] {\n const clippingParents = listScrollParents(getParentNode(element));\n const canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n }\n\n // $FlowFixMe: https://github.com/facebook/flow/issues/1414\n return clippingParents.filter(\n clippingParent =>\n isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'\n );\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n/**\n * @param element\n * @param boundary\n * @param rootBoundary\n */\nexport default function getClippingRect(\n element: Element,\n boundary: Boundary,\n rootBoundary: RootBoundary\n): ClientRectObject {\n const mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n const clippingParents = [...mainClippingParents, rootBoundary];\n const firstClippingParent = clippingParents[0];\n\n const clippingRect = clippingParents.reduce((accRect, clippingParent) => {\n const rect = getClientRectFromMixedType(element, clippingParent);\n\n accRect.top = Math.max(rect.top, accRect.top);\n accRect.right = Math.min(rect.right, accRect.right);\n accRect.bottom = Math.min(rect.bottom, accRect.bottom);\n accRect.left = Math.max(rect.left, accRect.left);\n\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n\n return clippingRect;\n}\n","// @ts-nocheck\nimport getWindow from './getWindow';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScrollBarX from './getWindowScrollBarX';\n\n/**\n * @param element\n */\nexport default function getViewportRect(element: Element) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n\n // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n\n // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width,\n height,\n x: x + getWindowScrollBarX(element),\n y\n };\n}\n","// @ts-nocheck\nimport { Rect } from '../types';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getWindowScroll from './getWindowScroll';\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable\n/**\n * @param element\n */\nexport default function getDocumentRect(element: HTMLElement): Rect {\n const html = getDocumentElement(element);\n const winScroll = getWindowScroll(element);\n const body = element.ownerDocument.body;\n\n const width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n const height = Math.max(\n html.scrollHeight,\n html.clientHeight,\n body ? body.scrollHeight : 0,\n body ? body.clientHeight : 0\n );\n\n let x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n const y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return { width, height, x, y };\n}\n","// @ts-nocheck\nimport { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\n/**\n * @param paddingObject\n */\nexport default function mergePaddingObject(paddingObject: Partial<SideObject>): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject\n };\n}\n","// @ts-nocheck\nimport { SideObject } from '../types';\n\n/**\n *\n */\nexport default function getFreshSideObject(): SideObject {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}\n","// @ts-nocheck\n\n/**\n * @param value\n * @param keys\n */\nexport default function expandToHashMap<T extends number | string | boolean, K extends string>(\n value: T,\n keys: K[]\n): {\n [key: string]: T;\n} {\n return keys.reduce((hashMap, key) => {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n","// @ts-nocheck\nimport { State, SideObject, Padding } from '../types';\nimport { Placement, Boundary, RootBoundary, Context } from '../enums';\nimport getBoundingClientRect from '../dom-utils/getBoundingClientRect';\nimport getClippingRect from '../dom-utils/getClippingRect';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport computeOffsets from './computeOffsets';\nimport rectToClientRect from './rectToClientRect';\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from '../enums';\nimport { isElement } from '../dom-utils/instanceOf';\nimport mergePaddingObject from './mergePaddingObject';\nimport expandToHashMap from './expandToHashMap';\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n placement: Placement;\n boundary: Boundary;\n rootBoundary: RootBoundary;\n elementContext: Context;\n altBoundary: boolean;\n padding: Padding;\n}\n\n/**\n * @param state\n * @param options\n */\nexport default function detectOverflow(state: State, options: Partial<Options> = {}): SideObject {\n const {\n placement = state.placement,\n boundary = clippingParents,\n rootBoundary = viewport,\n elementContext = popper,\n altBoundary = false,\n padding = 0\n } = options;\n\n const paddingObject = mergePaddingObject(\n typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)\n );\n\n const altContext = elementContext === popper ? reference : popper;\n\n const referenceElement = state.elements.reference;\n const popperRect = state.rects.popper;\n const element = state.elements[altBoundary ? altContext : elementContext];\n\n const clippingClientRect = getClippingRect(\n isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper),\n boundary,\n rootBoundary\n );\n\n const referenceClientRect = getBoundingClientRect(referenceElement);\n\n const popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement\n });\n\n const popperClientRect = rectToClientRect({\n ...popperRect,\n ...popperOffsets\n });\n\n const elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;\n\n // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n const overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n\n const offsetData = state.modifiersData.offset;\n\n // Offsets can be applied only to the popper element\n if (elementContext === popper && offsetData) {\n const offset = offsetData[placement];\n\n Object.keys(overflowOffsets).forEach(key => {\n const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n const axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n","// @ts-nocheck\nimport { Placement, Boundary, RootBoundary } from '../enums';\nimport { ModifierArguments, Modifier, Padding } from '../types';\nimport getOppositePlacement from '../utils/getOppositePlacement';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getOppositeVariationPlacement from '../utils/getOppositeVariationPlacement';\nimport detectOverflow from '../utils/detectOverflow';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\nimport { bottom, top, start, right, left, auto } from '../enums';\nimport getVariation from '../utils/getVariation';\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n mainAxis: boolean;\n altAxis: boolean;\n fallbackPlacements: Placement[];\n padding: Padding;\n boundary: Boundary;\n rootBoundary: RootBoundary;\n altBoundary: boolean;\n flipVariations: boolean;\n allowedAutoPlacements: Placement[];\n}\n\n/**\n * @param placement\n */\nfunction getExpandedFallbackPlacements(placement: Placement): Placement[] {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n const oppositePlacement = getOppositePlacement(placement);\n\n return [\n getOppositeVariationPlacement(placement),\n oppositePlacement,\n getOppositeVariationPlacement(oppositePlacement)\n ];\n}\n\n/**\n *\n */\nfunction flip({ state, options, name }: ModifierArguments<Options>) {\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n padding,\n boundary,\n rootBoundary,\n altBoundary,\n flipVariations = true,\n allowedAutoPlacements\n } = options;\n\n const preferredPlacement = state.options.placement;\n const basePlacement = getBasePlacement(preferredPlacement);\n const isBasePlacement = basePlacement === preferredPlacement;\n\n const fallbackPlacements =\n specifiedFallbackPlacements ||\n (isBasePlacement || !flipVariations\n ? [getOppositePlacement(preferredPlacement)]\n : getExpandedFallbackPlacements(preferredPlacement));\n\n const placements = [preferredPlacement, ...fallbackPlacements].reduce(\n (acc, placement) =>\n acc.concat(\n getBasePlacement(placement) === auto\n ? computeAutoPlacement(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements\n })\n : placement\n ),\n []\n );\n\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n\n const checksMap = new Map();\n let makeFallbackChecks = true;\n let firstFittingPlacement = placements[0];\n\n for (let i = 0; i < placements.length; i++) {\n const placement = placements[i];\n const basePlacement = getBasePlacement(placement);\n const isStartVariation = getVariation(placement) === start;\n const isVertical = [top, bottom].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'width' : 'height';\n\n const overflow = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n altBoundary,\n padding\n });\n\n let mainVariationSide: any = isVertical ? (isStartVariation ? right : left) : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n const altVariationSide: any = getOppositePlacement(mainVariationSide);\n\n const checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(check => check)) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases research later\n const numberOfChecks = flipVariations ? 3 : 1;\n\n for (let i = numberOfChecks; i > 0; i--) {\n const fittingPlacement = placements.find(placement => {\n const checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, i).every(check => check);\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n break;\n }\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type FlipModifier = Modifier<'flip', Options>;\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: { _skip: false }\n} as FlipModifier;\n","// @ts-nocheck\nimport { State, Padding } from '../types';\nimport { Placement, ComputedPlacement, Boundary, RootBoundary } from '../enums';\nimport getVariation from './getVariation';\nimport { variationPlacements, basePlacements, placements as allPlacements } from '../enums';\nimport detectOverflow from './detectOverflow';\nimport getBasePlacement from './getBasePlacement';\n\ninterface Options {\n placement: Placement;\n padding: Padding;\n boundary: Boundary;\n rootBoundary: RootBoundary;\n flipVariations: boolean;\n allowedAutoPlacements?: Placement[];\n}\n\n/* :: type OverflowsMap = { [ComputedPlacement]: number }; */\n\n/* ;; type OverflowsMap = { [key in ComputedPlacement]: number }; */\n\n/**\n * @param state\n * @param options\n */\nexport default function computeAutoPlacement(state: Partial<State>, options: Options = {}): ComputedPlacement[] {\n const { placement, boundary, rootBoundary, padding, flipVariations, allowedAutoPlacements = allPlacements } = options;\n\n const variation = getVariation(placement);\n\n const placements = variation\n ? flipVariations\n ? variationPlacements\n : variationPlacements.filter(placement => getVariation(placement) === variation)\n : basePlacements;\n\n // $FlowFixMe\n let allowedPlacements = placements.filter(placement => allowedAutoPlacements.indexOf(placement) >= 0);\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (false /* __DEV__*/) {\n console.error(\n [\n 'Popper: The `allowedAutoPlacements` option did not allow any',\n 'placements. Ensure the `placement` option matches the variation',\n 'of the allowed placements.',\n 'For example, \"auto\" cannot be used to allow \"bottom-start\".',\n 'Use \"auto-start\" instead.'\n ].join(' ')\n );\n }\n }\n\n // $FlowFixMe: Flow seems to have problems with two array unions...\n const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {\n acc[placement] = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n padding\n })[getBasePlacement(placement)];\n\n return acc;\n }, {});\n\n return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);\n}\n","// @ts-nocheck\n\n/**\n * @param min\n * @param value\n * @param max\n */\nexport default function within(min: number, value: number, max: number): number {\n return Math.max(min, Math.min(value, max));\n}\n","// @ts-nocheck\nimport { top, left, right, bottom, start } from '../enums';\nimport { Placement, Boundary, RootBoundary } from '../enums';\nimport { Rect, ModifierArguments, Modifier, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport getAltAxis from '../utils/getAltAxis';\nimport within from '../utils/within';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport detectOverflow from '../utils/detectOverflow';\nimport getVariation from '../utils/getVariation';\nimport getFreshSideObject from '../utils/getFreshSideObject';\n\ntype TetherOffset = (arg0: { popper: Rect; reference: Rect; placement: Placement }) => number | number;\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n /* Prevents boundaries overflow on the main axis */\n mainAxis: boolean;\n\n /* Prevents boundaries overflow on the alternate axis */\n altAxis: boolean;\n\n /* The area to check the popper is overflowing in */\n boundary: Boundary;\n\n /* If the popper is not overflowing the main area, fallback to this one */\n rootBoundary: RootBoundary;\n\n /* Use the reference's \"clippingParents\" boundary context */\n altBoundary: boolean;\n\n /**\n * Allows the popper to overflow from its boundaries to keep it near its\n * reference element\n */\n tether: boolean;\n\n /* Offsets when the `tether` option should activate */\n tetherOffset: TetherOffset;\n\n /* Sets a padding to the provided boundary */\n padding: Padding;\n}\n\n/**\n *\n */\nfunction preventOverflow({ state, options, name }: ModifierArguments<Options>) {\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = false,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n tether = true,\n tetherOffset = 0\n } = options;\n\n const overflow = detectOverflow(state, {\n boundary,\n rootBoundary,\n padding,\n altBoundary\n });\n const basePlacement = getBasePlacement(state.placement);\n const variation = getVariation(state.placement);\n const isBasePlacement = !variation;\n const mainAxis = getMainAxisFromPlacement(basePlacement);\n const altAxis = getAltAxis(mainAxis);\n const popperOffsets = state.modifiersData.popperOffsets;\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const tetherOffsetValue =\n typeof tetherOffset === 'function'\n ? tetherOffset({\n ...state.rects,\n placement: state.placement\n })\n : tetherOffset;\n\n const data = { x: 0, y: 0 };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n const mainSide = mainAxis === 'y' ? top : left;\n const altSide = mainAxis === 'y' ? bottom : right;\n const len = mainAxis === 'y' ? 'height' : 'width';\n const offset = popperOffsets[mainAxis];\n\n const min = popperOffsets[mainAxis] + overflow[mainSide];\n const max = popperOffsets[mainAxis] - overflow[altSide];\n\n const additive = tether ? -popperRect[len] / 2 : 0;\n\n const minLen = variation === start ? referenceRect[len] : popperRect[len];\n const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];\n\n // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n const arrowElement = state.elements.arrow;\n const arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { width: 0, height: 0 };\n const arrowPaddingObject = state.modifiersData['arrow#persistent']\n ? state.modifiersData['arrow#persistent'].padding\n : getFreshSideObject();\n const arrowPaddingMin = arrowPaddingObject[mainSide];\n const arrowPaddingMax = arrowPaddingObject[altSide];\n\n // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n const arrowLen = within(0, referenceRect[len], arrowRect[len]);\n\n const minOffset = isBasePlacement\n ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue\n : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n const maxOffset = isBasePlacement\n ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue\n : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n\n const arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n const clientOffset = arrowOffsetParent\n ? mainAxis === 'y'\n ? arrowOffsetParent.clientTop || 0\n : arrowOffsetParent.clientLeft || 0\n : 0;\n\n const offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;\n\n const tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n const tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n\n const preventedOffset = within(\n tether ? Math.min(min, tetherMin) : min,\n offset,\n tether ? Math.max(max, tetherMax) : max\n );\n\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n const mainSide = mainAxis === 'x' ? top : left;\n const altSide = mainAxis === 'x' ? bottom : right;\n const offset = popperOffsets[altAxis];\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const preventedOffset = within(min, offset, max);\n\n popperOffsets[altAxis] = preventedOffset;\n data[altAxis] = preventedOffset - offset;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PreventOverflowModifier = Modifier<'preventOverflow', Options>;\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n} as PreventOverflowModifier;\n","// @ts-nocheck\n\n/**\n * @param axis\n */\nexport default function getAltAxis(axis: 'x' | 'y'): 'x' | 'y' {\n return axis === 'x' ? 'y' : 'x';\n}\n","// @ts-nocheck\nimport { Modifier, ModifierArguments, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport contains from '../dom-utils/contains';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport within from '../utils/within';\nimport mergePaddingObject from '../utils/mergePaddingObject';\nimport expandToHashMap from '../utils/expandToHashMap';\nimport { left, right, basePlacements, top, bottom } from '../enums';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// eslint-disable-next-line import/no-unused-modules\nexport interface Options {\n element: HTMLElement | string | null;\n padding: Padding;\n}\n\n/**\n *\n */\nfunction arrow({ state, name }: ModifierArguments<Options>) {\n const arrowElement = state.elements.arrow;\n const popperOffsets = state.modifiersData.popperOffsets;\n const basePlacement = getBasePlacement(state.placement);\n const axis = getMainAxisFromPlacement(basePlacement);\n const isVertical = [left, right].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n const paddingObject = state.modifiersData[`${name}#persistent`].padding;\n const arrowRect = getLayoutRect(arrowElement);\n const minProp = axis === 'y' ? top : left;\n const maxProp = axis === 'y' ? bottom : right;\n\n const endDiff =\n state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n const startDiff = popperOffsets[axis] - state.rects.reference[axis];\n\n const arrowOffsetParent = getOffsetParent(arrowElement);\n const clientSize = arrowOffsetParent\n ? axis === 'y'\n ? arrowOffsetParent.clientHeight || 0\n : arrowOffsetParent.clientWidth || 0\n : 0;\n\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n const min = paddingObject[minProp];\n const max = clientSize - arrowRect[len] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // Prevents breaking syntax highlighting...\n const axisProp: string = axis;\n state.modifiersData[name] = {\n [axisProp]: offset,\n centerOffset: offset - center\n };\n}\n\n/**\n *\n */\nfunction effect({ state, options, name }: ModifierArguments<Options>) {\n let { element: arrowElement = '[data-popper-arrow]', padding = 0 } = options;\n\n if (arrowElement == null) {\n return;\n }\n\n // CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (false /* __DEV__*/) {\n if (!isHTMLElement(arrowElement)) {\n console.error(\n [\n 'Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).',\n 'To use an SVG arrow, wrap it in an HTMLElement that will be used as',\n 'the arrow.'\n ].join(' ')\n );\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (false /* __DEV__*/) {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n state.modifiersData[`${name}#persistent`] = {\n padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ArrowModifier = Modifier<'arrow', Options>;\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n} as ArrowModifier;\n","// @ts-nocheck\nimport { ModifierArguments, Modifier, Rect, SideObject, Offsets } from '../types';\nimport { top, bottom, left, right } from '../enums';\nimport detectOverflow from '../utils/detectOverflow';\n\n/**\n * @param overflow\n * @param rect\n * @param preventedOffsets\n */\nfunction getSideOffsets(overflow: SideObject, rect: Rect, preventedOffsets: Offsets = { x: 0, y: 0 }): SideObject {\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\n/**\n * @param overflow\n */\nfunction isAnySideFullyClipped(overflow: SideObject): boolean {\n return [top, right, bottom, left].some(side => overflow[side] >= 0);\n}\n\n/**\n *\n */\nfunction hide({ state, name }: ModifierArguments<{}>) {\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const preventedOffsets = state.modifiersData.preventOverflow;\n\n const referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n const popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n\n const referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n const popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n\n const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n\n state.modifiersData[name] = {\n referenceClippingOffsets,\n popperEscapeOffsets,\n isReferenceHidden,\n hasPopperEscaped\n };\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type HideModifier = Modifier<'hide', {}>;\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n} as HideModifier;\n","// @ts-nocheck\nimport { popperGenerator, detectOverflow } from '.';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\nimport offset from './modifiers/offset';\nimport flip from './modifiers/flip';\nimport preventOverflow from './modifiers/preventOverflow';\nimport arrow from './modifiers/arrow';\nimport hide from './modifiers/hide';\n\nexport * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n offset,\n flip,\n preventOverflow,\n arrow,\n hide\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @ts-nocheck\nimport { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\n/**\n *\n */\nfunction applyStyles({ state }: ModifierArguments<{}>) {\n Object.keys(state.elements).forEach(name => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach(name => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\n/**\n *\n */\nfunction effect({ state }: ModifierArguments<{}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach(name => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach(attribute => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {}>;\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles']\n} as ApplyStylesModifier;\n","import * as React from 'react';\nimport { canUseDOM } from './util';\n\n/**\n * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs\n */\nexport const useIsomorphicLayoutEffect = canUseDOM ? React.useLayoutEffect : React.useEffect;\n","/* eslint-disable @typescript-eslint/consistent-type-definitions */\n\nimport * as React from 'react';\nimport { createPopper as defaultCreatePopper, Options as PopperOptions, VirtualElement } from '../popper-core/popper';\nimport { useIsomorphicLayoutEffect } from '../../../../helpers/useIsomorphicLayout';\n\ntype $Shape<T extends object> = Partial<T>;\n\nconst isEqual = (a: any, b: any) => JSON.stringify(a) === JSON.stringify(b);\n\n/**\n * Simple ponyfill for Object.fromEntries\n */\nconst fromEntries = (entries: [string, any][]) =>\n entries.reduce((acc: any, [key, value]) => {\n acc[key] = value;\n return acc;\n }, {});\n\ntype Options = $Shape<\n PopperOptions & {\n createPopper: typeof defaultCreatePopper;\n }\n>;\n\ntype State = {\n styles: {\n [key: string]: $Shape<CSSStyleDeclaration>;\n };\n attributes: {\n [key: string]: {\n [key: string]: string;\n };\n };\n};\n\nconst EMPTY_MODIFIERS: any = [];\n\nexport const usePopper = (\n referenceElement: (Element | VirtualElement) | null | undefined,\n popperElement: HTMLElement | null | undefined,\n options: Options = {}\n) => {\n const prevOptions = React.useRef<PopperOptions | null | undefined>(null);\n\n const optionsWithDefaults = {\n onFirstUpdate: options.onFirstUpdate,\n placement: options.placement || 'bottom',\n strategy: options.strategy || 'absolute',\n modifiers: options.modifiers || EMPTY_MODIFIERS\n };\n\n const [state, setState] = React.useState<State>({\n styles: {\n popper: {\n position: optionsWithDefaults.strategy,\n left: '0',\n top: '0'\n }\n },\n attributes: {}\n });\n\n const updateStateModifier = React.useMemo(\n () => ({\n name: 'updateState',\n enabled: true,\n phase: 'write',\n // eslint-disable-next-line no-shadow\n fn: ({ state }: any) => {\n const elements = Object.keys(state.elements);\n\n setState({\n styles: fromEntries(elements.map(element => [element, state.styles[element] || {}])),\n attributes: fromEntries(elements.map(element => [element, state.attributes[element]]))\n });\n },\n requires: ['computeStyles']\n }),\n []\n );\n\n const popperOptions = React.useMemo(() => {\n const newOptions = {\n onFirstUpdate: optionsWithDefaults.onFirstUpdate,\n placement: optionsWithDefaults.placement,\n strategy: optionsWithDefaults.strategy,\n modifiers: [...optionsWithDefaults.modifiers, updateStateModifier, { name: 'applyStyles', enabled: false }]\n };\n\n if (isEqual(prevOptions.current, newOptions)) {\n return prevOptions.current || newOptions;\n } else {\n prevOptions.current = newOptions;\n return newOptions;\n }\n }, [\n optionsWithDefaults.onFirstUpdate,\n optionsWithDefaults.placement,\n optionsWithDefaults.strategy,\n optionsWithDefaults.modifiers,\n updateStateModifier\n ]);\n\n const popperInstanceRef = React.useRef<any>();\n\n useIsomorphicLayoutEffect(() => {\n if (popperInstanceRef && popperInstanceRef.current) {\n popperInstanceRef.current.setOptions(popperOptions);\n }\n }, [popperOptions]);\n\n useIsomorphicLayoutEffect(() => {\n if (referenceElement == null || popperElement == null) {\n return;\n }\n\n const createPopper = options.createPopper || defaultCreatePopper;\n const popperInstance = createPopper(referenceElement, popperElement, popperOptions);\n\n popperInstanceRef.current = popperInstance;\n\n return () => {\n popperInstance.destroy();\n popperInstanceRef.current = null;\n };\n }, [referenceElement, popperElement, options.createPopper]);\n\n return {\n state: popperInstanceRef.current ? popperInstanceRef.current.state : null,\n styles: state.styles,\n attributes: state.attributes,\n update: popperInstanceRef.current ? popperInstanceRef.current.update : null,\n forceUpdate: popperInstanceRef.current ? popperInstanceRef.current.forceUpdate : null\n };\n};\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\ninterface FindRefWrapperProps {\n children: React.ReactNode;\n onFoundRef: any;\n}\n\n/**\n * This component wraps any ReactNode and finds its ref\n * It has to be a class for findDOMNode to work\n * Ideally, all components used as triggers/toggles are either:\n * - class based components we can assign our own ref to\n * - functional components that have forwardRef implemented\n * However, there is no guarantee that is what will get passed in as trigger/toggle in the case of tooltips and popovers\n */\nexport class FindRefWrapper extends React.Component<FindRefWrapperProps> {\n static displayName = 'FindRefWrapper';\n componentDidMount() {\n // eslint-disable-next-line react/no-find-dom-node\n const root = ReactDOM.findDOMNode(this);\n this.props.onFoundRef(root);\n }\n\n render() {\n return this.props.children || null;\n }\n}\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { usePopper } from './thirdparty/react-popper/usePopper';\nimport { Placement, Modifier } from './thirdparty/popper-core';\nimport { css } from '@patternfly/react-styles';\nimport { FindRefWrapper } from './FindRefWrapper';\nimport '@patternfly/react-styles/css/components/Popper/Popper.css';\n\nconst hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom',\n 'top-start': 'bottom-end',\n 'top-end': 'bottom-start',\n 'bottom-start': 'top-end',\n 'bottom-end': 'top-start',\n 'left-start': 'right-end',\n 'left-end': 'right-start',\n 'right-start': 'left-end',\n 'right-end': 'left-start'\n};\n\nconst getOppositePlacement = (placement: Placement): any =>\n placement.replace(\n /left|right|bottom|top|top-start|top-end|bottom-start|bottom-end|right-start|right-end|left-start|left-end/g,\n (matched: string) =>\n hash[\n matched as\n | 'left'\n | 'right'\n | 'bottom'\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end'\n ] as Placement\n );\n\n/** @deprecated Please use the menuAppendTo prop directly from within the PF component which uses it. */\nexport interface ToggleMenuBaseProps {\n /** The container to append the menu to. Defaults to 'inline'\n * If your menu is being cut off you can append it to an element higher up the DOM tree.\n * Some examples:\n * menuAppendTo=\"parent\"\n * menuAppendTo={() => document.body}\n * menuAppendTo={document.getElementById('target')}\n */\n menuAppendTo?: HTMLElement | (() => HTMLElement) | 'parent' | 'inline';\n}\n\nexport const getOpacityTransition = (animationDuration: number) =>\n `opacity ${animationDuration}ms cubic-bezier(.54, 1.5, .38, 1.11)`;\n\nexport interface PopperProps {\n /**\n * The reference element to which the Popover is relatively placed to.\n * Use either trigger or reference, not both.\n */\n trigger?: React.ReactNode;\n /**\n * The reference element to which the Popover is relatively placed to.\n * Use either trigger or reference, not both.\n * Passing this property or the removeFindDomNode property, will bypass the use of findDOMNode for the trigger in react strict mode.\n */\n reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;\n /** The popper (menu/tooltip/popover) element */\n popper: React.ReactElement;\n /** True to set the width of the popper element to the trigger element's width */\n popperMatchesTriggerWidth?: boolean;\n /** popper direction */\n direction?: 'up' | 'down';\n /** popper position */\n position?: 'right' | 'left' | 'center';\n /** Instead of direction and position can set the placement of the popper */\n placement?: Placement;\n /** The container to append the popper to. Defaults to 'document.body' */\n appendTo?: HTMLElement | (() => HTMLElement);\n /** z-index of the popper element */\n zIndex?: number;\n /** True to make the popper visible */\n isVisible?: boolean;\n /**\n * Map class names to positions, for example:\n * {\n * top: styles.modifiers.top,\n * bottom: styles.modifiers.bottom,\n * left: styles.modifiers.left,\n * right: styles.modifiers.right\n * }\n */\n positionModifiers?: {\n top?: string;\n right?: string;\n bottom?: string;\n left?: string;\n topStart?: string;\n topEnd?: string;\n bottomStart?: string;\n bottomEnd?: string;\n leftStart?: string;\n leftEnd?: string;\n rightStart?: string;\n rightEnd?: string;\n };\n /** Distance of the popper to the trigger */\n distance?: number;\n /** Callback function when mouse enters trigger */\n onMouseEnter?: (event?: MouseEvent) => void;\n /** Callback function when mouse leaves trigger */\n onMouseLeave?: (event?: MouseEvent) => void;\n /** Callback function when trigger is focused */\n onFocus?: (event?: FocusEvent) => void;\n /** Callback function when trigger is blurred (focus leaves) */\n onBlur?: (event?: FocusEvent) => void;\n /** Callback function when trigger is clicked */\n onTriggerClick?: (event?: MouseEvent) => void;\n /** Callback function when Enter key is used on trigger */\n onTriggerEnter?: (event?: KeyboardEvent) => void;\n /** Callback function when popper is clicked */\n onPopperClick?: (event?: MouseEvent) => void;\n /** Callback function when mouse enters popper content */\n onPopperMouseEnter?: (event?: MouseEvent) => void;\n /** Callback function when mouse leaves popper content */\n onPopperMouseLeave?: (event?: MouseEvent) => void;\n /** Callback function when document is clicked */\n onDocumentClick?: (event?: MouseEvent, triggerElement?: HTMLElement, popperElement?: HTMLElement) => void;\n /** Callback function when keydown event occurs on document */\n onDocumentKeyDown?: (event?: KeyboardEvent) => void;\n /** Enable to flip the popper when it reaches the boundary */\n enableFlip?: boolean;\n /** The behavior of how the popper flips when it reaches the boundary */\n flipBehavior?:\n | 'flip'\n | (\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'\n )[];\n /** @beta Bypasses the use of findDOMNode for both the popper and trigger in react strict mode. Without this flag, the trigger and popper will require passed references via the reference property (trigger) and popperRef property (popper) for strict mode. */\n removeFindDomNode?: boolean;\n /** @beta Reference to the popper (menu/tooltip/popover) element. Passing this property or the removeFindDomNode property, will bypass the use of findDOMNode for the popper in react strict mode. The popper property is still required. */\n popperRef?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;\n}\n\nexport const Popper: React.FunctionComponent<PopperProps> = ({\n trigger,\n popper,\n popperMatchesTriggerWidth = true,\n direction = 'down',\n position = 'left',\n placement,\n appendTo = () => document.body,\n zIndex = 9999,\n isVisible = true,\n positionModifiers,\n distance = 0,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onDocumentClick,\n onTriggerClick,\n onTriggerEnter,\n onPopperClick,\n onPopperMouseEnter,\n onPopperMouseLeave,\n onDocumentKeyDown,\n enableFlip = true,\n flipBehavior = 'flip',\n reference,\n removeFindDomNode = false,\n popperRef\n}) => {\n const [triggerElement, setTriggerElement] = React.useState(null);\n const [refElement, setRefElement] = React.useState<HTMLElement>(null);\n const [popperElement, setPopperElement] = React.useState<HTMLElement>(null);\n const [ready, setReady] = React.useState(false);\n const refOrTrigger = refElement || triggerElement;\n const onDocumentClickCallback = React.useCallback(\n (event: MouseEvent) => onDocumentClick(event, refOrTrigger, popperElement),\n [isVisible, triggerElement, refElement, popperElement, onDocumentClick]\n );\n\n React.useEffect(() => {\n setReady(true);\n }, []);\n React.useEffect(() => {\n if (reference) {\n if ((reference as React.RefObject<any>).current) {\n setRefElement((reference as React.RefObject<any>).current);\n } else if (typeof reference === 'function') {\n setRefElement(reference());\n }\n }\n }, [reference]);\n React.useEffect(() => {\n // When the popperRef is defined or the popper visiblity changes, ensure the popper element is up to date\n if (popperRef) {\n if ((popperRef as React.RefObject<any>).current) {\n setPopperElement((popperRef as React.RefObject<any>).current);\n } else if (typeof popperRef === 'function') {\n setPopperElement(popperRef());\n }\n }\n }, [isVisible, popperRef]);\n const addEventListener = (listener: any, element: Document | HTMLElement, event: string, capture = false) => {\n if (listener && element) {\n element.addEventListener(event, listener, { capture });\n }\n };\n const removeEventListener = (listener: any, element: Document | HTMLElement, event: string, capture = false) => {\n if (listener && element) {\n element.removeEventListener(event, listener, { capture });\n }\n };\n\n React.useEffect(() => {\n addEventListener(onMouseEnter, refOrTrigger, 'mouseenter');\n addEventListener(onMouseLeave, refOrTrigger, 'mouseleave');\n addEventListener(onFocus, refOrTrigger, 'focus');\n addEventListener(onBlur, refOrTrigger, 'blur');\n addEventListener(onTriggerClick, refOrTrigger, 'click');\n addEventListener(onTriggerEnter, refOrTrigger, 'keydown');\n addEventListener(onPopperClick, popperElement, 'click');\n addEventListener(onPopperMouseEnter, popperElement, 'mouseenter');\n addEventListener(onPopperMouseLeave, popperElement, 'mouseleave');\n onDocumentClick && addEventListener(onDocumentClickCallback, document, 'click', true);\n addEventListener(onDocumentKeyDown, document, 'keydown', true);\n\n // Trigger a Popper update when content changes.\n const observer = new MutationObserver(() => {\n update && update();\n });\n popperElement && observer.observe(popperElement, { attributes: true, childList: true, subtree: true });\n\n return () => {\n removeEventListener(onMouseEnter, refOrTrigger, 'mouseenter');\n removeEventListener(onMouseLeave, refOrTrigger, 'mouseleave');\n removeEventListener(onFocus, refOrTrigger, 'focus');\n removeEventListener(onBlur, refOrTrigger, 'blur');\n removeEventListener(onTriggerClick, refOrTrigger, 'click');\n removeEventListener(onTriggerEnter, refOrTrigger, 'keydown');\n removeEventListener(onPopperClick, popperElement, 'click');\n removeEventListener(onPopperMouseEnter, popperElement, 'mouseenter');\n removeEventListener(onPopperMouseLeave, popperElement, 'mouseleave');\n onDocumentClick && removeEventListener(onDocumentClickCallback, document, 'click', true);\n removeEventListener(onDocumentKeyDown, document, 'keydown', true);\n observer.disconnect();\n };\n }, [\n triggerElement,\n popperElement,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onTriggerClick,\n onTriggerEnter,\n onPopperClick,\n onPopperMouseEnter,\n onPopperMouseLeave,\n onDocumentClick,\n onDocumentKeyDown,\n refElement\n ]);\n const getPlacement = () => {\n if (placement) {\n return placement;\n }\n let convertedPlacement = direction === 'up' ? 'top' : 'bottom';\n if (position !== 'center') {\n convertedPlacement = `${convertedPlacement}-${position === 'right' ? 'end' : 'start'}`;\n }\n return convertedPlacement as Placement;\n };\n const getPlacementMemo = React.useMemo(getPlacement, [direction, position, placement]);\n const getOppositePlacementMemo = React.useMemo(() => getOppositePlacement(getPlacement()), [\n direction,\n position,\n placement\n ]);\n const sameWidthMod: Modifier<'sameWidth', {}> = React.useMemo(\n () => ({\n name: 'sameWidth',\n enabled: popperMatchesTriggerWidth,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: ({ state }) => {\n state.styles.popper.width = `${state.rects.reference.width}px`;\n },\n effect: ({ state }) => {\n state.elements.popper.style.width = `${(state.elements.reference as HTMLElement).offsetWidth}px`;\n return () => {};\n }\n }),\n [popperMatchesTriggerWidth]\n );\n\n const { styles: popperStyles, attributes, update, forceUpdate } = usePopper(refOrTrigger, popperElement, {\n placement: getPlacementMemo,\n modifiers: [\n {\n name: 'offset',\n options: {\n offset: [0, distance]\n }\n },\n {\n name: 'preventOverflow',\n enabled: false\n },\n {\n // adds attribute [data-popper-reference-hidden] to the popper element which can be used to hide it using CSS\n name: 'hide',\n enabled: true\n },\n {\n name: 'flip',\n enabled: getPlacementMemo.startsWith('auto') || enableFlip,\n options: {\n fallbackPlacements: flipBehavior === 'flip' ? [getOppositePlacementMemo] : flipBehavior\n }\n },\n sameWidthMod\n ]\n });\n\n React.useEffect(() => {\n forceUpdate && forceUpdate();\n }, [popper]);\n\n // Returns the CSS modifier class in order to place the Popper's arrow properly\n // Depends on the position of the Popper relative to the reference element\n const modifierFromPopperPosition = () => {\n if (attributes && attributes.popper && attributes.popper['data-popper-placement']) {\n const popperPlacement = attributes.popper['data-popper-placement'] as keyof typeof positionModifiers;\n return positionModifiers[popperPlacement];\n }\n return positionModifiers.top;\n };\n\n const options = {\n className: css(popper.props && popper.props.className, positionModifiers && modifierFromPopperPosition()),\n style: {\n ...((popper.props && popper.props.style) || {}),\n ...popperStyles.popper,\n zIndex\n },\n ...attributes.popper\n };\n\n const menuWithPopper = React.cloneElement(popper, options);\n\n const getTarget: () => HTMLElement = () => {\n if (typeof appendTo === 'function') {\n return appendTo();\n }\n return appendTo;\n };\n\n /**\n * To enable strict mode, the popper must either have its reference defined via the popperRef property,\n * or the removeFindDomNode flag must be present. Even if the reference is passed in, unlike the trigger,\n * the popper property must still be passed.\n * The trigger must similarly have either its reference defined via the reference property, or the\n * removeFindDomNode flag must be present. The trigger property is not required when the reference is passed.\n *\n * Strict mode may be enabled by passing both reference properties to Popper, or by passing the\n * removeFindDomNode flag with either reference property, or by solely passing the removeFindDomNode\n * flag.\n */\n let popperPortal;\n if (removeFindDomNode) {\n // If removeFindDomNode is passed, use the removeFindDomNode method of wrapping divs\n popperPortal = (\n <div style={{ display: 'contents' }} ref={node => setPopperElement(node?.firstElementChild as HTMLElement)}>\n {menuWithPopper}\n </div>\n );\n } else if (popperRef) {\n // If removeFindDomNode is not passed and popperRef is passed, use the popperRef method\n popperPortal = menuWithPopper;\n } else {\n // If neither removeFindDomNode and popperRef exist, use the old method of FindRefWrapper\n popperPortal = (\n <FindRefWrapper onFoundRef={(foundRef: any) => setPopperElement(foundRef)}>{menuWithPopper}</FindRefWrapper>\n );\n }\n\n return (\n <>\n {!reference && trigger && React.isValidElement(trigger) && !removeFindDomNode && (\n <FindRefWrapper onFoundRef={(foundRef: any) => setTriggerElement(foundRef)}>{trigger}</FindRefWrapper>\n )}\n {!reference && trigger && React.isValidElement(trigger) && removeFindDomNode && (\n <div style={{ display: 'contents' }} ref={node => setTriggerElement(node?.firstElementChild as HTMLElement)}>\n {trigger}\n </div>\n )}\n {ready && isVisible && ReactDOM.createPortal(popperPortal, getTarget())}\n </>\n );\n};\nPopper.displayName = 'Popper';\n","/* eslint-disable no-console */\nimport * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Tooltip/tooltip';\nimport { css } from '@patternfly/react-styles';\nimport { TooltipContent } from './TooltipContent';\nimport { TooltipArrow } from './TooltipArrow';\nimport { KeyTypes } from '../../helpers/constants';\nimport tooltipMaxWidth from '@patternfly/react-tokens/dist/esm/c_tooltip_MaxWidth';\nimport { ReactElement } from 'react';\nimport { Popper, getOpacityTransition } from '../../helpers/Popper/Popper';\nimport { Props as TippyProps } from '../../helpers/Popper/DeprecatedTippyTypes';\n\nexport enum TooltipPosition {\n auto = 'auto',\n top = 'top',\n bottom = 'bottom',\n left = 'left',\n right = 'right',\n topStart = 'top-start',\n topEnd = 'top-end',\n bottomStart = 'bottom-start',\n bottomEnd = 'bottom-end',\n leftStart = 'left-start',\n leftEnd = 'left-end',\n rightStart = 'right-start',\n rightEnd = 'right-end'\n}\n\nexport interface TooltipProps extends Omit<React.HTMLProps<HTMLDivElement>, 'content'> {\n /** The element to append the tooltip to, defaults to body */\n appendTo?: HTMLElement | ((ref?: HTMLElement) => HTMLElement);\n /**\n * aria-labelledby or aria-describedby for tooltip.\n * The trigger will be cloned to add the aria attribute, and the corresponding id in the form of 'pf-tooltip-#' is added to the content container.\n * If you don't want that or prefer to add the aria attribute yourself on the trigger, set aria to 'none'.\n */\n aria?: 'describedby' | 'labelledby' | 'none';\n /**\n * Determines whether the tooltip is an aria-live region. If the reference prop is passed in the\n * default behavior is 'polite' in order to ensure the tooltip contents is announced to\n * assistive technologies. Otherwise the default behavior is 'off'.\n */\n 'aria-live'?: 'off' | 'polite';\n /**\n * The reference element to which the Tooltip is relatively placed to.\n * If you cannot wrap the reference with the Tooltip, you can use the reference prop instead.\n * Usage: <Tooltip><Button>Reference</Button></Tooltip>\n */\n children?: ReactElement<any>;\n /**\n * The reference element to which the Tooltip is relatively placed to.\n * If you can wrap the reference with the Tooltip, you can use the children prop instead.\n * Usage: <Tooltip reference={() => document.getElementById('reference-element')} />\n */\n reference?: HTMLElement | (() => HTMLElement) | React.RefObject<any>;\n /** Tooltip additional class */\n className?: string;\n /** Tooltip content */\n content: React.ReactNode;\n /** Distance of the tooltip to its target, defaults to 15 */\n distance?: number;\n /** If true, tries to keep the tooltip in view by flipping it if necessary */\n enableFlip?: boolean;\n /** Delay in ms before the tooltip appears */\n entryDelay?: number;\n /** Delay in ms before the tooltip disappears, Avoid passing in a value of \"0\", as users should\n * be given ample time to move their mouse from the trigger to the tooltip content without the content\n * being hidden.\n */\n exitDelay?: number;\n /**\n * The desired position to flip the tooltip to if the initial position is not possible.\n * By setting this prop to 'flip' it attempts to flip the tooltip to the opposite side if there is no space.\n * You can also pass an array of positions that determines the flip order. It should contain the initial position\n * followed by alternative positions if that position is unavailable.\n * Example: Initial position is 'top'. Button with tooltip is in the top right corner. 'flipBehavior' is set to\n * ['top', 'right', 'left']. Since there is no space to the top, it checks if right is available. There's also no\n * space to the right, so it finally shows the tooltip on the left.\n */\n flipBehavior?:\n | 'flip'\n | (\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end'\n )[];\n /** Maximum width of the tooltip (default 18.75rem) */\n maxWidth?: string;\n /** Callback when tooltip's hide transition has finished executing */\n onTooltipHidden?: () => void;\n /**\n * Tooltip position. Note: With 'enableFlip' set to true,\n * it will change the position if there is not enough space for the starting position.\n * The behavior of where it flips to can be controlled through the flipBehavior prop.\n * The 'auto' position chooses the side with the most space.\n * The 'auto' position requires the 'enableFlip' prop to be true.\n */\n position?:\n | TooltipPosition\n | 'auto'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end';\n /**\n * Tooltip trigger: click, mouseenter, focus, manual\n * Set to manual to trigger tooltip programmatically (through the isVisible prop)\n */\n trigger?: string;\n /** Flag to indicate that the text content is left aligned */\n isContentLeftAligned?: boolean;\n /** value for visibility when trigger is 'manual' */\n isVisible?: boolean;\n /** z-index of the tooltip */\n zIndex?: number;\n /** id of the tooltip */\n id?: string;\n /** CSS fade transition animation duration */\n animationDuration?: number;\n /** @deprecated - no longer used. if you want to constrain the popper to a specific element use the appendTo prop instead */\n boundary?: 'scrollParent' | 'window' | 'viewport' | HTMLElement;\n /** @deprecated - no longer used */\n isAppLauncher?: boolean;\n /** @deprecated - no longer used */\n tippyProps?: Partial<TippyProps>;\n /** @beta Opt-in for updated popper that does not use findDOMNode. */\n removeFindDomNode?: boolean;\n}\n\n// id for associating trigger with the content aria-describedby or aria-labelledby\nlet pfTooltipIdCounter = 1;\n\nexport const Tooltip: React.FunctionComponent<TooltipProps> = ({\n content: bodyContent,\n position = 'top',\n trigger = 'mouseenter focus',\n isVisible = false,\n isContentLeftAligned = false,\n enableFlip = true,\n className = '',\n entryDelay = 300,\n exitDelay = 300,\n appendTo = () => document.body,\n zIndex = 9999,\n maxWidth = tooltipMaxWidth.value,\n distance = 15,\n aria = 'describedby',\n // For every initial starting position, there are 3 escape positions\n flipBehavior = ['top', 'right', 'bottom', 'left', 'top', 'right', 'bottom'],\n id = `pf-tooltip-${pfTooltipIdCounter++}`,\n children,\n animationDuration = 300,\n reference,\n 'aria-live': ariaLive = reference ? 'polite' : 'off',\n boundary,\n isAppLauncher,\n tippyProps,\n removeFindDomNode = false,\n onTooltipHidden = () => {},\n ...rest\n}: TooltipProps) => {\n if (process.env.NODE_ENV !== 'production') {\n boundary !== undefined &&\n console.warn(\n 'The Tooltip boundary prop has been deprecated. If you want to constrain the popper to a specific element use the appendTo prop instead.'\n );\n isAppLauncher !== undefined &&\n console.warn('The Tooltip isAppLauncher prop has been deprecated and is no longer used.');\n tippyProps !== undefined && console.warn('The Tooltip tippyProps prop has been deprecated and is no longer used.');\n }\n // could make this a prop in the future (true | false | 'toggle')\n const hideOnClick = true;\n const triggerOnMouseenter = trigger.includes('mouseenter');\n const triggerOnFocus = trigger.includes('focus');\n const triggerOnClick = trigger.includes('click');\n const triggerManually = trigger === 'manual';\n const [visible, setVisible] = React.useState(false);\n const [opacity, setOpacity] = React.useState(0);\n const transitionTimerRef = React.useRef(null);\n const showTimerRef = React.useRef(null);\n const hideTimerRef = React.useRef(null);\n\n const prevExitDelayRef = React.useRef<number>();\n\n const clearTimeouts = (timeoutRefs: React.RefObject<any>[]) => {\n timeoutRefs.forEach(ref => {\n if (ref.current) {\n clearTimeout(ref.current);\n }\n });\n };\n\n // Cancel all timers on unmount\n React.useEffect(\n () => () => {\n clearTimeouts([transitionTimerRef, hideTimerRef, showTimerRef]);\n },\n []\n );\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (!triggerManually) {\n if (event.key === KeyTypes.Escape && visible) {\n hide();\n }\n }\n };\n const onTriggerEnter = (event: KeyboardEvent) => {\n if (event.key === KeyTypes.Enter) {\n if (!visible) {\n show();\n } else {\n hide();\n }\n }\n };\n React.useEffect(() => {\n if (isVisible) {\n show();\n } else {\n hide();\n }\n }, [isVisible]);\n\n React.useEffect(() => {\n if (prevExitDelayRef.current < exitDelay) {\n clearTimeouts([transitionTimerRef, hideTimerRef]);\n hideTimerRef.current = setTimeout(() => {\n setOpacity(0);\n transitionTimerRef.current = setTimeout(() => {\n setVisible(false);\n onTooltipHidden();\n }, animationDuration);\n }, exitDelay);\n }\n prevExitDelayRef.current = exitDelay;\n }, [exitDelay]);\n\n const show = () => {\n clearTimeouts([transitionTimerRef, hideTimerRef]);\n showTimerRef.current = setTimeout(() => {\n setVisible(true);\n setOpacity(1);\n }, entryDelay);\n };\n const hide = () => {\n clearTimeouts([showTimerRef]);\n hideTimerRef.current = setTimeout(() => {\n setOpacity(0);\n transitionTimerRef.current = setTimeout(() => {\n setVisible(false);\n onTooltipHidden();\n }, animationDuration);\n }, exitDelay);\n };\n const positionModifiers = {\n top: styles.modifiers.top,\n bottom: styles.modifiers.bottom,\n left: styles.modifiers.left,\n right: styles.modifiers.right,\n 'top-start': styles.modifiers.topLeft,\n 'top-end': styles.modifiers.topRight,\n 'bottom-start': styles.modifiers.bottomLeft,\n 'bottom-end': styles.modifiers.bottomRight,\n 'left-start': styles.modifiers.leftTop,\n 'left-end': styles.modifiers.leftBottom,\n 'right-start': styles.modifiers.rightTop,\n 'right-end': styles.modifiers.rightBottom\n };\n const hasCustomMaxWidth = maxWidth !== tooltipMaxWidth.value;\n const content = (\n <div\n aria-live={ariaLive}\n className={css(styles.tooltip, className)}\n role=\"tooltip\"\n id={id}\n style={{\n maxWidth: hasCustomMaxWidth ? maxWidth : null,\n opacity,\n transition: getOpacityTransition(animationDuration)\n }}\n {...rest}\n >\n <TooltipArrow />\n <TooltipContent isLeftAligned={isContentLeftAligned}>{bodyContent}</TooltipContent>\n </div>\n );\n\n const onDocumentClick = (event: MouseEvent, triggerElement: HTMLElement) => {\n // event.currentTarget = document\n // event.target could be triggerElement or something else\n if (hideOnClick === true) {\n // hide on inside the toggle as well as on outside clicks\n if (visible) {\n hide();\n } else if (event.target === triggerElement) {\n show();\n }\n } else if (hideOnClick === 'toggle' && event.target === triggerElement) {\n // prevent outside clicks from hiding but allow it to still be toggled on toggle click\n if (visible) {\n hide();\n } else {\n show();\n }\n } else if (hideOnClick === false && !visible && event.target === triggerElement) {\n show();\n }\n };\n\n const addAriaToTrigger = () => {\n if (aria === 'describedby' && children && children.props && !children.props['aria-describedby']) {\n return React.cloneElement(children, { 'aria-describedby': id });\n } else if (aria === 'labelledby' && children.props && !children.props['aria-labelledby']) {\n return React.cloneElement(children, { 'aria-labelledby': id });\n }\n return children;\n };\n\n return (\n <Popper\n trigger={aria !== 'none' && visible ? addAriaToTrigger() : children}\n reference={reference}\n popper={content}\n popperMatchesTriggerWidth={false}\n appendTo={appendTo}\n isVisible={visible}\n positionModifiers={positionModifiers}\n distance={distance}\n placement={position}\n onMouseEnter={triggerOnMouseenter && show}\n onMouseLeave={triggerOnMouseenter && hide}\n onPopperMouseEnter={triggerOnMouseenter && show}\n onPopperMouseLeave={triggerOnMouseenter && hide}\n onFocus={triggerOnFocus && show}\n onBlur={triggerOnFocus && hide}\n onDocumentClick={triggerOnClick && onDocumentClick}\n onDocumentKeyDown={triggerManually ? null : onDocumentKeyDown}\n onTriggerEnter={triggerManually ? null : onTriggerEnter}\n enableFlip={enableFlip}\n zIndex={zIndex}\n flipBehavior={flipBehavior}\n removeFindDomNode={removeFindDomNode}\n />\n );\n};\nTooltip.displayName = 'Tooltip';\n","import { createIcon } from '../createIcon';\n\nexport const CheckCircleIconConfig = {\n name: 'CheckCircleIcon',\n height: 512,\n width: 512,\n svgPath: 'M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const CheckCircleIcon = createIcon(CheckCircleIconConfig);\n\nexport default CheckCircleIcon;","import { createIcon } from '../createIcon';\n\nexport const ExclamationCircleIconConfig = {\n name: 'ExclamationCircleIcon',\n height: 512,\n width: 512,\n svgPath: 'M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const ExclamationCircleIcon = createIcon(ExclamationCircleIconConfig);\n\nexport default ExclamationCircleIcon;","import { createIcon } from '../createIcon';\n\nexport const ExclamationTriangleIconConfig = {\n name: 'ExclamationTriangleIcon',\n height: 512,\n width: 576,\n svgPath: 'M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const ExclamationTriangleIcon = createIcon(ExclamationTriangleIconConfig);\n\nexport default ExclamationTriangleIcon;","import { createIcon } from '../createIcon';\n\nexport const InfoCircleIconConfig = {\n name: 'InfoCircleIcon',\n height: 512,\n width: 512,\n svgPath: 'M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const InfoCircleIcon = createIcon(InfoCircleIconConfig);\n\nexport default InfoCircleIcon;","import { createIcon } from '../createIcon';\n\nexport const BellIconConfig = {\n name: 'BellIcon',\n height: 1024,\n width: 896,\n svgPath: 'M448,0 C465.333333,0 480.333333,6.33333333 493,19 C505.666667,31.6666667 512,46.6666667 512,64 L512,106 L514.23,106.45 C587.89,121.39 648.48,157.24 696,214 C744,271.333333 768,338.666667 768,416 C768,500 780,568.666667 804,622 C818.666667,652.666667 841.333333,684 872,716 C873.773676,718.829136 875.780658,721.505113 878,724 C890,737.333333 896,752.333333 896,769 C896,785.666667 890,800.333333 878,813 C866,825.666667 850.666667,832 832,832 L63.3,832 C44.9533333,831.84 29.8533333,825.506667 18,813 C6,800.333333 0,785.666667 0,769 C0,752.333333 6,737.333333 18,724 L24,716 L25.06,714.9 C55.1933333,683.28 77.5066667,652.313333 92,622 C116,568.666667 128,500 128,416 C128,338.666667 152,271.333333 200,214 C248,156.666667 309.333333,120.666667 384,106 L384,63.31 C384.166667,46.27 390.5,31.5 403,19 C415.666667,6.33333333 430.666667,0 448,0 Z M576,896 L576,897.08 C575.74,932.6 563.073333,962.573333 538,987 C512.666667,1011.66667 482.666667,1024 448,1024 C413.333333,1024 383.333333,1011.66667 358,987 C332.666667,962.333333 320,932 320,896 L576,896 Z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const BellIcon = createIcon(BellIconConfig);\n\nexport default BellIcon;","import * as React from 'react';\nimport modalStyles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\nimport { css } from '@patternfly/react-styles';\nimport accessibleStyles from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';\nimport { capitalize } from '../../helpers';\nimport { Tooltip } from '../Tooltip';\nimport CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';\nimport ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';\nimport ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';\nimport InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';\nimport BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';\nimport { useIsomorphicLayoutEffect } from '../../helpers';\n\nexport const isVariantIcon = (icon: any): icon is string =>\n ['success', 'danger', 'warning', 'info', 'default'].includes(icon as string);\n\nexport interface ModalBoxTitleProps {\n /** Additional classes added to the modal box title. */\n className?: string;\n /** Id of the modal box title. */\n id: string;\n /** Content rendered inside the modal box title. */\n title: React.ReactNode;\n /** Optional alert icon (or other) to show before the title. When the predefined alert types\n * are used the default styling will be automatically applied. */\n titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'default' | React.ComponentType<any>;\n /** Optional title label text for screen readers. */\n titleLabel?: string;\n}\n\nexport const ModalBoxTitle: React.FunctionComponent<ModalBoxTitleProps> = ({\n className = '',\n id,\n title,\n titleIconVariant,\n titleLabel = '',\n ...props\n}: ModalBoxTitleProps) => {\n const [hasTooltip, setHasTooltip] = React.useState(false);\n const h1 = React.useRef<HTMLHeadingElement>(null);\n const label = titleLabel || (isVariantIcon(titleIconVariant) ? `${capitalize(titleIconVariant)} alert:` : titleLabel);\n const variantIcons = {\n success: <CheckCircleIcon />,\n danger: <ExclamationCircleIcon />,\n warning: <ExclamationTriangleIcon />,\n info: <InfoCircleIcon />,\n default: <BellIcon />\n };\n const CustomIcon = !isVariantIcon(titleIconVariant) && titleIconVariant;\n\n useIsomorphicLayoutEffect(() => {\n setHasTooltip(h1.current && h1.current.offsetWidth < h1.current.scrollWidth);\n }, []);\n\n const content = (\n <h1\n id={id}\n ref={h1}\n className={css(modalStyles.modalBoxTitle, titleIconVariant && modalStyles.modifiers.icon, className)}\n {...props}\n >\n {titleIconVariant && (\n <span className={css(modalStyles.modalBoxTitleIcon)}>\n {isVariantIcon(titleIconVariant) ? variantIcons[titleIconVariant] : <CustomIcon />}\n </span>\n )}\n {label && <span className={css(accessibleStyles.screenReader)}>{label}</span>}\n <span className={css(modalStyles.modalBoxTitleText)}>{title}</span>\n </h1>\n );\n\n return hasTooltip ? <Tooltip content={title}>{content}</Tooltip> : content;\n};\nModalBoxTitle.displayName = 'ModalBoxTitle';\n","import * as React from 'react';\nimport { FocusTrap } from '../../helpers';\nimport modalStyles from '@patternfly/react-styles/css/components/ModalBox/modal-box';\nimport bullsEyeStyles from '@patternfly/react-styles/css/layouts/Bullseye/bullseye';\nimport { css } from '@patternfly/react-styles';\nimport { getOUIAProps, OUIAProps } from '../../helpers';\n\nimport { Backdrop } from '../Backdrop/Backdrop';\nimport { ModalBoxBody } from './ModalBoxBody';\nimport { ModalBoxCloseButton } from './ModalBoxCloseButton';\nimport { ModalBox } from './ModalBox';\nimport { ModalBoxFooter } from './ModalBoxFooter';\nimport { ModalBoxDescription } from './ModalBoxDescription';\nimport { ModalBoxHeader } from './ModalBoxHeader';\nimport { ModalBoxTitle, isVariantIcon } from './ModalBoxTitle';\n\nexport interface ModalContentProps extends OUIAProps {\n /** Action buttons to add to the standard modal footer. Ignored if the footer property\n * is passed in.\n */\n actions?: any;\n /** Id to use for the modal box descriptor. */\n 'aria-describedby'?: string;\n /** Accessible descriptor of the modal. */\n 'aria-label'?: string;\n /** Id to use for the modal box label. */\n 'aria-labelledby'?: string | null;\n /** Accessible label applied to the modal box body. This should be used to communicate\n * important information about the modal box body div element if needed, such as that it\n * is scrollable.\n */\n bodyAriaLabel?: string;\n /** Accessible role applied to the modal box body. This will default to \"region\" if the\n * bodyAriaLabel property is passed in. Set to a more appropriate role as applicable\n * based on the modal content and context.\n */\n bodyAriaRole?: string;\n /** Id of the modal box container. */\n boxId: string;\n /** Content rendered inside the modal. */\n children: React.ReactNode;\n /** Additional classes added to the modal box. */\n className?: string;\n /** Description of the modal. */\n description?: React.ReactNode;\n /** Id of the modal box description. */\n descriptorId: string;\n /** Flag to disable focus trap. */\n disableFocusTrap?: boolean;\n /** Custom footer. */\n footer?: React.ReactNode;\n /** Flag indicating if modal content should be placed in a modal box body wrapper. */\n hasNoBodyWrapper?: boolean;\n /** Complex header (more than just text), supersedes the title property for header content. */\n header?: React.ReactNode;\n /** Optional help section for the modal header. */\n help?: React.ReactNode;\n /** Flag to show the modal. */\n isOpen?: boolean;\n /** Id of the modal box title. */\n labelId: string;\n /** A callback for when the close button is clicked. */\n onClose?: () => void;\n /** Alternate position of the modal. */\n position?: 'top';\n /** Offset from alternate position. Can be any valid CSS length/percentage. */\n positionOffset?: string;\n /** Flag to show the close button in the header area of the modal. */\n showClose?: boolean;\n /** Simple text content of the modal header. Also used for the aria-label on the body. */\n title?: string;\n /** Optional alert icon (or other) to show before the title of the modal header. When the\n * predefined alert types are used the default styling will be automatically applied.\n */\n titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'default' | React.ComponentType<any>;\n /** Optional title label text for screen readers. */\n titleLabel?: string;\n /** Variant of the modal. */\n variant?: 'small' | 'medium' | 'large' | 'default';\n /** Default width of the modal. */\n width?: number | string;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\nexport const ModalContent: React.FunctionComponent<ModalContentProps> = ({\n children,\n className = '',\n isOpen = false,\n header = null,\n help = null,\n description = null,\n title = '',\n titleIconVariant = null,\n titleLabel = '',\n 'aria-label': ariaLabel = '',\n 'aria-describedby': ariaDescribedby,\n 'aria-labelledby': ariaLabelledby,\n bodyAriaLabel,\n bodyAriaRole,\n showClose = true,\n footer = null,\n actions = [],\n onClose = () => undefined as any,\n variant = 'default',\n position,\n positionOffset,\n width = -1,\n boxId,\n labelId,\n descriptorId,\n disableFocusTrap = false,\n hasNoBodyWrapper = false,\n ouiaId,\n ouiaSafe = true,\n ...props\n}: ModalContentProps) => {\n if (!isOpen) {\n return null;\n }\n\n const modalBoxHeader = header ? (\n <ModalBoxHeader help={help}>{header}</ModalBoxHeader>\n ) : (\n title && (\n <ModalBoxHeader help={help}>\n <ModalBoxTitle title={title} titleIconVariant={titleIconVariant} titleLabel={titleLabel} id={labelId} />\n {description && <ModalBoxDescription id={descriptorId}>{description}</ModalBoxDescription>}\n </ModalBoxHeader>\n )\n );\n\n const modalBoxFooter = footer ? (\n <ModalBoxFooter>{footer}</ModalBoxFooter>\n ) : (\n actions.length > 0 && <ModalBoxFooter>{actions}</ModalBoxFooter>\n );\n\n const defaultModalBodyAriaRole = bodyAriaLabel ? 'region' : undefined;\n\n const modalBody = hasNoBodyWrapper ? (\n children\n ) : (\n <ModalBoxBody\n aria-label={bodyAriaLabel}\n role={bodyAriaRole || defaultModalBodyAriaRole}\n {...props}\n {...(!description && !ariaDescribedby && { id: descriptorId })}\n >\n {children}\n </ModalBoxBody>\n );\n const boxStyle = width === -1 ? {} : { width };\n const ariaLabelledbyFormatted = (): null | string => {\n if (ariaLabelledby === null) {\n return null;\n }\n const idRefList: string[] = [];\n if ((ariaLabel && boxId) !== '') {\n idRefList.push(ariaLabel && boxId);\n }\n if (ariaLabelledby) {\n idRefList.push(ariaLabelledby);\n }\n if (title) {\n idRefList.push(labelId);\n }\n return idRefList.join(' ');\n };\n\n const modalBox = (\n <ModalBox\n id={boxId}\n style={boxStyle}\n className={css(\n className,\n isVariantIcon(titleIconVariant) &&\n modalStyles.modifiers[titleIconVariant as 'success' | 'warning' | 'info' | 'danger' | 'default']\n )}\n variant={variant}\n position={position}\n positionOffset={positionOffset}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledbyFormatted()}\n aria-describedby={ariaDescribedby || (hasNoBodyWrapper ? null : descriptorId)}\n {...getOUIAProps(ModalContent.displayName, ouiaId, ouiaSafe)}\n >\n {showClose && <ModalBoxCloseButton onClose={onClose} ouiaId={ouiaId} />}\n {modalBoxHeader}\n {modalBody}\n {modalBoxFooter}\n </ModalBox>\n );\n return (\n <Backdrop>\n <FocusTrap\n active={!disableFocusTrap}\n focusTrapOptions={{ clickOutsideDeactivates: true, tabbableOptions: { displayCheck: 'none' } }}\n className={css(bullsEyeStyles.bullseye)}\n >\n {modalBox}\n </FocusTrap>\n </Backdrop>\n );\n};\nModalContent.displayName = 'ModalContent';\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { canUseDOM, KeyTypes, PickOptional } from '../../helpers';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/Backdrop/backdrop';\nimport { ModalContent } from './ModalContent';\nimport { OUIAProps, getDefaultOUIAId } from '../../helpers';\n\nexport interface ModalProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {\n /** Action buttons to add to the standard modal footer. Ignored if the footer property\n * is passed in.\n */\n actions?: any;\n /** The parent container to append the modal to. Defaults to \"document.body\". */\n appendTo?: HTMLElement | (() => HTMLElement);\n /** Id to use for the modal box descriptor. */\n 'aria-describedby'?: string;\n /** Accessible descriptor of the modal. */\n 'aria-label'?: string;\n /** Id to use for the modal box label. */\n 'aria-labelledby'?: string;\n /** Accessible label applied to the modal box body. This should be used to communicate\n * important information about the modal box body div element if needed, such as that it\n * is scrollable.\n */\n bodyAriaLabel?: string;\n /** Accessible role applied to the modal box body. This will default to \"region\" if the\n * bodyAriaLabel property is passed in. Set to a more appropriate role as applicable\n * based on the modal content and context.\n */\n bodyAriaRole?: string;\n /** Content rendered inside the modal. */\n children: React.ReactNode;\n /** Additional classes added to the modal. */\n className?: string;\n /** Description of the modal. */\n description?: React.ReactNode;\n /** Flag to disable focus trap. */\n disableFocusTrap?: boolean;\n /** Custom footer. */\n footer?: React.ReactNode;\n /** Flag indicating if modal content should be placed in a modal box body wrapper. */\n hasNoBodyWrapper?: boolean;\n /** Complex header (more than just text), supersedes the title property for header content. */\n header?: React.ReactNode;\n /** Optional help section for the modal header. */\n help?: React.ReactNode;\n /** An id to use for the modal box container. */\n id?: string;\n /** Flag to show the modal. */\n isOpen?: boolean;\n /** A callback for when the close button is clicked. */\n onClose?: () => void;\n /** Modal handles pressing of the escape key and closes the modal. If you want to handle\n * this yourself you can use this callback function. */\n onEscapePress?: (event: KeyboardEvent) => void;\n /** Alternate position of the modal. */\n position?: 'top';\n /** Offset from alternate position. Can be any valid CSS length/percentage. */\n positionOffset?: string;\n /** Flag to show the close button in the header area of the modal. */\n showClose?: boolean;\n /** Simple text content of the modal header. Also used for the aria-label on the body. */\n title?: string;\n /** Optional alert icon (or other) to show before the title of the modal header. When the\n * predefined alert types are used the default styling will be automatically applied.\n */\n titleIconVariant?: 'success' | 'danger' | 'warning' | 'info' | 'default' | React.ComponentType<any>;\n /** Optional title label text for screen readers. */\n titleLabel?: string;\n /** Variant of the modal. */\n variant?: 'small' | 'medium' | 'large' | 'default';\n /** Default width of the modal. */\n width?: number | string;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\nexport enum ModalVariant {\n small = 'small',\n medium = 'medium',\n large = 'large',\n default = 'default'\n}\n\ninterface ModalState {\n container: HTMLElement;\n ouiaStateId: string;\n}\n\nexport class Modal extends React.Component<ModalProps, ModalState> {\n static displayName = 'Modal';\n static currentId = 0;\n boxId = '';\n labelId = '';\n descriptorId = '';\n\n static defaultProps: PickOptional<ModalProps> = {\n className: '',\n isOpen: false,\n title: '',\n titleIconVariant: null,\n titleLabel: '',\n 'aria-label': '',\n showClose: true,\n 'aria-describedby': '',\n 'aria-labelledby': '',\n id: undefined,\n actions: [] as any[],\n onClose: () => undefined as any,\n variant: 'default',\n hasNoBodyWrapper: false,\n appendTo: () => document.body,\n ouiaSafe: true\n };\n\n constructor(props: ModalProps) {\n super(props);\n const boxIdNum = Modal.currentId++;\n const labelIdNum = boxIdNum + 1;\n const descriptorIdNum = boxIdNum + 2;\n this.boxId = props.id || `pf-modal-part-${boxIdNum}`;\n this.labelId = `pf-modal-part-${labelIdNum}`;\n this.descriptorId = `pf-modal-part-${descriptorIdNum}`;\n\n this.state = {\n container: undefined,\n ouiaStateId: getDefaultOUIAId(Modal.displayName, props.variant)\n };\n }\n\n handleEscKeyClick = (event: KeyboardEvent): void => {\n const { onEscapePress } = this.props;\n if (event.key === KeyTypes.Escape && this.props.isOpen) {\n onEscapePress ? onEscapePress(event) : this.props.onClose?.();\n }\n };\n\n getElement = (appendTo: HTMLElement | (() => HTMLElement)) => {\n if (typeof appendTo === 'function') {\n return appendTo();\n }\n return appendTo || document.body;\n };\n\n toggleSiblingsFromScreenReaders = (hide: boolean) => {\n const { appendTo } = this.props;\n const target: HTMLElement = this.getElement(appendTo);\n const bodyChildren = target.children;\n for (const child of Array.from(bodyChildren)) {\n if (child !== this.state.container) {\n hide ? child.setAttribute('aria-hidden', '' + hide) : child.removeAttribute('aria-hidden');\n }\n }\n };\n\n isEmpty = (value: string | null | undefined) => value === null || value === undefined || value === '';\n\n componentDidMount() {\n const {\n appendTo,\n title,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n hasNoBodyWrapper,\n header\n } = this.props;\n const target: HTMLElement = this.getElement(appendTo);\n const container = document.createElement('div');\n this.setState({ container });\n target.appendChild(container);\n target.addEventListener('keydown', this.handleEscKeyClick, false);\n\n if (this.props.isOpen) {\n target.classList.add(css(styles.backdropOpen));\n } else {\n target.classList.remove(css(styles.backdropOpen));\n }\n\n if (this.isEmpty(title) && this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby)) {\n // eslint-disable-next-line no-console\n console.error('Modal: Specify at least one of: title, aria-label, aria-labelledby.');\n }\n\n if (this.isEmpty(ariaLabel) && this.isEmpty(ariaLabelledby) && (hasNoBodyWrapper || header)) {\n // eslint-disable-next-line no-console\n console.error(\n 'Modal: When using hasNoBodyWrapper or setting a custom header, ensure you assign an accessible name to the the modal container with aria-label or aria-labelledby.'\n );\n }\n }\n\n componentDidUpdate() {\n const { appendTo } = this.props;\n const target: HTMLElement = this.getElement(appendTo);\n if (this.props.isOpen) {\n target.classList.add(css(styles.backdropOpen));\n this.toggleSiblingsFromScreenReaders(true);\n } else {\n target.classList.remove(css(styles.backdropOpen));\n this.toggleSiblingsFromScreenReaders(false);\n }\n }\n\n componentWillUnmount() {\n const { appendTo } = this.props;\n const target: HTMLElement = this.getElement(appendTo);\n if (this.state.container) {\n target.removeChild(this.state.container);\n }\n target.removeEventListener('keydown', this.handleEscKeyClick, false);\n target.classList.remove(css(styles.backdropOpen));\n }\n\n render() {\n const {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n appendTo,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onEscapePress,\n 'aria-labelledby': ariaLabelledby,\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n bodyAriaLabel,\n bodyAriaRole,\n title,\n titleIconVariant,\n titleLabel,\n ouiaId,\n ouiaSafe,\n ...props\n } = this.props;\n const { container } = this.state;\n\n if (!canUseDOM || !container) {\n return null;\n }\n\n return ReactDOM.createPortal(\n <ModalContent\n {...props}\n boxId={this.boxId}\n labelId={this.labelId}\n descriptorId={this.descriptorId}\n title={title}\n titleIconVariant={titleIconVariant}\n titleLabel={titleLabel}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-labelledby={ariaLabelledby}\n bodyAriaLabel={bodyAriaLabel}\n bodyAriaRole={bodyAriaRole}\n ouiaId={ouiaId !== undefined ? ouiaId : this.state.ouiaStateId}\n ouiaSafe={ouiaSafe}\n />,\n container\n ) as React.ReactElement;\n }\n}\n","import * as React from 'react';\nimport { HTMLProps } from 'react';\nimport styles from '@patternfly/react-styles/css/components/FormControl/form-control';\nimport heightToken from '@patternfly/react-tokens/dist/esm/c_form_control_textarea_Height';\nimport { css } from '@patternfly/react-styles';\nimport { capitalize, ValidatedOptions, canUseDOM } from '../../helpers';\n\nexport enum TextAreResizeOrientation {\n horizontal = 'horizontal',\n vertical = 'vertical',\n both = 'both'\n}\n\nexport enum TextAreaReadOnlyVariant {\n default = 'default',\n plain = 'plain'\n}\n\nexport interface TextAreaProps extends Omit<HTMLProps<HTMLTextAreaElement>, 'onChange' | 'ref'> {\n /** Additional classes added to the text area. */\n className?: string;\n /** Flag to show if the text area is required. */\n isRequired?: boolean;\n /** Flag to show if the text area is disabled. */\n isDisabled?: boolean;\n /** @deprecated Use readOnlyVariant instead. Flag to show if the text area is read only. */\n isReadOnly?: boolean;\n /** Read only variant. */\n readOnlyVariant?: 'default' | 'plain';\n /** Use the external file instead of a data URI */\n isIconSprite?: boolean;\n /** Flag to modify height based on contents. */\n autoResize?: boolean;\n /** Value to indicate if the text area is modified to show that validation state.\n * If set to success, text area will be modified to indicate valid state.\n * If set to error, text area will be modified to indicate error state.\n */\n validated?: 'success' | 'warning' | 'error' | 'default';\n /** Value of the text area. */\n value?: string | number;\n /** A callback for when the text area value changes. */\n onChange?: (value: string, event: React.ChangeEvent<HTMLTextAreaElement>) => void;\n /** Sets the orientation to limit the resize to */\n resizeOrientation?: 'horizontal' | 'vertical' | 'both';\n /** Custom flag to show that the text area requires an associated id or aria-label. */\n 'aria-label'?: string;\n /** A reference object to attach to the text area. */\n innerRef?: React.RefObject<any>;\n}\n\nexport class TextAreaBase extends React.Component<TextAreaProps> {\n static displayName = 'TextArea';\n static defaultProps: TextAreaProps = {\n innerRef: React.createRef<HTMLTextAreaElement>(),\n className: '',\n isRequired: false,\n isDisabled: false,\n isIconSprite: false,\n validated: 'default',\n resizeOrientation: 'both',\n 'aria-label': null as string\n };\n\n inputRef = React.createRef<HTMLTextAreaElement>();\n\n private setAutoHeight = (field: HTMLTextAreaElement) => {\n field.style.setProperty(heightToken.name, 'inherit');\n const computed = window.getComputedStyle(field);\n // Calculate the height\n const height =\n parseInt(computed.getPropertyValue('border-top-width')) +\n parseInt(computed.getPropertyValue('padding-top')) +\n field.scrollHeight +\n parseInt(computed.getPropertyValue('padding-bottom')) +\n parseInt(computed.getPropertyValue('border-bottom-width'));\n field.style.setProperty(heightToken.name, `${height}px`);\n };\n\n constructor(props: TextAreaProps) {\n super(props);\n if (!props.id && !props['aria-label']) {\n // eslint-disable-next-line no-console\n console.error('TextArea: TextArea requires either an id or aria-label to be specified');\n }\n }\n\n componentDidMount(): void {\n const inputRef = this.props.innerRef || this.inputRef;\n if (this.props.autoResize && canUseDOM) {\n const field = inputRef.current;\n this.setAutoHeight(field);\n }\n }\n\n private handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n // https://gomakethings.com/automatically-expand-a-textarea-as-the-user-types-using-vanilla-javascript/\n const field = event.currentTarget;\n if (this.props.autoResize && canUseDOM) {\n this.setAutoHeight(field);\n }\n if (this.props.onChange) {\n this.props.onChange(field.value, event);\n }\n };\n\n render() {\n const {\n className,\n value,\n validated,\n isRequired,\n isDisabled,\n isIconSprite,\n isReadOnly,\n readOnlyVariant,\n resizeOrientation,\n innerRef,\n disabled,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n autoResize,\n onChange,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...props\n } = this.props;\n const orientation = `resize${capitalize(resizeOrientation)}` as 'resizeVertical' | 'resizeHorizontal';\n return (\n <textarea\n className={css(\n styles.formControl,\n isIconSprite && styles.modifiers.iconSprite,\n readOnlyVariant === 'plain' && styles.modifiers.plain,\n className,\n resizeOrientation !== TextAreResizeOrientation.both && styles.modifiers[orientation],\n validated === ValidatedOptions.success && styles.modifiers.success,\n validated === ValidatedOptions.warning && styles.modifiers.warning\n )}\n onChange={this.handleChange}\n {...(typeof this.props.defaultValue !== 'string' && { value })}\n aria-invalid={validated === ValidatedOptions.error}\n required={isRequired}\n disabled={isDisabled || disabled}\n readOnly={!!readOnlyVariant || isReadOnly}\n ref={innerRef || this.inputRef}\n {...props}\n />\n );\n }\n}\n\nexport const TextArea = React.forwardRef((props: TextAreaProps, ref: React.Ref<HTMLTextAreaElement>) => (\n <TextAreaBase {...props} innerRef={ref as React.MutableRefObject<any>} />\n));\nTextArea.displayName = 'TextArea';\n","import './number-input.css';\nexport default {\n \"formControl\": \"pf-c-form-control\",\n \"inputGroup\": \"pf-c-input-group\",\n \"modifiers\": {\n \"status\": \"pf-m-status\"\n },\n \"numberInput\": \"pf-c-number-input\",\n \"numberInputIcon\": \"pf-c-number-input__icon\",\n \"numberInputUnit\": \"pf-c-number-input__unit\"\n};","import { createIcon } from '../createIcon';\n\nexport const MinusIconConfig = {\n name: 'MinusIcon',\n height: 512,\n width: 448,\n svgPath: 'M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const MinusIcon = createIcon(MinusIconConfig);\n\nexport default MinusIcon;","import { createIcon } from '../createIcon';\n\nexport const PlusIconConfig = {\n name: 'PlusIcon',\n height: 512,\n width: 448,\n svgPath: 'M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z',\n yOffset: 0,\n xOffset: 0,\n};\n\nexport const PlusIcon = createIcon(PlusIconConfig);\n\nexport default PlusIcon;","import './input-group.css';\nexport default {\n \"formControl\": \"pf-c-form-control\",\n \"inputGroup\": \"pf-c-input-group\",\n \"inputGroupText\": \"pf-c-input-group__text\",\n \"modifiers\": {\n \"plain\": \"pf-m-plain\",\n \"disabled\": \"pf-m-disabled\"\n },\n \"themeDark\": \"pf-theme-dark\"\n};","export const c_form_control_textarea_Height = {\n \"name\": \"--pf-c-form-control--textarea--Height\",\n \"value\": \"auto\",\n \"var\": \"var(--pf-c-form-control--textarea--Height)\"\n};\nexport default c_form_control_textarea_Height;","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/FormControl/form-control';\nimport { css } from '@patternfly/react-styles';\nimport { ValidatedOptions } from '../../helpers/constants';\nimport { trimLeft } from '../../helpers/util';\nimport { getDefaultOUIAId, getOUIAProps, OUIAProps } from '../../helpers';\nimport { getResizeObserver } from '../../helpers/resizeObserver';\n\nexport enum TextInputTypes {\n text = 'text',\n date = 'date',\n datetimeLocal = 'datetime-local',\n email = 'email',\n month = 'month',\n number = 'number',\n password = 'password',\n search = 'search',\n tel = 'tel',\n time = 'time',\n url = 'url'\n}\n\nexport enum TextInputReadOnlyVariant {\n default = 'default',\n plain = 'plain'\n}\n\nexport interface TextInputProps\n extends Omit<React.HTMLProps<HTMLInputElement>, 'onChange' | 'onFocus' | 'onBlur' | 'disabled' | 'ref'>,\n OUIAProps {\n /** Additional classes added to the text input. */\n className?: string;\n /** Flag to show if the text input is disabled. */\n isDisabled?: boolean;\n /** @deprecated Use readOnlyVariant instead. Flag to show if the text input is read only. */\n isReadOnly?: boolean;\n /** Read only variant. */\n readOnlyVariant?: 'plain' | 'default';\n isRequired?: boolean;\n /** Value to indicate if the text input is modified to show that validation state.\n * If set to success, text input will be modified to indicate valid state.\n * If set to error, text input will be modified to indicate error state.\n */\n validated?: 'success' | 'warning' | 'error' | 'default';\n /** A callback for when the text input value changes. */\n onChange?: (value: string, event: React.FormEvent<HTMLInputElement>) => void;\n /** Type that the text input accepts. */\n type?:\n | 'text'\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'month'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'time'\n | 'url';\n /** Value of the text input. */\n value?: string | number;\n /** Aria-label. The text input requires an associated id or aria-label. */\n 'aria-label'?: string;\n /** A reference object to attach to the text input box. */\n innerRef?: React.RefObject<any>;\n /** Trim text on left */\n isLeftTruncated?: boolean;\n /** Callback function when text input is focused */\n onFocus?: (event?: any) => void;\n /** Callback function when text input is blurred (focus leaves) */\n onBlur?: (event?: any) => void;\n /** icon variant */\n iconVariant?: 'calendar' | 'clock' | 'search';\n /** Use the external file instead of a data URI */\n isIconSprite?: boolean;\n /** Custom icon url to set as the text input's background-image */\n customIconUrl?: string;\n /** Dimensions for the custom icon set as the text input's background-size */\n customIconDimensions?: string;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\ninterface TextInputState {\n ouiaStateId: string;\n}\n\nexport class TextInputBase extends React.Component<TextInputProps, TextInputState> {\n static displayName = 'TextInputBase';\n static defaultProps: TextInputProps = {\n 'aria-label': null,\n className: '',\n isRequired: false,\n validated: 'default' as 'success' | 'warning' | 'error' | 'default',\n isDisabled: false,\n isReadOnly: false,\n isIconSprite: false,\n type: TextInputTypes.text,\n isLeftTruncated: false,\n onChange: (): any => undefined,\n ouiaSafe: true\n };\n inputRef = React.createRef<HTMLInputElement>();\n observer: any = () => {};\n\n constructor(props: TextInputProps) {\n super(props);\n if (!props.id && !props['aria-label'] && !props['aria-labelledby']) {\n // eslint-disable-next-line no-console\n console.error('Text input:', 'Text input requires either an id or aria-label to be specified');\n }\n this.state = {\n ouiaStateId: getDefaultOUIAId(TextInputBase.displayName)\n };\n }\n\n handleChange = (event: React.FormEvent<HTMLInputElement>) => {\n if (this.props.onChange) {\n this.props.onChange(event.currentTarget.value, event);\n }\n };\n\n componentDidMount() {\n if (this.props.isLeftTruncated) {\n const inputRef = this.props.innerRef || this.inputRef;\n this.observer = getResizeObserver(inputRef.current, this.handleResize);\n this.handleResize();\n }\n }\n\n componentWillUnmount() {\n if (this.props.isLeftTruncated) {\n this.observer();\n }\n }\n\n handleResize = () => {\n const inputRef = this.props.innerRef || this.inputRef;\n if (inputRef && inputRef.current) {\n trimLeft(inputRef.current, String(this.props.value));\n }\n };\n\n restoreText = () => {\n const inputRef = this.props.innerRef || this.inputRef;\n // restore the value\n (inputRef.current as HTMLInputElement).value = String(this.props.value);\n // make sure we still see the rightmost value to preserve cursor click position\n inputRef.current.scrollLeft = inputRef.current.scrollWidth;\n };\n\n onFocus = (event?: any) => {\n const { isLeftTruncated, onFocus } = this.props;\n if (isLeftTruncated) {\n this.restoreText();\n }\n onFocus && onFocus(event);\n };\n\n onBlur = (event?: any) => {\n const { isLeftTruncated, onBlur } = this.props;\n if (isLeftTruncated) {\n this.handleResize();\n }\n onBlur && onBlur(event);\n };\n\n render() {\n const {\n innerRef,\n className,\n type,\n value,\n validated,\n /* eslint-disable @typescript-eslint/no-unused-vars */\n onChange,\n onFocus,\n onBlur,\n isLeftTruncated,\n isReadOnly,\n readOnly,\n readOnlyVariant,\n isRequired,\n isDisabled,\n isIconSprite,\n iconVariant,\n customIconUrl,\n customIconDimensions,\n ouiaId,\n ouiaSafe,\n ...props\n } = this.props;\n\n const customIconStyle = {} as any;\n if (customIconUrl) {\n customIconStyle.backgroundImage = `url('${customIconUrl}')`;\n }\n if (customIconDimensions) {\n customIconStyle.backgroundSize = customIconDimensions;\n }\n\n return (\n <input\n {...props}\n onFocus={this.onFocus}\n onBlur={this.onBlur}\n className={css(\n styles.formControl,\n isIconSprite && styles.modifiers.iconSprite,\n readOnlyVariant === 'plain' && styles.modifiers.plain,\n validated === ValidatedOptions.success && styles.modifiers.success,\n validated === ValidatedOptions.warning && styles.modifiers.warning,\n ((iconVariant && iconVariant !== 'search') || customIconUrl) && styles.modifiers.icon,\n iconVariant && styles.modifiers[iconVariant],\n className\n )}\n onChange={this.handleChange}\n type={type}\n value={this.sanitizeInputValue(value)}\n aria-invalid={props['aria-invalid'] ? props['aria-invalid'] : validated === ValidatedOptions.error}\n required={isRequired}\n disabled={isDisabled}\n readOnly={!!readOnlyVariant || isReadOnly || readOnly}\n ref={innerRef || this.inputRef}\n {...((customIconUrl || customIconDimensions) && { style: customIconStyle })}\n {...getOUIAProps(TextInput.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId, ouiaSafe)}\n />\n );\n }\n\n private sanitizeInputValue = (value: string | number) =>\n typeof value === 'string' ? value.replace(/\\n/g, ' ') : value;\n}\n\nexport const TextInput = React.forwardRef((props: TextInputProps, ref: React.Ref<HTMLInputElement>) => (\n <TextInputBase {...props} innerRef={ref as React.MutableRefObject<any>} />\n));\nTextInput.displayName = 'TextInput';\n","import { canUseDOM } from './util';\n\n/**\n * This function creates a ResizeObserver used to handle resize events for the given containerRef. If ResizeObserver\n * or the given containerRef are not available, a window resize event listener is used by default.\n *\n * Example 1:\n *\n * private containerRef = React.createRef<HTMLDivElement>();\n * private observer: any = () => {};\n *\n * public componentDidMount() {\n * this.observer = getResizeObserver(this.containerRef.current, this.handleResize);\n * }\n *\n * public componentWillUnmount() {\n * this.observer();\n * }\n *\n * private handleResize = () => {\n * if (this.containerRef.current && this.containerRef.current.clientWidth) {\n * this.setState({ width: this.containerRef.current.clientWidth });\n * }\n * };\n *\n * public render() {\n * return (\n * <div ref={this.containerRef} >\n * <Chart width={this.state.width} ... />\n * </div>\n * );\n * }\n *\n * Example 2:\n *\n * private inputRef = React.createRef<HTMLInputElement>();\n * private observer: any = () => {};\n *\n * public componentDidMount() {\n * this.observer = getResizeObserver(this.inputRef.current, this.handleResize);\n * }\n *\n * public componentWillUnmount() {\n * this.observer();\n * }\n *\n * private handleResize = () => {\n * if (this.inputRef.current) {\n * trimLeft(inputRef.current, String(this.props.value));\n * }\n * };\n *\n * public render() {\n * return (\n * <input ref={this.inputRef} ... />\n * );\n * }\n *\n * Example 3 - With debounced method passed in:\n *\n * public componentDidMount() {\n * this.observer = getResizeObserver(this.inputRef.current, debounce(this.handleResize, 250), false);\n * }\n *\n * @param {Element} containerRefElement The container reference to observe\n * @param {Function} handleResize The function to call for resize events\n * @param {boolean} useRequestAnimationFrame Whether to pass the handleResize function as a callback to requestAnimationFrame. Pass in false when the function passed in is debounced. Defaults to true.\n * @return {Function} The function used to unobserve resize events\n */\nexport const getResizeObserver = (\n containerRefElement: Element,\n handleResize: () => void,\n useRequestAnimationFrame: boolean = true\n) => {\n let unobserve: any;\n\n if (canUseDOM) {\n const { ResizeObserver } = window as any;\n\n if (containerRefElement && ResizeObserver) {\n const resizeObserver = new ResizeObserver((entries: any) => {\n // Wrap resize function in requestAnimationFrame to avoid \"ResizeObserver loop limit exceeded\" errors\n if (useRequestAnimationFrame) {\n window.requestAnimationFrame(() => {\n if (Array.isArray(entries) && entries.length > 0) {\n handleResize();\n }\n });\n // Avoid wrapping function in requestAnimationFrame if the function is debounced\n } else {\n if (Array.isArray(entries) && entries.length > 0) {\n handleResize();\n }\n }\n });\n resizeObserver.observe(containerRefElement);\n unobserve = () => resizeObserver.unobserve(containerRefElement);\n } else {\n window.addEventListener('resize', handleResize);\n unobserve = () => window.removeEventListener('resize', handleResize);\n }\n }\n return () => {\n if (unobserve) {\n unobserve();\n }\n };\n};\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/InputGroup/input-group';\nimport { css } from '@patternfly/react-styles';\nimport { FormSelect } from '../FormSelect';\nimport { TextArea } from '../TextArea';\nimport { TextInput } from '../TextInput';\n\nexport interface InputGroupProps extends React.HTMLProps<HTMLDivElement> {\n /** Additional classes added to the input group. */\n className?: string;\n /** Content rendered inside the input group. */\n children: React.ReactNode;\n /** @hide A reference object to attach to the input box */\n innerRef?: React.RefObject<any>;\n}\n\nexport const InputGroup: React.FunctionComponent<InputGroupProps> = ({\n className = '',\n children,\n innerRef,\n ...props\n}: InputGroupProps) => {\n const formCtrls = [FormSelect, TextArea, TextInput].map(comp => comp.displayName);\n const idItem = React.Children.toArray(children).find(\n (child: any) => !formCtrls.includes(child.type.displayName) && child.props.id\n ) as React.ReactElement<{ id: string }>;\n\n const ref = React.useRef(null);\n const inputGroupRef = innerRef || ref;\n\n return (\n <div ref={inputGroupRef} className={css(styles.inputGroup, className)} {...props}>\n {idItem\n ? React.Children.map(children, (child: any) =>\n !formCtrls.includes(child.type.displayName) || child.props['aria-describedby']\n ? child\n : React.cloneElement(child, {\n 'aria-describedby': child.props['aria-describedby'] === '' ? undefined : idItem.props.id\n })\n )\n : children}\n </div>\n );\n};\nInputGroup.displayName = 'InputGroup';\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/NumberInput/number-input';\nimport { css } from '@patternfly/react-styles';\nimport MinusIcon from '@patternfly/react-icons/dist/esm/icons/minus-icon';\nimport PlusIcon from '@patternfly/react-icons/dist/esm/icons/plus-icon';\nimport { InputGroup } from '../InputGroup';\nimport { Button, ButtonProps } from '../Button';\nimport { KeyTypes, ValidatedOptions } from '../../helpers';\nimport { TextInput } from '../TextInput';\n\nexport interface NumberInputProps extends React.HTMLProps<HTMLDivElement> {\n /** Value of the number input */\n value?: number | '';\n /** Additional classes added to the number input */\n className?: string;\n /** Sets the width of the number input to a number of characters */\n widthChars?: number;\n /** Indicates the whole number input should be disabled */\n isDisabled?: boolean;\n /** Value to indicate if the input is modified to show that validation state\n * @beta\n */\n validated?: 'default' | 'error' | 'warning' | 'success' | ValidatedOptions;\n /** Callback for the minus button */\n onMinus?: (event: React.MouseEvent, name?: string) => void;\n /** Callback for the text input changing */\n onChange?: (event: React.FormEvent<HTMLInputElement>) => void;\n /** Callback function when text input is blurred (focus leaves) */\n onBlur?: (event?: any) => void;\n /** Callback for the plus button */\n onPlus?: (event: React.MouseEvent, name?: string) => void;\n /** Adds the given unit to the number input */\n unit?: React.ReactNode;\n /** Position of the number input unit in relation to the number input */\n unitPosition?: 'before' | 'after';\n /** Minimum value of the number input, disabling the minus button when reached */\n min?: number;\n /** Maximum value of the number input, disabling the plus button when reached */\n max?: number;\n /** Name of the input */\n inputName?: string;\n /** Aria label of the input */\n inputAriaLabel?: string;\n /** Aria label of the minus button */\n minusBtnAriaLabel?: string;\n /** Aria label of the plus button */\n plusBtnAriaLabel?: string;\n /** Additional properties added to the text input */\n inputProps?: any;\n /** Additional properties added to the minus button */\n minusBtnProps?: ButtonProps;\n /** Additional properties added to the plus button */\n plusBtnProps?: ButtonProps;\n /** Allow the user to clear out the input to an empty string (recommended) */\n allowEmptyInput?: boolean;\n}\n\ntype DefaultKeyDownHandlerArgs = Pick<NumberInputProps, 'inputName' | 'onMinus' | 'onPlus'>;\n\nconst defaultKeyDownHandler = (args: DefaultKeyDownHandlerArgs) => (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (KeyTypes.ArrowUp === event.key && args.onPlus) {\n event.preventDefault();\n args.onPlus(null, args.inputName);\n }\n if (KeyTypes.ArrowDown === event.key && args.onMinus) {\n event.preventDefault();\n args.onMinus(null, args.inputName);\n }\n};\n\nexport const NumberInput: React.FunctionComponent<NumberInputProps> = ({\n value = 0,\n className,\n widthChars,\n isDisabled = false,\n validated = ValidatedOptions.default,\n onMinus = () => {},\n onChange,\n onBlur,\n onPlus = () => {},\n unit,\n unitPosition = 'after',\n min,\n max,\n inputName,\n inputAriaLabel = 'Input',\n minusBtnAriaLabel = 'Minus',\n plusBtnAriaLabel = 'Plus',\n inputProps,\n minusBtnProps,\n plusBtnProps,\n allowEmptyInput = false,\n ...props\n}: NumberInputProps) => {\n if (!allowEmptyInput) {\n value = value || 0;\n }\n const numberInputUnit = <div className={css(styles.numberInputUnit)}>{unit}</div>;\n const keyDownHandler =\n inputProps && inputProps.onKeyDown ? inputProps.onKeyDown : defaultKeyDownHandler({ inputName, onMinus, onPlus });\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n event.target.value = Number(event.target.value).toString();\n if (onChange) {\n onChange(event);\n }\n if (onBlur) {\n onBlur(event);\n }\n };\n\n return (\n <div\n className={css(styles.numberInput, validated !== 'default' && styles.modifiers.status, className)}\n {...(widthChars && {\n style: {\n '--pf-c-number-input--c-form-control--width-chars': widthChars,\n ...props.style\n } as React.CSSProperties\n })}\n {...props}\n >\n {unit && unitPosition === 'before' && numberInputUnit}\n <InputGroup>\n <Button\n variant=\"control\"\n aria-label={minusBtnAriaLabel}\n isDisabled={isDisabled || value <= min}\n onClick={evt => onMinus(evt, inputName)}\n {...minusBtnProps}\n >\n <span className={css(styles.numberInputIcon)}>\n <MinusIcon aria-hidden=\"true\" />\n </span>\n </Button>\n <TextInput\n {...inputProps}\n type=\"number\"\n value={value}\n name={inputName}\n aria-label={inputAriaLabel}\n {...(isDisabled && { isDisabled })}\n {...(onChange && { onChange: (value, event) => onChange(event) })}\n onBlur={handleBlur}\n {...(!onChange && { isReadOnly: true })}\n onKeyDown={keyDownHandler}\n validated={validated}\n />\n <Button\n variant=\"control\"\n aria-label={plusBtnAriaLabel}\n isDisabled={isDisabled || value >= max}\n onClick={evt => onPlus(evt, inputName)}\n {...plusBtnProps}\n >\n <span className={css(styles.numberInputIcon)}>\n <PlusIcon aria-hidden=\"true\" />\n </span>\n </Button>\n </InputGroup>\n {unit && unitPosition === 'after' && numberInputUnit}\n </div>\n );\n};\nNumberInput.displayName = 'NumberInput';\n","import * as React from 'react';\nimport { getBreakpoint, getVerticalBreakpoint } from '../../helpers/util';\n\nexport interface PageContextProps {\n isManagedSidebar: boolean;\n onNavToggle: () => void;\n isNavOpen: boolean;\n width: number;\n height: number;\n getBreakpoint: (width: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n getVerticalBreakpoint: (height: number | null) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n}\n\nexport const pageContextDefaults: PageContextProps = {\n isManagedSidebar: false,\n isNavOpen: false,\n onNavToggle: () => null,\n width: null,\n height: null,\n getBreakpoint,\n getVerticalBreakpoint\n};\n\nexport const PageContext = React.createContext<PageContextProps>(pageContextDefaults);\n\nexport const PageContextProvider = PageContext.Provider;\nexport const PageContextConsumer = PageContext.Consumer;\n","/** This Component can be used to wrap a functional component in order to generate a random ID\n * Example of how to use this component\n *\n * const Component = ({id}: {id: string}) => (\n * <GenerateId>{randomId => (\n * <div id={id || randomId}>\n * div with random ID\n * </div>\n * )}\n * </GenerateId>\n * );\n */\n\nimport * as React from 'react';\n\nlet currentId = 0;\n\ninterface GenerateIdProps {\n /** String to prefix the random id with */\n prefix?: string;\n /** Component to be rendered with the generated id */\n children(id: string): React.ReactNode;\n}\n\nexport class GenerateId extends React.Component<GenerateIdProps, {}> {\n static displayName = 'GenerateId';\n static defaultProps = {\n prefix: 'pf-random-id-'\n };\n id = `${this.props.prefix}${currentId++}`;\n\n render() {\n return this.props.children(this.id);\n }\n}\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { css } from '@patternfly/react-styles';\nimport { canUseDOM } from '../../helpers/util';\n\nimport { RefObject } from 'react';\nimport { ToolbarItem } from './ToolbarItem';\nimport { Button } from '../Button';\nimport { ToolbarGroup } from './ToolbarGroup';\nimport { globalBreakpoints } from './ToolbarUtils';\nimport { PickOptional } from '../../helpers/typeUtils';\n\nexport interface ToolbarChipGroupContentProps extends React.HTMLProps<HTMLDivElement> {\n /** Classes applied to root element of the data toolbar content row */\n className?: string;\n /** Flag indicating if a data toolbar toggle group's expandable content is expanded */\n isExpanded?: boolean;\n /** Chip group content reference for passing to data toolbar children */\n chipGroupContentRef?: RefObject<any>;\n /** optional callback for clearing all filters in the toolbar */\n clearAllFilters?: () => void;\n /** Flag indicating that the clear all filters button should be visible */\n showClearFiltersButton: boolean;\n /** Text to display in the clear all filters button */\n clearFiltersButtonText?: string;\n /** Total number of filters currently being applied across all ToolbarFilter components */\n numberOfFilters: number;\n /** Text to display in the total number of applied filters ToolbarFilter */\n numberOfFiltersText?: (numberOfFilters: number) => string;\n /** The breakpoint at which the listed filters in chip groups are collapsed down to a summary */\n collapseListedFiltersBreakpoint?: 'all' | 'md' | 'lg' | 'xl' | '2xl';\n /** Custom additional content appended to the generated chips. To maintain spacing and styling, each node should be a ToolbarItem or ToolbarGroup. This property will remove the built in \"Clear all filters\" button. */\n customChipGroupContent?: React.ReactNode;\n}\n\nexport class ToolbarChipGroupContent extends React.Component<ToolbarChipGroupContentProps> {\n static displayName = 'ToolbarChipGroupContent';\n static defaultProps: PickOptional<ToolbarChipGroupContentProps> = {\n clearFiltersButtonText: 'Clear all filters',\n collapseListedFiltersBreakpoint: 'lg',\n numberOfFiltersText: (numberOfFilters: number) => `${numberOfFilters} filters applied`\n };\n\n render() {\n const {\n className,\n isExpanded,\n chipGroupContentRef,\n clearAllFilters,\n showClearFiltersButton,\n clearFiltersButtonText,\n collapseListedFiltersBreakpoint,\n numberOfFilters,\n numberOfFiltersText,\n customChipGroupContent,\n ...props\n } = this.props;\n\n const clearChipGroups = () => {\n clearAllFilters();\n };\n\n let collapseListedFilters = false;\n if (collapseListedFiltersBreakpoint === 'all') {\n collapseListedFilters = true;\n } else if (canUseDOM) {\n collapseListedFilters =\n (canUseDOM ? window.innerWidth : 1200) < globalBreakpoints[collapseListedFiltersBreakpoint];\n }\n\n return (\n <div\n className={css(\n styles.toolbarContent,\n (numberOfFilters === 0 || isExpanded) && styles.modifiers.hidden,\n className\n )}\n {...((numberOfFilters === 0 || isExpanded) && { hidden: true })}\n ref={chipGroupContentRef}\n {...props}\n >\n <ToolbarGroup\n className={css(collapseListedFilters && styles.modifiers.hidden)}\n {...(collapseListedFilters && { hidden: true })}\n {...(collapseListedFilters && { 'aria-hidden': true })}\n />\n {collapseListedFilters && numberOfFilters > 0 && !isExpanded && (\n <ToolbarGroup>\n <ToolbarItem>{numberOfFiltersText(numberOfFilters)}</ToolbarItem>\n </ToolbarGroup>\n )}\n {showClearFiltersButton && !isExpanded && !customChipGroupContent && (\n <ToolbarItem>\n <Button variant=\"link\" onClick={clearChipGroups} isInline>\n {clearFiltersButtonText}\n </Button>\n </ToolbarItem>\n )}\n {customChipGroupContent && customChipGroupContent}\n </div>\n );\n }\n}\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { GenerateId } from '../../helpers/GenerateId/GenerateId';\nimport { css } from '@patternfly/react-styles';\nimport { ToolbarContext } from './ToolbarUtils';\nimport { ToolbarChipGroupContent } from './ToolbarChipGroupContent';\nimport { formatBreakpointMods, canUseDOM } from '../../helpers/util';\nimport { getDefaultOUIAId, getOUIAProps, OUIAProps } from '../../helpers';\nimport { PageContext } from '../Page/PageContext';\n\nexport interface ToolbarProps extends React.HTMLProps<HTMLDivElement>, OUIAProps {\n /** Optional callback for clearing all filters in the toolbar */\n clearAllFilters?: () => void;\n /** Text to display in the clear all filters button */\n clearFiltersButtonText?: string;\n /** Custom content appended to the filter generated chip group. To maintain spacing and styling, each node should be wrapped in a ToolbarItem or ToolbarGroup. This property will remove the default \"Clear all filters\" button. */\n customChipGroupContent?: React.ReactNode;\n /** The breakpoint at which the listed filters in chip groups are collapsed down to a summary */\n collapseListedFiltersBreakpoint?: 'all' | 'md' | 'lg' | 'xl' | '2xl';\n /** Flag indicating if a data toolbar toggle group's expandable content is expanded */\n isExpanded?: boolean;\n /** A callback for setting the isExpanded flag */\n toggleIsExpanded?: () => void;\n /** Classes applied to root element of the data toolbar */\n className?: string;\n /** Content to be rendered as rows in the data toolbar */\n children?: React.ReactNode;\n /** Id of the data toolbar */\n id?: string;\n /** Flag indicating the toolbar height should expand to the full height of the container */\n isFullHeight?: boolean;\n /** Flag indicating the toolbar is static */\n isStatic?: boolean;\n /** Flag indicating the toolbar should use the Page insets */\n usePageInsets?: boolean;\n /** Flag indicating the toolbar should stick to the top of its container */\n isSticky?: boolean;\n /** Insets at various breakpoints. */\n inset?: {\n default?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n sm?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n md?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n lg?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n xl?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n '2xl'?: 'insetNone' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl';\n };\n /** Text to display in the total number of applied filters ToolbarFilter */\n numberOfFiltersText?: (numberOfFilters: number) => string;\n /** Value to overwrite the randomly generated data-ouia-component-id.*/\n ouiaId?: number | string;\n /** Set the value of data-ouia-safe. Only set to true when the component is in a static state, i.e. no animations are occurring. At all other times, this value must be false. */\n ouiaSafe?: boolean;\n}\n\nexport interface ToolbarState {\n /** Flag used if the user has opted NOT to manage the 'isExpanded' state of the toggle group.\n * Indicates whether or not the toggle group is expanded. */\n isManagedToggleExpanded: boolean;\n /** Object managing information about how many chips are in each chip group */\n filterInfo: FilterInfo;\n /** Used to keep track of window width so we can collapse expanded content when window is resizing */\n windowWidth: number;\n ouiaStateId: string;\n}\n\ninterface FilterInfo {\n [key: string]: number;\n}\n\nexport class Toolbar extends React.Component<ToolbarProps, ToolbarState> {\n static displayName = 'Toolbar';\n chipGroupContentRef = React.createRef<HTMLDivElement>();\n staticFilterInfo = {};\n state = {\n isManagedToggleExpanded: false,\n filterInfo: {},\n windowWidth: canUseDOM ? window.innerWidth : 1200,\n ouiaStateId: getDefaultOUIAId(Toolbar.displayName)\n };\n\n isToggleManaged = () => !(this.props.isExpanded || !!this.props.toggleIsExpanded);\n\n toggleIsExpanded = () => {\n this.setState(prevState => ({\n isManagedToggleExpanded: !prevState.isManagedToggleExpanded\n }));\n };\n\n closeExpandableContent = (e: any) => {\n if (e.target.innerWidth !== this.state.windowWidth) {\n this.setState(() => ({\n isManagedToggleExpanded: false,\n windowWidth: e.target.innerWidth\n }));\n }\n };\n\n componentDidMount() {\n if (this.isToggleManaged() && canUseDOM) {\n window.addEventListener('resize', this.closeExpandableContent);\n }\n }\n\n componentWillUnmount() {\n if (this.isToggleManaged() && canUseDOM) {\n window.removeEventListener('resize', this.closeExpandableContent);\n }\n }\n\n updateNumberFilters = (categoryName: string, numberOfFilters: number) => {\n const filterInfoToUpdate: FilterInfo = { ...this.staticFilterInfo };\n if (!filterInfoToUpdate.hasOwnProperty(categoryName) || filterInfoToUpdate[categoryName] !== numberOfFilters) {\n filterInfoToUpdate[categoryName] = numberOfFilters;\n this.staticFilterInfo = filterInfoToUpdate;\n this.setState({ filterInfo: filterInfoToUpdate });\n }\n };\n\n getNumberOfFilters = () =>\n Object.values(this.state.filterInfo).reduce((acc: any, cur: any) => acc + cur, 0) as number;\n\n renderToolbar = (randomId: string) => {\n const {\n clearAllFilters,\n clearFiltersButtonText,\n collapseListedFiltersBreakpoint,\n isExpanded: isExpandedProp,\n toggleIsExpanded,\n className,\n children,\n isFullHeight,\n isStatic,\n inset,\n usePageInsets,\n isSticky,\n ouiaId,\n numberOfFiltersText,\n customChipGroupContent,\n ...props\n } = this.props;\n\n const { isManagedToggleExpanded } = this.state;\n\n const isToggleManaged = this.isToggleManaged();\n const isExpanded = isToggleManaged ? isManagedToggleExpanded : isExpandedProp;\n const numberOfFilters = this.getNumberOfFilters();\n const showClearFiltersButton = numberOfFilters > 0;\n\n return (\n <PageContext.Consumer>\n {({ width, getBreakpoint }) => (\n <div\n className={css(\n styles.toolbar,\n isFullHeight && styles.modifiers.fullHeight,\n isStatic && styles.modifiers.static,\n usePageInsets && styles.modifiers.pageInsets,\n isSticky && styles.modifiers.sticky,\n formatBreakpointMods(inset, styles, '', getBreakpoint(width)),\n className\n )}\n id={randomId}\n {...getOUIAProps(Toolbar.displayName, ouiaId !== undefined ? ouiaId : this.state.ouiaStateId)}\n {...props}\n >\n <ToolbarContext.Provider\n value={{\n isExpanded,\n toggleIsExpanded: isToggleManaged ? this.toggleIsExpanded : toggleIsExpanded,\n chipGroupContentRef: this.chipGroupContentRef,\n updateNumberFilters: this.updateNumberFilters,\n numberOfFilters,\n clearAllFilters,\n clearFiltersButtonText,\n showClearFiltersButton,\n toolbarId: randomId,\n customChipGroupContent\n }}\n >\n {children}\n <ToolbarChipGroupContent\n isExpanded={isExpanded}\n chipGroupContentRef={this.chipGroupContentRef}\n clearAllFilters={clearAllFilters}\n showClearFiltersButton={showClearFiltersButton}\n clearFiltersButtonText={clearFiltersButtonText}\n numberOfFilters={numberOfFilters}\n numberOfFiltersText={numberOfFiltersText}\n collapseListedFiltersBreakpoint={collapseListedFiltersBreakpoint}\n customChipGroupContent={customChipGroupContent}\n />\n </ToolbarContext.Provider>\n </div>\n )}\n </PageContext.Consumer>\n );\n };\n\n render() {\n return this.props.id ? (\n this.renderToolbar(this.props.id)\n ) : (\n <GenerateId>{randomId => this.renderToolbar(randomId)}</GenerateId>\n );\n }\n}\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { css } from '@patternfly/react-styles';\n\nimport { RefObject } from 'react';\nimport { ToolbarGroup } from './ToolbarGroup';\nimport { ToolbarItem } from './ToolbarItem';\nimport { Button } from '../Button';\nimport { ToolbarContext } from './ToolbarUtils';\nimport { PickOptional } from '../../helpers/typeUtils';\n\nexport interface ToolbarExpandableContentProps extends React.HTMLProps<HTMLDivElement> {\n /** Classes added to the root element of the data toolbar expandable content */\n className?: string;\n /** Flag indicating the expandable content is expanded */\n isExpanded?: boolean;\n /** Expandable content reference for passing to data toolbar children */\n expandableContentRef?: RefObject<HTMLDivElement>;\n /** Chip container reference for passing to data toolbar children */\n chipContainerRef?: RefObject<any>;\n /** optional callback for clearing all filters in the toolbar */\n clearAllFilters?: () => void;\n /** Text to display in the clear all filters button */\n clearFiltersButtonText?: string;\n /** Flag indicating that the clear all filters button should be visible */\n showClearFiltersButton: boolean;\n}\n\nexport class ToolbarExpandableContent extends React.Component<ToolbarExpandableContentProps> {\n static displayName = 'ToolbarExpandableContent';\n static contextType = ToolbarContext;\n context!: React.ContextType<typeof ToolbarContext>;\n static defaultProps: PickOptional<ToolbarExpandableContentProps> = {\n isExpanded: false,\n clearFiltersButtonText: 'Clear all filters'\n };\n\n render() {\n const {\n className,\n expandableContentRef,\n chipContainerRef,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isExpanded,\n clearAllFilters,\n clearFiltersButtonText,\n showClearFiltersButton,\n ...props\n } = this.props;\n const { numberOfFilters, customChipGroupContent } = this.context;\n\n const clearChipGroups = () => {\n clearAllFilters();\n };\n\n return (\n <div className={css(styles.toolbarExpandableContent, className)} ref={expandableContentRef} {...props}>\n <ToolbarGroup />\n {numberOfFilters > 0 && (\n <ToolbarGroup className={styles.modifiers.chipContainer}>\n <ToolbarGroup ref={chipContainerRef} />\n {showClearFiltersButton && !customChipGroupContent && (\n <ToolbarItem>\n <Button variant=\"link\" onClick={clearChipGroups} isInline>\n {clearFiltersButtonText}\n </Button>\n </ToolbarItem>\n )}\n {customChipGroupContent && customChipGroupContent}\n </ToolbarGroup>\n )}\n </div>\n );\n }\n}\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { css } from '@patternfly/react-styles';\nimport { ToolbarContentContext, ToolbarContext } from './ToolbarUtils';\nimport { formatBreakpointMods } from '../../helpers/util';\nimport { ToolbarExpandableContent } from './ToolbarExpandableContent';\nimport { PageContext } from '../Page/PageContext';\n\nexport interface ToolbarContentProps extends React.HTMLProps<HTMLDivElement> {\n /** Classes applied to root element of the data toolbar content row */\n className?: string;\n /** Visibility at various breakpoints. */\n visibility?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** @deprecated prop misspelled */\n visiblity?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** Alignment at various breakpoints. */\n alignment?: {\n default?: 'alignRight' | 'alignLeft';\n md?: 'alignRight' | 'alignLeft';\n lg?: 'alignRight' | 'alignLeft';\n xl?: 'alignRight' | 'alignLeft';\n '2xl'?: 'alignRight' | 'alignLeft';\n };\n /** Content to be rendered as children of the content row */\n children?: React.ReactNode;\n /** Flag indicating if a data toolbar toggle group's expandable content is expanded */\n isExpanded?: boolean;\n /** Optional callback for clearing all filters in the toolbar */\n clearAllFilters?: () => void;\n /** Flag indicating that the clear all filters button should be visible */\n showClearFiltersButton?: boolean;\n /** Text to display in the clear all filters button */\n clearFiltersButtonText?: string;\n /** Id of the parent Toolbar component */\n toolbarId?: string;\n}\n\nexport class ToolbarContent extends React.Component<ToolbarContentProps> {\n static displayName = 'ToolbarContent';\n private expandableContentRef = React.createRef<HTMLDivElement>();\n private chipContainerRef = React.createRef<HTMLDivElement>();\n private static currentId = 0;\n\n static defaultProps: ToolbarContentProps = {\n isExpanded: false,\n showClearFiltersButton: false\n };\n\n render() {\n const {\n className,\n children,\n isExpanded,\n toolbarId,\n visibility,\n visiblity,\n alignment,\n clearAllFilters,\n showClearFiltersButton,\n clearFiltersButtonText,\n ...props\n } = this.props;\n\n if (visiblity !== undefined) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The ToolbarContent visiblity prop has been deprecated. ' +\n 'Please use the correctly spelled visibility prop instead.'\n );\n }\n\n return (\n <PageContext.Consumer>\n {({ width, getBreakpoint }) => (\n <div\n className={css(\n styles.toolbarContent,\n formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),\n formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),\n className\n )}\n {...props}\n >\n <ToolbarContext.Consumer>\n {({\n clearAllFilters: clearAllFiltersContext,\n clearFiltersButtonText: clearFiltersButtonContext,\n showClearFiltersButton: showClearFiltersButtonContext,\n toolbarId: toolbarIdContext\n }) => {\n const expandableContentId = `${toolbarId ||\n toolbarIdContext}-expandable-content-${ToolbarContent.currentId++}`;\n return (\n <ToolbarContentContext.Provider\n value={{\n expandableContentRef: this.expandableContentRef,\n expandableContentId,\n chipContainerRef: this.chipContainerRef\n }}\n >\n <div className={css(styles.toolbarContentSection)}>{children}</div>\n <ToolbarExpandableContent\n id={expandableContentId}\n isExpanded={isExpanded}\n expandableContentRef={this.expandableContentRef}\n chipContainerRef={this.chipContainerRef}\n clearAllFilters={clearAllFilters || clearAllFiltersContext}\n showClearFiltersButton={showClearFiltersButton || showClearFiltersButtonContext}\n clearFiltersButtonText={clearFiltersButtonText || clearFiltersButtonContext}\n />\n </ToolbarContentContext.Provider>\n );\n }}\n </ToolbarContext.Consumer>\n </div>\n )}\n </PageContext.Consumer>\n );\n }\n}\n","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { css } from '@patternfly/react-styles';\nimport { formatBreakpointMods, toCamel } from '../../helpers/util';\nimport { PageContext } from '../Page/PageContext';\n\nexport enum ToolbarGroupVariant {\n 'filter-group' = 'filter-group',\n 'icon-button-group' = 'icon-button-group',\n 'button-group' = 'button-group'\n}\n\nexport interface ToolbarGroupProps extends Omit<React.HTMLProps<HTMLDivElement>, 'ref'> {\n /** Classes applied to root element of the data toolbar group */\n className?: string;\n /** A type modifier which modifies spacing specifically depending on the type of group */\n variant?: ToolbarGroupVariant | 'filter-group' | 'icon-button-group' | 'button-group';\n /** Visibility at various breakpoints. */\n visibility?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** @deprecated prop misspelled */\n visiblity?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** Alignment at various breakpoints. */\n alignment?: {\n default?: 'alignRight' | 'alignLeft';\n md?: 'alignRight' | 'alignLeft';\n lg?: 'alignRight' | 'alignLeft';\n xl?: 'alignRight' | 'alignLeft';\n '2xl'?: 'alignRight' | 'alignLeft';\n };\n /** Spacers at various breakpoints. */\n spacer?: {\n default?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n md?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n lg?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n xl?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n '2xl'?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n };\n /** Space items at various breakpoints. */\n spaceItems?: {\n default?: 'spaceItemsNone' | 'spaceItemsSm' | 'spaceItemsMd' | 'spaceItemsLg';\n md?: 'spaceItemsNone' | 'spaceItemsSm' | 'spaceItemsMd' | 'spaceItemsLg';\n lg?: 'spaceItemsNone' | 'spaceItemsSm' | 'spaceItemsMd' | 'spaceItemsLg';\n xl?: 'spaceItemsNone' | 'spaceItemsSm' | 'spaceItemsMd' | 'spaceItemsLg';\n '2xl'?: 'spaceItemsNone' | 'spaceItemsSm' | 'spaceItemsMd' | 'spaceItemsLg';\n };\n /** Content to be rendered inside the data toolbar group */\n children?: React.ReactNode;\n /** Reference to pass to this group if it has .pf-m-chip-container modifier */\n innerRef?: React.RefObject<any>;\n}\n\nclass ToolbarGroupWithRef extends React.Component<ToolbarGroupProps> {\n render() {\n const {\n visibility,\n visiblity,\n alignment,\n spacer,\n spaceItems,\n className,\n variant,\n children,\n innerRef,\n ...props\n } = this.props;\n\n if (visiblity !== undefined) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The ToolbarGroup visiblity prop has been deprecated. ' +\n 'Please use the correctly spelled visibility prop instead.'\n );\n }\n\n return (\n <PageContext.Consumer>\n {({ width, getBreakpoint }) => (\n <div\n className={css(\n styles.toolbarGroup,\n variant && styles.modifiers[toCamel(variant) as 'filterGroup' | 'iconButtonGroup' | 'buttonGroup'],\n formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),\n formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),\n formatBreakpointMods(spacer, styles, '', getBreakpoint(width)),\n formatBreakpointMods(spaceItems, styles, '', getBreakpoint(width)),\n className\n )}\n {...props}\n ref={innerRef}\n >\n {children}\n </div>\n )}\n </PageContext.Consumer>\n );\n }\n}\n\nexport const ToolbarGroup = React.forwardRef((props: ToolbarGroupProps, ref: any) => (\n <ToolbarGroupWithRef {...props} innerRef={ref} />\n));\n","import * as React from 'react';\nimport { css } from '@patternfly/react-styles';\nimport styles from '@patternfly/react-styles/css/components/Divider/divider';\nimport { formatBreakpointMods } from '../../helpers/util';\n\nexport enum DividerVariant {\n hr = 'hr',\n li = 'li',\n div = 'div'\n}\n\nexport interface DividerProps extends React.HTMLProps<HTMLElement> {\n /** Additional classes added to the divider */\n className?: string;\n /** The component type to use */\n component?: 'hr' | 'li' | 'div';\n /** @deprecated Use `orientation` instead. Flag to indicate the divider is vertical (must be in a flex layout) */\n isVertical?: boolean;\n /** Insets at various breakpoints. */\n inset?: {\n default?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n sm?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n md?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n lg?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n xl?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n '2xl'?: 'insetNone' | 'insetXs' | 'insetSm' | 'insetMd' | 'insetLg' | 'insetXl' | 'inset2xl' | 'inset3xl';\n };\n /** Indicates how the divider will display at various breakpoints. Vertical divider must be in a flex layout. */\n orientation?: {\n default?: 'vertical' | 'horizontal';\n sm?: 'vertical' | 'horizontal';\n md?: 'vertical' | 'horizontal';\n lg?: 'vertical' | 'horizontal';\n xl?: 'vertical' | 'horizontal';\n '2xl'?: 'vertical' | 'horizontal';\n };\n}\n\nexport const Divider: React.FunctionComponent<DividerProps> = ({\n className,\n component = DividerVariant.hr,\n isVertical = false,\n inset,\n orientation,\n ...props\n}: DividerProps) => {\n const Component: any = component;\n\n return (\n <Component\n className={css(\n styles.divider,\n isVertical && styles.modifiers.vertical,\n formatBreakpointMods(inset, styles),\n formatBreakpointMods(orientation, styles),\n className\n )}\n {...(component !== 'hr' && { role: 'separator' })}\n {...props}\n />\n );\n};\nDivider.displayName = 'Divider';\n","import './divider.css';\nexport default {\n \"divider\": \"pf-c-divider\",\n \"modifiers\": {\n \"hidden\": \"pf-m-hidden\",\n \"hiddenOnSm\": \"pf-m-hidden-on-sm\",\n \"visibleOnSm\": \"pf-m-visible-on-sm\",\n \"hiddenOnMd\": \"pf-m-hidden-on-md\",\n \"visibleOnMd\": \"pf-m-visible-on-md\",\n \"hiddenOnLg\": \"pf-m-hidden-on-lg\",\n \"visibleOnLg\": \"pf-m-visible-on-lg\",\n \"hiddenOnXl\": \"pf-m-hidden-on-xl\",\n \"visibleOnXl\": \"pf-m-visible-on-xl\",\n \"hiddenOn_2xl\": \"pf-m-hidden-on-2xl\",\n \"visibleOn_2xl\": \"pf-m-visible-on-2xl\",\n \"vertical\": \"pf-m-vertical\",\n \"insetNone\": \"pf-m-inset-none\",\n \"insetXs\": \"pf-m-inset-xs\",\n \"insetSm\": \"pf-m-inset-sm\",\n \"insetMd\": \"pf-m-inset-md\",\n \"insetLg\": \"pf-m-inset-lg\",\n \"insetXl\": \"pf-m-inset-xl\",\n \"inset_2xl\": \"pf-m-inset-2xl\",\n \"inset_3xl\": \"pf-m-inset-3xl\",\n \"horizontalOnSm\": \"pf-m-horizontal-on-sm\",\n \"verticalOnSm\": \"pf-m-vertical-on-sm\",\n \"insetNoneOnSm\": \"pf-m-inset-none-on-sm\",\n \"insetXsOnSm\": \"pf-m-inset-xs-on-sm\",\n \"insetSmOnSm\": \"pf-m-inset-sm-on-sm\",\n \"insetMdOnSm\": \"pf-m-inset-md-on-sm\",\n \"insetLgOnSm\": \"pf-m-inset-lg-on-sm\",\n \"insetXlOnSm\": \"pf-m-inset-xl-on-sm\",\n \"inset_2xlOnSm\": \"pf-m-inset-2xl-on-sm\",\n \"inset_3xlOnSm\": \"pf-m-inset-3xl-on-sm\",\n \"horizontalOnMd\": \"pf-m-horizontal-on-md\",\n \"verticalOnMd\": \"pf-m-vertical-on-md\",\n \"insetNoneOnMd\": \"pf-m-inset-none-on-md\",\n \"insetXsOnMd\": \"pf-m-inset-xs-on-md\",\n \"insetSmOnMd\": \"pf-m-inset-sm-on-md\",\n \"insetMdOnMd\": \"pf-m-inset-md-on-md\",\n \"insetLgOnMd\": \"pf-m-inset-lg-on-md\",\n \"insetXlOnMd\": \"pf-m-inset-xl-on-md\",\n \"inset_2xlOnMd\": \"pf-m-inset-2xl-on-md\",\n \"inset_3xlOnMd\": \"pf-m-inset-3xl-on-md\",\n \"horizontalOnLg\": \"pf-m-horizontal-on-lg\",\n \"verticalOnLg\": \"pf-m-vertical-on-lg\",\n \"insetNoneOnLg\": \"pf-m-inset-none-on-lg\",\n \"insetXsOnLg\": \"pf-m-inset-xs-on-lg\",\n \"insetSmOnLg\": \"pf-m-inset-sm-on-lg\",\n \"insetMdOnLg\": \"pf-m-inset-md-on-lg\",\n \"insetLgOnLg\": \"pf-m-inset-lg-on-lg\",\n \"insetXlOnLg\": \"pf-m-inset-xl-on-lg\",\n \"inset_2xlOnLg\": \"pf-m-inset-2xl-on-lg\",\n \"inset_3xlOnLg\": \"pf-m-inset-3xl-on-lg\",\n \"horizontalOnXl\": \"pf-m-horizontal-on-xl\",\n \"verticalOnXl\": \"pf-m-vertical-on-xl\",\n \"insetNoneOnXl\": \"pf-m-inset-none-on-xl\",\n \"insetXsOnXl\": \"pf-m-inset-xs-on-xl\",\n \"insetSmOnXl\": \"pf-m-inset-sm-on-xl\",\n \"insetMdOnXl\": \"pf-m-inset-md-on-xl\",\n \"insetLgOnXl\": \"pf-m-inset-lg-on-xl\",\n \"insetXlOnXl\": \"pf-m-inset-xl-on-xl\",\n \"inset_2xlOnXl\": \"pf-m-inset-2xl-on-xl\",\n \"inset_3xlOnXl\": \"pf-m-inset-3xl-on-xl\",\n \"horizontalOn_2xl\": \"pf-m-horizontal-on-2xl\",\n \"verticalOn_2xl\": \"pf-m-vertical-on-2xl\",\n \"insetNoneOn_2xl\": \"pf-m-inset-none-on-2xl\",\n \"insetXsOn_2xl\": \"pf-m-inset-xs-on-2xl\",\n \"insetSmOn_2xl\": \"pf-m-inset-sm-on-2xl\",\n \"insetMdOn_2xl\": \"pf-m-inset-md-on-2xl\",\n \"insetLgOn_2xl\": \"pf-m-inset-lg-on-2xl\",\n \"insetXlOn_2xl\": \"pf-m-inset-xl-on-2xl\",\n \"inset_2xlOn_2xl\": \"pf-m-inset-2xl-on-2xl\",\n \"inset_3xlOn_2xl\": \"pf-m-inset-3xl-on-2xl\"\n }\n};","import * as React from 'react';\nimport styles from '@patternfly/react-styles/css/components/Toolbar/toolbar';\nimport { css } from '@patternfly/react-styles';\n\nimport { formatBreakpointMods, toCamel } from '../../helpers/util';\nimport { Divider } from '../Divider';\nimport { PageContext } from '../Page/PageContext';\n\nexport enum ToolbarItemVariant {\n separator = 'separator',\n 'bulk-select' = 'bulk-select',\n 'overflow-menu' = 'overflow-menu',\n pagination = 'pagination',\n 'search-filter' = 'search-filter',\n label = 'label',\n 'chip-group' = 'chip-group',\n 'expand-all' = 'expand-all'\n}\n\nexport interface ToolbarItemProps extends React.HTMLProps<HTMLDivElement> {\n /** Classes applied to root element of the data toolbar item */\n className?: string;\n /** A type modifier which modifies spacing specifically depending on the type of item */\n variant?:\n | ToolbarItemVariant\n | 'bulk-select'\n | 'overflow-menu'\n | 'pagination'\n | 'search-filter'\n | 'label'\n | 'chip-group'\n | 'separator'\n | 'expand-all';\n /** Visibility at various breakpoints. */\n visibility?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** @deprecated prop misspelled */\n visiblity?: {\n default?: 'hidden' | 'visible';\n md?: 'hidden' | 'visible';\n lg?: 'hidden' | 'visible';\n xl?: 'hidden' | 'visible';\n '2xl'?: 'hidden' | 'visible';\n };\n /** Alignment at various breakpoints. */\n alignment?: {\n default?: 'alignRight' | 'alignLeft';\n md?: 'alignRight' | 'alignLeft';\n lg?: 'alignRight' | 'alignLeft';\n xl?: 'alignRight' | 'alignLeft';\n '2xl'?: 'alignRight' | 'alignLeft';\n };\n /** Spacers at various breakpoints. */\n spacer?: {\n default?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n md?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n lg?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n xl?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n '2xl'?: 'spacerNone' | 'spacerSm' | 'spacerMd' | 'spacerLg';\n };\n /** Widths at various breakpoints. */\n widths?: {\n default?: string;\n sm?: string;\n md?: string;\n lg?: string;\n xl?: string;\n '2xl'?: string;\n };\n /** id for this data toolbar item */\n id?: string;\n /** Flag indicating if the expand-all variant is expanded or not */\n isAllExpanded?: boolean;\n /** Content to be rendered inside the data toolbar item */\n children?: React.ReactNode;\n}\n\nexport const ToolbarItem: React.FunctionComponent<ToolbarItemProps> = ({\n className,\n variant,\n visibility,\n visiblity,\n alignment,\n spacer,\n widths,\n id,\n children,\n isAllExpanded,\n ...props\n}: ToolbarItemProps) => {\n if (variant === ToolbarItemVariant.separator) {\n return <Divider className={css(styles.modifiers.vertical, className)} {...props} />;\n }\n\n if (visiblity !== undefined) {\n // eslint-disable-next-line no-console\n console.warn(\n 'The ToolbarItem visiblity prop has been deprecated. ' +\n 'Please use the correctly spelled visibility prop instead.'\n );\n }\n\n const widthStyles: any = {};\n if (widths) {\n Object.entries(widths || {}).map(\n ([breakpoint, value]) =>\n (widthStyles[`--pf-c-toolbar__item--Width${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}`] = value)\n );\n }\n\n return (\n <PageContext.Consumer>\n {({ width, getBreakpoint }) => (\n <div\n className={css(\n styles.toolbarItem,\n variant &&\n styles.modifiers[\n toCamel(variant) as\n | 'bulkSelect'\n | 'overflowMenu'\n | 'pagination'\n | 'searchFilter'\n | 'label'\n | 'chipGroup'\n ],\n isAllExpanded && styles.modifiers.expanded,\n formatBreakpointMods(visibility || visiblity, styles, '', getBreakpoint(width)),\n formatBreakpointMods(alignment, styles, '', getBreakpoint(width)),\n formatBreakpointMods(spacer, styles, '', getBreakpoint(width)),\n className\n )}\n {...(variant === 'label' && { 'aria-hidden': true })}\n id={id}\n {...props}\n {...(widths && { style: { ...widthStyles, ...props.style } as React.CSSProperties })}\n >\n {children}\n </div>\n )}\n </PageContext.Consumer>\n );\n};\nToolbarItem.displayName = 'ToolbarItem';\n","import * as React from 'react';\nimport { RefObject } from 'react';\nimport globalBreakpointMd from '@patternfly/react-tokens/dist/esm/global_breakpoint_md';\nimport globalBreakpointLg from '@patternfly/react-tokens/dist/esm/global_breakpoint_lg';\nimport globalBreakpointXl from '@patternfly/react-tokens/dist/esm/global_breakpoint_xl';\nimport globalBreakpoint2xl from '@patternfly/react-tokens/dist/esm/global_breakpoint_2xl';\n\nexport interface ToolbarContextProps {\n isExpanded: boolean;\n toggleIsExpanded: () => void;\n chipGroupContentRef: RefObject<HTMLDivElement>;\n updateNumberFilters: (categoryName: string, numberOfFilters: number) => void;\n numberOfFilters: number;\n clearAllFilters?: () => void;\n clearFiltersButtonText?: string;\n showClearFiltersButton?: boolean;\n toolbarId?: string;\n customChipGroupContent?: React.ReactNode;\n}\n\nexport const ToolbarContext = React.createContext<ToolbarContextProps>({\n isExpanded: false,\n toggleIsExpanded: () => {},\n chipGroupContentRef: null,\n updateNumberFilters: () => {},\n numberOfFilters: 0,\n clearAllFilters: () => {}\n});\n\ninterface ToolbarContentContextProps {\n expandableContentRef: RefObject<HTMLDivElement>;\n expandableContentId: string;\n chipContainerRef: RefObject<any>;\n}\n\nexport const ToolbarContentContext = React.createContext<ToolbarContentContextProps>({\n expandableContentRef: null,\n expandableContentId: '',\n chipContainerRef: null\n});\n\nexport const globalBreakpoints = {\n md: parseInt(globalBreakpointMd.value),\n lg: parseInt(globalBreakpointLg.value),\n xl: parseInt(globalBreakpointXl.value),\n '2xl': parseInt(globalBreakpoint2xl.value)\n};\n","import { useMemo } from 'react';\n\ntype OuiaId = number | string;\n\n// https://ouia.readthedocs.io/en/latest/README.html#ouia-component\nexport interface OUIAProps {\n // If there is only one instance of the component on the page at once, it is OPTIONAL\n ouiaId?: OuiaId;\n // False if in animation\n ouiaSafe?: boolean;\n}\n\nlet uid = 0;\nconst ouiaPrefix = 'OUIA-Generated-';\nconst ouiaIdByRoute: any = {};\n\n/** Get props to conform to OUIA spec\n *\n * For functional components, use the useOUIAProps function instead\n *\n * In class based components, create a state variable ouiaStateId to create a static generated ID:\n * state = {\n * ouiaStateId: getDefaultOUIAId(Chip.displayName)\n * }\n * This generated ID should remain alive as long as the component is not unmounted.\n *\n * Then add the attributes to the component\n * {...getOUIAProps('OverflowChip', this.props.ouiaId !== undefined ? this.props.ouiaId : this.state.ouiaStateId)}\n *\n * @param {string} componentType OUIA component type\n * @param {number|string} id OUIA component id\n * @param {boolean} ouiaSafe false if in animation\n */\nexport function getOUIAProps(componentType: string, id: OuiaId, ouiaSafe: boolean = true) {\n return {\n 'data-ouia-component-type': `PF4/${componentType}`,\n 'data-ouia-safe': ouiaSafe,\n 'data-ouia-component-id': id\n };\n}\n\n/**\n * Hooks version of the getOUIAProps function that also memoizes the generated ID\n * Can only be used in functional components\n *\n * @param {string} componentType OUIA component type\n * @param {number|string} id OUIA component id\n * @param {boolean} ouiaSafe false if in animation\n * @param {string} variant Optional variant to add to the generated ID\n */\nexport const useOUIAProps = (componentType: string, id?: OuiaId, ouiaSafe: boolean = true, variant?: string) => ({\n 'data-ouia-component-type': `PF4/${componentType}`,\n 'data-ouia-safe': ouiaSafe,\n 'data-ouia-component-id': useOUIAId(componentType, id, variant)\n});\n\n/**\n * Returns the ID or the memoized generated ID\n *\n * @param {string} componentType OUIA component type\n * @param {number|string} id OUIA component id\n * @param {string} variant Optional variant to add to the generated ID\n */\nexport const useOUIAId = (componentType: string, id?: OuiaId, variant?: string) => {\n const defaultOUIAId = useMemo(() => getDefaultOUIAId(componentType, variant), [componentType, variant]);\n return id ?? defaultOUIAId;\n};\n\n/**\n * Returns a generated id based on the URL location\n *\n * @param {string} componentType OUIA component type\n * @param {string} variant Optional variant to add to the generated ID\n */\nexport function getDefaultOUIAId(componentType: string, variant?: string) {\n /*\n ouiaIdByRoute = {\n [route+componentType]: [number]\n }\n */\n try {\n let key;\n if (typeof window !== 'undefined') {\n // browser environments\n key = `${window.location.href}-${componentType}-${variant || ''}`;\n } else {\n // node/SSR environments\n key = `${componentType}-${variant || ''}`;\n }\n if (!ouiaIdByRoute[key]) {\n ouiaIdByRoute[key] = 0;\n }\n return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ''}${++ouiaIdByRoute[key]}`;\n } catch (exception) {\n return `${ouiaPrefix}${componentType}-${variant ? `${variant}-` : ''}${++uid}`;\n }\n}\n","export const global_breakpoint_sm = {\n \"name\": \"--pf-global--breakpoint--sm\",\n \"value\": \"576px\",\n \"var\": \"var(--pf-global--breakpoint--sm)\"\n};\nexport default global_breakpoint_sm;","import globalBreakpointSm from '@patternfly/react-tokens/dist/esm/global_breakpoint_sm';\nimport globalBreakpointMd from '@patternfly/react-tokens/dist/esm/global_breakpoint_md';\nimport globalBreakpointLg from '@patternfly/react-tokens/dist/esm/global_breakpoint_lg';\nimport globalBreakpointXl from '@patternfly/react-tokens/dist/esm/global_breakpoint_xl';\nimport globalBreakpoint2xl from '@patternfly/react-tokens/dist/esm/global_breakpoint_2xl';\n\nimport globalHeightBreakpointSm from '@patternfly/react-tokens/dist/esm/global_height_breakpoint_sm';\nimport globalHeightBreakpointMd from '@patternfly/react-tokens/dist/esm/global_height_breakpoint_md';\nimport globalHeightBreakpointLg from '@patternfly/react-tokens/dist/esm/global_height_breakpoint_lg';\nimport globalHeightBreakpointXl from '@patternfly/react-tokens/dist/esm/global_height_breakpoint_xl';\nimport globalHeightBreakpoint2xl from '@patternfly/react-tokens/dist/esm/global_height_breakpoint_2xl';\n\nexport const KEY_CODES = { ARROW_UP: 38, ARROW_DOWN: 40, ESCAPE_KEY: 27, TAB: 9, ENTER: 13, SPACE: 32 };\n\nexport const SIDE = { RIGHT: 'right', LEFT: 'left', BOTH: 'both', NONE: 'none' };\n\nexport const KEYHANDLER_DIRECTION = { UP: 'up', DOWN: 'down', RIGHT: 'right', LEFT: 'left' };\n\nexport enum ValidatedOptions {\n success = 'success',\n error = 'error',\n warning = 'warning',\n default = 'default'\n}\n\nexport const KeyTypes = {\n Tab: 'Tab',\n Space: ' ',\n Escape: 'Escape',\n Enter: 'Enter',\n ArrowUp: 'ArrowUp',\n ArrowDown: 'ArrowDown',\n ArrowLeft: 'ArrowLeft',\n ArrowRight: 'ArrowRight'\n};\n\nexport const globalWidthBreakpoints = {\n sm: parseInt(globalBreakpointSm.value),\n md: parseInt(globalBreakpointMd.value),\n lg: parseInt(globalBreakpointLg.value),\n xl: parseInt(globalBreakpointXl.value),\n '2xl': parseInt(globalBreakpoint2xl.value)\n};\n\nexport const globalHeightBreakpoints = {\n sm: parseInt(globalHeightBreakpointSm.value),\n md: parseInt(globalHeightBreakpointMd.value),\n lg: parseInt(globalHeightBreakpointLg.value),\n xl: parseInt(globalHeightBreakpointXl.value),\n '2xl': parseInt(globalHeightBreakpoint2xl.value)\n};\n","export const global_height_breakpoint_sm = {\n \"name\": \"--pf-global--height-breakpoint--sm\",\n \"value\": \"0\",\n \"var\": \"var(--pf-global--height-breakpoint--sm)\"\n};\nexport default global_height_breakpoint_sm;","export const global_height_breakpoint_md = {\n \"name\": \"--pf-global--height-breakpoint--md\",\n \"value\": \"40rem\",\n \"var\": \"var(--pf-global--height-breakpoint--md)\"\n};\nexport default global_height_breakpoint_md;","export const global_height_breakpoint_lg = {\n \"name\": \"--pf-global--height-breakpoint--lg\",\n \"value\": \"48rem\",\n \"var\": \"var(--pf-global--height-breakpoint--lg)\"\n};\nexport default global_height_breakpoint_lg;","export const global_height_breakpoint_xl = {\n \"name\": \"--pf-global--height-breakpoint--xl\",\n \"value\": \"60rem\",\n \"var\": \"var(--pf-global--height-breakpoint--xl)\"\n};\nexport default global_height_breakpoint_xl;","export const global_height_breakpoint_2xl = {\n \"name\": \"--pf-global--height-breakpoint--2xl\",\n \"value\": \"80rem\",\n \"var\": \"var(--pf-global--height-breakpoint--2xl)\"\n};\nexport default global_height_breakpoint_2xl;","import * as ReactDOM from 'react-dom';\nimport { globalWidthBreakpoints, globalHeightBreakpoints, SIDE } from './constants';\n\n/**\n * @param {string} input - String to capitalize first letter\n */\nexport function capitalize(input: string) {\n return input[0].toUpperCase() + input.substring(1);\n}\n\n/**\n * @param {string} prefix - String to prefix ID with\n */\nexport function getUniqueId(prefix = 'pf') {\n const uid =\n new Date().getTime() +\n Math.random()\n .toString(36)\n .slice(2);\n return `${prefix}-${uid}`;\n}\n\n/**\n * @param { any } this - \"This\" reference\n * @param { Function } func - Function to debounce\n * @param { number } wait - Debounce amount\n */\nexport function debounce(this: any, func: (...args: any[]) => any, wait: number) {\n let timeout: number;\n return (...args: any[]) => {\n clearTimeout(timeout);\n timeout = setTimeout(() => func.apply(this, args), wait) as any;\n };\n}\n\n/** This function returns whether or not an element is within the viewable area of a container. If partial is true,\n * then this function will return true even if only part of the element is in view.\n *\n * @param {HTMLElement} container The container to check if the element is in view of.\n * @param {HTMLElement} element The element to check if it is view\n * @param {boolean} partial true if partial view is allowed\n * @param {boolean} strict true if strict mode is set, never consider the container width and element width\n *\n * @returns { boolean } True if the component is in View.\n */\nexport function isElementInView(\n container: HTMLElement,\n element: HTMLElement,\n partial: boolean,\n strict: boolean = false\n): boolean {\n if (!container || !element) {\n return false;\n }\n const containerBounds = container.getBoundingClientRect();\n const elementBounds = element.getBoundingClientRect();\n const containerBoundsLeft = Math.ceil(containerBounds.left);\n const containerBoundsRight = Math.floor(containerBounds.right);\n const elementBoundsLeft = Math.ceil(elementBounds.left);\n const elementBoundsRight = Math.floor(elementBounds.right);\n\n // Check if in view\n const isTotallyInView = elementBoundsLeft >= containerBoundsLeft && elementBoundsRight <= containerBoundsRight;\n const isPartiallyInView =\n (partial || (!strict && containerBounds.width < elementBounds.width)) &&\n ((elementBoundsLeft < containerBoundsLeft && elementBoundsRight > containerBoundsLeft) ||\n (elementBoundsRight > containerBoundsRight && elementBoundsLeft < containerBoundsRight));\n\n // Return outcome\n return isTotallyInView || isPartiallyInView;\n}\n\n/** This function returns the side the element is out of view on (right, left or both)\n *\n * @param {HTMLElement} container The container to check if the element is in view of.\n * @param {HTMLElement} element The element to check if it is view\n *\n * @returns {string} right if the element is of the right, left if element is off the left or both if it is off on both sides.\n */\nexport function sideElementIsOutOfView(container: HTMLElement, element: HTMLElement): string {\n const containerBounds = container.getBoundingClientRect();\n const elementBounds = element.getBoundingClientRect();\n const containerBoundsLeft = Math.floor(containerBounds.left);\n const containerBoundsRight = Math.floor(containerBounds.right);\n const elementBoundsLeft = Math.floor(elementBounds.left);\n const elementBoundsRight = Math.floor(elementBounds.right);\n\n // Check if in view\n const isOffLeft = elementBoundsLeft < containerBoundsLeft;\n const isOffRight = elementBoundsRight > containerBoundsRight;\n\n let side = SIDE.NONE;\n\n if (isOffRight && isOffLeft) {\n side = SIDE.BOTH;\n } else if (isOffRight) {\n side = SIDE.RIGHT;\n } else if (isOffLeft) {\n side = SIDE.LEFT;\n }\n // Return outcome\n return side;\n}\n\n/** Interpolates a parameterized templateString using values from a templateVars object.\n * The templateVars object should have keys and values which match the templateString's parameters.\n * Example:\n * const templateString: 'My name is ${firstName} ${lastName}';\n * const templateVars: {\n * firstName: 'Jon'\n * lastName: 'Dough'\n * };\n * const result = fillTemplate(templateString, templateVars);\n * // \"My name is Jon Dough\"\n *\n * @param {string} templateString The string passed by the consumer\n * @param {object} templateVars The variables passed to the string\n *\n * @returns {string} The template string literal result\n */\nexport function fillTemplate(templateString: string, templateVars: any) {\n return templateString.replace(/\\${(.*?)}/g, (_, match) => templateVars[match] || '');\n}\n\n/**\n * This function allows for keyboard navigation through dropdowns. The custom argument is optional.\n *\n * @param {number} index The index of the element you're on\n * @param {number} innerIndex Inner index number\n * @param {string} position The orientation of the dropdown\n * @param {string[]} refsCollection Array of refs to the items in the dropdown\n * @param {object[]} kids Array of items in the dropdown\n * @param {boolean} [custom] Allows for handling of flexible content\n */\nexport function keyHandler(\n index: number,\n innerIndex: number,\n position: string,\n refsCollection: any[],\n kids: any[],\n custom = false\n) {\n if (!Array.isArray(kids)) {\n return;\n }\n const isMultiDimensional = refsCollection.filter(ref => ref)[0].constructor === Array;\n let nextIndex = index;\n let nextInnerIndex = innerIndex;\n if (position === 'up') {\n if (index === 0) {\n // loop back to end\n nextIndex = kids.length - 1;\n } else {\n nextIndex = index - 1;\n }\n } else if (position === 'down') {\n if (index === kids.length - 1) {\n // loop back to beginning\n nextIndex = 0;\n } else {\n nextIndex = index + 1;\n }\n } else if (position === 'left') {\n if (innerIndex === 0) {\n nextInnerIndex = refsCollection[index].length - 1;\n } else {\n nextInnerIndex = innerIndex - 1;\n }\n } else if (position === 'right') {\n if (innerIndex === refsCollection[index].length - 1) {\n nextInnerIndex = 0;\n } else {\n nextInnerIndex = innerIndex + 1;\n }\n }\n if (\n refsCollection[nextIndex] === null ||\n refsCollection[nextIndex] === undefined ||\n (isMultiDimensional &&\n (refsCollection[nextIndex][nextInnerIndex] === null || refsCollection[nextIndex][nextInnerIndex] === undefined))\n ) {\n keyHandler(nextIndex, nextInnerIndex, position, refsCollection, kids, custom);\n } else if (custom) {\n if (refsCollection[nextIndex].focus) {\n refsCollection[nextIndex].focus();\n }\n // eslint-disable-next-line react/no-find-dom-node\n const element = ReactDOM.findDOMNode(refsCollection[nextIndex]) as HTMLElement;\n element.focus();\n } else if (position !== 'tab') {\n if (isMultiDimensional) {\n refsCollection[nextIndex][nextInnerIndex].focus();\n } else {\n refsCollection[nextIndex].focus();\n }\n }\n}\n\n/** This function returns a list of tabbable items in a container\n *\n * @param {any} containerRef to the container\n * @param {string} tababbleSelectors CSS selector string of tabbable items\n */\nexport function findTabbableElements(containerRef: any, tababbleSelectors: string): any[] {\n const tabbable = containerRef.current.querySelectorAll(tababbleSelectors);\n const list = Array.prototype.filter.call(tabbable, function(item) {\n return item.tabIndex >= '0';\n });\n return list;\n}\n\n/** This function is a helper for keyboard navigation through dropdowns.\n *\n * @param {number} index The index of the element you're on\n * @param {string} position The orientation of the dropdown\n * @param {string[]} collection Array of refs to the items in the dropdown\n */\nexport function getNextIndex(index: number, position: string, collection: any[]): number {\n let nextIndex;\n if (position === 'up') {\n if (index === 0) {\n // loop back to end\n nextIndex = collection.length - 1;\n } else {\n nextIndex = index - 1;\n }\n } else if (index === collection.length - 1) {\n // loop back to beginning\n nextIndex = 0;\n } else {\n nextIndex = index + 1;\n }\n if (collection[nextIndex] === undefined || collection[nextIndex][0] === null) {\n return getNextIndex(nextIndex, position, collection);\n } else {\n return nextIndex;\n }\n}\n\n/** This function is a helper for pluralizing strings.\n *\n * @param {number} i The quantity of the string you want to pluralize\n * @param {string} singular The singular version of the string\n * @param {string} plural The change to the string that should occur if the quantity is not equal to 1.\n * Defaults to adding an 's'.\n */\nexport function pluralize(i: number, singular: string, plural?: string) {\n if (!plural) {\n plural = `${singular}s`;\n }\n return `${i || 0} ${i === 1 ? singular : plural}`;\n}\n\n/**\n * This function is a helper for turning arrays of breakpointMod objects for flex and grid into style object\n *\n * @param {object} mods The modifiers object\n * @param {string} css-variable The appropriate css variable for the component\n */\nexport const setBreakpointCssVars = (\n mods: {\n default?: string;\n sm?: string;\n md?: string;\n lg?: string;\n xl?: string;\n '2xl'?: string;\n '3xl'?: string;\n },\n cssVar: string\n): React.CSSProperties =>\n Object.entries(mods || {}).reduce(\n (acc, [breakpoint, value]) =>\n breakpoint === 'default' ? { ...acc, [cssVar]: value } : { ...acc, [`${cssVar}-on-${breakpoint}`]: value },\n {}\n );\n\nexport interface Mods {\n default?: string;\n sm?: string;\n md?: string;\n lg?: string;\n xl?: string;\n '2xl'?: string;\n '3xl'?: string;\n}\n\n/**\n * This function is a helper for turning arrays of breakpointMod objects for data toolbar and flex into classes\n *\n * @param {object} mods The modifiers object\n * @param {any} styles The appropriate styles object for the component\n */\nexport const formatBreakpointMods = (\n mods: Mods,\n styles: any,\n stylePrefix: string = '',\n breakpoint?: 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl',\n vertical?: boolean\n) => {\n if (!mods) {\n return '';\n }\n if (breakpoint && !vertical) {\n if (breakpoint in mods) {\n return styles.modifiers[toCamel(`${stylePrefix}${mods[breakpoint as keyof Mods]}`)];\n }\n // the current breakpoint is not specified in mods, so we try to find the next nearest\n const breakpointsOrder = ['2xl', 'xl', 'lg', 'md', 'sm', 'default'];\n const breakpointsIndex = breakpointsOrder.indexOf(breakpoint);\n for (let i = breakpointsIndex; i < breakpointsOrder.length; i++) {\n if (breakpointsOrder[i] in mods) {\n return styles.modifiers[toCamel(`${stylePrefix}${mods[breakpointsOrder[i] as keyof Mods]}`)];\n }\n }\n return '';\n }\n\n return Object.entries(mods || {})\n .map(\n ([breakpoint, mod]) =>\n `${stylePrefix}${mod}${breakpoint !== 'default' ? `-on-${breakpoint}` : ''}${\n vertical && breakpoint !== 'default' ? '-height' : ''\n }`\n )\n .map(toCamel)\n .map(mod => mod.replace(/-?(\\dxl)/gi, (_res, group) => `_${group}`))\n .map(modifierKey => styles.modifiers[modifierKey])\n .filter(Boolean)\n .join(' ');\n};\n\n/**\n * Return the breakpoint for the given height\n *\n * @param {number | null} height The height to check\n * @returns {'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'} The breakpoint\n */\nexport const getVerticalBreakpoint = (height: number): 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' => {\n if (height === null) {\n return null;\n }\n if (height >= globalHeightBreakpoints['2xl']) {\n return '2xl';\n }\n if (height >= globalHeightBreakpoints.xl) {\n return 'xl';\n }\n if (height >= globalHeightBreakpoints.lg) {\n return 'lg';\n }\n if (height >= globalHeightBreakpoints.md) {\n return 'md';\n }\n if (height >= globalHeightBreakpoints.sm) {\n return 'sm';\n }\n return 'default';\n};\n\n/**\n * Return the breakpoint for the given width\n *\n * @param {number | null} width The width to check\n * @returns {'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'} The breakpoint\n */\nexport const getBreakpoint = (width: number): 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' => {\n if (width === null) {\n return null;\n }\n if (width >= globalWidthBreakpoints['2xl']) {\n return '2xl';\n }\n if (width >= globalWidthBreakpoints.xl) {\n return 'xl';\n }\n if (width >= globalWidthBreakpoints.lg) {\n return 'lg';\n }\n if (width >= globalWidthBreakpoints.md) {\n return 'md';\n }\n if (width >= globalWidthBreakpoints.sm) {\n return 'sm';\n }\n return 'default';\n};\n\nconst camelize = (s: string) =>\n s\n .toUpperCase()\n .replace('-', '')\n .replace('_', '');\n/**\n *\n * @param {string} s string to make camelCased\n */\nexport const toCamel = (s: string) => s.replace(/([-_][a-z])/gi, camelize);\n\n/**\n * Copied from exenv\n */\nexport const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Calculate the width of the text\n * Example:\n * getTextWidth('my text', node)\n *\n * @param {string} text The text to calculate the width for\n * @param {HTMLElement} node The HTML element\n */\nexport const getTextWidth = (text: string, node: HTMLElement) => {\n const computedStyle = getComputedStyle(node);\n // Firefox returns the empty string for .font, so this function creates the .font property manually\n const getFontFromComputedStyle = () => {\n let computedFont = '';\n // Firefox uses percentages for font-stretch, but Canvas does not accept percentages\n // so convert to keywords, as listed at:\n // https://developer.mozilla.org/en-US/docs/Web/CSS/font-stretch\n const fontStretchLookupTable = {\n '50%': 'ultra-condensed',\n '62.5%': 'extra-condensed',\n '75%': 'condensed',\n '87.5%': 'semi-condensed',\n '100%': 'normal',\n '112.5%': 'semi-expanded',\n '125%': 'expanded',\n '150%': 'extra-expanded',\n '200%': 'ultra-expanded'\n };\n // If the retrieved font-stretch percentage isn't found in the lookup table, use\n // 'normal' as a last resort.\n let fontStretch;\n if (computedStyle.fontStretch in fontStretchLookupTable) {\n fontStretch = (fontStretchLookupTable as any)[computedStyle.fontStretch];\n } else {\n fontStretch = 'normal';\n }\n computedFont =\n computedStyle.fontStyle +\n ' ' +\n computedStyle.fontVariant +\n ' ' +\n computedStyle.fontWeight +\n ' ' +\n fontStretch +\n ' ' +\n computedStyle.fontSize +\n '/' +\n computedStyle.lineHeight +\n ' ' +\n computedStyle.fontFamily;\n return computedFont;\n };\n\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n context.font = computedStyle.font || getFontFromComputedStyle();\n\n return context.measureText(text).width;\n};\n\n/**\n * Get the inner dimensions of an element\n *\n * @param {HTMLElement} node HTML element to calculate the inner dimensions for\n */\nexport const innerDimensions = (node: HTMLElement) => {\n const computedStyle = getComputedStyle(node);\n\n let width = node.clientWidth; // width with padding\n let height = node.clientHeight; // height with padding\n\n height -= parseFloat(computedStyle.paddingTop) + parseFloat(computedStyle.paddingBottom);\n width -= parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);\n return { height, width };\n};\n\n/**\n * This function is a helper for truncating text content on the left, leaving the right side of the content in view\n *\n * @param {HTMLElement} node HTML element\n * @param {string} value The original text value\n */\nexport const trimLeft = (node: HTMLElement, value: string) => {\n const availableWidth = innerDimensions(node).width;\n let newValue = value;\n if (getTextWidth(value, node) > availableWidth) {\n // we have text overflow, trim the text to the left and add ... in the front until it fits\n while (getTextWidth(`...${newValue}`, node) > availableWidth) {\n newValue = newValue.substring(1);\n }\n // replace text with our truncated text\n if ((node as HTMLInputElement).value) {\n (node as HTMLInputElement).value = `...${newValue}`;\n } else {\n node.innerText = `...${newValue}`;\n }\n } else {\n if ((node as HTMLInputElement).value) {\n (node as HTMLInputElement).value = value;\n } else {\n node.innerText = value;\n }\n }\n};\n\n/**\n * @param {string[]} events - Operations to prevent when disabled\n */\nexport const preventedEvents = (events: string[]) =>\n events.reduce(\n (handlers, eventToPrevent) => ({\n ...handlers,\n [eventToPrevent]: (event: React.SyntheticEvent<HTMLElement>) => {\n event.preventDefault();\n }\n }),\n {}\n );\n","import * as React from 'react';\n\nexport enum IconSize {\n sm = 'sm',\n md = 'md',\n lg = 'lg',\n xl = 'xl'\n}\n\nexport const getSize = (size: IconSize | keyof typeof IconSize) => {\n switch (size) {\n case IconSize.sm:\n return '1em';\n case IconSize.md:\n return '1.5em';\n case IconSize.lg:\n return '2em';\n case IconSize.xl:\n return '3em';\n default:\n return '1em';\n }\n};\n\nexport interface IconDefinition {\n name?: string;\n width: number;\n height: number;\n svgPath: string;\n xOffset?: number;\n yOffset?: number;\n}\n\nexport interface SVGIconProps extends Omit<React.HTMLProps<SVGElement>, 'size' | 'ref'> {\n color?: string;\n size?: IconSize | keyof typeof IconSize;\n title?: string;\n noVerticalAlign?: boolean;\n}\n\nlet currentId = 0;\n\n/**\n * Factory to create Icon class components for consumers\n */\nexport function createIcon({\n name,\n xOffset = 0,\n yOffset = 0,\n width,\n height,\n svgPath\n}: IconDefinition): React.ComponentClass<SVGIconProps> {\n return class SVGIcon extends React.Component<SVGIconProps> {\n static displayName = name;\n static defaultProps = {\n color: 'currentColor',\n size: IconSize.sm,\n noVerticalAlign: false\n };\n\n id = `icon-title-${currentId++}`;\n\n render() {\n const { size, color, title, noVerticalAlign, ...props } = this.props;\n\n const hasTitle = Boolean(title);\n const heightWidth = getSize(size);\n const baseAlign = -0.125 * Number.parseFloat(heightWidth);\n const style = noVerticalAlign ? null : { verticalAlign: `${baseAlign}em` };\n const viewBox = [xOffset, yOffset, width, height].join(' ');\n\n return (\n <svg\n style={style}\n fill={color}\n height={heightWidth}\n width={heightWidth}\n viewBox={viewBox}\n aria-labelledby={hasTitle ? this.id : null}\n aria-hidden={hasTitle ? null : true}\n role=\"img\"\n {...(props as Omit<React.SVGProps<SVGElement>, 'ref'>)} // Lie.\n >\n {hasTitle && <title id={this.id}>{title}</title>}\n <path d={svgPath} />\n </svg>\n );\n }\n };\n}\n","/** Joins args into a className string\n *\n * @param {any} args list of objects, string, or arrays to reduce\n */\nexport function css(...args: any): string {\n // Adapted from https://github.com/JedWatson/classnames/blob/master/index.js\n const classes = [] as string[];\n const hasOwn = {}.hasOwnProperty;\n\n args.filter(Boolean).forEach((arg: any) => {\n const argType = typeof arg;\n\n if (argType === 'string' || argType === 'number') {\n classes.push(arg);\n } else if (Array.isArray(arg) && arg.length) {\n const inner = css(...(arg as any));\n if (inner) {\n classes.push(inner);\n }\n } else if (argType === 'object') {\n for (const key in arg) {\n if (hasOwn.call(arg, key) && arg[key]) {\n classes.push(key);\n }\n }\n }\n });\n\n return classes.join(' ');\n}\n","export const global_breakpoint_2xl = {\n \"name\": \"--pf-global--breakpoint--2xl\",\n \"value\": \"1450px\",\n \"var\": \"var(--pf-global--breakpoint--2xl)\"\n};\nexport default global_breakpoint_2xl;","export const global_breakpoint_lg = {\n \"name\": \"--pf-global--breakpoint--lg\",\n \"value\": \"992px\",\n \"var\": \"var(--pf-global--breakpoint--lg)\"\n};\nexport default global_breakpoint_lg;","export const global_breakpoint_md = {\n \"name\": \"--pf-global--breakpoint--md\",\n \"value\": \"768px\",\n \"var\": \"var(--pf-global--breakpoint--md)\"\n};\nexport default global_breakpoint_md;","export const global_breakpoint_xl = {\n \"name\": \"--pf-global--breakpoint--xl\",\n \"value\": \"1200px\",\n \"var\": \"var(--pf-global--breakpoint--xl)\"\n};\nexport default global_breakpoint_xl;","(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[\"CanvasAddon\"] = factory();\n\telse\n\t\troot[\"CanvasAddon\"] = factory();\n})(self, function() {\nreturn ","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { removeElementFromParent } from 'browser/Dom';\nimport { acquireTextureAtlas } from 'browser/renderer/shared/CharAtlasCache';\nimport { TEXT_BASELINE } from 'browser/renderer/shared/Constants';\nimport { tryDrawCustomChar } from 'browser/renderer/shared/CustomGlyphs';\nimport { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';\nimport { IRasterizedGlyph, IRenderDimensions, ISelectionRenderModel, ITextureAtlas } from 'browser/renderer/shared/Types';\nimport { createSelectionRenderModel } from 'browser/renderer/shared/SelectionRenderModel';\nimport { ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { ReadonlyColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { WHITESPACE_CELL_CODE } from 'common/buffer/Constants';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { ICellData, IDisposable } from 'common/Types';\nimport { Terminal } from 'xterm';\nimport { IRenderLayer } from './Types';\nimport { CellColorResolver } from 'browser/renderer/shared/CellColorResolver';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { isSafari } from 'common/Platform';\nimport { EventEmitter, forwardEvent } from 'common/EventEmitter';\n\nexport abstract class BaseRenderLayer extends Disposable implements IRenderLayer {\n private _canvas: HTMLCanvasElement;\n protected _ctx!: CanvasRenderingContext2D;\n private _deviceCharWidth: number = 0;\n private _deviceCharHeight: number = 0;\n private _deviceCellWidth: number = 0;\n private _deviceCellHeight: number = 0;\n private _deviceCharLeft: number = 0;\n private _deviceCharTop: number = 0;\n\n protected _selectionModel: ISelectionRenderModel = createSelectionRenderModel();\n private _cellColorResolver: CellColorResolver;\n private _bitmapGenerator: (BitmapGenerator | undefined)[] = [];\n\n protected _charAtlas!: ITextureAtlas;\n private _charAtlasDisposable?: IDisposable;\n\n public get canvas(): HTMLCanvasElement { return this._canvas; }\n public get cacheCanvas(): HTMLCanvasElement { return this._charAtlas?.pages[0].canvas!; }\n\n private readonly _onAddTextureAtlasCanvas = this.register(new EventEmitter<HTMLCanvasElement>());\n public readonly onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;\n\n constructor(\n private readonly _terminal: Terminal,\n private _container: HTMLElement,\n id: string,\n zIndex: number,\n private _alpha: boolean,\n protected readonly _themeService: IThemeService,\n protected readonly _bufferService: IBufferService,\n protected readonly _optionsService: IOptionsService,\n protected readonly _decorationService: IDecorationService,\n protected readonly _coreBrowserService: ICoreBrowserService\n ) {\n super();\n this._cellColorResolver = new CellColorResolver(this._terminal, this._selectionModel, this._decorationService, this._coreBrowserService, this._themeService);\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add(`xterm-${id}-layer`);\n this._canvas.style.zIndex = zIndex.toString();\n this._initCanvas();\n this._container.appendChild(this._canvas);\n this._refreshCharAtlas(this._themeService.colors);\n this.register(this._themeService.onChangeColors(e => {\n this._refreshCharAtlas(e);\n this.reset();\n }));\n\n this.register(toDisposable(() => {\n removeElementFromParent(this._canvas);\n this._charAtlas?.dispose();\n }));\n }\n\n private _initCanvas(): void {\n this._ctx = throwIfFalsy(this._canvas.getContext('2d', { alpha: this._alpha }));\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n }\n\n public handleBlur(): void {}\n public handleFocus(): void {}\n public handleCursorMove(): void {}\n public handleGridChanged(startRow: number, endRow: number): void {}\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._selectionModel.update(this._terminal, start, end, columnSelectMode);\n }\n\n protected _setTransparency(alpha: boolean): void {\n // Do nothing when alpha doesn't change\n if (alpha === this._alpha) {\n return;\n }\n\n // Create new canvas and replace old one\n const oldCanvas = this._canvas;\n this._alpha = alpha;\n // Cloning preserves properties\n this._canvas = this._canvas.cloneNode() as HTMLCanvasElement;\n this._initCanvas();\n this._container.replaceChild(this._canvas, oldCanvas);\n\n // Regenerate char atlas and force a full redraw\n this._refreshCharAtlas(this._themeService.colors);\n this.handleGridChanged(0, this._bufferService.rows - 1);\n }\n\n /**\n * Refreshes the char atlas, aquiring a new one if necessary.\n * @param colorSet The color set to use for the char atlas.\n */\n private _refreshCharAtlas(colorSet: ReadonlyColorSet): void {\n if (this._deviceCharWidth <= 0 && this._deviceCharHeight <= 0) {\n return;\n }\n this._charAtlasDisposable?.dispose();\n this._charAtlas = acquireTextureAtlas(this._terminal, this._optionsService.rawOptions, colorSet, this._deviceCellWidth, this._deviceCellHeight, this._deviceCharWidth, this._deviceCharHeight, this._coreBrowserService.dpr);\n this._charAtlasDisposable = forwardEvent(this._charAtlas.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas);\n this._charAtlas.warmUp();\n for (let i = 0; i < this._charAtlas.pages.length; i++) {\n this._bitmapGenerator[i] = new BitmapGenerator(this._charAtlas.pages[i].canvas);\n }\n }\n\n public resize(dim: IRenderDimensions): void {\n this._deviceCellWidth = dim.device.cell.width;\n this._deviceCellHeight = dim.device.cell.height;\n this._deviceCharWidth = dim.device.char.width;\n this._deviceCharHeight = dim.device.char.height;\n this._deviceCharLeft = dim.device.char.left;\n this._deviceCharTop = dim.device.char.top;\n this._canvas.width = dim.device.canvas.width;\n this._canvas.height = dim.device.canvas.height;\n this._canvas.style.width = `${dim.css.canvas.width}px`;\n this._canvas.style.height = `${dim.css.canvas.height}px`;\n\n // Draw the background if this is an opaque layer\n if (!this._alpha) {\n this._clearAll();\n }\n\n this._refreshCharAtlas(this._themeService.colors);\n }\n\n public abstract reset(): void;\n\n public clearTextureAtlas(): void {\n this._charAtlas?.clearTexture();\n }\n\n /**\n * Fills 1+ cells completely. This uses the existing fillStyle on the context.\n * @param x The column to start at.\n * @param y The row to start at\n * @param width The number of columns to fill.\n * @param height The number of rows to fill.\n */\n protected _fillCells(x: number, y: number, width: number, height: number): void {\n this._ctx.fillRect(\n x * this._deviceCellWidth,\n y * this._deviceCellHeight,\n width * this._deviceCellWidth,\n height * this._deviceCellHeight);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the middle of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillMiddleLineAtCells(x: number, y: number, width: number = 1): void {\n const cellOffset = Math.ceil(this._deviceCellHeight * 0.5);\n this._ctx.fillRect(\n x * this._deviceCellWidth,\n (y + 1) * this._deviceCellHeight - cellOffset - this._coreBrowserService.dpr,\n width * this._deviceCellWidth,\n this._coreBrowserService.dpr);\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the bottom of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillBottomLineAtCells(x: number, y: number, width: number = 1, pixelOffset: number = 0): void {\n this._ctx.fillRect(\n x * this._deviceCellWidth,\n (y + 1) * this._deviceCellHeight + pixelOffset - this._coreBrowserService.dpr - 1 /* Ensure it's drawn within the cell */,\n width * this._deviceCellWidth,\n this._coreBrowserService.dpr);\n }\n\n protected _curlyUnderlineAtCell(x: number, y: number, width: number = 1): void {\n this._ctx.save();\n this._ctx.beginPath();\n this._ctx.strokeStyle = this._ctx.fillStyle;\n const lineWidth = this._coreBrowserService.dpr;\n this._ctx.lineWidth = lineWidth;\n for (let xOffset = 0; xOffset < width; xOffset++) {\n const xLeft = (x + xOffset) * this._deviceCellWidth;\n const xMid = (x + xOffset + 0.5) * this._deviceCellWidth;\n const xRight = (x + xOffset + 1) * this._deviceCellWidth;\n const yMid = (y + 1) * this._deviceCellHeight - lineWidth - 1;\n const yMidBot = yMid - lineWidth;\n const yMidTop = yMid + lineWidth;\n this._ctx.moveTo(xLeft, yMid);\n this._ctx.bezierCurveTo(\n xLeft, yMidBot,\n xMid, yMidBot,\n xMid, yMid\n );\n this._ctx.bezierCurveTo(\n xMid, yMidTop,\n xRight, yMidTop,\n xRight, yMid\n );\n }\n this._ctx.stroke();\n this._ctx.restore();\n }\n\n protected _dottedUnderlineAtCell(x: number, y: number, width: number = 1): void {\n this._ctx.save();\n this._ctx.beginPath();\n this._ctx.strokeStyle = this._ctx.fillStyle;\n const lineWidth = this._coreBrowserService.dpr;\n this._ctx.lineWidth = lineWidth;\n this._ctx.setLineDash([lineWidth * 2, lineWidth]);\n const xLeft = x * this._deviceCellWidth;\n const yMid = (y + 1) * this._deviceCellHeight - lineWidth - 1;\n this._ctx.moveTo(xLeft, yMid);\n for (let xOffset = 0; xOffset < width; xOffset++) {\n // const xLeft = x * this._deviceCellWidth;\n const xRight = (x + width + xOffset) * this._deviceCellWidth;\n this._ctx.lineTo(xRight, yMid);\n }\n this._ctx.stroke();\n this._ctx.closePath();\n this._ctx.restore();\n }\n\n protected _dashedUnderlineAtCell(x: number, y: number, width: number = 1): void {\n this._ctx.save();\n this._ctx.beginPath();\n this._ctx.strokeStyle = this._ctx.fillStyle;\n const lineWidth = this._coreBrowserService.dpr;\n this._ctx.lineWidth = lineWidth;\n this._ctx.setLineDash([lineWidth * 4, lineWidth * 3]);\n const xLeft = x * this._deviceCellWidth;\n const xRight = (x + width) * this._deviceCellWidth;\n const yMid = (y + 1) * this._deviceCellHeight - lineWidth - 1;\n this._ctx.moveTo(xLeft, yMid);\n this._ctx.lineTo(xRight, yMid);\n this._ctx.stroke();\n this._ctx.closePath();\n this._ctx.restore();\n }\n\n /**\n * Fills a 1px line (2px on HDPI) at the left of the cell. This uses the\n * existing fillStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _fillLeftLineAtCell(x: number, y: number, width: number): void {\n this._ctx.fillRect(\n x * this._deviceCellWidth,\n y * this._deviceCellHeight,\n this._coreBrowserService.dpr * width,\n this._deviceCellHeight);\n }\n\n /**\n * Strokes a 1px rectangle (2px on HDPI) around a cell. This uses the existing\n * strokeStyle on the context.\n * @param x The column to fill.\n * @param y The row to fill.\n */\n protected _strokeRectAtCell(x: number, y: number, width: number, height: number): void {\n const lineWidth = this._coreBrowserService.dpr;\n this._ctx.lineWidth = lineWidth;\n this._ctx.strokeRect(\n x * this._deviceCellWidth + lineWidth / 2,\n y * this._deviceCellHeight + (lineWidth / 2),\n width * this._deviceCellWidth - lineWidth,\n (height * this._deviceCellHeight) - lineWidth);\n }\n\n /**\n * Clears the entire canvas.\n */\n protected _clearAll(): void {\n if (this._alpha) {\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n } else {\n this._ctx.fillStyle = this._themeService.colors.background.css;\n this._ctx.fillRect(0, 0, this._canvas.width, this._canvas.height);\n }\n }\n\n /**\n * Clears 1+ cells completely.\n * @param x The column to start at.\n * @param y The row to start at.\n * @param width The number of columns to clear.\n * @param height The number of rows to clear.\n */\n protected _clearCells(x: number, y: number, width: number, height: number): void {\n if (this._alpha) {\n this._ctx.clearRect(\n x * this._deviceCellWidth,\n y * this._deviceCellHeight,\n width * this._deviceCellWidth,\n height * this._deviceCellHeight);\n } else {\n this._ctx.fillStyle = this._themeService.colors.background.css;\n this._ctx.fillRect(\n x * this._deviceCellWidth,\n y * this._deviceCellHeight,\n width * this._deviceCellWidth,\n height * this._deviceCellHeight);\n }\n }\n\n /**\n * Draws a truecolor character at the cell. The character will be clipped to\n * ensure that it fits with the cell, including the cell to the right if it's\n * a wide character. This uses the existing fillStyle on the context.\n * @param cell The cell data for the character to draw.\n * @param x The column to draw at.\n * @param y The row to draw at.\n */\n protected _fillCharTrueColor(cell: CellData, x: number, y: number): void {\n this._ctx.font = this._getFont(false, false);\n this._ctx.textBaseline = TEXT_BASELINE;\n this._clipRow(y);\n\n // Draw custom characters if applicable\n let drawSuccess = false;\n if (this._optionsService.rawOptions.customGlyphs !== false) {\n drawSuccess = tryDrawCustomChar(this._ctx, cell.getChars(), x * this._deviceCellWidth, y * this._deviceCellHeight, this._deviceCellWidth, this._deviceCellHeight, this._optionsService.rawOptions.fontSize, this._coreBrowserService.dpr);\n }\n\n // Draw the character\n if (!drawSuccess) {\n this._ctx.fillText(\n cell.getChars(),\n x * this._deviceCellWidth + this._deviceCharLeft,\n y * this._deviceCellHeight + this._deviceCharTop + this._deviceCharHeight);\n }\n }\n\n /**\n * Draws one or more characters at a cell. If possible this will draw using\n * the character atlas to reduce draw time.\n */\n protected _drawChars(cell: ICellData, x: number, y: number): void {\n const chars = cell.getChars();\n this._cellColorResolver.resolve(cell, x, this._bufferService.buffer.ydisp + y);\n let glyph: IRasterizedGlyph;\n if (chars && chars.length > 1) {\n glyph = this._charAtlas.getRasterizedGlyphCombinedChar(chars, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext);\n } else {\n glyph = this._charAtlas.getRasterizedGlyph(cell.getCode() || WHITESPACE_CELL_CODE, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext);\n }\n if (!glyph.size.x || !glyph.size.y) {\n return;\n }\n this._ctx.save();\n this._clipRow(y);\n // Draw the image, use the bitmap if it's available\n if (this._charAtlas.pages[glyph.texturePage].version !== this._bitmapGenerator[glyph.texturePage]?.version) {\n if (!this._bitmapGenerator[glyph.texturePage]) {\n this._bitmapGenerator[glyph.texturePage] = new BitmapGenerator(this._charAtlas.pages[glyph.texturePage].canvas);\n }\n this._bitmapGenerator[glyph.texturePage]!.refresh();\n this._bitmapGenerator[glyph.texturePage]!.version = this._charAtlas.pages[glyph.texturePage].version;\n }\n this._ctx.drawImage(\n this._bitmapGenerator[glyph.texturePage]?.bitmap || this._charAtlas!.pages[glyph.texturePage].canvas,\n glyph.texturePosition.x,\n glyph.texturePosition.y,\n glyph.size.x,\n glyph.size.y,\n x * this._deviceCellWidth + this._deviceCharLeft - glyph.offset.x,\n y * this._deviceCellHeight + this._deviceCharTop - glyph.offset.y,\n glyph.size.x,\n glyph.size.y\n );\n this._ctx.restore();\n }\n\n /**\n * Clips a row to ensure no pixels will be drawn outside the cells in the row.\n * @param y The row to clip.\n */\n private _clipRow(y: number): void {\n this._ctx.beginPath();\n this._ctx.rect(\n 0,\n y * this._deviceCellHeight,\n this._bufferService.cols * this._deviceCellWidth,\n this._deviceCellHeight);\n this._ctx.clip();\n }\n\n /**\n * Gets the current font.\n * @param isBold If we should use the bold fontWeight.\n */\n protected _getFont(isBold: boolean, isItalic: boolean): string {\n const fontWeight = isBold ? this._optionsService.rawOptions.fontWeightBold : this._optionsService.rawOptions.fontWeight;\n const fontStyle = isItalic ? 'italic' : '';\n\n return `${fontStyle} ${fontWeight} ${this._optionsService.rawOptions.fontSize * this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`;\n }\n}\n\n/**\n * The number of milliseconds to wait before generating the ImageBitmap, this is to debounce/batch\n * the operation as window.createImageBitmap is asynchronous.\n */\nconst GLYPH_BITMAP_COMMIT_DELAY = 100;\n\nconst enum BitmapGeneratorState {\n IDLE = 0,\n GENERATING = 1,\n GENERATING_INVALID = 2\n}\n\nclass BitmapGenerator {\n private _state: BitmapGeneratorState = BitmapGeneratorState.IDLE;\n private _commitTimeout: number | undefined = undefined;\n private _bitmap: ImageBitmap | undefined = undefined;\n public get bitmap(): ImageBitmap | undefined { return this._bitmap; }\n public version: number = -1;\n\n constructor(private readonly _canvas: HTMLCanvasElement) {\n }\n\n public refresh(): void {\n // Clear the bitmap immediately as it's stale\n this._bitmap = undefined;\n // Disable ImageBitmaps on Safari because of https://bugs.webkit.org/show_bug.cgi?id=149990\n if (isSafari) {\n return;\n }\n if (this._commitTimeout === undefined) {\n this._commitTimeout = window.setTimeout(() => this._generate(), GLYPH_BITMAP_COMMIT_DELAY);\n }\n if (this._state === BitmapGeneratorState.GENERATING) {\n this._state = BitmapGeneratorState.GENERATING_INVALID;\n }\n }\n\n private _generate(): void {\n if (this._state === BitmapGeneratorState.IDLE) {\n this._bitmap = undefined;\n this._state = BitmapGeneratorState.GENERATING;\n window.createImageBitmap(this._canvas).then(bitmap => {\n if (this._state === BitmapGeneratorState.GENERATING_INVALID) {\n this.refresh();\n } else {\n this._bitmap = bitmap;\n }\n this._state = BitmapGeneratorState.IDLE;\n });\n if (this._commitTimeout) {\n this._commitTimeout = undefined;\n }\n }\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { removeTerminalFromCache } from 'browser/renderer/shared/CharAtlasCache';\nimport { observeDevicePixelDimensions } from 'browser/renderer/shared/DevicePixelObserver';\nimport { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';\nimport { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/shared/Types';\nimport { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { ILinkifier2 } from 'browser/Types';\nimport { EventEmitter, forwardEvent } from 'common/EventEmitter';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { Terminal } from 'xterm';\nimport { CursorRenderLayer } from './CursorRenderLayer';\nimport { LinkRenderLayer } from './LinkRenderLayer';\nimport { SelectionRenderLayer } from './SelectionRenderLayer';\nimport { TextRenderLayer } from './TextRenderLayer';\nimport { IRenderLayer } from './Types';\n\nexport class CanvasRenderer extends Disposable implements IRenderer {\n private _renderLayers: IRenderLayer[];\n private _devicePixelRatio: number;\n\n public dimensions: IRenderDimensions;\n\n private readonly _onRequestRedraw = this.register(new EventEmitter<IRequestRedrawEvent>());\n public readonly onRequestRedraw = this._onRequestRedraw.event;\n private readonly _onChangeTextureAtlas = this.register(new EventEmitter<HTMLCanvasElement>());\n public readonly onChangeTextureAtlas = this._onChangeTextureAtlas.event;\n private readonly _onAddTextureAtlasCanvas = this.register(new EventEmitter<HTMLCanvasElement>());\n public readonly onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;\n\n constructor(\n private readonly _terminal: Terminal,\n private readonly _screenElement: HTMLElement,\n linkifier2: ILinkifier2,\n private readonly _bufferService: IBufferService,\n private readonly _charSizeService: ICharSizeService,\n private readonly _optionsService: IOptionsService,\n characterJoinerService: ICharacterJoinerService,\n coreService: ICoreService,\n private readonly _coreBrowserService: ICoreBrowserService,\n decorationService: IDecorationService,\n private readonly _themeService: IThemeService\n ) {\n super();\n const allowTransparency = this._optionsService.rawOptions.allowTransparency;\n this._renderLayers = [\n new TextRenderLayer(this._terminal, this._screenElement, 0, allowTransparency, this._bufferService, this._optionsService, characterJoinerService, decorationService, this._coreBrowserService, _themeService),\n new SelectionRenderLayer(this._terminal, this._screenElement, 1, this._bufferService, this._coreBrowserService, decorationService, this._optionsService, _themeService),\n new LinkRenderLayer(this._terminal, this._screenElement, 2, linkifier2, this._bufferService, this._optionsService, decorationService, this._coreBrowserService, _themeService),\n new CursorRenderLayer(this._terminal, this._screenElement, 3, this._onRequestRedraw, this._bufferService, this._optionsService, coreService, this._coreBrowserService, decorationService, _themeService)\n ];\n for (const layer of this._renderLayers) {\n forwardEvent(layer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas);\n }\n this.dimensions = createRenderDimensions();\n this._devicePixelRatio = this._coreBrowserService.dpr;\n this._updateDimensions();\n\n this.register(observeDevicePixelDimensions(this._renderLayers[0].canvas, this._coreBrowserService.window, (w, h) => this._setCanvasDevicePixelDimensions(w, h)));\n this.register(toDisposable(() => {\n for (const l of this._renderLayers) {\n l.dispose();\n }\n removeTerminalFromCache(this._terminal);\n }));\n }\n\n public get textureAtlas(): HTMLCanvasElement | undefined {\n return this._renderLayers[0].cacheCanvas;\n }\n\n public handleDevicePixelRatioChange(): void {\n // If the device pixel ratio changed, the char atlas needs to be regenerated\n // and the terminal needs to refreshed\n if (this._devicePixelRatio !== this._coreBrowserService.dpr) {\n this._devicePixelRatio = this._coreBrowserService.dpr;\n this.handleResize(this._bufferService.cols, this._bufferService.rows);\n }\n }\n\n public handleResize(cols: number, rows: number): void {\n // Update character and canvas dimensions\n this._updateDimensions();\n\n // Resize all render layers\n for (const l of this._renderLayers) {\n l.resize(this.dimensions);\n }\n\n // Resize the screen\n this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`;\n this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;\n }\n\n public handleCharSizeChanged(): void {\n this.handleResize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public handleBlur(): void {\n this._runOperation(l => l.handleBlur());\n }\n\n public handleFocus(): void {\n this._runOperation(l => l.handleFocus());\n }\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this._runOperation(l => l.handleSelectionChanged(start, end, columnSelectMode));\n // Selection foreground requires a full re-render\n if (this._themeService.colors.selectionForeground) {\n this._onRequestRedraw.fire({ start: 0, end: this._bufferService.rows - 1 });\n }\n }\n\n public handleCursorMove(): void {\n this._runOperation(l => l.handleCursorMove());\n }\n\n public clear(): void {\n this._runOperation(l => l.reset());\n }\n\n private _runOperation(operation: (layer: IRenderLayer) => void): void {\n for (const l of this._renderLayers) {\n operation(l);\n }\n }\n\n /**\n * Performs the refresh loop callback, calling refresh only if a refresh is\n * necessary before queueing up the next one.\n */\n public renderRows(start: number, end: number): void {\n for (const l of this._renderLayers) {\n l.handleGridChanged(start, end);\n }\n }\n\n public clearTextureAtlas(): void {\n for (const layer of this._renderLayers) {\n layer.clearTextureAtlas();\n }\n }\n\n /**\n * Recalculates the character and canvas dimensions.\n */\n private _updateDimensions(): void {\n if (!this._charSizeService.hasValidSize) {\n return;\n }\n\n // See the WebGL renderer for an explanation of this section.\n const dpr = this._coreBrowserService.dpr;\n this.dimensions.device.char.width = Math.floor(this._charSizeService.width * dpr);\n this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * dpr);\n this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight);\n this.dimensions.device.char.top = this._optionsService.rawOptions.lineHeight === 1 ? 0 : Math.round((this.dimensions.device.cell.height - this.dimensions.device.char.height) / 2);\n this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing);\n this.dimensions.device.char.left = Math.floor(this._optionsService.rawOptions.letterSpacing / 2);\n this.dimensions.device.canvas.height = this._bufferService.rows * this.dimensions.device.cell.height;\n this.dimensions.device.canvas.width = this._bufferService.cols * this.dimensions.device.cell.width;\n this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / dpr);\n this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / dpr);\n this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;\n this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols;\n }\n\n private _setCanvasDevicePixelDimensions(width: number, height: number): void {\n this.dimensions.device.canvas.height = height;\n this.dimensions.device.canvas.width = width;\n // Resize all render layers\n for (const l of this._renderLayers) {\n l.resize(this.dimensions);\n }\n this._requestRedrawViewport();\n }\n\n private _requestRedrawViewport(): void {\n this._onRequestRedraw.fire({ start: 0, end: this._bufferService.rows - 1 });\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/shared/Types';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { ICellData } from 'common/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService, IDecorationService } from 'common/services/Services';\nimport { IEventEmitter } from 'common/EventEmitter';\nimport { ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { Terminal } from 'xterm';\nimport { toDisposable } from 'common/Lifecycle';\n\ninterface ICursorState {\n x: number;\n y: number;\n isFocused: boolean;\n style: string;\n width: number;\n}\n\n/**\n * The time between cursor blinks.\n */\nconst BLINK_INTERVAL = 600;\n\nexport class CursorRenderLayer extends BaseRenderLayer {\n private _state: ICursorState;\n private _cursorRenderers: {[key: string]: (x: number, y: number, cell: ICellData) => void};\n private _cursorBlinkStateManager: CursorBlinkStateManager | undefined;\n private _cell: ICellData = new CellData();\n\n constructor(\n terminal: Terminal,\n container: HTMLElement,\n zIndex: number,\n private readonly _onRequestRedraw: IEventEmitter<IRequestRedrawEvent>,\n bufferService: IBufferService,\n optionsService: IOptionsService,\n private readonly _coreService: ICoreService,\n coreBrowserService: ICoreBrowserService,\n decorationService: IDecorationService,\n themeService: IThemeService\n ) {\n super(terminal, container, 'cursor', zIndex, true, themeService, bufferService, optionsService, decorationService, coreBrowserService);\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n this._cursorRenderers = {\n 'bar': this._renderBarCursor.bind(this),\n 'block': this._renderBlockCursor.bind(this),\n 'underline': this._renderUnderlineCursor.bind(this)\n };\n this.register(optionsService.onOptionChange(() => this._handleOptionsChanged()));\n this.register(toDisposable(() => {\n this._cursorBlinkStateManager?.dispose();\n this._cursorBlinkStateManager = undefined;\n }));\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n\n public reset(): void {\n this._clearCursor();\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n this._handleOptionsChanged();\n }\n\n public handleBlur(): void {\n this._cursorBlinkStateManager?.pause();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public handleFocus(): void {\n this._cursorBlinkStateManager?.resume();\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n private _handleOptionsChanged(): void {\n if (this._optionsService.rawOptions.cursorBlink) {\n if (!this._cursorBlinkStateManager) {\n this._cursorBlinkStateManager = new CursorBlinkStateManager(this._coreBrowserService.isFocused, () => {\n this._render(true);\n }, this._coreBrowserService);\n }\n } else {\n this._cursorBlinkStateManager?.dispose();\n this._cursorBlinkStateManager = undefined;\n }\n // Request a refresh from the terminal as management of rendering is being\n // moved back to the terminal\n this._onRequestRedraw.fire({ start: this._bufferService.buffer.y, end: this._bufferService.buffer.y });\n }\n\n public handleCursorMove(): void {\n this._cursorBlinkStateManager?.restartBlinkAnimation();\n }\n\n public handleGridChanged(startRow: number, endRow: number): void {\n if (!this._cursorBlinkStateManager || this._cursorBlinkStateManager.isPaused) {\n this._render(false);\n } else {\n this._cursorBlinkStateManager.restartBlinkAnimation();\n }\n }\n\n private _render(triggeredByAnimationFrame: boolean): void {\n // Don't draw the cursor if it's hidden\n if (!this._coreService.isCursorInitialized || this._coreService.isCursorHidden) {\n this._clearCursor();\n return;\n }\n\n const cursorY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const viewportRelativeCursorY = cursorY - this._bufferService.buffer.ydisp;\n\n // Don't draw the cursor if it's off-screen\n if (viewportRelativeCursorY < 0 || viewportRelativeCursorY >= this._bufferService.rows) {\n this._clearCursor();\n return;\n }\n\n // in case cursor.x == cols adjust visual cursor to cols - 1\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n this._bufferService.buffer.lines.get(cursorY)!.loadCell(cursorX, this._cell);\n if (this._cell.content === undefined) {\n return;\n }\n\n if (!this._coreBrowserService.isFocused) {\n this._clearCursor();\n this._ctx.save();\n this._ctx.fillStyle = this._themeService.colors.cursor.css;\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n if (cursorStyle && cursorStyle !== 'block') {\n this._cursorRenderers[cursorStyle](cursorX, viewportRelativeCursorY, this._cell);\n } else {\n this._renderBlurCursor(cursorX, viewportRelativeCursorY, this._cell);\n }\n this._ctx.restore();\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = cursorStyle;\n this._state.width = this._cell.getWidth();\n return;\n }\n\n // Don't draw the cursor if it's blinking\n if (this._cursorBlinkStateManager && !this._cursorBlinkStateManager.isCursorVisible) {\n this._clearCursor();\n return;\n }\n\n if (this._state) {\n // The cursor is already in the correct spot, don't redraw\n if (this._state.x === cursorX &&\n this._state.y === viewportRelativeCursorY &&\n this._state.isFocused === this._coreBrowserService.isFocused &&\n this._state.style === this._optionsService.rawOptions.cursorStyle &&\n this._state.width === this._cell.getWidth()) {\n return;\n }\n this._clearCursor();\n }\n\n this._ctx.save();\n this._cursorRenderers[this._optionsService.rawOptions.cursorStyle || 'block'](cursorX, viewportRelativeCursorY, this._cell);\n this._ctx.restore();\n\n this._state.x = cursorX;\n this._state.y = viewportRelativeCursorY;\n this._state.isFocused = false;\n this._state.style = this._optionsService.rawOptions.cursorStyle;\n this._state.width = this._cell.getWidth();\n }\n\n private _clearCursor(): void {\n if (this._state) {\n // Avoid potential rounding errors when device pixel ratio is less than 1\n if (this._coreBrowserService.dpr < 1) {\n this._clearAll();\n } else {\n this._clearCells(this._state.x, this._state.y, this._state.width, 1);\n }\n this._state = {\n x: 0,\n y: 0,\n isFocused: false,\n style: '',\n width: 0\n };\n }\n }\n\n private _renderBarCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._themeService.colors.cursor.css;\n this._fillLeftLineAtCell(x, y, this._optionsService.rawOptions.cursorWidth);\n this._ctx.restore();\n }\n\n private _renderBlockCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._themeService.colors.cursor.css;\n this._fillCells(x, y, cell.getWidth(), 1);\n this._ctx.fillStyle = this._themeService.colors.cursorAccent.css;\n this._fillCharTrueColor(cell, x, y);\n this._ctx.restore();\n }\n\n private _renderUnderlineCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.fillStyle = this._themeService.colors.cursor.css;\n this._fillBottomLineAtCells(x, y);\n this._ctx.restore();\n }\n\n private _renderBlurCursor(x: number, y: number, cell: ICellData): void {\n this._ctx.save();\n this._ctx.strokeStyle = this._themeService.colors.cursor.css;\n this._strokeRectAtCell(x, y, cell.getWidth(), 1);\n this._ctx.restore();\n }\n}\n\nclass CursorBlinkStateManager {\n public isCursorVisible: boolean;\n\n private _animationFrame: number | undefined;\n private _blinkStartTimeout: number | undefined;\n private _blinkInterval: number | undefined;\n\n /**\n * The time at which the animation frame was restarted, this is used on the\n * next render to restart the timers so they don't need to restart the timers\n * multiple times over a short period.\n */\n private _animationTimeRestarted: number | undefined;\n\n constructor(\n isFocused: boolean,\n private _renderCallback: () => void,\n private _coreBrowserService: ICoreBrowserService\n ) {\n this.isCursorVisible = true;\n if (isFocused) {\n this._restartInterval();\n }\n }\n\n public get isPaused(): boolean { return !(this._blinkStartTimeout || this._blinkInterval); }\n\n public dispose(): void {\n if (this._blinkInterval) {\n this._coreBrowserService.window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public restartBlinkAnimation(): void {\n if (this.isPaused) {\n return;\n }\n // Save a timestamp so that the restart can be done on the next interval\n this._animationTimeRestarted = Date.now();\n // Force a cursor render to ensure it's visible and in the correct position\n this.isCursorVisible = true;\n if (!this._animationFrame) {\n this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }\n }\n\n private _restartInterval(timeToStart: number = BLINK_INTERVAL): void {\n // Clear any existing interval\n if (this._blinkInterval) {\n this._coreBrowserService.window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n\n // Setup the initial timeout which will hide the cursor, this is done before\n // the regular interval is setup in order to support restarting the blink\n // animation in a lightweight way (without thrashing clearInterval and\n // setInterval).\n this._blinkStartTimeout = this._coreBrowserService.window.setTimeout(() => {\n // Check if another animation restart was requested while this was being\n // started\n if (this._animationTimeRestarted) {\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n if (time > 0) {\n this._restartInterval(time);\n return;\n }\n }\n\n // Hide the cursor\n this.isCursorVisible = false;\n this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n\n // Setup the blink interval\n this._blinkInterval = this._coreBrowserService.window.setInterval(() => {\n // Adjust the animation time if it was restarted\n if (this._animationTimeRestarted) {\n // calc time diff\n // Make restart interval do a setTimeout initially?\n const time = BLINK_INTERVAL - (Date.now() - this._animationTimeRestarted);\n this._animationTimeRestarted = undefined;\n this._restartInterval(time);\n return;\n }\n\n // Invert visibility and render\n this.isCursorVisible = !this.isCursorVisible;\n this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {\n this._renderCallback();\n this._animationFrame = undefined;\n });\n }, BLINK_INTERVAL);\n }, timeToStart);\n }\n\n public pause(): void {\n this.isCursorVisible = true;\n if (this._blinkInterval) {\n this._coreBrowserService.window.clearInterval(this._blinkInterval);\n this._blinkInterval = undefined;\n }\n if (this._blinkStartTimeout) {\n this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout);\n this._blinkStartTimeout = undefined;\n }\n if (this._animationFrame) {\n this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public resume(): void {\n // Clear out any existing timers just in case\n this.pause();\n\n this._animationTimeRestarted = undefined;\n this._restartInterval();\n this.restartBlinkAnimation();\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport class GridCache<T> {\n public cache: (T | undefined)[][];\n\n public constructor() {\n this.cache = [];\n }\n\n public resize(width: number, height: number): void {\n for (let x = 0; x < width; x++) {\n if (this.cache.length <= x) {\n this.cache.push([]);\n }\n for (let y = this.cache[x].length; y < height; y++) {\n this.cache[x].push(undefined);\n }\n this.cache[x].length = height;\n }\n this.cache.length = width;\n }\n\n public clear(): void {\n for (let x = 0; x < this.cache.length; x++) {\n for (let y = 0; y < this.cache[x].length; y++) {\n this.cache[x][y] = undefined;\n }\n }\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/shared/Types';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants';\nimport { ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { IColorSet, ILinkifierEvent, ILinkifier2, ReadonlyColorSet } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { is256Color } from 'browser/renderer/shared/CharAtlasUtils';\nimport { Terminal } from 'xterm';\n\nexport class LinkRenderLayer extends BaseRenderLayer {\n private _state: ILinkifierEvent | undefined;\n\n constructor(\n terminal: Terminal,\n container: HTMLElement,\n zIndex: number,\n linkifier2: ILinkifier2,\n bufferService: IBufferService,\n optionsService: IOptionsService,\n decorationService: IDecorationService,\n coreBrowserService: ICoreBrowserService,\n themeService: IThemeService\n ) {\n super(terminal, container, 'link', zIndex, true, themeService, bufferService, optionsService, decorationService, coreBrowserService);\n\n this.register(linkifier2.onShowLinkUnderline(e => this._handleShowLinkUnderline(e)));\n this.register(linkifier2.onHideLinkUnderline(e => this._handleHideLinkUnderline(e)));\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state = undefined;\n }\n\n public reset(): void {\n this._clearCurrentLink();\n }\n\n private _clearCurrentLink(): void {\n if (this._state) {\n this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);\n const middleRowCount = this._state.y2 - this._state.y1 - 1;\n if (middleRowCount > 0) {\n this._clearCells(0, this._state.y1 + 1, this._state.cols, middleRowCount);\n }\n this._clearCells(0, this._state.y2, this._state.x2, 1);\n this._state = undefined;\n }\n }\n\n private _handleShowLinkUnderline(e: ILinkifierEvent): void {\n if (e.fg === INVERTED_DEFAULT_COLOR) {\n this._ctx.fillStyle = this._themeService.colors.background.css;\n } else if (e.fg && is256Color(e.fg)) {\n // 256 color support\n this._ctx.fillStyle = this._themeService.colors.ansi[e.fg].css;\n } else {\n this._ctx.fillStyle = this._themeService.colors.foreground.css;\n }\n\n if (e.y1 === e.y2) {\n // Single line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);\n } else {\n // Multi-line link\n this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);\n for (let y = e.y1 + 1; y < e.y2; y++) {\n this._fillBottomLineAtCells(0, y, e.cols);\n }\n this._fillBottomLineAtCells(0, e.y2, e.x2);\n }\n this._state = e;\n }\n\n private _handleHideLinkUnderline(e: ILinkifierEvent): void {\n this._clearCurrentLink();\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/shared/Types';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { Terminal } from 'xterm';\n\ninterface ISelectionState {\n start?: [number, number];\n end?: [number, number];\n columnSelectMode?: boolean;\n ydisp?: number;\n}\n\nexport class SelectionRenderLayer extends BaseRenderLayer {\n private _state!: ISelectionState;\n\n constructor(\n terminal: Terminal,\n container: HTMLElement,\n zIndex: number,\n bufferService: IBufferService,\n coreBrowserService: ICoreBrowserService,\n decorationService: IDecorationService,\n optionsService: IOptionsService,\n themeService: IThemeService\n ) {\n super(terminal, container, 'selection', zIndex, true, themeService, bufferService, optionsService, decorationService, coreBrowserService);\n this._clearState();\n }\n\n private _clearState(): void {\n this._state = {\n start: undefined,\n end: undefined,\n columnSelectMode: undefined,\n ydisp: undefined\n };\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n // On resize use the base render layer's cached selection values since resize clears _state\n // inside reset.\n if (this._selectionModel.selectionStart && this._selectionModel.selectionEnd) {\n this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);\n }\n }\n\n public reset(): void {\n if (this._state.start && this._state.end) {\n this._clearState();\n this._clearAll();\n }\n }\n\n public handleBlur(): void {\n this.reset();\n this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);\n }\n\n public handleFocus(): void {\n this.reset();\n this._redrawSelection(this._selectionModel.selectionStart, this._selectionModel.selectionEnd, this._selectionModel.columnSelectMode);\n }\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n super.handleSelectionChanged(start, end, columnSelectMode);\n this._redrawSelection(start, end, columnSelectMode);\n }\n\n private _redrawSelection(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n // Selection has not changed\n if (!this._didStateChange(start, end, columnSelectMode, this._bufferService.buffer.ydisp)) {\n return;\n }\n\n // Remove all selections\n this._clearAll();\n\n // Selection does not exist\n if (!start || !end) {\n this._clearState();\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n this._state.ydisp = this._bufferService.buffer.ydisp;\n return;\n }\n\n this._ctx.fillStyle = (this._coreBrowserService.isFocused\n ? this._themeService.colors.selectionBackgroundTransparent\n : this._themeService.colors.selectionInactiveBackgroundTransparent).css;\n\n if (columnSelectMode) {\n const startCol = start[0];\n const width = end[0] - startCol;\n const height = viewportCappedEndRow - viewportCappedStartRow + 1;\n this._fillCells(startCol, viewportCappedStartRow, width, height);\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const startRowEndCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(startCol, viewportCappedStartRow, startRowEndCol - startCol, 1);\n\n // Draw middle rows\n const middleRowsCount = Math.max(viewportCappedEndRow - viewportCappedStartRow - 1, 0);\n this._fillCells(0, viewportCappedStartRow + 1, this._bufferService.cols, middleRowsCount);\n\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewportStartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n this._fillCells(0, viewportCappedEndRow, endCol, 1);\n }\n }\n\n // Save state for next render\n this._state.start = [start[0], start[1]];\n this._state.end = [end[0], end[1]];\n this._state.columnSelectMode = columnSelectMode;\n this._state.ydisp = this._bufferService.buffer.ydisp;\n }\n\n private _didStateChange(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean, ydisp: number): boolean {\n return !this._areCoordinatesEqual(start, this._state.start) ||\n !this._areCoordinatesEqual(end, this._state.end) ||\n columnSelectMode !== this._state.columnSelectMode ||\n ydisp !== this._state.ydisp;\n }\n\n private _areCoordinatesEqual(coord1: [number, number] | undefined, coord2: [number, number] | undefined): boolean {\n if (!coord1 || !coord2) {\n return false;\n }\n\n return coord1[0] === coord2[0] && coord1[1] === coord2[1];\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDimensions } from 'browser/renderer/shared/Types';\nimport { CharData, ICellData } from 'common/Types';\nimport { GridCache } from './GridCache';\nimport { BaseRenderLayer } from './BaseRenderLayer';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { NULL_CELL_CODE, Content, UnderlineStyle } from 'common/buffer/Constants';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharacterJoinerService, ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\nimport { color, css } from 'common/Color';\nimport { Terminal } from 'xterm';\n\n/**\n * This CharData looks like a null character, which will forc a clear and render\n * when the character changes (a regular space ' ' character may not as it's\n * drawn state is a cleared cell).\n */\n// const OVERLAP_OWNED_CHAR_DATA: CharData = [null, '', 0, -1];\n\nexport class TextRenderLayer extends BaseRenderLayer {\n private _state: GridCache<CharData>;\n private _characterWidth: number = 0;\n private _characterFont: string = '';\n private _characterOverlapCache: { [key: string]: boolean } = {};\n private _workCell = new CellData();\n\n constructor(\n terminal: Terminal,\n container: HTMLElement,\n zIndex: number,\n alpha: boolean,\n bufferService: IBufferService,\n optionsService: IOptionsService,\n private readonly _characterJoinerService: ICharacterJoinerService,\n decorationService: IDecorationService,\n coreBrowserService: ICoreBrowserService,\n themeService: IThemeService\n ) {\n super(terminal, container, 'text', zIndex, alpha, themeService, bufferService, optionsService, decorationService, coreBrowserService);\n this._state = new GridCache<CharData>();\n this.register(optionsService.onSpecificOptionChange('allowTransparency', value => this._setTransparency(value)));\n }\n\n public resize(dim: IRenderDimensions): void {\n super.resize(dim);\n\n // Clear the character width cache if the font or width has changed\n const terminalFont = this._getFont(false, false);\n if (this._characterWidth !== dim.device.char.width || this._characterFont !== terminalFont) {\n this._characterWidth = dim.device.char.width;\n this._characterFont = terminalFont;\n this._characterOverlapCache = {};\n }\n // Resizing the canvas discards the contents of the canvas so clear state\n this._state.clear();\n this._state.resize(this._bufferService.cols, this._bufferService.rows);\n }\n\n public reset(): void {\n this._state.clear();\n this._clearAll();\n }\n\n private _forEachCell(\n firstRow: number,\n lastRow: number,\n callback: (\n cell: ICellData,\n x: number,\n y: number\n ) => void\n ): void {\n for (let y = firstRow; y <= lastRow; y++) {\n const row = y + this._bufferService.buffer.ydisp;\n const line = this._bufferService.buffer.lines.get(row);\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n for (let x = 0; x < this._bufferService.cols; x++) {\n line!.loadCell(x, this._workCell);\n let cell = this._workCell;\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // The character to the left is a wide character, drawing is owned by\n // the char at x-1\n if (cell.getWidth() === 0) {\n continue;\n }\n\n // exit early for NULL and SP\n const code = cell.getCode();\n if (code === 0 || code === 32) {\n continue;\n }\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n line!.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n }\n\n // If the character is an overlapping char and the character to the\n // right is a space, take ownership of the cell to the right. We skip\n // this check for joined characters because their rendering likely won't\n // yield the same result as rendering the last character individually.\n if (!isJoined && this._isOverlapping(cell)) {\n // If the character is overlapping, we want to force a re-render on every\n // frame. This is specifically to work around the case where two\n // overlaping chars `a` and `b` are adjacent, the cursor is moved to b and a\n // space is added. Without this, the first half of `b` would never\n // get removed, and `a` would not re-render because it thinks it's\n // already in the correct state.\n // this._state.cache[x][y] = OVERLAP_OWNED_CHAR_DATA;\n if (lastCharX < line!.length - 1 && line!.getCodePoint(lastCharX + 1) === NULL_CELL_CODE) {\n // patch width to 2\n cell.content &= ~Content.WIDTH_MASK;\n cell.content |= 2 << Content.WIDTH_SHIFT;\n // this._clearChar(x + 1, y);\n // The overlapping char's char data will force a clear and render when the\n // overlapping char is no longer to the left of the character and also when\n // the space changes to another character.\n // this._state.cache[x + 1][y] = OVERLAP_OWNED_CHAR_DATA;\n }\n }\n\n callback(\n cell,\n x,\n y\n );\n\n x = lastCharX;\n }\n }\n }\n\n /**\n * Draws the background for a specified range of columns. Tries to batch adjacent cells of the\n * same color together to reduce draw calls.\n */\n private _drawBackground(firstRow: number, lastRow: number): void {\n const ctx = this._ctx;\n const cols = this._bufferService.cols;\n let startX: number = 0;\n let startY: number = 0;\n let prevFillStyle: string | null = null;\n\n ctx.save();\n\n this._forEachCell(firstRow, lastRow, (cell, x, y) => {\n // libvte and xterm both draw the background (but not foreground) of invisible characters,\n // so we should too.\n let nextFillStyle = null; // null represents default background color\n\n if (cell.isInverse()) {\n if (cell.isFgDefault()) {\n nextFillStyle = this._themeService.colors.foreground.css;\n } else if (cell.isFgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getFgColor()).join(',')})`;\n } else {\n nextFillStyle = this._themeService.colors.ansi[cell.getFgColor()].css;\n }\n } else if (cell.isBgRGB()) {\n nextFillStyle = `rgb(${AttributeData.toColorRGB(cell.getBgColor()).join(',')})`;\n } else if (cell.isBgPalette()) {\n nextFillStyle = this._themeService.colors.ansi[cell.getBgColor()].css;\n }\n\n // Apply dim to the background, this is relatively slow as the CSS is re-parsed but dim is\n // rarely used\n if (nextFillStyle && cell.isDim()) {\n nextFillStyle = color.multiplyOpacity(css.toColor(nextFillStyle), 0.5).css;\n }\n\n // Get any decoration foreground/background overrides, this must be fetched before the early\n // exist but applied after inverse\n let isTop = false;\n this._decorationService.forEachDecorationAtCell(x, this._bufferService.buffer.ydisp + y, undefined, d => {\n if (d.options.layer !== 'top' && isTop) {\n return;\n }\n if (d.backgroundColorRGB) {\n nextFillStyle = d.backgroundColorRGB.css;\n }\n isTop = d.options.layer === 'top';\n });\n\n if (prevFillStyle === null) {\n // This is either the first iteration, or the default background was set. Either way, we\n // don't need to draw anything.\n startX = x;\n startY = y;\n }\n\n if (y !== startY) {\n // our row changed, draw the previous row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, cols - startX, 1);\n startX = x;\n startY = y;\n } else if (prevFillStyle !== nextFillStyle) {\n // our color changed, draw the previous characters in this row\n ctx.fillStyle = prevFillStyle || '';\n this._fillCells(startX, startY, x - startX, 1);\n startX = x;\n startY = y;\n }\n\n prevFillStyle = nextFillStyle;\n });\n\n // flush the last color we encountered\n if (prevFillStyle !== null) {\n ctx.fillStyle = prevFillStyle;\n this._fillCells(startX, startY, cols - startX, 1);\n }\n\n ctx.restore();\n }\n\n private _drawForeground(firstRow: number, lastRow: number): void {\n this._forEachCell(firstRow, lastRow, (cell, x, y) => this._drawChars(cell, x, y));\n }\n\n public handleGridChanged(firstRow: number, lastRow: number): void {\n // Resize has not been called yet\n if (this._state.cache.length === 0) {\n return;\n }\n\n if (this._charAtlas) {\n this._charAtlas.beginFrame();\n }\n\n this._clearCells(0, firstRow, this._bufferService.cols, lastRow - firstRow + 1);\n this._drawBackground(firstRow, lastRow);\n this._drawForeground(firstRow, lastRow);\n }\n\n /**\n * Whether a character is overlapping to the next cell.\n */\n private _isOverlapping(cell: ICellData): boolean {\n // Only single cell characters can be overlapping, rendering issues can\n // occur without this check\n if (cell.getWidth() !== 1) {\n return false;\n }\n\n // We assume that any ascii character will not overlap\n if (cell.getCode() < 256) {\n return false;\n }\n\n const chars = cell.getChars();\n\n // Deliver from cache if available\n if (this._characterOverlapCache.hasOwnProperty(chars)) {\n return this._characterOverlapCache[chars];\n }\n\n // Setup the font\n this._ctx.save();\n this._ctx.font = this._characterFont;\n\n // Measure the width of the character, but Math.floor it\n // because that is what the renderer does when it calculates\n // the character dimensions we are comparing against\n const overlaps = Math.floor(this._ctx.measureText(chars).width) > this._characterWidth;\n\n // Restore the original context\n this._ctx.restore();\n\n // Cache and return\n this._characterOverlapCache[chars] = overlaps;\n return overlaps;\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {\n for (const e of elements) {\n e?.parentElement?.removeChild(e);\n }\n}\n","import { ISelectionRenderModel } from 'browser/renderer/shared/Types';\nimport { ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { Attributes, BgFlags, FgFlags } from 'common/buffer/Constants';\nimport { IDecorationService } from 'common/services/Services';\nimport { ICellData } from 'common/Types';\nimport { Terminal } from 'xterm';\n\n// Work variables to avoid garbage collection\nlet $fg = 0;\nlet $bg = 0;\nlet $hasFg = false;\nlet $hasBg = false;\nlet $isSelected = false;\nlet $colors: ReadonlyColorSet | undefined;\n\nexport class CellColorResolver {\n /**\n * The shared result of the {@link resolve} call. This is only safe to use immediately after as\n * any other calls will share object.\n */\n public readonly result: { fg: number, bg: number, ext: number } = {\n fg: 0,\n bg: 0,\n ext: 0\n };\n\n constructor(\n private readonly _terminal: Terminal,\n private readonly _selectionRenderModel: ISelectionRenderModel,\n private readonly _decorationService: IDecorationService,\n private readonly _coreBrowserService: ICoreBrowserService,\n private readonly _themeService: IThemeService\n ) {\n }\n\n /**\n * Resolves colors for the cell, putting the result into the shared {@link result}. This resolves\n * overrides, inverse and selection for the cell which can then be used to feed into the renderer.\n */\n public resolve(cell: ICellData, x: number, y: number): void {\n this.result.bg = cell.bg;\n this.result.fg = cell.fg;\n this.result.ext = cell.bg & BgFlags.HAS_EXTENDED ? cell.extended.ext : 0;\n // Get any foreground/background overrides, this happens on the model to avoid spreading\n // override logic throughout the different sub-renderers\n\n // Reset overrides work variables\n $bg = 0;\n $fg = 0;\n $hasBg = false;\n $hasFg = false;\n $isSelected = false;\n $colors = this._themeService.colors;\n\n // Apply decorations on the bottom layer\n this._decorationService.forEachDecorationAtCell(x, y, 'bottom', d => {\n if (d.backgroundColorRGB) {\n $bg = d.backgroundColorRGB.rgba >> 8 & 0xFFFFFF;\n $hasBg = true;\n }\n if (d.foregroundColorRGB) {\n $fg = d.foregroundColorRGB.rgba >> 8 & 0xFFFFFF;\n $hasFg = true;\n }\n });\n\n // Apply the selection color if needed\n $isSelected = this._selectionRenderModel.isCellSelected(this._terminal, x, y);\n if ($isSelected) {\n $bg = (this._coreBrowserService.isFocused ? $colors.selectionBackgroundOpaque : $colors.selectionInactiveBackgroundOpaque).rgba >> 8 & 0xFFFFFF;\n $hasBg = true;\n if ($colors.selectionForeground) {\n $fg = $colors.selectionForeground.rgba >> 8 & 0xFFFFFF;\n $hasFg = true;\n }\n }\n\n // Apply decorations on the top layer\n this._decorationService.forEachDecorationAtCell(x, y, 'top', d => {\n if (d.backgroundColorRGB) {\n $bg = d.backgroundColorRGB.rgba >> 8 & 0xFFFFFF;\n $hasBg = true;\n }\n if (d.foregroundColorRGB) {\n $fg = d.foregroundColorRGB.rgba >> 8 & 0xFFFFFF;\n $hasFg = true;\n }\n });\n\n // Convert any overrides from rgba to the fg/bg packed format. This resolves the inverse flag\n // ahead of time in order to use the correct cache key\n if ($hasBg) {\n if ($isSelected) {\n // Non-RGB attributes from model + force non-dim + override + force RGB color mode\n $bg = (cell.bg & ~Attributes.RGB_MASK & ~BgFlags.DIM) | $bg | Attributes.CM_RGB;\n } else {\n // Non-RGB attributes from model + override + force RGB color mode\n $bg = (cell.bg & ~Attributes.RGB_MASK) | $bg | Attributes.CM_RGB;\n }\n }\n if ($hasFg) {\n // Non-RGB attributes from model + force disable inverse + override + force RGB color mode\n $fg = (cell.fg & ~Attributes.RGB_MASK & ~FgFlags.INVERSE) | $fg | Attributes.CM_RGB;\n }\n\n // Handle case where inverse was specified by only one of bg override or fg override was set,\n // resolving the other inverse color and setting the inverse flag if needed.\n if (this.result.fg & FgFlags.INVERSE) {\n if ($hasBg && !$hasFg) {\n // Resolve bg color type (default color has a different meaning in fg vs bg)\n if ((this.result.bg & Attributes.CM_MASK) === Attributes.CM_DEFAULT) {\n $fg = (this.result.fg & ~(Attributes.RGB_MASK | FgFlags.INVERSE | Attributes.CM_MASK)) | (($colors.background.rgba >> 8 & 0xFFFFFF) & Attributes.RGB_MASK) | Attributes.CM_RGB;\n } else {\n $fg = (this.result.fg & ~(Attributes.RGB_MASK | FgFlags.INVERSE | Attributes.CM_MASK)) | this.result.bg & (Attributes.RGB_MASK | Attributes.CM_MASK);\n }\n $hasFg = true;\n }\n if (!$hasBg && $hasFg) {\n // Resolve bg color type (default color has a different meaning in fg vs bg)\n if ((this.result.fg & Attributes.CM_MASK) === Attributes.CM_DEFAULT) {\n $bg = (this.result.bg & ~(Attributes.RGB_MASK | Attributes.CM_MASK)) | (($colors.foreground.rgba >> 8 & 0xFFFFFF) & Attributes.RGB_MASK) | Attributes.CM_RGB;\n } else {\n $bg = (this.result.bg & ~(Attributes.RGB_MASK | Attributes.CM_MASK)) | this.result.fg & (Attributes.RGB_MASK | Attributes.CM_MASK);\n }\n $hasBg = true;\n }\n }\n\n // Release object\n $colors = undefined;\n\n // Use the override if it exists\n this.result.bg = $hasBg ? $bg : this.result.bg;\n this.result.fg = $hasFg ? $fg : this.result.fg;\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { TextureAtlas } from 'browser/renderer/shared/TextureAtlas';\nimport { ITerminalOptions, Terminal } from 'xterm';\nimport { ITerminal, ReadonlyColorSet } from 'browser/Types';\nimport { ICharAtlasConfig, ITextureAtlas } from 'browser/renderer/shared/Types';\nimport { generateConfig, configEquals } from 'browser/renderer/shared/CharAtlasUtils';\n\ninterface ITextureAtlasCacheEntry {\n atlas: ITextureAtlas;\n config: ICharAtlasConfig;\n // N.B. This implementation potentially holds onto copies of the terminal forever, so\n // this may cause memory leaks.\n ownedBy: Terminal[];\n}\n\nconst charAtlasCache: ITextureAtlasCacheEntry[] = [];\n\n/**\n * Acquires a char atlas, either generating a new one or returning an existing\n * one that is in use by another terminal.\n */\nexport function acquireTextureAtlas(\n terminal: Terminal,\n options: Required<ITerminalOptions>,\n colors: ReadonlyColorSet,\n deviceCellWidth: number,\n deviceCellHeight: number,\n deviceCharWidth: number,\n deviceCharHeight: number,\n devicePixelRatio: number\n): ITextureAtlas {\n const newConfig = generateConfig(deviceCellWidth, deviceCellHeight, deviceCharWidth, deviceCharHeight, options, colors, devicePixelRatio);\n\n // Check to see if the terminal already owns this config\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n const ownedByIndex = entry.ownedBy.indexOf(terminal);\n if (ownedByIndex >= 0) {\n if (configEquals(entry.config, newConfig)) {\n return entry.atlas;\n }\n // The configs differ, release the terminal from the entry\n if (entry.ownedBy.length === 1) {\n entry.atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n entry.ownedBy.splice(ownedByIndex, 1);\n }\n break;\n }\n }\n\n // Try match a char atlas from the cache\n for (let i = 0; i < charAtlasCache.length; i++) {\n const entry = charAtlasCache[i];\n if (configEquals(entry.config, newConfig)) {\n // Add the terminal to the cache entry and return\n entry.ownedBy.push(terminal);\n return entry.atlas;\n }\n }\n\n const core: ITerminal = (terminal as any)._core;\n const newEntry: ITextureAtlasCacheEntry = {\n atlas: new TextureAtlas(document, newConfig, core.unicodeService),\n config: newConfig,\n ownedBy: [terminal]\n };\n charAtlasCache.push(newEntry);\n return newEntry.atlas;\n}\n\n/**\n * Removes a terminal reference from the cache, allowing its memory to be freed.\n * @param terminal The terminal to remove.\n */\nexport function removeTerminalFromCache(terminal: Terminal): void {\n for (let i = 0; i < charAtlasCache.length; i++) {\n const index = charAtlasCache[i].ownedBy.indexOf(terminal);\n if (index !== -1) {\n if (charAtlasCache[i].ownedBy.length === 1) {\n // Remove the cache entry if it's the only terminal\n charAtlasCache[i].atlas.dispose();\n charAtlasCache.splice(i, 1);\n } else {\n // Remove the reference from the cache entry\n charAtlasCache[i].ownedBy.splice(index, 1);\n }\n break;\n }\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharAtlasConfig } from './Types';\nimport { Attributes } from 'common/buffer/Constants';\nimport { ITerminalOptions } from 'xterm';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { NULL_COLOR } from 'common/Color';\n\nexport function generateConfig(deviceCellWidth: number, deviceCellHeight: number, deviceCharWidth: number, deviceCharHeight: number, options: Required<ITerminalOptions>, colors: ReadonlyColorSet, devicePixelRatio: number): ICharAtlasConfig {\n // null out some fields that don't matter\n const clonedColors: IColorSet = {\n foreground: colors.foreground,\n background: colors.background,\n cursor: NULL_COLOR,\n cursorAccent: NULL_COLOR,\n selectionForeground: NULL_COLOR,\n selectionBackgroundTransparent: NULL_COLOR,\n selectionBackgroundOpaque: NULL_COLOR,\n selectionInactiveBackgroundTransparent: NULL_COLOR,\n selectionInactiveBackgroundOpaque: NULL_COLOR,\n // For the static char atlas, we only use the first 16 colors, but we need all 256 for the\n // dynamic character atlas.\n ansi: colors.ansi.slice(),\n contrastCache: colors.contrastCache\n };\n return {\n customGlyphs: options.customGlyphs,\n devicePixelRatio,\n letterSpacing: options.letterSpacing,\n lineHeight: options.lineHeight,\n deviceCellWidth: deviceCellWidth,\n deviceCellHeight: deviceCellHeight,\n deviceCharWidth: deviceCharWidth,\n deviceCharHeight: deviceCharHeight,\n fontFamily: options.fontFamily,\n fontSize: options.fontSize,\n fontWeight: options.fontWeight,\n fontWeightBold: options.fontWeightBold,\n allowTransparency: options.allowTransparency,\n drawBoldTextInBrightColors: options.drawBoldTextInBrightColors,\n minimumContrastRatio: options.minimumContrastRatio,\n colors: clonedColors\n };\n}\n\nexport function configEquals(a: ICharAtlasConfig, b: ICharAtlasConfig): boolean {\n for (let i = 0; i < a.colors.ansi.length; i++) {\n if (a.colors.ansi[i].rgba !== b.colors.ansi[i].rgba) {\n return false;\n }\n }\n return a.devicePixelRatio === b.devicePixelRatio &&\n a.customGlyphs === b.customGlyphs &&\n a.lineHeight === b.lineHeight &&\n a.letterSpacing === b.letterSpacing &&\n a.fontFamily === b.fontFamily &&\n a.fontSize === b.fontSize &&\n a.fontWeight === b.fontWeight &&\n a.fontWeightBold === b.fontWeightBold &&\n a.allowTransparency === b.allowTransparency &&\n a.deviceCharWidth === b.deviceCharWidth &&\n a.deviceCharHeight === b.deviceCharHeight &&\n a.drawBoldTextInBrightColors === b.drawBoldTextInBrightColors &&\n a.minimumContrastRatio === b.minimumContrastRatio &&\n a.colors.foreground.rgba === b.colors.foreground.rgba &&\n a.colors.background.rgba === b.colors.background.rgba;\n}\n\nexport function is256Color(colorCode: number): boolean {\n return (colorCode & Attributes.CM_MASK) === Attributes.CM_P16 || (colorCode & Attributes.CM_MASK) === Attributes.CM_P256;\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isFirefox, isLegacyEdge } from 'common/Platform';\n\nexport const INVERTED_DEFAULT_COLOR = 257;\n\nexport const DIM_OPACITY = 0.5;\n// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge would\n// result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly\n// unaligned Powerline fonts (PR 3356#issuecomment-850928179).\nexport const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { throwIfFalsy } from 'browser/renderer/shared/RendererUtils';\n\ninterface IBlockVector {\n x: number;\n y: number;\n w: number;\n h: number;\n}\n\nexport const blockElementDefinitions: { [index: string]: IBlockVector[] | undefined } = {\n // Block elements (0x2580-0x2590)\n '▀': [{ x: 0, y: 0, w: 8, h: 4 }], // UPPER HALF BLOCK\n '▁': [{ x: 0, y: 7, w: 8, h: 1 }], // LOWER ONE EIGHTH BLOCK\n '▂': [{ x: 0, y: 6, w: 8, h: 2 }], // LOWER ONE QUARTER BLOCK\n '▃': [{ x: 0, y: 5, w: 8, h: 3 }], // LOWER THREE EIGHTHS BLOCK\n '▄': [{ x: 0, y: 4, w: 8, h: 4 }], // LOWER HALF BLOCK\n '▅': [{ x: 0, y: 3, w: 8, h: 5 }], // LOWER FIVE EIGHTHS BLOCK\n '▆': [{ x: 0, y: 2, w: 8, h: 6 }], // LOWER THREE QUARTERS BLOCK\n '▇': [{ x: 0, y: 1, w: 8, h: 7 }], // LOWER SEVEN EIGHTHS BLOCK\n '█': [{ x: 0, y: 0, w: 8, h: 8 }], // FULL BLOCK\n '▉': [{ x: 0, y: 0, w: 7, h: 8 }], // LEFT SEVEN EIGHTHS BLOCK\n '▊': [{ x: 0, y: 0, w: 6, h: 8 }], // LEFT THREE QUARTERS BLOCK\n '▋': [{ x: 0, y: 0, w: 5, h: 8 }], // LEFT FIVE EIGHTHS BLOCK\n '▌': [{ x: 0, y: 0, w: 4, h: 8 }], // LEFT HALF BLOCK\n '▍': [{ x: 0, y: 0, w: 3, h: 8 }], // LEFT THREE EIGHTHS BLOCK\n '▎': [{ x: 0, y: 0, w: 2, h: 8 }], // LEFT ONE QUARTER BLOCK\n '▏': [{ x: 0, y: 0, w: 1, h: 8 }], // LEFT ONE EIGHTH BLOCK\n '▐': [{ x: 4, y: 0, w: 4, h: 8 }], // RIGHT HALF BLOCK\n\n // Block elements (0x2594-0x2595)\n '▔': [{ x: 0, y: 0, w: 8, h: 1 }], // UPPER ONE EIGHTH BLOCK\n '▕': [{ x: 7, y: 0, w: 1, h: 8 }], // RIGHT ONE EIGHTH BLOCK\n\n // Terminal graphic characters (0x2596-0x259F)\n '▖': [{ x: 0, y: 4, w: 4, h: 4 }], // QUADRANT LOWER LEFT\n '▗': [{ x: 4, y: 4, w: 4, h: 4 }], // QUADRANT LOWER RIGHT\n '▘': [{ x: 0, y: 0, w: 4, h: 4 }], // QUADRANT UPPER LEFT\n '▙': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER LEFT AND LOWER LEFT AND LOWER RIGHT\n '▚': [{ x: 0, y: 0, w: 4, h: 4 }, { x: 4, y: 4, w: 4, h: 4 }], // QUADRANT UPPER LEFT AND LOWER RIGHT\n '▛': [{ x: 0, y: 0, w: 4, h: 8 }, { x: 4, y: 0, w: 4, h: 4 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER LEFT\n '▜': [{ x: 0, y: 0, w: 8, h: 4 }, { x: 4, y: 0, w: 4, h: 8 }], // QUADRANT UPPER LEFT AND UPPER RIGHT AND LOWER RIGHT\n '▝': [{ x: 4, y: 0, w: 4, h: 4 }], // QUADRANT UPPER RIGHT\n '▞': [{ x: 4, y: 0, w: 4, h: 4 }, { x: 0, y: 4, w: 4, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT\n '▟': [{ x: 4, y: 0, w: 4, h: 8 }, { x: 0, y: 4, w: 8, h: 4 }], // QUADRANT UPPER RIGHT AND LOWER LEFT AND LOWER RIGHT\n\n // VERTICAL ONE EIGHTH BLOCK-2 through VERTICAL ONE EIGHTH BLOCK-7\n '\\u{1FB70}': [{ x: 1, y: 0, w: 1, h: 8 }],\n '\\u{1FB71}': [{ x: 2, y: 0, w: 1, h: 8 }],\n '\\u{1FB72}': [{ x: 3, y: 0, w: 1, h: 8 }],\n '\\u{1FB73}': [{ x: 4, y: 0, w: 1, h: 8 }],\n '\\u{1FB74}': [{ x: 5, y: 0, w: 1, h: 8 }],\n '\\u{1FB75}': [{ x: 6, y: 0, w: 1, h: 8 }],\n\n // HORIZONTAL ONE EIGHTH BLOCK-2 through HORIZONTAL ONE EIGHTH BLOCK-7\n '\\u{1FB76}': [{ x: 0, y: 1, w: 8, h: 1 }],\n '\\u{1FB77}': [{ x: 0, y: 2, w: 8, h: 1 }],\n '\\u{1FB78}': [{ x: 0, y: 3, w: 8, h: 1 }],\n '\\u{1FB79}': [{ x: 0, y: 4, w: 8, h: 1 }],\n '\\u{1FB7A}': [{ x: 0, y: 5, w: 8, h: 1 }],\n '\\u{1FB7B}': [{ x: 0, y: 6, w: 8, h: 1 }],\n\n // LEFT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7C}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // LEFT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7D}': [{ x: 0, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND UPPER ONE EIGHTH BLOCK\n '\\u{1FB7E}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 0, w: 8, h: 1 }],\n // RIGHT AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB7F}': [{ x: 7, y: 0, w: 1, h: 8 }, { x: 0, y: 7, w: 8, h: 1 }],\n // UPPER AND LOWER ONE EIGHTH BLOCK\n '\\u{1FB80}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n // HORIZONTAL ONE EIGHTH BLOCK-1358\n '\\u{1FB81}': [{ x: 0, y: 0, w: 8, h: 1 }, { x: 0, y: 2, w: 8, h: 1 }, { x: 0, y: 4, w: 8, h: 1 }, { x: 0, y: 7, w: 8, h: 1 }],\n\n // UPPER ONE QUARTER BLOCK\n '\\u{1FB82}': [{ x: 0, y: 0, w: 8, h: 2 }],\n // UPPER THREE EIGHTHS BLOCK\n '\\u{1FB83}': [{ x: 0, y: 0, w: 8, h: 3 }],\n // UPPER FIVE EIGHTHS BLOCK\n '\\u{1FB84}': [{ x: 0, y: 0, w: 8, h: 5 }],\n // UPPER THREE QUARTERS BLOCK\n '\\u{1FB85}': [{ x: 0, y: 0, w: 8, h: 6 }],\n // UPPER SEVEN EIGHTHS BLOCK\n '\\u{1FB86}': [{ x: 0, y: 0, w: 8, h: 7 }],\n\n // RIGHT ONE QUARTER BLOCK\n '\\u{1FB87}': [{ x: 6, y: 0, w: 2, h: 8 }],\n // RIGHT THREE EIGHTHS B0OCK\n '\\u{1FB88}': [{ x: 5, y: 0, w: 3, h: 8 }],\n // RIGHT FIVE EIGHTHS BL0CK\n '\\u{1FB89}': [{ x: 3, y: 0, w: 5, h: 8 }],\n // RIGHT THREE QUARTERS 0LOCK\n '\\u{1FB8A}': [{ x: 2, y: 0, w: 6, h: 8 }],\n // RIGHT SEVEN EIGHTHS B0OCK\n '\\u{1FB8B}': [{ x: 1, y: 0, w: 7, h: 8 }],\n\n // CHECKER BOARD FILL\n '\\u{1FB95}': [\n { x: 0, y: 0, w: 2, h: 2 }, { x: 4, y: 0, w: 2, h: 2 },\n { x: 2, y: 2, w: 2, h: 2 }, { x: 6, y: 2, w: 2, h: 2 },\n { x: 0, y: 4, w: 2, h: 2 }, { x: 4, y: 4, w: 2, h: 2 },\n { x: 2, y: 6, w: 2, h: 2 }, { x: 6, y: 6, w: 2, h: 2 }\n ],\n // INVERSE CHECKER BOARD FILL\n '\\u{1FB96}': [\n { x: 2, y: 0, w: 2, h: 2 }, { x: 6, y: 0, w: 2, h: 2 },\n { x: 0, y: 2, w: 2, h: 2 }, { x: 4, y: 2, w: 2, h: 2 },\n { x: 2, y: 4, w: 2, h: 2 }, { x: 6, y: 4, w: 2, h: 2 },\n { x: 0, y: 6, w: 2, h: 2 }, { x: 4, y: 6, w: 2, h: 2 }\n ],\n // HEAVY HORIZONTAL FILL (upper middle and lower one quarter block)\n '\\u{1FB97}': [{ x: 0, y: 2, w: 8, h: 2 }, { x: 0, y: 6, w: 8, h: 2 }]\n};\n\ntype PatternDefinition = number[][];\n\n/**\n * Defines the repeating pattern used by special characters, the pattern is made up of a 2d array of\n * pixel values to be filled (1) or not filled (0).\n */\nconst patternCharacterDefinitions: { [key: string]: PatternDefinition | undefined } = {\n // Shade characters (0x2591-0x2593)\n '░': [ // LIGHT SHADE (25%)\n [1, 0, 0, 0],\n [0, 0, 0, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 0]\n ],\n '▒': [ // MEDIUM SHADE (50%)\n [1, 0],\n [0, 0],\n [0, 1],\n [0, 0]\n ],\n '▓': [ // DARK SHADE (75%)\n [0, 1],\n [1, 1],\n [1, 0],\n [1, 1]\n ]\n};\n\nconst enum Shapes {\n /** │ */ TOP_TO_BOTTOM = 'M.5,0 L.5,1',\n /** ─ */ LEFT_TO_RIGHT = 'M0,.5 L1,.5',\n\n /** └ */ TOP_TO_RIGHT = 'M.5,0 L.5,.5 L1,.5',\n /** ┘ */ TOP_TO_LEFT = 'M.5,0 L.5,.5 L0,.5',\n /** ┐ */ LEFT_TO_BOTTOM = 'M0,.5 L.5,.5 L.5,1',\n /** ┌ */ RIGHT_TO_BOTTOM = 'M0.5,1 L.5,.5 L1,.5',\n\n /** ╵ */ MIDDLE_TO_TOP = 'M.5,.5 L.5,0',\n /** ╴ */ MIDDLE_TO_LEFT = 'M.5,.5 L0,.5',\n /** ╶ */ MIDDLE_TO_RIGHT = 'M.5,.5 L1,.5',\n /** ╷ */ MIDDLE_TO_BOTTOM = 'M.5,.5 L.5,1',\n\n /** ┴ */ T_TOP = 'M0,.5 L1,.5 M.5,.5 L.5,0',\n /** ┤ */ T_LEFT = 'M.5,0 L.5,1 M.5,.5 L0,.5',\n /** ├ */ T_RIGHT = 'M.5,0 L.5,1 M.5,.5 L1,.5',\n /** ┬ */ T_BOTTOM = 'M0,.5 L1,.5 M.5,.5 L.5,1',\n\n /** ┼ */ CROSS = 'M0,.5 L1,.5 M.5,0 L.5,1',\n\n /** ╌ */ TWO_DASHES_HORIZONTAL = 'M.1,.5 L.4,.5 M.6,.5 L.9,.5', // .2 empty, .3 filled\n /** ┄ */ THREE_DASHES_HORIZONTAL = 'M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5', // .1333 empty, .2 filled\n /** ┉ */ FOUR_DASHES_HORIZONTAL = 'M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5', // .1 empty, .15 filled\n /** ╎ */ TWO_DASHES_VERTICAL = 'M.5,.1 L.5,.4 M.5,.6 L.5,.9',\n /** ┆ */ THREE_DASHES_VERTICAL = 'M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333',\n /** ┊ */ FOUR_DASHES_VERTICAL = 'M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95',\n}\n\nconst enum Style {\n NORMAL = 1,\n BOLD = 3\n}\n\n/**\n * @param xp The percentage of 15% of the x axis.\n * @param yp The percentage of 15% of the x axis on the y axis.\n */\ntype DrawFunctionDefinition = (xp: number, yp: number) => string;\n\n/**\n * This contains the definitions of all box drawing characters in the format of SVG paths (ie. the\n * svg d attribute).\n */\nexport const boxDrawingDefinitions: { [character: string]: { [fontWeight: number]: string | DrawFunctionDefinition } | undefined } = {\n // Uniform normal and bold\n '─': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT },\n '━': { [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '│': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM },\n '┃': { [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┌': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM },\n '┏': { [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┐': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM },\n '┓': { [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '└': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT },\n '┗': { [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┘': { [Style.NORMAL]: Shapes.TOP_TO_LEFT },\n '┛': { [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '├': { [Style.NORMAL]: Shapes.T_RIGHT },\n '┣': { [Style.BOLD]: Shapes.T_RIGHT },\n '┤': { [Style.NORMAL]: Shapes.T_LEFT },\n '┫': { [Style.BOLD]: Shapes.T_LEFT },\n '┬': { [Style.NORMAL]: Shapes.T_BOTTOM },\n '┳': { [Style.BOLD]: Shapes.T_BOTTOM },\n '┴': { [Style.NORMAL]: Shapes.T_TOP },\n '┻': { [Style.BOLD]: Shapes.T_TOP },\n '┼': { [Style.NORMAL]: Shapes.CROSS },\n '╋': { [Style.BOLD]: Shapes.CROSS },\n '╴': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT },\n '╸': { [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╵': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP },\n '╹': { [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╶': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT },\n '╺': { [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╷': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM },\n '╻': { [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n\n // Double border\n '═': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '║': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╒': { [Style.NORMAL]: (xp, yp) => `M.5,1 L.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╓': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},1 L${.5 - xp},.5 L1,.5 M${.5 + xp},.5 L${.5 + xp},1` },\n '╔': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╕': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L.5,${.5 - yp} L.5,1 M0,${.5 + yp} L.5,${.5 + yp}` },\n '╖': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},1 L${.5 + xp},.5 L0,.5 M${.5 - xp},.5 L${.5 - xp},1` },\n '╗': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},1` },\n '╘': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 + yp} L1,${.5 + yp} M.5,${.5 - yp} L1,${.5 - yp}` },\n '╙': { [Style.NORMAL]: (xp, yp) => `M1,.5 L${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╚': { [Style.NORMAL]: (xp, yp) => `M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0 M1,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},0` },\n '╛': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L.5,${.5 + yp} L.5,0 M0,${.5 - yp} L.5,${.5 - yp}` },\n '╜': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 + xp},.5 L${.5 + xp},0 M${.5 - xp},.5 L${.5 - xp},0` },\n '╝': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M0,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},0` },\n '╞': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M.5,${.5 - yp} L1,${.5 - yp} M.5,${.5 + yp} L1,${.5 + yp}` },\n '╟': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1 M${.5 + xp},.5 L1,.5` },\n '╠': { [Style.NORMAL]: (xp, yp) => `M${.5 - xp},0 L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╡': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L.5,${.5 - yp} M0,${.5 + yp} L.5,${.5 + yp}` },\n '╢': { [Style.NORMAL]: (xp, yp) => `M0,.5 L${.5 - xp},.5 M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╣': { [Style.NORMAL]: (xp, yp) => `M${.5 + xp},0 L${.5 + xp},1 M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0` },\n '╤': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp} M.5,${.5 + yp} L.5,1` },\n '╥': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},1 M${.5 + xp},.5 L${.5 + xp},1` },\n '╦': { [Style.NORMAL]: (xp, yp) => `M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1` },\n '╧': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 - yp} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╨': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},.5 L${.5 - xp},0 M${.5 + xp},.5 L${.5 + xp},0` },\n '╩': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L1,${.5 + yp} M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n '╪': { [Style.NORMAL]: (xp, yp) => `${Shapes.TOP_TO_BOTTOM} M0,${.5 - yp} L1,${.5 - yp} M0,${.5 + yp} L1,${.5 + yp}` },\n '╫': { [Style.NORMAL]: (xp, yp) => `${Shapes.LEFT_TO_RIGHT} M${.5 - xp},0 L${.5 - xp},1 M${.5 + xp},0 L${.5 + xp},1` },\n '╬': { [Style.NORMAL]: (xp, yp) => `M0,${.5 + yp} L${.5 - xp},${.5 + yp} L${.5 - xp},1 M1,${.5 + yp} L${.5 + xp},${.5 + yp} L${.5 + xp},1 M0,${.5 - yp} L${.5 - xp},${.5 - yp} L${.5 - xp},0 M1,${.5 - yp} L${.5 + xp},${.5 - yp} L${.5 + xp},0` },\n\n // Diagonal\n '': { [Style.NORMAL]: 'M1,0 L0,1' },\n '╲': { [Style.NORMAL]: 'M0,0 L1,1' },\n '': { [Style.NORMAL]: 'M1,0 L0,1 M0,0 L1,1' },\n\n // Mixed weight\n '╼': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '╽': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╾': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '╿': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┍': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┎': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┑': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┒': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┕': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┖': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┙': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┚': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┝': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┞': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┟': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┠': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┡': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┢': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┥': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┦': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┧': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┨': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '┩': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┪': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┭': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┮': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┯': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┰': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '┱': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '┲': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '┵': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┶': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┷': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '┸': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '┹': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '┺': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '┽': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_LEFT },\n '┾': { [Style.NORMAL]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}`, [Style.BOLD]: Shapes.MIDDLE_TO_RIGHT },\n '┿': { [Style.NORMAL]: Shapes.TOP_TO_BOTTOM, [Style.BOLD]: Shapes.LEFT_TO_RIGHT },\n '╀': { [Style.NORMAL]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}`, [Style.BOLD]: Shapes.MIDDLE_TO_TOP },\n '╁': { [Style.NORMAL]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}`, [Style.BOLD]: Shapes.MIDDLE_TO_BOTTOM },\n '╂': { [Style.NORMAL]: Shapes.LEFT_TO_RIGHT, [Style.BOLD]: Shapes.TOP_TO_BOTTOM },\n '╃': { [Style.NORMAL]: Shapes.RIGHT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_LEFT },\n '╄': { [Style.NORMAL]: Shapes.LEFT_TO_BOTTOM, [Style.BOLD]: Shapes.TOP_TO_RIGHT },\n '╅': { [Style.NORMAL]: Shapes.TOP_TO_RIGHT, [Style.BOLD]: Shapes.LEFT_TO_BOTTOM },\n '╆': { [Style.NORMAL]: Shapes.TOP_TO_LEFT, [Style.BOLD]: Shapes.RIGHT_TO_BOTTOM },\n '╇': { [Style.NORMAL]: Shapes.MIDDLE_TO_BOTTOM, [Style.BOLD]: `${Shapes.MIDDLE_TO_TOP} ${Shapes.LEFT_TO_RIGHT}` },\n '╈': { [Style.NORMAL]: Shapes.MIDDLE_TO_TOP, [Style.BOLD]: `${Shapes.LEFT_TO_RIGHT} ${Shapes.MIDDLE_TO_BOTTOM}` },\n '╉': { [Style.NORMAL]: Shapes.MIDDLE_TO_RIGHT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_LEFT}` },\n '╊': { [Style.NORMAL]: Shapes.MIDDLE_TO_LEFT, [Style.BOLD]: `${Shapes.TOP_TO_BOTTOM} ${Shapes.MIDDLE_TO_RIGHT}` },\n\n // Dashed\n '╌': { [Style.NORMAL]: Shapes.TWO_DASHES_HORIZONTAL },\n '╍': { [Style.BOLD]: Shapes.TWO_DASHES_HORIZONTAL },\n '┄': { [Style.NORMAL]: Shapes.THREE_DASHES_HORIZONTAL },\n '┅': { [Style.BOLD]: Shapes.THREE_DASHES_HORIZONTAL },\n '┈': { [Style.NORMAL]: Shapes.FOUR_DASHES_HORIZONTAL },\n '┉': { [Style.BOLD]: Shapes.FOUR_DASHES_HORIZONTAL },\n '╎': { [Style.NORMAL]: Shapes.TWO_DASHES_VERTICAL },\n '╏': { [Style.BOLD]: Shapes.TWO_DASHES_VERTICAL },\n '┆': { [Style.NORMAL]: Shapes.THREE_DASHES_VERTICAL },\n '┇': { [Style.BOLD]: Shapes.THREE_DASHES_VERTICAL },\n '┊': { [Style.NORMAL]: Shapes.FOUR_DASHES_VERTICAL },\n '┋': { [Style.BOLD]: Shapes.FOUR_DASHES_VERTICAL },\n\n // Curved\n '╭': { [Style.NORMAL]: (xp, yp) => `M.5,1 L.5,${.5 + (yp / .15 * .5)} C.5,${.5 + (yp / .15 * .5)},.5,.5,1,.5` },\n '╮': { [Style.NORMAL]: (xp, yp) => `M.5,1 L.5,${.5 + (yp / .15 * .5)} C.5,${.5 + (yp / .15 * .5)},.5,.5,0,.5` },\n '╯': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 - (yp / .15 * .5)} C.5,${.5 - (yp / .15 * .5)},.5,.5,0,.5` },\n '╰': { [Style.NORMAL]: (xp, yp) => `M.5,0 L.5,${.5 - (yp / .15 * .5)} C.5,${.5 - (yp / .15 * .5)},.5,.5,1,.5` }\n};\n\ninterface IVectorShape {\n d: string;\n type: VectorType;\n leftPadding?: number;\n rightPadding?: number;\n}\n\nconst enum VectorType {\n FILL,\n STROKE\n}\n\n/**\n * This contains the definitions of the primarily used box drawing characters as vector shapes. The\n * reason these characters are defined specially is to avoid common problems if a user's font has\n * not been patched with powerline characters and also to get pixel perfect rendering as rendering\n * issues can occur around AA/SPAA.\n *\n * The line variants draw beyond the cell and get clipped to ensure the end of the line is not visible.\n *\n * Original symbols defined in https://github.com/powerline/fontpatcher\n */\nexport const powerlineDefinitions: { [index: string]: IVectorShape } = {\n // Right triangle solid\n '\\u{E0B0}': { d: 'M0,0 L1,.5 L0,1', type: VectorType.FILL, rightPadding: 2 },\n // Right triangle line\n '\\u{E0B1}': { d: 'M-1,-.5 L1,.5 L-1,1.5', type: VectorType.STROKE, leftPadding: 1, rightPadding: 1 },\n // Left triangle solid\n '\\u{E0B2}': { d: 'M1,0 L0,.5 L1,1', type: VectorType.FILL, leftPadding: 2 },\n // Left triangle line\n '\\u{E0B3}': { d: 'M2,-.5 L0,.5 L2,1.5', type: VectorType.STROKE, leftPadding: 1, rightPadding: 1 },\n // Right semi-circle solid\n '\\u{E0B4}': { d: 'M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0', type: VectorType.FILL, rightPadding: 1 },\n // Right semi-circle line\n '\\u{E0B5}': { d: 'M0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0', type: VectorType.STROKE, rightPadding: 1 },\n // Left semi-circle solid\n '\\u{E0B6}': { d: 'M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0', type: VectorType.FILL, leftPadding: 1 },\n // Left semi-circle line\n '\\u{E0B7}': { d: 'M1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0', type: VectorType.STROKE, leftPadding: 1 },\n // Lower left triangle\n '\\u{E0B8}': { d: 'M-.5,-.5 L1.5,1.5 L-.5,1.5', type: VectorType.FILL },\n // Backslash separator\n '\\u{E0B9}': { d: 'M-.5,-.5 L1.5,1.5', type: VectorType.STROKE, leftPadding: 1, rightPadding: 1 },\n // Lower right triangle\n '\\u{E0BA}': { d: 'M1.5,-.5 L-.5,1.5 L1.5,1.5', type: VectorType.FILL },\n // Upper left triangle\n '\\u{E0BC}': { d: 'M1.5,-.5 L-.5,1.5 L-.5,-.5', type: VectorType.FILL },\n // Forward slash separator\n '\\u{E0BD}': { d: 'M1.5,-.5 L-.5,1.5', type: VectorType.STROKE, leftPadding: 1, rightPadding: 1 },\n // Upper right triangle\n '\\u{E0BE}': { d: 'M-.5,-.5 L1.5,1.5 L1.5,-.5', type: VectorType.FILL }\n};\n// Backslash separator redundant\npowerlineDefinitions['\\u{E0BB}'] = powerlineDefinitions['\\u{E0B9}'];\n// Forward slash separator redundant\npowerlineDefinitions['\\u{E0BF}'] = powerlineDefinitions['\\u{E0BD}'];\n\n/**\n * Try drawing a custom block element or box drawing character, returning whether it was\n * successfully drawn.\n */\nexport function tryDrawCustomChar(\n ctx: CanvasRenderingContext2D,\n c: string,\n xOffset: number,\n yOffset: number,\n deviceCellWidth: number,\n deviceCellHeight: number,\n fontSize: number,\n devicePixelRatio: number\n): boolean {\n const blockElementDefinition = blockElementDefinitions[c];\n if (blockElementDefinition) {\n drawBlockElementChar(ctx, blockElementDefinition, xOffset, yOffset, deviceCellWidth, deviceCellHeight);\n return true;\n }\n\n const patternDefinition = patternCharacterDefinitions[c];\n if (patternDefinition) {\n drawPatternChar(ctx, patternDefinition, xOffset, yOffset, deviceCellWidth, deviceCellHeight);\n return true;\n }\n\n const boxDrawingDefinition = boxDrawingDefinitions[c];\n if (boxDrawingDefinition) {\n drawBoxDrawingChar(ctx, boxDrawingDefinition, xOffset, yOffset, deviceCellWidth, deviceCellHeight, devicePixelRatio);\n return true;\n }\n\n const powerlineDefinition = powerlineDefinitions[c];\n if (powerlineDefinition) {\n drawPowerlineChar(ctx, powerlineDefinition, xOffset, yOffset, deviceCellWidth, deviceCellHeight, fontSize, devicePixelRatio);\n return true;\n }\n\n return false;\n}\n\nfunction drawBlockElementChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IBlockVector[],\n xOffset: number,\n yOffset: number,\n deviceCellWidth: number,\n deviceCellHeight: number\n): void {\n for (let i = 0; i < charDefinition.length; i++) {\n const box = charDefinition[i];\n const xEighth = deviceCellWidth / 8;\n const yEighth = deviceCellHeight / 8;\n ctx.fillRect(\n xOffset + box.x * xEighth,\n yOffset + box.y * yEighth,\n box.w * xEighth,\n box.h * yEighth\n );\n }\n}\n\nconst cachedPatterns: Map<PatternDefinition, Map</* fillStyle */string, CanvasPattern>> = new Map();\n\nfunction drawPatternChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: number[][],\n xOffset: number,\n yOffset: number,\n deviceCellWidth: number,\n deviceCellHeight: number\n): void {\n let patternSet = cachedPatterns.get(charDefinition);\n if (!patternSet) {\n patternSet = new Map();\n cachedPatterns.set(charDefinition, patternSet);\n }\n const fillStyle = ctx.fillStyle;\n if (typeof fillStyle !== 'string') {\n throw new Error(`Unexpected fillStyle type \"${fillStyle}\"`);\n }\n let pattern = patternSet.get(fillStyle);\n if (!pattern) {\n const width = charDefinition[0].length;\n const height = charDefinition.length;\n const tmpCanvas = document.createElement('canvas');\n tmpCanvas.width = width;\n tmpCanvas.height = height;\n const tmpCtx = throwIfFalsy(tmpCanvas.getContext('2d'));\n const imageData = new ImageData(width, height);\n\n // Extract rgba from fillStyle\n let r: number;\n let g: number;\n let b: number;\n let a: number;\n if (fillStyle.startsWith('#')) {\n r = parseInt(fillStyle.slice(1, 3), 16);\n g = parseInt(fillStyle.slice(3, 5), 16);\n b = parseInt(fillStyle.slice(5, 7), 16);\n a = fillStyle.length > 7 && parseInt(fillStyle.slice(7, 9), 16) || 1;\n } else if (fillStyle.startsWith('rgba')) {\n ([r, g, b, a] = fillStyle.substring(5, fillStyle.length - 1).split(',').map(e => parseFloat(e)));\n } else {\n throw new Error(`Unexpected fillStyle color format \"${fillStyle}\" when drawing pattern glyph`);\n }\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n imageData.data[(y * width + x) * 4 ] = r;\n imageData.data[(y * width + x) * 4 + 1] = g;\n imageData.data[(y * width + x) * 4 + 2] = b;\n imageData.data[(y * width + x) * 4 + 3] = charDefinition[y][x] * (a * 255);\n }\n }\n tmpCtx.putImageData(imageData, 0, 0);\n pattern = throwIfFalsy(ctx.createPattern(tmpCanvas, null));\n patternSet.set(fillStyle, pattern);\n }\n ctx.fillStyle = pattern;\n ctx.fillRect(xOffset, yOffset, deviceCellWidth, deviceCellHeight);\n}\n\n/**\n * Draws the following box drawing characters by mapping a subset of SVG d attribute instructions to\n * canvas draw calls.\n *\n * Box styles: ┎┰┒┍┯┑╓╥╖╒╤╕ ┏┳┓┌┲┓┌┬┐┏┱┐\n * ┌─┬─┐ ┏━┳━┓ ╔═╦═╗ ┠╂┨┝┿┥╟╫╢╞╪╡ ┡╇┩├╊┫┢╈┪┣╉┤\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┖┸┚┕┷┙╙╨╜╘╧╛ └┴┘└┺┛┗┻┛┗┹┘\n * ├─┼─┤ ┣━╋━┫ ╠═╬═╣ ┏┱┐┌┲┓┌┬┐┌┬┐ ┏┳┓┌┮┓┌┬┐┏┭┐\n * │ │ │ ┃ ┃ ┃ ║ ║ ║ ┡╃┤├╄┩├╆┪┢╅┤ ┞╀┦├┾┫┟╁┧┣┽┤\n * └─┴─┘ ┗━┻━┛ ╚═╩═╝ └┴┘└┴┘└┺┛┗┹┘ └┴┘└┶┛┗┻┛┗┵┘\n *\n * Other:\n * ╭─╮ ╲ ╷╻╎╏┆┇┊┋ ╺╾╴ ╌╌╌ ┄┄┄ ┈┈┈\n * │ │ ╽╿╎╏┆┇┊┋ ╶╼╸ ╍╍╍ ┅┅┅ ┉┉┉\n * ╰─╯ ╲ ╹╵╎╏┆┇┊┋\n *\n * All box drawing characters:\n * ─ ━ │ ┃ ┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋ ┌ ┍ ┎ ┏\n * ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛ ├ ┝ ┞ ┟\n * ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯\n * ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿\n * ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋ ╌ ╍ ╎ ╏\n * ═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟\n * ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬ ╭ ╮ ╯\n * ╰ ╴ ╵ ╶ ╷ ╸ ╹ ╺ ╻ ╼ ╽ ╾ ╿\n *\n * ---\n *\n * Box drawing alignment tests: █\n * ▉\n * ╔══╦══╗ ┌──┬──┐ ╭──┬──╮ ╭──┬──╮ ┏━━┳━━┓ ┎┒┏┑ ╷ ╻ ┏┯┓ ┌┰┐ ▊ ╱╲╱╲╳╳╳\n * ║┌─╨─┐║ │╔═╧═╗│ │╒═╪═╕│ │╓─╁─╖│ ┃┌─╂─┐┃ ┗╃╄┙ ╶┼╴╺╋╸┠┼┨ ┝╋┥ ▋ ╲╱╲╱╳╳╳\n * ║│╲ ╱│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╿ │┃ ┍╅╆┓ ╵ ╹ ┗┷┛ └┸┘ ▌ ╱╲╱╲╳╳╳\n * ╠╡ ╞╣ ├╢ ╟┤ ├┼─┼─┼┤ ├╫─╂─╫┤ ┣┿╾┼╼┿┫ ┕┛┖┚ ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳\n * ║│╱ ╲│║ │║ ║│ ││ │ ││ │║ ┃ ║│ ┃│ ╽ │┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▎\n * ║└─╥─┘║ │╚═╤═╝│ │╘═╪═╛│ │╙─╀─╜│ ┃└─╂─┘┃ ░░▒▒▓▓██ ┊ ┆ ╎ ╏ ┇ ┋ ▏\n * ╚══╩══╝ └──┴──┘ ╰──┴──╯ ╰──┴──╯ ┗━━┻━━┛ └╌╌┘ ╎ ┗╍╍┛ ┋ ▁▂▃▄▅▆▇█\n *\n * Source: https://www.w3.org/2001/06/utf-8-test/UTF-8-demo.html\n */\nfunction drawBoxDrawingChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: { [fontWeight: number]: string | ((xp: number, yp: number) => string) },\n xOffset: number,\n yOffset: number,\n deviceCellWidth: number,\n deviceCellHeight: number,\n devicePixelRatio: number\n): void {\n ctx.strokeStyle = ctx.fillStyle;\n for (const [fontWeight, instructions] of Object.entries(charDefinition)) {\n ctx.beginPath();\n ctx.lineWidth = devicePixelRatio * Number.parseInt(fontWeight);\n let actualInstructions: string;\n if (typeof instructions === 'function') {\n const xp = .15;\n const yp = .15 / deviceCellHeight * deviceCellWidth;\n actualInstructions = instructions(xp, yp);\n } else {\n actualInstructions = instructions;\n }\n for (const instruction of actualInstructions.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(args, deviceCellWidth, deviceCellHeight, xOffset, yOffset, true, devicePixelRatio));\n }\n ctx.stroke();\n ctx.closePath();\n }\n}\n\nfunction drawPowerlineChar(\n ctx: CanvasRenderingContext2D,\n charDefinition: IVectorShape,\n xOffset: number,\n yOffset: number,\n deviceCellWidth: number,\n deviceCellHeight: number,\n fontSize: number,\n devicePixelRatio: number\n): void {\n // Clip the cell to make sure drawing doesn't occur beyond bounds\n const clipRegion = new Path2D();\n clipRegion.rect(xOffset, yOffset, deviceCellWidth, deviceCellHeight);\n ctx.clip(clipRegion);\n\n ctx.beginPath();\n // Scale the stroke with DPR and font size\n const cssLineWidth = fontSize / 12;\n ctx.lineWidth = devicePixelRatio * cssLineWidth;\n for (const instruction of charDefinition.d.split(' ')) {\n const type = instruction[0];\n const f = svgToCanvasInstructionMap[type];\n if (!f) {\n console.error(`Could not find drawing instructions for \"${type}\"`);\n continue;\n }\n const args: string[] = instruction.substring(1).split(',');\n if (!args[0] || !args[1]) {\n continue;\n }\n f(ctx, translateArgs(\n args,\n deviceCellWidth,\n deviceCellHeight,\n xOffset,\n yOffset,\n false,\n devicePixelRatio,\n (charDefinition.leftPadding ?? 0) * (cssLineWidth / 2),\n (charDefinition.rightPadding ?? 0) * (cssLineWidth / 2)\n ));\n }\n if (charDefinition.type === VectorType.STROKE) {\n ctx.strokeStyle = ctx.fillStyle;\n ctx.stroke();\n } else {\n ctx.fill();\n }\n ctx.closePath();\n}\n\nfunction clamp(value: number, max: number, min: number = 0): number {\n return Math.max(Math.min(value, max), min);\n}\n\nconst svgToCanvasInstructionMap: { [index: string]: any } = {\n 'C': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.bezierCurveTo(args[0], args[1], args[2], args[3], args[4], args[5]),\n 'L': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.lineTo(args[0], args[1]),\n 'M': (ctx: CanvasRenderingContext2D, args: number[]) => ctx.moveTo(args[0], args[1])\n};\n\nfunction translateArgs(args: string[], cellWidth: number, cellHeight: number, xOffset: number, yOffset: number, doClamp: boolean, devicePixelRatio: number, leftPadding: number = 0, rightPadding: number = 0): number[] {\n const result = args.map(e => parseFloat(e) || parseInt(e));\n\n if (result.length < 2) {\n throw new Error('Too few arguments for instruction');\n }\n\n for (let x = 0; x < result.length; x += 2) {\n // Translate from 0-1 to 0-cellWidth\n result[x] *= cellWidth - (leftPadding * devicePixelRatio) - (rightPadding * devicePixelRatio);\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (doClamp && result[x] !== 0) {\n result[x] = clamp(Math.round(result[x] + 0.5) - 0.5, cellWidth, 0);\n }\n // Apply the cell's offset (ie. x*cellWidth)\n result[x] += xOffset + (leftPadding * devicePixelRatio);\n }\n\n for (let y = 1; y < result.length; y += 2) {\n // Translate from 0-1 to 0-cellHeight\n result[y] *= cellHeight;\n // Ensure coordinate doesn't escape cell bounds and round to the nearest 0.5 to ensure a crisp\n // line at 100% devicePixelRatio\n if (doClamp && result[y] !== 0) {\n result[y] = clamp(Math.round(result[y] + 0.5) - 0.5, cellHeight, 0);\n }\n // Apply the cell's offset (ie. x*cellHeight)\n result[y] += yOffset;\n }\n\n return result;\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { toDisposable } from 'common/Lifecycle';\nimport { IDisposable } from 'common/Types';\n\nexport function observeDevicePixelDimensions(element: HTMLElement, parentWindow: Window & typeof globalThis, callback: (deviceWidth: number, deviceHeight: number) => void): IDisposable {\n // Observe any resizes to the element and extract the actual pixel size of the element if the\n // devicePixelContentBoxSize API is supported. This allows correcting rounding errors when\n // converting between CSS pixels and device pixels which causes blurry rendering when device\n // pixel ratio is not a round number.\n let observer: ResizeObserver | undefined = new parentWindow.ResizeObserver((entries) => {\n const entry = entries.find((entry) => entry.target === element);\n if (!entry) {\n return;\n }\n\n // Disconnect if devicePixelContentBoxSize isn't supported by the browser\n if (!('devicePixelContentBoxSize' in entry)) {\n observer?.disconnect();\n observer = undefined;\n return;\n }\n\n // Fire the callback, ignore events where the dimensions are 0x0 as the canvas is likely hidden\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n if (width > 0 && height > 0) {\n callback(width, height);\n }\n });\n try {\n observer.observe(element, { box: ['device-pixel-content-box'] } as any);\n } catch {\n observer.disconnect();\n observer = undefined;\n }\n return toDisposable(() => observer?.disconnect());\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDimensions, IOffset, IRenderDimensions } from 'browser/renderer/shared/Types';\n\nexport function throwIfFalsy<T>(value: T | undefined | null): T {\n if (!value) {\n throw new Error('value must not be falsy');\n }\n return value;\n}\n\nexport function isPowerlineGlyph(codepoint: number): boolean {\n // Only return true for Powerline symbols which require\n // different padding and should be excluded from minimum contrast\n // ratio standards\n return 0xE0A4 <= codepoint && codepoint <= 0xE0D6;\n}\n\nexport function isRestrictedPowerlineGlyph(codepoint: number): boolean {\n return 0xE0B0 <= codepoint && codepoint <= 0xE0B7;\n}\n\nfunction isBoxOrBlockGlyph(codepoint: number): boolean {\n return 0x2500 <= codepoint && codepoint <= 0x259F;\n}\n\nexport function excludeFromContrastRatioDemands(codepoint: number): boolean {\n return isPowerlineGlyph(codepoint) || isBoxOrBlockGlyph(codepoint);\n}\n\nexport function createRenderDimensions(): IRenderDimensions {\n return {\n css: {\n canvas: createDimension(),\n cell: createDimension()\n },\n device: {\n canvas: createDimension(),\n cell: createDimension(),\n char: {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n }\n }\n };\n}\n\nfunction createDimension(): IDimensions {\n return {\n width: 0,\n height: 0\n };\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionRenderModel } from 'browser/renderer/shared/Types';\nimport { Terminal } from 'xterm';\n\nclass SelectionRenderModel implements ISelectionRenderModel {\n public hasSelection!: boolean;\n public columnSelectMode!: boolean;\n public viewportStartRow!: number;\n public viewportEndRow!: number;\n public viewportCappedStartRow!: number;\n public viewportCappedEndRow!: number;\n public startCol!: number;\n public endCol!: number;\n public selectionStart: [number, number] | undefined;\n public selectionEnd: [number, number] | undefined;\n\n constructor() {\n this.clear();\n }\n\n public clear(): void {\n this.hasSelection = false;\n this.columnSelectMode = false;\n this.viewportStartRow = 0;\n this.viewportEndRow = 0;\n this.viewportCappedStartRow = 0;\n this.viewportCappedEndRow = 0;\n this.startCol = 0;\n this.endCol = 0;\n this.selectionStart = undefined;\n this.selectionEnd = undefined;\n }\n\n public update(terminal: Terminal, start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {\n this.selectionStart = start;\n this.selectionEnd = end;\n // Selection does not exist\n if (!start || !end || (start[0] === end[0] && start[1] === end[1])) {\n this.clear();\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - terminal.buffer.active.viewportY;\n const viewportEndRow = end[1] - terminal.buffer.active.viewportY;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, terminal.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= terminal.rows || viewportCappedEndRow < 0) {\n this.clear();\n return;\n }\n\n this.hasSelection = true;\n this.columnSelectMode = columnSelectMode;\n this.viewportStartRow = viewportStartRow;\n this.viewportEndRow = viewportEndRow;\n this.viewportCappedStartRow = viewportCappedStartRow;\n this.viewportCappedEndRow = viewportCappedEndRow;\n this.startCol = start[0];\n this.endCol = end[0];\n }\n\n public isCellSelected(terminal: Terminal, x: number, y: number): boolean {\n if (!this.hasSelection) {\n return false;\n }\n y -= terminal.buffer.active.viewportY;\n if (this.columnSelectMode) {\n if (this.startCol <= this.endCol) {\n return x >= this.startCol && y >= this.viewportCappedStartRow &&\n x < this.endCol && y <= this.viewportCappedEndRow;\n }\n return x < this.startCol && y >= this.viewportCappedStartRow &&\n x >= this.endCol && y <= this.viewportCappedEndRow;\n }\n return (y > this.viewportStartRow && y < this.viewportEndRow) ||\n (this.viewportStartRow === this.viewportEndRow && y === this.viewportStartRow && x >= this.startCol && x < this.endCol) ||\n (this.viewportStartRow < this.viewportEndRow && y === this.viewportEndRow && x < this.endCol) ||\n (this.viewportStartRow < this.viewportEndRow && y === this.viewportStartRow && x >= this.startCol);\n }\n}\n\nexport function createSelectionRenderModel(): ISelectionRenderModel {\n return new SelectionRenderModel();\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { DIM_OPACITY, TEXT_BASELINE } from 'browser/renderer/shared/Constants';\nimport { DEFAULT_COLOR, Attributes, DEFAULT_EXT, UnderlineStyle } from 'common/buffer/Constants';\nimport { IColor } from 'common/Types';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { color, NULL_COLOR, rgba } from 'common/Color';\nimport { tryDrawCustomChar } from 'browser/renderer/shared/CustomGlyphs';\nimport { excludeFromContrastRatioDemands, isPowerlineGlyph, isRestrictedPowerlineGlyph, throwIfFalsy } from 'browser/renderer/shared/RendererUtils';\nimport { IUnicodeService } from 'common/services/Services';\nimport { FourKeyMap } from 'common/MultiKeyMap';\nimport { IdleTaskQueue } from 'common/TaskQueue';\nimport { IBoundingBox, ICharAtlasConfig, IRasterizedGlyph, IRequestRedrawEvent, ITextureAtlas } from 'browser/renderer/shared/Types';\nimport { EventEmitter } from 'common/EventEmitter';\n\n/**\n * A shared object which is used to draw nothing for a particular cell.\n */\nconst NULL_RASTERIZED_GLYPH: IRasterizedGlyph = {\n texturePage: 0,\n texturePosition: { x: 0, y: 0 },\n texturePositionClipSpace: { x: 0, y: 0 },\n offset: { x: 0, y: 0 },\n size: { x: 0, y: 0 },\n sizeClipSpace: { x: 0, y: 0 }\n};\n\nconst TMP_CANVAS_GLYPH_PADDING = 2;\n\nconst enum Constants {\n /**\n * The amount of pixel padding to allow in each row. Setting this to zero would make the atlas\n * page pack as tightly as possible, but more pages would end up being created as a result.\n */\n ROW_PIXEL_THRESHOLD = 2,\n /**\n * The maximum texture size regardless of what the actual hardware maximum turns out to be. This\n * is enforced to ensure uploading the texture still finishes in a reasonable amount of time. A\n * 4096 squared image takes up 16MB of GPU memory.\n */\n FORCED_MAX_TEXTURE_SIZE = 4096\n}\n\ninterface ICharAtlasActiveRow {\n x: number;\n y: number;\n height: number;\n}\n\n// Work variables to avoid garbage collection\nlet $glyph = undefined;\n\nexport class TextureAtlas implements ITextureAtlas {\n private _didWarmUp: boolean = false;\n\n private _cacheMap: FourKeyMap<number, number, number, number, IRasterizedGlyph> = new FourKeyMap();\n private _cacheMapCombined: FourKeyMap<string, number, number, number, IRasterizedGlyph> = new FourKeyMap();\n\n // The texture that the atlas is drawn to\n private _pages: AtlasPage[] = [];\n public get pages(): { canvas: HTMLCanvasElement, version: number }[] { return this._pages; }\n\n // The set of atlas pages that can be written to\n private _activePages: AtlasPage[] = [];\n\n private _tmpCanvas: HTMLCanvasElement;\n // A temporary context that glyphs are drawn to before being transfered to the atlas.\n private _tmpCtx: CanvasRenderingContext2D;\n\n private _workBoundingBox: IBoundingBox = { top: 0, left: 0, bottom: 0, right: 0 };\n private _workAttributeData: AttributeData = new AttributeData();\n\n private _textureSize: number = 512;\n\n public static maxAtlasPages: number | undefined;\n public static maxTextureSize: number | undefined;\n\n private readonly _onAddTextureAtlasCanvas = new EventEmitter<HTMLCanvasElement>();\n public readonly onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;\n private readonly _onRemoveTextureAtlasCanvas = new EventEmitter<HTMLCanvasElement>();\n public readonly onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event;\n\n constructor(\n private readonly _document: Document,\n private readonly _config: ICharAtlasConfig,\n private readonly _unicodeService: IUnicodeService\n ) {\n this._createNewPage();\n this._tmpCanvas = createCanvas(\n _document,\n this._config.deviceCellWidth * 4 + TMP_CANVAS_GLYPH_PADDING * 2,\n this._config.deviceCellHeight + TMP_CANVAS_GLYPH_PADDING * 2\n );\n this._tmpCtx = throwIfFalsy(this._tmpCanvas.getContext('2d', {\n alpha: this._config.allowTransparency,\n willReadFrequently: true\n }));\n }\n\n public dispose(): void {\n for (const page of this.pages) {\n page.canvas.remove();\n }\n this._onAddTextureAtlasCanvas.dispose();\n }\n\n public warmUp(): void {\n if (!this._didWarmUp) {\n this._doWarmUp();\n this._didWarmUp = true;\n }\n }\n\n private _doWarmUp(): void {\n // Pre-fill with ASCII 33-126, this is not urgent and done in idle callbacks\n const queue = new IdleTaskQueue();\n for (let i = 33; i < 126; i++) {\n queue.enqueue(() => {\n if (!this._cacheMap.get(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT)) {\n const rasterizedGlyph = this._drawToCache(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT);\n this._cacheMap.set(i, DEFAULT_COLOR, DEFAULT_COLOR, DEFAULT_EXT, rasterizedGlyph);\n }\n });\n }\n }\n\n private _requestClearModel = false;\n public beginFrame(): boolean {\n return this._requestClearModel;\n }\n\n public clearTexture(): void {\n if (this._pages[0].currentRow.x === 0 && this._pages[0].currentRow.y === 0) {\n return;\n }\n for (const page of this._pages) {\n page.clear();\n }\n this._cacheMap.clear();\n this._cacheMapCombined.clear();\n this._didWarmUp = false;\n }\n\n private _createNewPage(): AtlasPage {\n // Try merge the set of the 4 most used pages of the largest size. This is is deferred to a\n // microtask to ensure it does not interrupt textures that will be rendered in the current\n // animation frame which would result in blank rendered areas. This is actually not that\n // expensive relative to drawing the glyphs, so there is no need to wait for an idle callback.\n if (TextureAtlas.maxAtlasPages && this._pages.length >= Math.max(4, TextureAtlas.maxAtlasPages / 2)) {\n queueMicrotask(() => {\n // Find the set of the largest 4 images, below the maximum size, with the highest\n // percentages used\n const pagesBySize = this._pages.filter(e => {\n return e.canvas.width * 2 <= (TextureAtlas.maxTextureSize || Constants.FORCED_MAX_TEXTURE_SIZE);\n }).sort((a, b) => {\n if (b.canvas.width !== a.canvas.width) {\n return b.canvas.width - a.canvas.width;\n }\n return b.percentageUsed - a.percentageUsed;\n });\n let sameSizeI = -1;\n let size = 0;\n for (let i = 0; i < pagesBySize.length; i++) {\n if (pagesBySize[i].canvas.width !== size) {\n sameSizeI = i;\n size = pagesBySize[i].canvas.width;\n } else if (i - sameSizeI === 3) {\n break;\n }\n }\n\n // Gather details of the merge\n const mergingPages = pagesBySize.slice(sameSizeI, sameSizeI + 4);\n const sortedMergingPagesIndexes = mergingPages.map(e => e.glyphs[0].texturePage).sort((a, b) => a > b ? 1 : -1);\n const mergedPageIndex = sortedMergingPagesIndexes[0];\n\n // Merge into the new page\n const mergedPage = this._mergePages(mergingPages, mergedPageIndex);\n mergedPage.version++;\n\n // Replace the first _merging_ page with the _merged_ page\n this._pages[mergedPageIndex] = mergedPage;\n\n // Delete the other 3 pages, shifting glyph texture pages as needed\n for (let i = sortedMergingPagesIndexes.length - 1; i >= 1; i--) {\n this._deletePage(sortedMergingPagesIndexes[i]);\n }\n\n // Request the model to be cleared to refresh all texture pages.\n this._requestClearModel = true;\n this._onAddTextureAtlasCanvas.fire(mergedPage.canvas);\n });\n }\n\n // All new atlas pages are created small as they are highly dynamic\n const newPage = new AtlasPage(this._document, this._textureSize);\n this._pages.push(newPage);\n this._activePages.push(newPage);\n this._onAddTextureAtlasCanvas.fire(newPage.canvas);\n return newPage;\n }\n\n private _mergePages(mergingPages: AtlasPage[], mergedPageIndex: number): AtlasPage {\n const mergedSize = mergingPages[0].canvas.width * 2;\n const mergedPage = new AtlasPage(this._document, mergedSize, mergingPages);\n for (const [i, p] of mergingPages.entries()) {\n const xOffset = i * p.canvas.width % mergedSize;\n const yOffset = Math.floor(i / 2) * p.canvas.height;\n mergedPage.ctx.drawImage(p.canvas, xOffset, yOffset);\n for (const g of p.glyphs) {\n g.texturePage = mergedPageIndex;\n g.sizeClipSpace.x = g.size.x / mergedSize;\n g.sizeClipSpace.y = g.size.y / mergedSize;\n g.texturePosition.x += xOffset;\n g.texturePosition.y += yOffset;\n g.texturePositionClipSpace.x = g.texturePosition.x / mergedSize;\n g.texturePositionClipSpace.y = g.texturePosition.y / mergedSize;\n }\n\n this._onRemoveTextureAtlasCanvas.fire(p.canvas);\n\n // Remove the merging page from active pages if it was there\n const index = this._activePages.indexOf(p);\n if (index !== -1) {\n this._activePages.splice(index, 1);\n }\n }\n return mergedPage;\n }\n\n private _deletePage(pageIndex: number): void {\n this._pages.splice(pageIndex, 1);\n for (let j = pageIndex; j < this._pages.length; j++) {\n const adjustingPage = this._pages[j];\n for (const g of adjustingPage.glyphs) {\n g.texturePage--;\n }\n adjustingPage.version++;\n }\n }\n\n public getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number, ext: number): IRasterizedGlyph {\n return this._getFromCacheMap(this._cacheMapCombined, chars, bg, fg, ext);\n }\n\n public getRasterizedGlyph(code: number, bg: number, fg: number, ext: number): IRasterizedGlyph {\n return this._getFromCacheMap(this._cacheMap, code, bg, fg, ext);\n }\n\n /**\n * Gets the glyphs texture coords, drawing the texture if it's not already\n */\n private _getFromCacheMap(\n cacheMap: FourKeyMap<string | number, number, number, number, IRasterizedGlyph>,\n key: string | number,\n bg: number,\n fg: number,\n ext: number\n ): IRasterizedGlyph {\n $glyph = cacheMap.get(key, bg, fg, ext);\n if (!$glyph) {\n $glyph = this._drawToCache(key, bg, fg, ext);\n cacheMap.set(key, bg, fg, ext, $glyph);\n }\n return $glyph;\n }\n\n private _getColorFromAnsiIndex(idx: number): IColor {\n if (idx >= this._config.colors.ansi.length) {\n throw new Error('No color found for idx ' + idx);\n }\n return this._config.colors.ansi[idx];\n }\n\n private _getBackgroundColor(bgColorMode: number, bgColor: number, inverse: boolean, dim: boolean): IColor {\n if (this._config.allowTransparency) {\n // The background color might have some transparency, so we need to render it as fully\n // transparent in the atlas. Otherwise we'd end up drawing the transparent background twice\n // around the anti-aliased edges of the glyph, and it would look too dark.\n return NULL_COLOR;\n }\n\n let result: IColor;\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n result = this._getColorFromAnsiIndex(bgColor);\n break;\n case Attributes.CM_RGB:\n const arr = AttributeData.toColorRGB(bgColor);\n // TODO: This object creation is slow\n result = rgba.toColor(arr[0], arr[1], arr[2]);\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n result = this._config.colors.foreground;\n } else {\n result = this._config.colors.background;\n }\n break;\n }\n\n if (dim) {\n // Blend here instead of using opacity because transparent colors mess with clipping the\n // glyph's bounding box\n result = color.blend(this._config.colors.background, color.multiplyOpacity(result, DIM_OPACITY));\n }\n\n return result;\n }\n\n private _getForegroundColor(bg: number, bgColorMode: number, bgColor: number, fg: number, fgColorMode: number, fgColor: number, inverse: boolean, dim: boolean, bold: boolean, excludeFromContrastRatioDemands: boolean): IColor {\n // TODO: Pass dim along to get min contrast?\n const minimumContrastColor = this._getMinimumContrastColor(bg, bgColorMode, bgColor, fg, fgColorMode, fgColor, false, bold, excludeFromContrastRatioDemands);\n if (minimumContrastColor) {\n return minimumContrastColor;\n }\n\n let result: IColor;\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (this._config.drawBoldTextInBrightColors && bold && fgColor < 8) {\n fgColor += 8;\n }\n result = this._getColorFromAnsiIndex(fgColor);\n break;\n case Attributes.CM_RGB:\n const arr = AttributeData.toColorRGB(fgColor);\n result = rgba.toColor(arr[0], arr[1], arr[2]);\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n result = this._config.colors.background;\n } else {\n result = this._config.colors.foreground;\n }\n }\n\n // Always use an opaque color regardless of allowTransparency\n if (this._config.allowTransparency) {\n result = color.opaque(result);\n }\n\n // Apply dim to the color, opacity is fine to use for the foreground color\n if (dim) {\n result = color.multiplyOpacity(result, DIM_OPACITY);\n }\n\n return result;\n }\n\n private _resolveBackgroundRgba(bgColorMode: number, bgColor: number, inverse: boolean): number {\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n return this._getColorFromAnsiIndex(bgColor).rgba;\n case Attributes.CM_RGB:\n return bgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._config.colors.foreground.rgba;\n }\n return this._config.colors.background.rgba;\n }\n }\n\n private _resolveForegroundRgba(fgColorMode: number, fgColor: number, inverse: boolean, bold: boolean): number {\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (this._config.drawBoldTextInBrightColors && bold && fgColor < 8) {\n fgColor += 8;\n }\n return this._getColorFromAnsiIndex(fgColor).rgba;\n case Attributes.CM_RGB:\n return fgColor << 8;\n case Attributes.CM_DEFAULT:\n default:\n if (inverse) {\n return this._config.colors.background.rgba;\n }\n return this._config.colors.foreground.rgba;\n }\n }\n\n private _getMinimumContrastColor(bg: number, bgColorMode: number, bgColor: number, fg: number, fgColorMode: number, fgColor: number, inverse: boolean, bold: boolean, excludeFromContrastRatioDemands: boolean): IColor | undefined {\n if (this._config.minimumContrastRatio === 1 || excludeFromContrastRatioDemands) {\n return undefined;\n }\n\n // Try get from cache first\n const adjustedColor = this._config.colors.contrastCache.getColor(bg, fg);\n if (adjustedColor !== undefined) {\n return adjustedColor || undefined;\n }\n\n const bgRgba = this._resolveBackgroundRgba(bgColorMode, bgColor, inverse);\n const fgRgba = this._resolveForegroundRgba(fgColorMode, fgColor, inverse, bold);\n const result = rgba.ensureContrastRatio(bgRgba, fgRgba, this._config.minimumContrastRatio);\n\n if (!result) {\n this._config.colors.contrastCache.setColor(bg, fg, null);\n return undefined;\n }\n\n const color = rgba.toColor(\n (result >> 24) & 0xFF,\n (result >> 16) & 0xFF,\n (result >> 8) & 0xFF\n );\n this._config.colors.contrastCache.setColor(bg, fg, color);\n\n return color;\n }\n\n private _drawToCache(codeOrChars: number | string, bg: number, fg: number, ext: number): IRasterizedGlyph {\n const chars = typeof codeOrChars === 'number' ? String.fromCharCode(codeOrChars) : codeOrChars;\n\n // Uncomment for debugging\n // console.log(`draw to cache \"${chars}\"`, bg, fg, ext);\n\n // Allow 1 cell width per character, with a minimum of 2 (CJK), plus some padding. This is used\n // to draw the glyph to the canvas as well as to restrict the bounding box search to ensure\n // giant ligatures (eg. =====>) don't impact overall performance.\n const allowedWidth = this._config.deviceCellWidth * Math.max(chars.length, 2) + TMP_CANVAS_GLYPH_PADDING * 2;\n if (this._tmpCanvas.width < allowedWidth) {\n this._tmpCanvas.width = allowedWidth;\n }\n // Include line height when drawing glyphs\n const allowedHeight = this._config.deviceCellHeight + TMP_CANVAS_GLYPH_PADDING * 4;\n if (this._tmpCanvas.height < allowedHeight) {\n this._tmpCanvas.height = allowedHeight;\n }\n this._tmpCtx.save();\n\n this._workAttributeData.fg = fg;\n this._workAttributeData.bg = bg;\n this._workAttributeData.extended.ext = ext;\n\n const invisible = !!this._workAttributeData.isInvisible();\n if (invisible) {\n return NULL_RASTERIZED_GLYPH;\n }\n\n const bold = !!this._workAttributeData.isBold();\n const inverse = !!this._workAttributeData.isInverse();\n const dim = !!this._workAttributeData.isDim();\n const italic = !!this._workAttributeData.isItalic();\n const underline = !!this._workAttributeData.isUnderline();\n const strikethrough = !!this._workAttributeData.isStrikethrough();\n let fgColor = this._workAttributeData.getFgColor();\n let fgColorMode = this._workAttributeData.getFgColorMode();\n let bgColor = this._workAttributeData.getBgColor();\n let bgColorMode = this._workAttributeData.getBgColorMode();\n if (inverse) {\n const temp = fgColor;\n fgColor = bgColor;\n bgColor = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n // draw the background\n const backgroundColor = this._getBackgroundColor(bgColorMode, bgColor, inverse, dim);\n // Use a 'copy' composite operation to clear any existing glyph out of _tmpCtxWithAlpha, regardless of\n // transparency in backgroundColor\n this._tmpCtx.globalCompositeOperation = 'copy';\n this._tmpCtx.fillStyle = backgroundColor.css;\n this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height);\n this._tmpCtx.globalCompositeOperation = 'source-over';\n\n // draw the foreground/glyph\n const fontWeight = bold ? this._config.fontWeightBold : this._config.fontWeight;\n const fontStyle = italic ? 'italic' : '';\n this._tmpCtx.font =\n `${fontStyle} ${fontWeight} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`;\n this._tmpCtx.textBaseline = TEXT_BASELINE;\n\n const powerlineGlyph = chars.length === 1 && isPowerlineGlyph(chars.charCodeAt(0));\n const restrictedPowerlineGlyph = chars.length === 1 && isRestrictedPowerlineGlyph(chars.charCodeAt(0));\n const foregroundColor = this._getForegroundColor(bg, bgColorMode, bgColor, fg, fgColorMode, fgColor, inverse, dim, bold, excludeFromContrastRatioDemands(chars.charCodeAt(0)));\n this._tmpCtx.fillStyle = foregroundColor.css;\n\n // For powerline glyphs left/top padding is excluded (https://github.com/microsoft/vscode/issues/120129)\n const padding = restrictedPowerlineGlyph ? 0 : TMP_CANVAS_GLYPH_PADDING * 2;\n\n // Draw custom characters if applicable\n let customGlyph = false;\n if (this._config.customGlyphs !== false) {\n customGlyph = tryDrawCustomChar(this._tmpCtx, chars, padding, padding, this._config.deviceCellWidth, this._config.deviceCellHeight, this._config.fontSize, this._config.devicePixelRatio);\n }\n\n // Whether to clear pixels based on a threshold difference between the glyph color and the\n // background color. This should be disabled when the glyph contains multiple colors such as\n // underline colors to prevent important colors could get cleared.\n let enableClearThresholdCheck = !powerlineGlyph;\n\n let chWidth: number;\n if (typeof codeOrChars === 'number') {\n chWidth = this._unicodeService.wcwidth(codeOrChars);\n } else {\n chWidth = this._unicodeService.getStringCellWidth(codeOrChars);\n }\n\n // Draw underline\n if (underline) {\n this._tmpCtx.save();\n const lineWidth = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15));\n // When the line width is odd, draw at a 0.5 position\n const yOffset = lineWidth % 2 === 1 ? 0.5 : 0;\n this._tmpCtx.lineWidth = lineWidth;\n\n // Underline color\n if (this._workAttributeData.isUnderlineColorDefault()) {\n this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle;\n } else if (this._workAttributeData.isUnderlineColorRGB()) {\n enableClearThresholdCheck = false;\n this._tmpCtx.strokeStyle = `rgb(${AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(',')})`;\n } else {\n enableClearThresholdCheck = false;\n let fg = this._workAttributeData.getUnderlineColor();\n if (this._config.drawBoldTextInBrightColors && this._workAttributeData.isBold() && fg < 8) {\n fg += 8;\n }\n this._tmpCtx.strokeStyle = this._getColorFromAnsiIndex(fg).css;\n }\n\n // Underline style/stroke\n this._tmpCtx.beginPath();\n const xLeft = padding;\n const yTop = Math.ceil(padding + this._config.deviceCharHeight) - yOffset;\n const yMid = padding + this._config.deviceCharHeight + lineWidth - yOffset;\n const yBot = Math.ceil(padding + this._config.deviceCharHeight + lineWidth * 2) - yOffset;\n\n for (let i = 0; i < chWidth; i++) {\n this._tmpCtx.save();\n const xChLeft = xLeft + i * this._config.deviceCellWidth;\n const xChRight = xLeft + (i + 1) * this._config.deviceCellWidth;\n const xChMid = xChLeft + this._config.deviceCellWidth / 2;\n switch (this._workAttributeData.extended.underlineStyle) {\n case UnderlineStyle.DOUBLE:\n this._tmpCtx.moveTo(xChLeft, yTop);\n this._tmpCtx.lineTo(xChRight, yTop);\n this._tmpCtx.moveTo(xChLeft, yBot);\n this._tmpCtx.lineTo(xChRight, yBot);\n break;\n case UnderlineStyle.CURLY:\n // Choose the bezier top and bottom based on the device pixel ratio, the curly line is\n // made taller when the line width is as otherwise it's not very clear otherwise.\n const yCurlyBot = lineWidth <= 1 ? yBot : Math.ceil(padding + this._config.deviceCharHeight - lineWidth / 2) - yOffset;\n const yCurlyTop = lineWidth <= 1 ? yTop : Math.ceil(padding + this._config.deviceCharHeight + lineWidth / 2) - yOffset;\n // Clip the left and right edges of the underline such that it can be drawn just outside\n // the edge of the cell to ensure a continuous stroke when there are multiple underlined\n // glyphs adjacent to one another.\n const clipRegion = new Path2D();\n clipRegion.rect(xChLeft, yTop, this._config.deviceCellWidth, yBot - yTop);\n this._tmpCtx.clip(clipRegion);\n // Start 1/2 cell before and end 1/2 cells after to ensure a smooth curve with other cells\n this._tmpCtx.moveTo(xChLeft - this._config.deviceCellWidth / 2, yMid);\n this._tmpCtx.bezierCurveTo(\n xChLeft - this._config.deviceCellWidth / 2, yCurlyTop,\n xChLeft, yCurlyTop,\n xChLeft, yMid\n );\n this._tmpCtx.bezierCurveTo(\n xChLeft, yCurlyBot,\n xChMid, yCurlyBot,\n xChMid, yMid\n );\n this._tmpCtx.bezierCurveTo(\n xChMid, yCurlyTop,\n xChRight, yCurlyTop,\n xChRight, yMid\n );\n this._tmpCtx.bezierCurveTo(\n xChRight, yCurlyBot,\n xChRight + this._config.deviceCellWidth / 2, yCurlyBot,\n xChRight + this._config.deviceCellWidth / 2, yMid\n );\n break;\n case UnderlineStyle.DOTTED:\n this._tmpCtx.setLineDash([this._config.devicePixelRatio * 2, this._config.devicePixelRatio]);\n this._tmpCtx.moveTo(xChLeft, yTop);\n this._tmpCtx.lineTo(xChRight, yTop);\n break;\n case UnderlineStyle.DASHED:\n this._tmpCtx.setLineDash([this._config.devicePixelRatio * 4, this._config.devicePixelRatio * 3]);\n this._tmpCtx.moveTo(xChLeft, yTop);\n this._tmpCtx.lineTo(xChRight, yTop);\n break;\n case UnderlineStyle.SINGLE:\n default:\n this._tmpCtx.moveTo(xChLeft, yTop);\n this._tmpCtx.lineTo(xChRight, yTop);\n break;\n }\n this._tmpCtx.stroke();\n this._tmpCtx.restore();\n }\n this._tmpCtx.restore();\n\n // Draw stroke in the background color for non custom characters in order to give an outline\n // between the text and the underline. Only do this when font size is >= 12 as the underline\n // looks odd when the font size is too small\n if (!customGlyph && this._config.fontSize >= 12) {\n // This only works when transparency is disabled because it's not clear how to clear stroked\n // text\n if (!this._config.allowTransparency && chars !== ' ') {\n // Measure the text, only draw the stroke if there is a descent beyond an alphabetic text\n // baseline\n this._tmpCtx.save();\n this._tmpCtx.textBaseline = 'alphabetic';\n const metrics = this._tmpCtx.measureText(chars);\n this._tmpCtx.restore();\n if ('actualBoundingBoxDescent' in metrics && metrics.actualBoundingBoxDescent > 0) {\n // This translates to 1/2 the line width in either direction\n this._tmpCtx.save();\n // Clip the region to only draw in valid pixels near the underline to avoid a slight\n // outline around the whole glyph, as well as additional pixels in the glyph at the top\n // which would increase GPU memory demands\n const clipRegion = new Path2D();\n clipRegion.rect(xLeft, yTop - Math.ceil(lineWidth / 2), this._config.deviceCellWidth, yBot - yTop + Math.ceil(lineWidth / 2));\n this._tmpCtx.clip(clipRegion);\n this._tmpCtx.lineWidth = this._config.devicePixelRatio * 3;\n this._tmpCtx.strokeStyle = backgroundColor.css;\n this._tmpCtx.strokeText(chars, padding, padding + this._config.deviceCharHeight);\n this._tmpCtx.restore();\n }\n }\n }\n }\n\n // Draw the character\n if (!customGlyph) {\n this._tmpCtx.fillText(chars, padding, padding + this._config.deviceCharHeight);\n }\n\n // If this charcater is underscore and beyond the cell bounds, shift it up until it is visible\n // even on the bottom row, try for a maximum of 5 pixels.\n if (chars === '_' && !this._config.allowTransparency) {\n let isBeyondCellBounds = clearColor(this._tmpCtx.getImageData(padding, padding, this._config.deviceCellWidth, this._config.deviceCellHeight), backgroundColor, foregroundColor, enableClearThresholdCheck);\n if (isBeyondCellBounds) {\n for (let offset = 1; offset <= 5; offset++) {\n this._tmpCtx.save();\n this._tmpCtx.fillStyle = backgroundColor.css;\n this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height);\n this._tmpCtx.restore();\n this._tmpCtx.fillText(chars, padding, padding + this._config.deviceCharHeight - offset);\n isBeyondCellBounds = clearColor(this._tmpCtx.getImageData(padding, padding, this._config.deviceCellWidth, this._config.deviceCellHeight), backgroundColor, foregroundColor, enableClearThresholdCheck);\n if (!isBeyondCellBounds) {\n break;\n }\n }\n }\n }\n\n // Draw strokethrough\n if (strikethrough) {\n const lineWidth = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 10));\n const yOffset = this._tmpCtx.lineWidth % 2 === 1 ? 0.5 : 0; // When the width is odd, draw at 0.5 position\n this._tmpCtx.lineWidth = lineWidth;\n this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle;\n this._tmpCtx.beginPath();\n this._tmpCtx.moveTo(padding, padding + Math.floor(this._config.deviceCharHeight / 2) - yOffset);\n this._tmpCtx.lineTo(padding + this._config.deviceCharWidth * chWidth, padding + Math.floor(this._config.deviceCharHeight / 2) - yOffset);\n this._tmpCtx.stroke();\n }\n\n this._tmpCtx.restore();\n\n // clear the background from the character to avoid issues with drawing over the previous\n // character if it extends past it's bounds\n const imageData = this._tmpCtx.getImageData(\n 0, 0, this._tmpCanvas.width, this._tmpCanvas.height\n );\n\n // Clear out the background color and determine if the glyph is empty.\n let isEmpty: boolean;\n if (!this._config.allowTransparency) {\n isEmpty = clearColor(imageData, backgroundColor, foregroundColor, enableClearThresholdCheck);\n } else {\n isEmpty = checkCompletelyTransparent(imageData);\n }\n\n // Handle empty glyphs\n if (isEmpty) {\n return NULL_RASTERIZED_GLYPH;\n }\n\n const rasterizedGlyph = this._findGlyphBoundingBox(imageData, this._workBoundingBox, allowedWidth, restrictedPowerlineGlyph, customGlyph, padding);\n\n // Find the best atlas row to use\n let activePage: AtlasPage;\n let activeRow: ICharAtlasActiveRow;\n while (true) {\n // If there are no active pages (the last smallest 4 were merged), create a new one\n if (this._activePages.length === 0) {\n const newPage = this._createNewPage();\n activePage = newPage;\n activeRow = newPage.currentRow;\n activeRow.height = rasterizedGlyph.size.y;\n break;\n }\n\n // Get the best current row from all active pages\n activePage = this._activePages[this._activePages.length - 1];\n activeRow = activePage.currentRow;\n for (const p of this._activePages) {\n if (rasterizedGlyph.size.y <= p.currentRow.height) {\n activePage = p;\n activeRow = p.currentRow;\n }\n }\n\n // TODO: This algorithm could be simplified:\n // - Search for the page with ROW_PIXEL_THRESHOLD in mind\n // - Keep track of current/fixed rows in a Map\n\n // Replace the best current row with a fixed row if there is one at least as good as the\n // current row. Search in reverse to prioritize filling in older pages.\n for (let i = this._activePages.length - 1; i >= 0; i--) {\n for (const row of this._activePages[i].fixedRows) {\n if (row.height <= activeRow.height && rasterizedGlyph.size.y <= row.height) {\n activePage = this._activePages[i];\n activeRow = row;\n }\n }\n }\n\n // Create a new one if too much vertical space would be wasted or there is not enough room\n // left in the page. The previous active row will become fixed in the process as it now has a\n // fixed height\n if (activeRow.y + rasterizedGlyph.size.y >= activePage.canvas.height || activeRow.height > rasterizedGlyph.size.y + Constants.ROW_PIXEL_THRESHOLD) {\n // Create the new fixed height row, creating a new page if there isn't enough room on the\n // current page\n let wasNewPageCreated = false;\n if (activePage.currentRow.y + activePage.currentRow.height + rasterizedGlyph.size.y >= activePage.canvas.height) {\n // Find the first page with room to create the new row on\n let candidatePage: AtlasPage | undefined;\n for (const p of this._activePages) {\n if (p.currentRow.y + p.currentRow.height + rasterizedGlyph.size.y < p.canvas.height) {\n candidatePage = p;\n break;\n }\n }\n if (candidatePage) {\n activePage = candidatePage;\n } else {\n // Create a new page if there is no room\n const newPage = this._createNewPage();\n activePage = newPage;\n activeRow = newPage.currentRow;\n activeRow.height = rasterizedGlyph.size.y;\n wasNewPageCreated = true;\n }\n }\n if (!wasNewPageCreated) {\n // Fix the current row as the new row is being added below\n if (activePage.currentRow.height > 0) {\n activePage.fixedRows.push(activePage.currentRow);\n }\n activeRow = {\n x: 0,\n y: activePage.currentRow.y + activePage.currentRow.height,\n height: rasterizedGlyph.size.y\n };\n activePage.fixedRows.push(activeRow);\n\n // Create the new current row below the new fixed height row\n activePage.currentRow = {\n x: 0,\n y: activeRow.y + activeRow.height,\n height: 0\n };\n }\n // TODO: Remove pages from _activePages when all rows are filled\n }\n\n // Exit the loop if there is enough room in the row\n if (activeRow.x + rasterizedGlyph.size.x <= activePage.canvas.width) {\n break;\n }\n\n // If there is not enough room in the current row, finish it and try again\n if (activeRow === activePage.currentRow) {\n activeRow.x = 0;\n activeRow.y += activeRow.height;\n activeRow.height = 0;\n } else {\n activePage.fixedRows.splice(activePage.fixedRows.indexOf(activeRow), 1);\n }\n }\n\n // Record texture position\n rasterizedGlyph.texturePage = this._pages.indexOf(activePage);\n rasterizedGlyph.texturePosition.x = activeRow.x;\n rasterizedGlyph.texturePosition.y = activeRow.y;\n rasterizedGlyph.texturePositionClipSpace.x = activeRow.x / activePage.canvas.width;\n rasterizedGlyph.texturePositionClipSpace.y = activeRow.y / activePage.canvas.height;\n\n // Fix the clipspace position as pages may be of differing size\n rasterizedGlyph.sizeClipSpace.x /= activePage.canvas.width;\n rasterizedGlyph.sizeClipSpace.y /= activePage.canvas.height;\n\n // Update atlas current row, for fixed rows the glyph height will never be larger than the row\n // height\n activeRow.height = Math.max(activeRow.height, rasterizedGlyph.size.y);\n activeRow.x += rasterizedGlyph.size.x;\n\n // putImageData doesn't do any blending, so it will overwrite any existing cache entry for us\n activePage.ctx.putImageData(\n imageData,\n rasterizedGlyph.texturePosition.x - this._workBoundingBox.left,\n rasterizedGlyph.texturePosition.y - this._workBoundingBox.top,\n this._workBoundingBox.left,\n this._workBoundingBox.top,\n rasterizedGlyph.size.x,\n rasterizedGlyph.size.y\n );\n activePage.addGlyph(rasterizedGlyph);\n activePage.version++;\n\n return rasterizedGlyph;\n }\n\n /**\n * Given an ImageData object, find the bounding box of the non-transparent\n * portion of the texture and return an IRasterizedGlyph with these\n * dimensions.\n * @param imageData The image data to read.\n * @param boundingBox An IBoundingBox to put the clipped bounding box values.\n */\n private _findGlyphBoundingBox(imageData: ImageData, boundingBox: IBoundingBox, allowedWidth: number, restrictedGlyph: boolean, customGlyph: boolean, padding: number): IRasterizedGlyph {\n boundingBox.top = 0;\n const height = restrictedGlyph ? this._config.deviceCellHeight : this._tmpCanvas.height;\n const width = restrictedGlyph ? this._config.deviceCellWidth : allowedWidth;\n let found = false;\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n const alphaOffset = y * this._tmpCanvas.width * 4 + x * 4 + 3;\n if (imageData.data[alphaOffset] !== 0) {\n boundingBox.top = y;\n found = true;\n break;\n }\n }\n if (found) {\n break;\n }\n }\n boundingBox.left = 0;\n found = false;\n for (let x = 0; x < padding + width; x++) {\n for (let y = 0; y < height; y++) {\n const alphaOffset = y * this._tmpCanvas.width * 4 + x * 4 + 3;\n if (imageData.data[alphaOffset] !== 0) {\n boundingBox.left = x;\n found = true;\n break;\n }\n }\n if (found) {\n break;\n }\n }\n boundingBox.right = width;\n found = false;\n for (let x = padding + width - 1; x >= padding; x--) {\n for (let y = 0; y < height; y++) {\n const alphaOffset = y * this._tmpCanvas.width * 4 + x * 4 + 3;\n if (imageData.data[alphaOffset] !== 0) {\n boundingBox.right = x;\n found = true;\n break;\n }\n }\n if (found) {\n break;\n }\n }\n boundingBox.bottom = height;\n found = false;\n for (let y = height - 1; y >= 0; y--) {\n for (let x = 0; x < width; x++) {\n const alphaOffset = y * this._tmpCanvas.width * 4 + x * 4 + 3;\n if (imageData.data[alphaOffset] !== 0) {\n boundingBox.bottom = y;\n found = true;\n break;\n }\n }\n if (found) {\n break;\n }\n }\n return {\n texturePage: 0,\n texturePosition: { x: 0, y: 0 },\n texturePositionClipSpace: { x: 0, y: 0 },\n size: {\n x: boundingBox.right - boundingBox.left + 1,\n y: boundingBox.bottom - boundingBox.top + 1\n },\n sizeClipSpace: {\n x: (boundingBox.right - boundingBox.left + 1),\n y: (boundingBox.bottom - boundingBox.top + 1)\n },\n offset: {\n x: -boundingBox.left + padding + ((restrictedGlyph || customGlyph) ? Math.floor((this._config.deviceCellWidth - this._config.deviceCharWidth) / 2) : 0),\n y: -boundingBox.top + padding + ((restrictedGlyph || customGlyph) ? this._config.lineHeight === 1 ? 0 : Math.round((this._config.deviceCellHeight - this._config.deviceCharHeight) / 2) : 0)\n }\n };\n }\n}\n\nclass AtlasPage {\n public readonly canvas: HTMLCanvasElement;\n public readonly ctx: CanvasRenderingContext2D;\n\n private _usedPixels: number = 0;\n public get percentageUsed(): number { return this._usedPixels / (this.canvas.width * this.canvas.height); }\n\n private readonly _glyphs: IRasterizedGlyph[] = [];\n public get glyphs(): ReadonlyArray<IRasterizedGlyph> { return this._glyphs; }\n public addGlyph(glyph: IRasterizedGlyph): void {\n this._glyphs.push(glyph);\n this._usedPixels += glyph.size.x * glyph.size.y;\n }\n\n /**\n * Used to check whether the canvas of the atlas page has changed.\n */\n public version = 0;\n\n // Texture atlas current positioning data. The texture packing strategy used is to fill from\n // left-to-right and top-to-bottom. When the glyph being written is less than half of the current\n // row's height, the following happens:\n //\n // - The current row becomes the fixed height row A\n // - A new fixed height row B the exact size of the glyph is created below the current row\n // - A new dynamic height current row is created below B\n //\n // This strategy does a good job preventing space being wasted for very short glyphs such as\n // underscores, hyphens etc. or those with underlines rendered.\n public currentRow: ICharAtlasActiveRow = {\n x: 0,\n y: 0,\n height: 0\n };\n public readonly fixedRows: ICharAtlasActiveRow[] = [];\n\n constructor(\n document: Document,\n size: number,\n sourcePages?: AtlasPage[]\n ) {\n if (sourcePages) {\n for (const p of sourcePages) {\n this._glyphs.push(...p.glyphs);\n this._usedPixels += p._usedPixels;\n }\n }\n this.canvas = createCanvas(document, size, size);\n // The canvas needs alpha because we use clearColor to convert the background color to alpha.\n // It might also contain some characters with transparent backgrounds if allowTransparency is\n // set.\n this.ctx = throwIfFalsy(this.canvas.getContext('2d', { alpha: true }));\n }\n\n public clear(): void {\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.currentRow.x = 0;\n this.currentRow.y = 0;\n this.currentRow.height = 0;\n this.fixedRows.length = 0;\n this.version++;\n }\n}\n\n/**\n * Makes a particular rgb color and colors that are nearly the same in an ImageData completely\n * transparent.\n * @returns True if the result is \"empty\", meaning all pixels are fully transparent.\n */\nfunction clearColor(imageData: ImageData, bg: IColor, fg: IColor, enableThresholdCheck: boolean): boolean {\n // Get color channels\n const r = bg.rgba >>> 24;\n const g = bg.rgba >>> 16 & 0xFF;\n const b = bg.rgba >>> 8 & 0xFF;\n const fgR = fg.rgba >>> 24;\n const fgG = fg.rgba >>> 16 & 0xFF;\n const fgB = fg.rgba >>> 8 & 0xFF;\n\n // Calculate a threshold that when below a color will be treated as transpart when the sum of\n // channel value differs. This helps improve rendering when glyphs overlap with others. This\n // threshold is calculated relative to the difference between the background and foreground to\n // ensure important details of the glyph are always shown, even when the contrast ratio is low.\n // The number 12 is largely arbitrary to ensure the pixels that escape the cell in the test case\n // were covered (fg=#8ae234, bg=#c4a000).\n const threshold = Math.floor((Math.abs(r - fgR) + Math.abs(g - fgG) + Math.abs(b - fgB)) / 12);\n\n // Set alpha channel of relevent pixels to 0\n let isEmpty = true;\n for (let offset = 0; offset < imageData.data.length; offset += 4) {\n // Check exact match\n if (imageData.data[offset] === r &&\n imageData.data[offset + 1] === g &&\n imageData.data[offset + 2] === b) {\n imageData.data[offset + 3] = 0;\n } else {\n // Check the threshold based difference\n if (enableThresholdCheck &&\n (Math.abs(imageData.data[offset] - r) +\n Math.abs(imageData.data[offset + 1] - g) +\n Math.abs(imageData.data[offset + 2] - b)) < threshold) {\n imageData.data[offset + 3] = 0;\n } else {\n isEmpty = false;\n }\n }\n }\n\n return isEmpty;\n}\n\nfunction checkCompletelyTransparent(imageData: ImageData): boolean {\n for (let offset = 0; offset < imageData.data.length; offset += 4) {\n if (imageData.data[offset + 3] > 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction createCanvas(document: Document, width: number, height: number): HTMLCanvasElement {\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n return canvas;\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, CharData } from 'common/Types';\nimport { ICharacterJoiner } from 'browser/Types';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\n\nexport class JoinedCellData extends AttributeData implements ICellData {\n private _width: number;\n // .content carries no meaning for joined CellData, simply nullify it\n // thus we have to overload all other .content accessors\n public content: number = 0;\n public fg: number;\n public bg: number;\n public combinedData: string = '';\n\n constructor(firstCell: ICellData, chars: string, width: number) {\n super();\n this.fg = firstCell.fg;\n this.bg = firstCell.bg;\n this.combinedData = chars;\n this._width = width;\n }\n\n public isCombined(): number {\n // always mark joined cell data as combined\n return Content.IS_COMBINED_MASK;\n }\n\n public getWidth(): number {\n return this._width;\n }\n\n public getChars(): string {\n return this.combinedData;\n }\n\n public getCode(): number {\n // code always gets the highest possible fake codepoint (read as -1)\n // this is needed as code is used by caches as identifier\n return 0x1FFFFF;\n }\n\n public setFromCharData(value: CharData): void {\n throw new Error('not implemented');\n }\n\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n\nexport class CharacterJoinerService implements ICharacterJoinerService {\n public serviceBrand: undefined;\n\n private _characterJoiners: ICharacterJoiner[] = [];\n private _nextCharacterJoinerId: number = 0;\n private _workCell: CellData = new CellData();\n\n constructor(\n @IBufferService private _bufferService: IBufferService\n ) { }\n\n public register(handler: (text: string) => [number, number][]): number {\n const joiner: ICharacterJoiner = {\n id: this._nextCharacterJoinerId++,\n handler\n };\n\n this._characterJoiners.push(joiner);\n return joiner.id;\n }\n\n public deregister(joinerId: number): boolean {\n for (let i = 0; i < this._characterJoiners.length; i++) {\n if (this._characterJoiners[i].id === joinerId) {\n this._characterJoiners.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n public getJoinedCharacters(row: number): [number, number][] {\n if (this._characterJoiners.length === 0) {\n return [];\n }\n\n const line = this._bufferService.buffer.lines.get(row);\n if (!line || line.length === 0) {\n return [];\n }\n\n const ranges: [number, number][] = [];\n const lineStr = line.translateToString(true);\n\n // Because some cells can be represented by multiple javascript characters,\n // we track the cell and the string indexes separately. This allows us to\n // translate the string ranges we get from the joiners back into cell ranges\n // for use when rendering\n let rangeStartColumn = 0;\n let currentStringIndex = 0;\n let rangeStartStringIndex = 0;\n let rangeAttrFG = line.getFg(0);\n let rangeAttrBG = line.getBg(0);\n\n for (let x = 0; x < line.getTrimmedLength(); x++) {\n line.loadCell(x, this._workCell);\n\n if (this._workCell.getWidth() === 0) {\n // If this character is of width 0, skip it.\n continue;\n }\n\n // End of range\n if (this._workCell.fg !== rangeAttrFG || this._workCell.bg !== rangeAttrBG) {\n // If we ended up with a sequence of more than one character,\n // look for ranges to join.\n if (x - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n // Reset our markers for a new range.\n rangeStartColumn = x;\n rangeStartStringIndex = currentStringIndex;\n rangeAttrFG = this._workCell.fg;\n rangeAttrBG = this._workCell.bg;\n }\n\n currentStringIndex += this._workCell.getChars().length || WHITESPACE_CELL_CHAR.length;\n }\n\n // Process any trailing ranges.\n if (this._bufferService.cols - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n return ranges;\n }\n\n /**\n * Given a segment of a line of text, find all ranges of text that should be\n * joined in a single rendering unit. Ranges are internally converted to\n * column ranges, rather than string ranges.\n * @param line String representation of the full line of text\n * @param startIndex Start position of the range to search in the string (inclusive)\n * @param endIndex End position of the range to search in the string (exclusive)\n */\n private _getJoinedRanges(line: string, startIndex: number, endIndex: number, lineData: IBufferLine, startCol: number): [number, number][] {\n const text = line.substring(startIndex, endIndex);\n // At this point we already know that there is at least one joiner so\n // we can just pull its value and assign it directly rather than\n // merging it into an empty array, which incurs unnecessary writes.\n let allJoinedRanges: [number, number][] = [];\n try {\n allJoinedRanges = this._characterJoiners[0].handler(text);\n } catch (error) {\n console.error(error);\n }\n for (let i = 1; i < this._characterJoiners.length; i++) {\n // We merge any overlapping ranges across the different joiners\n try {\n const joinerRanges = this._characterJoiners[i].handler(text);\n for (let j = 0; j < joinerRanges.length; j++) {\n CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);\n }\n } catch (error) {\n console.error(error);\n }\n }\n this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);\n return allJoinedRanges;\n }\n\n /**\n * Modifies the provided ranges in-place to adjust for variations between\n * string length and cell width so that the range represents a cell range,\n * rather than the string range the joiner provides.\n * @param ranges String ranges containing start (inclusive) and end (exclusive) index\n * @param line Cell data for the relevant line in the terminal\n * @param startCol Offset within the line to start from\n */\n private _stringRangesToCellRanges(ranges: [number, number][], line: IBufferLine, startCol: number): void {\n let currentRangeIndex = 0;\n let currentRangeStarted = false;\n let currentStringIndex = 0;\n let currentRange = ranges[currentRangeIndex];\n\n // If we got through all of the ranges, stop searching\n if (!currentRange) {\n return;\n }\n\n for (let x = startCol; x < this._bufferService.cols; x++) {\n const width = line.getWidth(x);\n const length = line.getString(x).length || WHITESPACE_CELL_CHAR.length;\n\n // We skip zero-width characters when creating the string to join the text\n // so we do the same here\n if (width === 0) {\n continue;\n }\n\n // Adjust the start of the range\n if (!currentRangeStarted && currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n }\n\n // Adjust the end of the range\n if (currentRange[1] <= currentStringIndex) {\n currentRange[1] = x;\n\n // We're finished with this range, so we move to the next one\n currentRange = ranges[++currentRangeIndex];\n\n // If there are no more ranges left, stop searching\n if (!currentRange) {\n break;\n }\n\n // Ranges can be on adjacent characters. Because the end index of the\n // ranges are exclusive, this means that the index for the start of a\n // range can be the same as the end index of the previous range. To\n // account for the start of the next range, we check here just in case.\n if (currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n } else {\n currentRangeStarted = false;\n }\n }\n\n // Adjust the string index based on the character length to line up with\n // the column adjustment\n currentStringIndex += length;\n }\n\n // If there is still a range left at the end, it must extend all the way to\n // the end of the line.\n if (currentRange) {\n currentRange[1] = this._bufferService.cols;\n }\n }\n\n /**\n * Merges the range defined by the provided start and end into the list of\n * existing ranges. The merge is done in place on the existing range for\n * performance and is also returned.\n * @param ranges Existing range list\n * @param newRange Tuple of two numbers representing the new range to merge in.\n * @returns The ranges input with the new range merged in place\n */\n private static _mergeRanges(ranges: [number, number][], newRange: [number, number]): [number, number][] {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, newRange);\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRange[0], range[0]);\n return ranges;\n }\n\n if (newRange[0] < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRange[0], range[0]);\n inRange = true;\n }\n\n // Case 4: New range starts after the search range\n continue;\n } else {\n if (newRange[1] <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRange[1];\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRange[1], range[1]);\n ranges.splice(i, 1);\n return ranges;\n }\n\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRange[1];\n } else {\n // Case 9: New range starts after the last existing range\n ranges.push(newRange);\n }\n\n return ranges;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isNode } from 'common/Platform';\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\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 rgba.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', '#rrggbbaa').\n */\nexport namespace css {\n let $ctx: CanvasRenderingContext2D | undefined;\n let $litmusColor: CanvasGradient | undefined;\n if (!isNode) {\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\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 rgba.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 rgba.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 rgba.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 /**\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 // FIXME: Move this to channels NS?\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 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\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","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\ninterface IListener<T, U = void> {\n (arg1: T, arg2: U): void;\n}\n\nexport interface IEvent<T, U = void> {\n (listener: (arg1: T, arg2: U) => any): IDisposable;\n}\n\nexport interface IEventEmitter<T, U = void> {\n event: IEvent<T, U>;\n fire(arg1: T, arg2: U): void;\n dispose(): void;\n}\n\nexport class EventEmitter<T, U = void> implements IEventEmitter<T, U> {\n private _listeners: IListener<T, U>[] = [];\n private _event?: IEvent<T, U>;\n private _disposed: boolean = false;\n\n public get event(): IEvent<T, U> {\n if (!this._event) {\n this._event = (listener: (arg1: T, arg2: U) => any) => {\n this._listeners.push(listener);\n const disposable = {\n dispose: () => {\n if (!this._disposed) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n }\n }\n };\n return disposable;\n };\n }\n return this._event;\n }\n\n public fire(arg1: T, arg2: U): void {\n const queue: IListener<T, U>[] = [];\n for (let i = 0; i < this._listeners.length; i++) {\n queue.push(this._listeners[i]);\n }\n for (let i = 0; i < queue.length; i++) {\n queue[i].call(undefined, arg1, arg2);\n }\n }\n\n public dispose(): void {\n if (this._listeners) {\n this._listeners.length = 0;\n }\n this._disposed = true;\n }\n}\n\nexport function forwardEvent<T>(from: IEvent<T>, to: IEventEmitter<T>): IDisposable {\n return from(e => to.fire(e));\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * A base class that can be extended to provide convenience methods for managing the lifecycle of an\n * object and its components.\n */\nexport abstract class Disposable implements IDisposable {\n protected _disposables: IDisposable[] = [];\n protected _isDisposed: boolean = false;\n\n constructor() {\n }\n\n /**\n * Disposes the object, triggering the `dispose` method on all registered IDisposables.\n */\n public dispose(): void {\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.length = 0;\n }\n\n /**\n * Registers a disposable object.\n * @param d The disposable to register.\n * @returns The disposable.\n */\n public register<T extends IDisposable>(d: T): T {\n this._disposables.push(d);\n return d;\n }\n\n /**\n * Unregisters a disposable object if it has been registered, if not do\n * nothing.\n * @param d The disposable to unregister.\n */\n public unregister<T extends IDisposable>(d: T): void {\n const index = this._disposables.indexOf(d);\n if (index !== -1) {\n this._disposables.splice(index, 1);\n }\n }\n}\n\n/**\n * Wrap a function in a disposable.\n */\nexport function toDisposable(f: () => void): IDisposable {\n return { dispose: f };\n}\n\n/**\n * Dispose of all disposables in an array and set its length to 0.\n */\nexport function disposeArray(disposables: IDisposable[]): void {\n for (const d of disposables) {\n d.dispose();\n }\n disposables.length = 0;\n}\n\n/**\n * Creates a disposable that will dispose of an array of disposables when disposed.\n */\nexport function getDisposeArrayDisposable(array: IDisposable[]): IDisposable {\n return { dispose: () => disposeArray(array) };\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport class TwoKeyMap<TFirst extends string | number, TSecond extends string | number, TValue> {\n private _data: { [bg: string | number]: { [fg: string | number]: TValue | undefined } | undefined } = {};\n\n public set(first: TFirst, second: TSecond, value: TValue): void {\n if (!this._data[first]) {\n this._data[first] = {};\n }\n this._data[first as string | number]![second] = value;\n }\n\n public get(first: TFirst, second: TSecond): TValue | undefined {\n return this._data[first as string | number] ? this._data[first as string | number]![second] : undefined;\n }\n\n public clear(): void {\n this._data = {};\n }\n}\n\nexport class FourKeyMap<TFirst extends string | number, TSecond extends string | number, TThird extends string | number, TFourth extends string | number, TValue> {\n private _data: TwoKeyMap<TFirst, TSecond, TwoKeyMap<TThird, TFourth, TValue>> = new TwoKeyMap();\n\n public set(first: TFirst, second: TSecond, third: TThird, fourth: TFourth, value: TValue): void {\n if (!this._data.get(first, second)) {\n this._data.set(first, second, new TwoKeyMap());\n }\n this._data.get(first, second)!.set(third, fourth, value);\n }\n\n public get(first: TFirst, second: TSecond, third: TThird, fourth: TFourth): TValue | undefined {\n return this._data.get(first, second)?.get(third, fourth);\n }\n\n public clear(): void {\n this._data.clear();\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface INavigator {\n userAgent: string;\n language: string;\n platform: string;\n}\n\n// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but\n// we want this module to live in common.\ndeclare const navigator: INavigator;\n\nexport const isNode = (typeof navigator === 'undefined') ? true : false;\nconst userAgent = (isNode) ? 'node' : navigator.userAgent;\nconst platform = (isNode) ? 'node' : navigator.platform;\n\nexport const isFirefox = userAgent.includes('Firefox');\nexport const isLegacyEdge = userAgent.includes('Edge');\nexport const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\nexport function getSafariVersion(): number {\n if (!isSafari) {\n return 0;\n }\n const majorVersion = userAgent.match(/Version\\/(\\d+)/);\n if (majorVersion === null || majorVersion.length < 2) {\n return 0;\n }\n return parseInt(majorVersion[1]);\n}\n\n// Find the users platform. We use this to interpret the meta key\n// and ISO third level shifts.\n// http://stackoverflow.com/q/19877924/577598\nexport const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);\nexport const isIpad = platform === 'iPad';\nexport const isIphone = platform === 'iPhone';\nexport const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);\nexport const isLinux = platform.indexOf('Linux') >= 0;\n// Note that when this is true, isLinux will also be true.\nexport const isChromeOS = /\\bCrOS\\b/.test(userAgent);\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isNode } from 'common/Platform';\n\ninterface ITaskQueue {\n /**\n * Adds a task to the queue which will run in a future idle callback.\n * To avoid perceivable stalls on the mainthread, tasks with heavy workload\n * should split their work into smaller pieces and return `true` to get\n * called again until the work is done (on falsy return value).\n */\n enqueue(task: () => boolean | void): void;\n\n /**\n * Flushes the queue, running all remaining tasks synchronously.\n */\n flush(): void;\n\n /**\n * Clears any remaining tasks from the queue, these will not be run.\n */\n clear(): void;\n}\n\ninterface ITaskDeadline {\n timeRemaining(): number;\n}\ntype CallbackWithDeadline = (deadline: ITaskDeadline) => void;\n\nabstract class TaskQueue implements ITaskQueue {\n private _tasks: (() => boolean | void)[] = [];\n private _idleCallback?: number;\n private _i = 0;\n\n protected abstract _requestCallback(callback: CallbackWithDeadline): number;\n protected abstract _cancelCallback(identifier: number): void;\n\n public enqueue(task: () => boolean | void): void {\n this._tasks.push(task);\n this._start();\n }\n\n public flush(): void {\n while (this._i < this._tasks.length) {\n if (!this._tasks[this._i]()) {\n this._i++;\n }\n }\n this.clear();\n }\n\n public clear(): void {\n if (this._idleCallback) {\n this._cancelCallback(this._idleCallback);\n this._idleCallback = undefined;\n }\n this._i = 0;\n this._tasks.length = 0;\n }\n\n private _start(): void {\n if (!this._idleCallback) {\n this._idleCallback = this._requestCallback(this._process.bind(this));\n }\n }\n\n private _process(deadline: ITaskDeadline): void {\n this._idleCallback = undefined;\n let taskDuration = 0;\n let longestTask = 0;\n let lastDeadlineRemaining = deadline.timeRemaining();\n let deadlineRemaining = 0;\n while (this._i < this._tasks.length) {\n taskDuration = Date.now();\n if (!this._tasks[this._i]()) {\n this._i++;\n }\n // other than performance.now, Date.now might not be stable (changes on wall clock changes),\n // this is not an issue here as a clock change during a short running task is very unlikely\n // in case it still happened and leads to negative duration, simply assume 1 msec\n taskDuration = Math.max(1, Date.now() - taskDuration);\n longestTask = Math.max(taskDuration, longestTask);\n // Guess the following task will take a similar time to the longest task in this batch, allow\n // additional room to try avoid exceeding the deadline\n deadlineRemaining = deadline.timeRemaining();\n if (longestTask * 1.5 > deadlineRemaining) {\n // Warn when the time exceeding the deadline is over 20ms, if this happens in practice the\n // task should be split into sub-tasks to ensure the UI remains responsive.\n if (lastDeadlineRemaining - taskDuration < -20) {\n console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(lastDeadlineRemaining - taskDuration))}ms`);\n }\n this._start();\n return;\n }\n lastDeadlineRemaining = deadlineRemaining;\n }\n this.clear();\n }\n}\n\n/**\n * A queue of that runs tasks over several tasks via setTimeout, trying to maintain above 60 frames\n * per second. The tasks will run in the order they are enqueued, but they will run some time later,\n * and care should be taken to ensure they're non-urgent and will not introduce race conditions.\n */\nexport class PriorityTaskQueue extends TaskQueue {\n protected _requestCallback(callback: CallbackWithDeadline): number {\n return setTimeout(() => callback(this._createDeadline(16)));\n }\n\n protected _cancelCallback(identifier: number): void {\n clearTimeout(identifier);\n }\n\n private _createDeadline(duration: number): ITaskDeadline {\n const end = Date.now() + duration;\n return {\n timeRemaining: () => Math.max(0, end - Date.now())\n };\n }\n}\n\nclass IdleTaskQueueInternal extends TaskQueue {\n protected _requestCallback(callback: IdleRequestCallback): number {\n return requestIdleCallback(callback);\n }\n\n protected _cancelCallback(identifier: number): void {\n cancelIdleCallback(identifier);\n }\n}\n\n/**\n * A queue of that runs tasks over several idle callbacks, trying to respect the idle callback's\n * deadline given by the environment. The tasks will run in the order they are enqueued, but they\n * will run some time later, and care should be taken to ensure they're non-urgent and will not\n * introduce race conditions.\n *\n * This reverts to a {@link PriorityTaskQueue} if the environment does not support idle callbacks.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdleTaskQueue = (!isNode && 'requestIdleCallback' in window) ? IdleTaskQueueInternal : PriorityTaskQueue;\n\n/**\n * An object that tracks a single debounced task that will run on the next idle frame. When called\n * multiple times, only the last set task will run.\n */\nexport class DebouncedIdleTask {\n private _queue: ITaskQueue;\n\n constructor() {\n this._queue = new IdleTaskQueue();\n }\n\n public set(task: () => boolean | void): void {\n this._queue.clear();\n this._queue.enqueue(task);\n }\n\n public flush(): void {\n this._queue.flush();\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAttributeData, IColorRGB, IExtendedAttrs } from 'common/Types';\nimport { Attributes, FgFlags, BgFlags, UnderlineStyle, ExtFlags } from 'common/buffer/Constants';\n\nexport class AttributeData implements IAttributeData {\n public static toColorRGB(value: number): IColorRGB {\n return [\n value >>> Attributes.RED_SHIFT & 255,\n value >>> Attributes.GREEN_SHIFT & 255,\n value & 255\n ];\n }\n\n public static fromColorRGB(value: IColorRGB): number {\n return (value[0] & 255) << Attributes.RED_SHIFT | (value[1] & 255) << Attributes.GREEN_SHIFT | value[2] & 255;\n }\n\n public clone(): IAttributeData {\n const newObj = new AttributeData();\n newObj.fg = this.fg;\n newObj.bg = this.bg;\n newObj.extended = this.extended.clone();\n return newObj;\n }\n\n // data\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n\n // flags\n public isInverse(): number { return this.fg & FgFlags.INVERSE; }\n public isBold(): number { return this.fg & FgFlags.BOLD; }\n public isUnderline(): number {\n if (this.hasExtendedAttrs() && this.extended.underlineStyle !== UnderlineStyle.NONE) {\n return 1;\n }\n return this.fg & FgFlags.UNDERLINE;\n }\n public isBlink(): number { return this.fg & FgFlags.BLINK; }\n public isInvisible(): number { return this.fg & FgFlags.INVISIBLE; }\n public isItalic(): number { return this.bg & BgFlags.ITALIC; }\n public isDim(): number { return this.bg & BgFlags.DIM; }\n public isStrikethrough(): number { return this.fg & FgFlags.STRIKETHROUGH; }\n public isProtected(): number { return this.bg & BgFlags.PROTECTED; }\n\n // color modes\n public getFgColorMode(): number { return this.fg & Attributes.CM_MASK; }\n public getBgColorMode(): number { return this.bg & Attributes.CM_MASK; }\n public isFgRGB(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isBgRGB(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isFgPalette(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.fg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isBgPalette(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.bg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isFgDefault(): boolean { return (this.fg & Attributes.CM_MASK) === 0; }\n public isBgDefault(): boolean { return (this.bg & Attributes.CM_MASK) === 0; }\n public isAttributeDefault(): boolean { return this.fg === 0 && this.bg === 0; }\n\n // colors\n public getFgColor(): number {\n switch (this.fg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.fg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.fg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n public getBgColor(): number {\n switch (this.bg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.bg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.bg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n\n // extended attrs\n public hasExtendedAttrs(): number {\n return this.bg & BgFlags.HAS_EXTENDED;\n }\n public updateExtended(): void {\n if (this.extended.isEmpty()) {\n this.bg &= ~BgFlags.HAS_EXTENDED;\n } else {\n this.bg |= BgFlags.HAS_EXTENDED;\n }\n }\n public getUnderlineColor(): number {\n if ((this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor) {\n switch (this.extended.underlineColor & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.extended.underlineColor & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.extended.underlineColor & Attributes.RGB_MASK;\n default: return this.getFgColor();\n }\n }\n return this.getFgColor();\n }\n public getUnderlineColorMode(): number {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? this.extended.underlineColor & Attributes.CM_MASK\n : this.getFgColorMode();\n }\n public isUnderlineColorRGB(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_RGB\n : this.isFgRGB();\n }\n public isUnderlineColorPalette(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P16\n || (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P256\n : this.isFgPalette();\n }\n public isUnderlineColorDefault(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === 0\n : this.isFgDefault();\n }\n public getUnderlineStyle(): UnderlineStyle {\n return this.fg & FgFlags.UNDERLINE\n ? (this.bg & BgFlags.HAS_EXTENDED ? this.extended.underlineStyle : UnderlineStyle.SINGLE)\n : UnderlineStyle.NONE;\n }\n}\n\n\n/**\n * Extended attributes for a cell.\n * Holds information about different underline styles and color.\n */\nexport class ExtendedAttrs implements IExtendedAttrs {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrs {\n return new ExtendedAttrs(this._ext, this._urlId);\n }\n\n /**\n * Convenient method to indicate whether the object holds no additional information,\n * that needs to be persistant in the buffer.\n */\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, ICellData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, Content } from 'common/buffer/Constants';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * CellData - represents a single Cell in the terminal buffer.\n */\nexport class CellData extends AttributeData implements ICellData {\n /** Helper to create CellData from CharData. */\n public static fromCharData(value: CharData): CellData {\n const obj = new CellData();\n obj.setFromCharData(value);\n return obj;\n }\n /** Primitives from terminal buffer. */\n public content = 0;\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n public combinedData = '';\n /** Whether cell contains a combined string. */\n public isCombined(): number {\n return this.content & Content.IS_COMBINED_MASK;\n }\n /** Width of the cell. */\n public getWidth(): number {\n return this.content >> Content.WIDTH_SHIFT;\n }\n /** JS string of the content. */\n public getChars(): string {\n if (this.content & Content.IS_COMBINED_MASK) {\n return this.combinedData;\n }\n if (this.content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(this.content & Content.CODEPOINT_MASK);\n }\n return '';\n }\n /**\n * Codepoint of cell\n * Note this returns the UTF32 codepoint of single chars,\n * if content is a combined string it returns the codepoint\n * of the last char in string to be in line with code in CharData.\n */\n public getCode(): number {\n return (this.isCombined())\n ? this.combinedData.charCodeAt(this.combinedData.length - 1)\n : this.content & Content.CODEPOINT_MASK;\n }\n /** Set data from CharData */\n public setFromCharData(value: CharData): void {\n this.fg = value[CHAR_DATA_ATTR_INDEX];\n this.bg = 0;\n let combined = false;\n // surrogates and combined strings need special treatment\n if (value[CHAR_DATA_CHAR_INDEX].length > 2) {\n combined = true;\n }\n else if (value[CHAR_DATA_CHAR_INDEX].length === 2) {\n const code = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0);\n // if the 2-char string is a surrogate create single codepoint\n // everything else is combined\n if (0xD800 <= code && code <= 0xDBFF) {\n const second = value[CHAR_DATA_CHAR_INDEX].charCodeAt(1);\n if (0xDC00 <= second && second <= 0xDFFF) {\n this.content = ((code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n else {\n combined = true;\n }\n }\n else {\n combined = true;\n }\n }\n else {\n this.content = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n if (combined) {\n this.combinedData = value[CHAR_DATA_CHAR_INDEX];\n this.content = Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n /** Get data as CharData. */\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport const DEFAULT_COLOR = 0;\nexport const DEFAULT_ATTR = (0 << 18) | (DEFAULT_COLOR << 9) | (256 << 0);\nexport const DEFAULT_EXT = 0;\n\nexport const CHAR_DATA_ATTR_INDEX = 0;\nexport const CHAR_DATA_CHAR_INDEX = 1;\nexport const CHAR_DATA_WIDTH_INDEX = 2;\nexport const CHAR_DATA_CODE_INDEX = 3;\n\n/**\n * Null cell - a real empty cell (containing nothing).\n * Note that code should always be 0 for a null cell as\n * several test condition of the buffer line rely on this.\n */\nexport const NULL_CELL_CHAR = '';\nexport const NULL_CELL_WIDTH = 1;\nexport const NULL_CELL_CODE = 0;\n\n/**\n * Whitespace cell.\n * This is meant as a replacement for empty cells when needed\n * during rendering lines to preserve correct aligment.\n */\nexport const WHITESPACE_CELL_CHAR = ' ';\nexport const WHITESPACE_CELL_WIDTH = 1;\nexport const WHITESPACE_CELL_CODE = 32;\n\n/**\n * Bitmasks for accessing data in `content`.\n */\nexport const enum Content {\n /**\n * bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)\n * read: `codepoint = content & Content.codepointMask;`\n * write: `content |= codepoint & Content.codepointMask;`\n * shortcut if precondition `codepoint <= 0x10FFFF` is met:\n * `content |= codepoint;`\n */\n CODEPOINT_MASK = 0x1FFFFF,\n\n /**\n * bit 22 flag indication whether a cell contains combined content\n * read: `isCombined = content & Content.isCombined;`\n * set: `content |= Content.isCombined;`\n * clear: `content &= ~Content.isCombined;`\n */\n IS_COMBINED_MASK = 0x200000, // 1 << 21\n\n /**\n * bit 1..22 mask to check whether a cell contains any string data\n * we need to check for codepoint and isCombined bits to see\n * whether a cell contains anything\n * read: `isEmpty = !(content & Content.hasContent)`\n */\n HAS_CONTENT_MASK = 0x3FFFFF,\n\n /**\n * bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)\n * read: `width = (content & Content.widthMask) >> Content.widthShift;`\n * `hasWidth = content & Content.widthMask;`\n * as long as wcwidth is highest value in `content`:\n * `width = content >> Content.widthShift;`\n * write: `content |= (width << Content.widthShift) & Content.widthMask;`\n * shortcut if precondition `0 <= width <= 3` is met:\n * `content |= width << Content.widthShift;`\n */\n WIDTH_MASK = 0xC00000, // 3 << 22\n WIDTH_SHIFT = 22\n}\n\nexport const enum Attributes {\n /**\n * bit 1..8 blue in RGB, color in P256 and P16\n */\n BLUE_MASK = 0xFF,\n BLUE_SHIFT = 0,\n PCOLOR_MASK = 0xFF,\n PCOLOR_SHIFT = 0,\n\n /**\n * bit 9..16 green in RGB\n */\n GREEN_MASK = 0xFF00,\n GREEN_SHIFT = 8,\n\n /**\n * bit 17..24 red in RGB\n */\n RED_MASK = 0xFF0000,\n RED_SHIFT = 16,\n\n /**\n * bit 25..26 color mode: DEFAULT (0) | P16 (1) | P256 (2) | RGB (3)\n */\n CM_MASK = 0x3000000,\n CM_DEFAULT = 0,\n CM_P16 = 0x1000000,\n CM_P256 = 0x2000000,\n CM_RGB = 0x3000000,\n\n /**\n * bit 1..24 RGB room\n */\n RGB_MASK = 0xFFFFFF\n}\n\nexport const enum FgFlags {\n /**\n * bit 27..32\n */\n INVERSE = 0x4000000,\n BOLD = 0x8000000,\n UNDERLINE = 0x10000000,\n BLINK = 0x20000000,\n INVISIBLE = 0x40000000,\n STRIKETHROUGH = 0x80000000,\n}\n\nexport const enum BgFlags {\n /**\n * bit 27..32 (upper 2 unused)\n */\n ITALIC = 0x4000000,\n DIM = 0x8000000,\n HAS_EXTENDED = 0x10000000,\n PROTECTED = 0x20000000\n}\n\nexport const enum ExtFlags {\n /**\n * bit 27..32 (upper 3 unused)\n */\n UNDERLINE_STYLE = 0x1C000000\n}\n\nexport const enum UnderlineStyle {\n NONE = 0,\n SINGLE = 1,\n DOUBLE = 2,\n CURLY = 3,\n DOTTED = 4,\n DASHED = 5\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Polyfill - Convert UTF32 codepoint into JS string.\n * Note: The built-in String.fromCodePoint happens to be much slower\n * due to additional sanity checks. We can avoid them since\n * we always operate on legal UTF32 (granted by the input decoders)\n * and use this faster version instead.\n */\nexport function stringFromCodePoint(codePoint: number): string {\n if (codePoint > 0xFFFF) {\n codePoint -= 0x10000;\n return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);\n }\n return String.fromCharCode(codePoint);\n}\n\n/**\n * Convert UTF32 char codes into JS string.\n * Basically the same as `stringFromCodePoint` but for multiple codepoints\n * in a loop (which is a lot faster).\n */\nexport function utf32ToString(data: Uint32Array, start: number = 0, end: number = data.length): string {\n let result = '';\n for (let i = start; i < end; ++i) {\n let codepoint = data[i];\n if (codepoint > 0xFFFF) {\n // JS strings are encoded as UTF16, thus a non BMP codepoint gets converted into a surrogate pair\n // conversion rules:\n // - subtract 0x10000 from code point, leaving a 20 bit number\n // - add high 10 bits to 0xD800 --> first surrogate\n // - add low 10 bits to 0xDC00 --> second surrogate\n codepoint -= 0x10000;\n result += String.fromCharCode((codepoint >> 10) + 0xD800) + String.fromCharCode((codepoint % 0x400) + 0xDC00);\n } else {\n result += String.fromCharCode(codepoint);\n }\n }\n return result;\n}\n\n/**\n * StringToUtf32 - decodes UTF16 sequences into UTF32 codepoints.\n * To keep the decoder in line with JS strings it handles single surrogates as UCS2.\n */\nexport class StringToUtf32 {\n private _interim: number = 0;\n\n /**\n * Clears interim and resets decoder to clean state.\n */\n public clear(): void {\n this._interim = 0;\n }\n\n /**\n * Decode JS string to UTF32 codepoints.\n * The methods assumes stream input and will store partly transmitted\n * surrogate pairs and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided input data does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: string, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let startPos = 0;\n\n // handle leftover surrogate high\n if (this._interim) {\n const second = input.charCodeAt(startPos++);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (this._interim - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = this._interim;\n target[size++] = second;\n }\n this._interim = 0;\n }\n\n for (let i = startPos; i < length; ++i) {\n const code = input.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n this._interim = code;\n return size;\n }\n const second = input.charCodeAt(i);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = code;\n target[size++] = second;\n }\n continue;\n }\n if (code === 0xFEFF) {\n // BOM\n continue;\n }\n target[size++] = code;\n }\n return size;\n }\n}\n\n/**\n * Utf8Decoder - decodes UTF8 byte sequences into UTF32 codepoints.\n */\nexport class Utf8ToUtf32 {\n public interim: Uint8Array = new Uint8Array(3);\n\n /**\n * Clears interim bytes and resets decoder to clean state.\n */\n public clear(): void {\n this.interim.fill(0);\n }\n\n /**\n * Decodes UTF8 byte sequences in `input` to UTF32 codepoints in `target`.\n * The methods assumes stream input and will store partly transmitted bytes\n * and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided data chunk does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: Uint8Array, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let byte1: number;\n let byte2: number;\n let byte3: number;\n let byte4: number;\n let codepoint = 0;\n let startPos = 0;\n\n // handle leftover bytes\n if (this.interim[0]) {\n let discardInterim = false;\n let cp = this.interim[0];\n cp &= ((((cp & 0xE0) === 0xC0)) ? 0x1F : (((cp & 0xF0) === 0xE0)) ? 0x0F : 0x07);\n let pos = 0;\n let tmp: number;\n while ((tmp = this.interim[++pos] & 0x3F) && pos < 4) {\n cp <<= 6;\n cp |= tmp;\n }\n // missing bytes - read ahead from input\n const type = (((this.interim[0] & 0xE0) === 0xC0)) ? 2 : (((this.interim[0] & 0xF0) === 0xE0)) ? 3 : 4;\n const missing = type - pos;\n while (startPos < missing) {\n if (startPos >= length) {\n return 0;\n }\n tmp = input[startPos++];\n if ((tmp & 0xC0) !== 0x80) {\n // wrong continuation, discard interim bytes completely\n startPos--;\n discardInterim = true;\n break;\n } else {\n // need to save so we can continue short inputs in next call\n this.interim[pos++] = tmp;\n cp <<= 6;\n cp |= tmp & 0x3F;\n }\n }\n if (!discardInterim) {\n // final test is type dependent\n if (type === 2) {\n if (cp < 0x80) {\n // wrong starter byte\n startPos--;\n } else {\n target[size++] = cp;\n }\n } else if (type === 3) {\n if (cp < 0x0800 || (cp >= 0xD800 && cp <= 0xDFFF) || cp === 0xFEFF) {\n // illegal codepoint or BOM\n } else {\n target[size++] = cp;\n }\n } else {\n if (cp < 0x010000 || cp > 0x10FFFF) {\n // illegal codepoint\n } else {\n target[size++] = cp;\n }\n }\n }\n this.interim.fill(0);\n }\n\n // loop through input\n const fourStop = length - 4;\n let i = startPos;\n while (i < length) {\n /**\n * ASCII shortcut with loop unrolled to 4 consecutive ASCII chars.\n * This is a compromise between speed gain for ASCII\n * and penalty for non ASCII:\n * For best ASCII performance the char should be stored directly into target,\n * but even a single attempt to write to target and compare afterwards\n * penalizes non ASCII really bad (-50%), thus we load the char into byteX first,\n * which reduces ASCII performance by ~15%.\n * This trial for ASCII reduces non ASCII performance by ~10% which seems acceptible\n * compared to the gains.\n * Note that this optimization only takes place for 4 consecutive ASCII chars,\n * for any shorter it bails out. Worst case - all 4 bytes being read but\n * thrown away due to the last being a non ASCII char (-10% performance).\n */\n while (i < fourStop\n && !((byte1 = input[i]) & 0x80)\n && !((byte2 = input[i + 1]) & 0x80)\n && !((byte3 = input[i + 2]) & 0x80)\n && !((byte4 = input[i + 3]) & 0x80))\n {\n target[size++] = byte1;\n target[size++] = byte2;\n target[size++] = byte3;\n target[size++] = byte4;\n i += 4;\n }\n\n // reread byte1\n byte1 = input[i++];\n\n // 1 byte\n if (byte1 < 0x80) {\n target[size++] = byte1;\n\n // 2 bytes\n } else if ((byte1 & 0xE0) === 0xC0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x1F) << 6 | (byte2 & 0x3F);\n if (codepoint < 0x80) {\n // wrong starter byte\n i--;\n continue;\n }\n target[size++] = codepoint;\n\n // 3 bytes\n } else if ((byte1 & 0xF0) === 0xE0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F);\n if (codepoint < 0x0800 || (codepoint >= 0xD800 && codepoint <= 0xDFFF) || codepoint === 0xFEFF) {\n // illegal codepoint or BOM, no i-- here\n continue;\n }\n target[size++] = codepoint;\n\n // 4 bytes\n } else if ((byte1 & 0xF8) === 0xF0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n this.interim[2] = byte3;\n return size;\n }\n byte4 = input[i++];\n if ((byte4 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x07) << 18 | (byte2 & 0x3F) << 12 | (byte3 & 0x3F) << 6 | (byte4 & 0x3F);\n if (codepoint < 0x010000 || codepoint > 0x10FFFF) {\n // illegal codepoint, no i-- here\n continue;\n }\n target[size++] = codepoint;\n } else {\n // illegal byte, just skip\n }\n }\n return size;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IServiceIdentifier } from 'common/services/Services';\n\nconst DI_TARGET = 'di$target';\nconst DI_DEPENDENCIES = 'di$dependencies';\n\nexport const serviceRegistry: Map<string, IServiceIdentifier<any>> = new Map();\n\nexport function getServiceDependencies(ctor: any): { id: IServiceIdentifier<any>, index: number, optional: boolean }[] {\n return ctor[DI_DEPENDENCIES] || [];\n}\n\nexport function createDecorator<T>(id: string): IServiceIdentifier<T> {\n if (serviceRegistry.has(id)) {\n return serviceRegistry.get(id)!;\n }\n\n const decorator: any = function (target: Function, key: string, index: number): any {\n if (arguments.length !== 3) {\n throw new Error('@IServiceName-decorator can only be used to decorate a parameter');\n }\n\n storeServiceDependency(decorator, target, index);\n };\n\n decorator.toString = () => id;\n\n serviceRegistry.set(id, decorator);\n return decorator;\n}\n\nfunction storeServiceDependency(id: Function, target: Function, index: number): void {\n if ((target as any)[DI_TARGET] === target) {\n (target as any)[DI_DEPENDENCIES].push({ id, index });\n } else {\n (target as any)[DI_DEPENDENCIES] = [{ id, index }];\n (target as any)[DI_TARGET] = target;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent, IEventEmitter } from 'common/EventEmitter';\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColor, CursorStyle, IOscLinkData } from 'common/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDecorationOptions, IDecoration, ILinkHandler } from 'xterm';\n\nexport const IBufferService = createDecorator<IBufferService>('BufferService');\nexport interface IBufferService {\n serviceBrand: undefined;\n\n readonly cols: number;\n readonly rows: number;\n readonly buffer: IBuffer;\n readonly buffers: IBufferSet;\n isUserScrolling: boolean;\n onResize: IEvent<{ cols: number, rows: number }>;\n onScroll: IEvent<number>;\n scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;\n scrollToBottom(): void;\n scrollToTop(): void;\n scrollToLine(line: number): void;\n scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void;\n scrollPages(pageCount: number): void;\n resize(cols: number, rows: number): void;\n reset(): void;\n}\n\nexport const ICoreMouseService = createDecorator<ICoreMouseService>('CoreMouseService');\nexport interface ICoreMouseService {\n activeProtocol: string;\n activeEncoding: string;\n areMouseEventsActive: boolean;\n addProtocol(name: string, protocol: ICoreMouseProtocol): void;\n addEncoding(name: string, encoding: CoreMouseEncoding): void;\n reset(): void;\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n triggerMouseEvent(event: ICoreMouseEvent): boolean;\n\n /**\n * Event to announce changes in mouse tracking.\n */\n onProtocolChange: IEvent<CoreMouseEventType>;\n\n /**\n * Human readable version of mouse events.\n */\n explainEvents(events: CoreMouseEventType): { [event: string]: boolean };\n}\n\nexport const ICoreService = createDecorator<ICoreService>('CoreService');\nexport interface ICoreService {\n serviceBrand: undefined;\n\n /**\n * Initially the cursor will not be visible until the first time the terminal\n * is focused.\n */\n isCursorInitialized: boolean;\n isCursorHidden: boolean;\n\n readonly modes: IModes;\n readonly decPrivateModes: IDecPrivateModes;\n\n readonly onData: IEvent<string>;\n readonly onUserInput: IEvent<void>;\n readonly onBinary: IEvent<string>;\n readonly onRequestScrollToBottom: IEvent<void>;\n\n reset(): void;\n\n /**\n * Triggers the onData event in the public API.\n * @param data The data that is being emitted.\n * @param wasUserInput Whether the data originated from the user (as opposed to\n * resulting from parsing incoming data). When true this will also:\n * - Scroll to the bottom of the buffer if option scrollOnUserInput is true.\n * - Fire the `onUserInput` event (so selection can be cleared).\n */\n triggerDataEvent(data: string, wasUserInput?: boolean): void;\n\n /**\n * Triggers the onBinary event in the public API.\n * @param data The data that is being emitted.\n */\n triggerBinaryEvent(data: string): void;\n}\n\nexport const ICharsetService = createDecorator<ICharsetService>('CharsetService');\nexport interface ICharsetService {\n serviceBrand: undefined;\n\n charset: ICharset | undefined;\n readonly glevel: number;\n\n reset(): void;\n\n /**\n * Set the G level of the terminal.\n * @param g\n */\n setgLevel(g: number): void;\n\n /**\n * Set the charset for the given G level of the terminal.\n * @param g\n * @param charset\n */\n setgCharset(g: number, charset: ICharset | undefined): void;\n}\n\nexport interface IServiceIdentifier<T> {\n (...args: any[]): void;\n type: T;\n}\n\nexport interface IBrandedService {\n serviceBrand: undefined;\n}\n\ntype GetLeadingNonServiceArgs<Args> =\n Args extends [...IBrandedService[]] ? []\n : Args extends [infer A1, ...IBrandedService[]] ? [A1]\n : Args extends [infer A1, infer A2, ...IBrandedService[]] ? [A1, A2]\n : Args extends [infer A1, infer A2, infer A3, ...IBrandedService[]] ? [A1, A2, A3]\n : Args extends [infer A1, infer A2, infer A3, infer A4, ...IBrandedService[]] ? [A1, A2, A3, A4]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, ...IBrandedService[]] ? [A1, A2, A3, A4, A5]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7, A8]\n : never;\n\nexport const IInstantiationService = createDecorator<IInstantiationService>('InstantiationService');\nexport interface IInstantiationService {\n serviceBrand: undefined;\n\n setService<T>(id: IServiceIdentifier<T>, instance: T): void;\n getService<T>(id: IServiceIdentifier<T>): T | undefined;\n createInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(t: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;\n}\n\nexport enum LogLevelEnum {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n OFF = 4\n}\n\nexport const ILogService = createDecorator<ILogService>('LogService');\nexport interface ILogService {\n serviceBrand: undefined;\n\n logLevel: LogLevelEnum;\n\n debug(message: any, ...optionalParams: any[]): void;\n info(message: any, ...optionalParams: any[]): void;\n warn(message: any, ...optionalParams: any[]): void;\n error(message: any, ...optionalParams: any[]): void;\n}\n\nexport const IOptionsService = createDecorator<IOptionsService>('OptionsService');\nexport interface IOptionsService {\n serviceBrand: undefined;\n\n /**\n * Read only access to the raw options object, this is an internal-only fast path for accessing\n * single options without any validation as we trust TypeScript to enforce correct usage\n * internally.\n */\n readonly rawOptions: Required<ITerminalOptions>;\n\n /**\n * Options as exposed through the public API, this property uses getters and setters with\n * validation which makes it safer but slower. {@link rawOptions} should be used for pretty much\n * all internal usage for performance reasons.\n */\n readonly options: Required<ITerminalOptions>;\n\n /**\n * Adds an event listener for when any option changes.\n */\n readonly onOptionChange: IEvent<keyof ITerminalOptions>;\n\n /**\n * Adds an event listener for when a specific option changes, this is a convenience method that is\n * preferred over {@link onOptionChange} when only a single option is being listened to.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n onSpecificOptionChange<T extends keyof ITerminalOptions>(key: T, listener: (arg1: Required<ITerminalOptions>[T]) => any): IDisposable;\n\n /**\n * Adds an event listener for when a set of specific options change, this is a convenience method\n * that is preferred over {@link onOptionChange} when multiple options are being listened to and\n * handled the same way.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n onMultipleOptionChange(keys: (keyof ITerminalOptions)[], listener: () => any): IDisposable;\n}\n\nexport type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\nexport interface ITerminalOptions {\n allowProposedApi?: boolean;\n allowTransparency?: boolean;\n altClickMovesCursor?: boolean;\n cols?: number;\n convertEol?: boolean;\n cursorBlink?: boolean;\n cursorStyle?: CursorStyle;\n cursorWidth?: number;\n customGlyphs?: boolean;\n disableStdin?: boolean;\n drawBoldTextInBrightColors?: boolean;\n fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';\n fastScrollSensitivity?: number;\n fontSize?: number;\n fontFamily?: string;\n fontWeight?: FontWeight;\n fontWeightBold?: FontWeight;\n letterSpacing?: number;\n lineHeight?: number;\n linkHandler?: ILinkHandler | null;\n logLevel?: LogLevel;\n macOptionIsMeta?: boolean;\n macOptionClickForcesSelection?: boolean;\n minimumContrastRatio?: number;\n rightClickSelectsWord?: boolean;\n rows?: number;\n screenReaderMode?: boolean;\n scrollback?: number;\n scrollOnUserInput?: boolean;\n scrollSensitivity?: number;\n smoothScrollDuration?: number;\n tabStopWidth?: number;\n theme?: ITheme;\n windowsMode?: boolean;\n windowOptions?: IWindowOptions;\n wordSeparator?: string;\n overviewRulerWidth?: number;\n\n [key: string]: any;\n cancelEvents: boolean;\n termName: string;\n}\n\nexport interface ITheme {\n foreground?: string;\n background?: string;\n cursor?: string;\n cursorAccent?: string;\n selectionForeground?: string;\n selectionBackground?: string;\n selectionInactiveBackground?: string;\n black?: string;\n red?: string;\n green?: string;\n yellow?: string;\n blue?: string;\n magenta?: string;\n cyan?: string;\n white?: string;\n brightBlack?: string;\n brightRed?: string;\n brightGreen?: string;\n brightYellow?: string;\n brightBlue?: string;\n brightMagenta?: string;\n brightCyan?: string;\n brightWhite?: string;\n extendedAnsi?: string[];\n}\n\nexport const IOscLinkService = createDecorator<IOscLinkService>('OscLinkService');\nexport interface IOscLinkService {\n serviceBrand: undefined;\n /**\n * Registers a link to the service, returning the link ID. The link data is managed by this\n * service and will be freed when this current cursor position is trimmed off the buffer.\n */\n registerLink(linkData: IOscLinkData): number;\n /**\n * Adds a line to a link if needed.\n */\n addLineToLink(linkId: number, y: number): void;\n /** Get the link data associated with a link ID. */\n getLinkData(linkId: number): IOscLinkData | undefined;\n}\n\nexport const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');\nexport interface IUnicodeService {\n serviceBrand: undefined;\n /** Register an Unicode version provider. */\n register(provider: IUnicodeVersionProvider): void;\n /** Registered Unicode versions. */\n readonly versions: string[];\n /** Currently active version. */\n activeVersion: string;\n /** Event triggered, when activate version changed. */\n readonly onChange: IEvent<string>;\n\n /**\n * Unicode version dependent\n */\n wcwidth(codepoint: number): number;\n getStringCellWidth(s: string): number;\n}\n\nexport interface IUnicodeVersionProvider {\n readonly version: string;\n wcwidth(ucs: number): 0 | 1 | 2;\n}\n\nexport const IDecorationService = createDecorator<IDecorationService>('DecorationService');\nexport interface IDecorationService extends IDisposable {\n serviceBrand: undefined;\n readonly decorations: IterableIterator<IInternalDecoration>;\n readonly onDecorationRegistered: IEvent<IInternalDecoration>;\n readonly onDecorationRemoved: IEvent<IInternalDecoration>;\n registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;\n reset(): void;\n /**\n * Trigger a callback over the decoration at a cell (in no particular order). This uses a callback\n * instead of an iterator as it's typically used in hot code paths.\n */\n forEachDecorationAtCell(x: number, line: number, layer: 'bottom' | 'top' | undefined, callback: (decoration: IInternalDecoration) => void): void;\n}\nexport interface IInternalDecoration extends IDecoration {\n readonly options: IDecorationOptions;\n readonly backgroundColorRGB: IColor | undefined;\n readonly foregroundColorRGB: IColor | undefined;\n readonly onRenderEmitter: IEventEmitter<HTMLElement>;\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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';\nimport { IColorSet, ITerminal } from 'browser/Types';\nimport { CanvasRenderer } from './CanvasRenderer';\nimport { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { ITerminalAddon, Terminal } from 'xterm';\nimport { EventEmitter, forwardEvent } from 'common/EventEmitter';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\n\nexport class CanvasAddon extends Disposable implements ITerminalAddon {\n private _terminal?: Terminal;\n private _renderer?: CanvasRenderer;\n\n private readonly _onChangeTextureAtlas = this.register(new EventEmitter<HTMLCanvasElement>());\n public readonly onChangeTextureAtlas = this._onChangeTextureAtlas.event;\n private readonly _onAddTextureAtlasCanvas = this.register(new EventEmitter<HTMLCanvasElement>());\n public readonly onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event;\n\n public get textureAtlas(): HTMLCanvasElement | undefined {\n return this._renderer?.textureAtlas;\n }\n\n public activate(terminal: Terminal): void {\n const core = (terminal as any)._core as ITerminal;\n if (!terminal.element) {\n this.register(core.onWillOpen(() => this.activate(terminal)));\n return;\n }\n\n this._terminal = terminal;\n const coreService = core.coreService;\n const optionsService = core.optionsService;\n const screenElement = core.screenElement!;\n const linkifier = core.linkifier2;\n\n const unsafeCore = core as any;\n const bufferService: IBufferService = unsafeCore._bufferService;\n const renderService: IRenderService = unsafeCore._renderService;\n const characterJoinerService: ICharacterJoinerService = unsafeCore._characterJoinerService;\n const charSizeService: ICharSizeService = unsafeCore._charSizeService;\n const coreBrowserService: ICoreBrowserService = unsafeCore._coreBrowserService;\n const decorationService: IDecorationService = unsafeCore._decorationService;\n const themeService: IThemeService = unsafeCore._themeService;\n\n this._renderer = new CanvasRenderer(terminal, screenElement, linkifier, bufferService, charSizeService, optionsService, characterJoinerService, coreService, coreBrowserService, decorationService, themeService);\n this.register(forwardEvent(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas));\n this.register(forwardEvent(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas));\n renderService.setRenderer(this._renderer);\n renderService.handleResize(bufferService.cols, bufferService.rows);\n\n this.register(toDisposable(() => {\n renderService.setRenderer((this._terminal as any)._core._createRenderer());\n renderService.handleResize(terminal.cols, terminal.rows);\n this._renderer?.dispose();\n this._renderer = undefined;\n }));\n }\n}\n","(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 {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(self, function() {\nreturn ","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport * as Strings from 'browser/LocalizableStrings';\nimport { ITerminal, IRenderDebouncer } from 'browser/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { isMac } from 'common/Platform';\nimport { TimeBasedDebouncer } from 'browser/TimeBasedDebouncer';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { ScreenDprMonitor } from 'browser/ScreenDprMonitor';\nimport { IRenderService } from 'browser/services/Services';\nimport { removeElementFromParent } from 'browser/Dom';\n\nconst MAX_ROWS_TO_READ = 20;\n\nconst enum BoundaryPosition {\n TOP,\n BOTTOM\n}\n\nexport class AccessibilityManager extends Disposable {\n private _accessibilityTreeRoot: HTMLElement;\n private _rowContainer: HTMLElement;\n private _rowElements: HTMLElement[];\n private _liveRegion: HTMLElement;\n private _liveRegionLineCount: number = 0;\n\n private _renderRowsDebouncer: IRenderDebouncer;\n private _screenDprMonitor: ScreenDprMonitor;\n\n private _topBoundaryFocusListener: (e: FocusEvent) => void;\n private _bottomBoundaryFocusListener: (e: FocusEvent) => void;\n\n /**\n * This queue has a character pushed to it for keys that are pressed, if the\n * next character added to the terminal is equal to the key char then it is\n * not announced (added to live region) because it has already been announced\n * by the textarea event (which cannot be canceled). There are some race\n * condition cases if there is typing while data is streaming, but this covers\n * the main case of typing into the prompt and inputting the answer to a\n * question (Y/N, etc.).\n */\n private _charsToConsume: string[] = [];\n\n private _charsToAnnounce: string = '';\n\n constructor(\n private readonly _terminal: ITerminal,\n private readonly _renderService: IRenderService\n ) {\n super();\n this._accessibilityTreeRoot = document.createElement('div');\n this._accessibilityTreeRoot.classList.add('xterm-accessibility');\n this._accessibilityTreeRoot.tabIndex = 0;\n\n this._rowContainer = document.createElement('div');\n this._rowContainer.setAttribute('role', 'list');\n this._rowContainer.classList.add('xterm-accessibility-tree');\n this._rowElements = [];\n for (let i = 0; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n\n this._topBoundaryFocusListener = e => this._handleBoundaryFocus(e, BoundaryPosition.TOP);\n this._bottomBoundaryFocusListener = e => this._handleBoundaryFocus(e, BoundaryPosition.BOTTOM);\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n this._accessibilityTreeRoot.appendChild(this._rowContainer);\n\n this._renderRowsDebouncer = new TimeBasedDebouncer(this._renderRows.bind(this));\n this._refreshRows();\n\n this._liveRegion = document.createElement('div');\n this._liveRegion.classList.add('live-region');\n this._liveRegion.setAttribute('aria-live', 'assertive');\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n\n if (!this._terminal.element) {\n throw new Error('Cannot enable accessibility before Terminal.open');\n }\n this._terminal.element.insertAdjacentElement('afterbegin', this._accessibilityTreeRoot);\n\n this.register(this._renderRowsDebouncer);\n this.register(this._terminal.onResize(e => this._handleResize(e.rows)));\n this.register(this._terminal.onRender(e => this._refreshRows(e.start, e.end)));\n this.register(this._terminal.onScroll(() => this._refreshRows()));\n // Line feed is an issue as the prompt won't be read out after a command is run\n this.register(this._terminal.onA11yChar(char => this._handleChar(char)));\n this.register(this._terminal.onLineFeed(() => this._handleChar('\\n')));\n this.register(this._terminal.onA11yTab(spaceCount => this._handleTab(spaceCount)));\n this.register(this._terminal.onKey(e => this._handleKey(e.key)));\n this.register(this._terminal.onBlur(() => this._clearLiveRegion()));\n this.register(this._renderService.onDimensionsChange(() => this._refreshRowsDimensions()));\n\n this._screenDprMonitor = new ScreenDprMonitor(window);\n this.register(this._screenDprMonitor);\n this._screenDprMonitor.setListener(() => this._refreshRowsDimensions());\n // This shouldn't be needed on modern browsers but is present in case the\n // media query that drives the ScreenDprMonitor isn't supported\n this.register(addDisposableDomListener(window, 'resize', () => this._refreshRowsDimensions()));\n this.register(toDisposable(() => {\n removeElementFromParent(this._accessibilityTreeRoot);\n this._rowElements.length = 0;\n }));\n }\n\n private _handleBoundaryFocus(e: FocusEvent, position: BoundaryPosition): void {\n const boundaryElement = e.target as HTMLElement;\n const beforeBoundaryElement = this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2];\n\n // Don't scroll if the buffer top has reached the end in that direction\n const posInSet = boundaryElement.getAttribute('aria-posinset');\n const lastRowPos = position === BoundaryPosition.TOP ? '1' : `${this._terminal.buffer.lines.length}`;\n if (posInSet === lastRowPos) {\n return;\n }\n\n // Don't scroll when the last focused item was not the second row (focus is going the other\n // direction)\n if (e.relatedTarget !== beforeBoundaryElement) {\n return;\n }\n\n // Remove old boundary element from array\n let topBoundaryElement: HTMLElement;\n let bottomBoundaryElement: HTMLElement;\n if (position === BoundaryPosition.TOP) {\n topBoundaryElement = boundaryElement;\n bottomBoundaryElement = this._rowElements.pop()!;\n this._rowContainer.removeChild(bottomBoundaryElement);\n } else {\n topBoundaryElement = this._rowElements.shift()!;\n bottomBoundaryElement = boundaryElement;\n this._rowContainer.removeChild(topBoundaryElement);\n }\n\n // Remove listeners from old boundary elements\n topBoundaryElement.removeEventListener('focus', this._topBoundaryFocusListener);\n bottomBoundaryElement.removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Add new element to array/DOM\n if (position === BoundaryPosition.TOP) {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.unshift(newElement);\n this._rowContainer.insertAdjacentElement('afterbegin', newElement);\n } else {\n const newElement = this._createAccessibilityTreeNode();\n this._rowElements.push(newElement);\n this._rowContainer.appendChild(newElement);\n }\n\n // Add listeners to new boundary elements\n this._rowElements[0].addEventListener('focus', this._topBoundaryFocusListener);\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Scroll up\n this._terminal.scrollLines(position === BoundaryPosition.TOP ? -1 : 1);\n\n // Focus new boundary before element\n this._rowElements[position === BoundaryPosition.TOP ? 1 : this._rowElements.length - 2].focus();\n\n // Prevent the standard behavior\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n\n private _handleResize(rows: number): void {\n // Remove bottom boundary listener\n this._rowElements[this._rowElements.length - 1].removeEventListener('focus', this._bottomBoundaryFocusListener);\n\n // Grow rows as required\n for (let i = this._rowContainer.children.length; i < this._terminal.rows; i++) {\n this._rowElements[i] = this._createAccessibilityTreeNode();\n this._rowContainer.appendChild(this._rowElements[i]);\n }\n // Shrink rows as required\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n\n // Add bottom boundary listener\n this._rowElements[this._rowElements.length - 1].addEventListener('focus', this._bottomBoundaryFocusListener);\n\n this._refreshRowsDimensions();\n }\n\n private _createAccessibilityTreeNode(): HTMLElement {\n const element = document.createElement('div');\n element.setAttribute('role', 'listitem');\n element.tabIndex = -1;\n this._refreshRowDimensions(element);\n return element;\n }\n\n private _handleTab(spaceCount: number): void {\n for (let i = 0; i < spaceCount; i++) {\n this._handleChar(' ');\n }\n }\n\n private _handleChar(char: string): void {\n if (this._liveRegionLineCount < MAX_ROWS_TO_READ + 1) {\n if (this._charsToConsume.length > 0) {\n // Have the screen reader ignore the char if it was just input\n const shiftedChar = this._charsToConsume.shift();\n if (shiftedChar !== char) {\n this._charsToAnnounce += char;\n }\n } else {\n this._charsToAnnounce += char;\n }\n\n if (char === '\\n') {\n this._liveRegionLineCount++;\n if (this._liveRegionLineCount === MAX_ROWS_TO_READ + 1) {\n this._liveRegion.textContent += Strings.tooMuchOutput;\n }\n }\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n if (this._liveRegion.textContent && this._liveRegion.textContent.length > 0 && !this._liveRegion.parentNode) {\n setTimeout(() => {\n this._accessibilityTreeRoot.appendChild(this._liveRegion);\n }, 0);\n }\n }\n }\n }\n\n private _clearLiveRegion(): void {\n this._liveRegion.textContent = '';\n this._liveRegionLineCount = 0;\n\n // Only detach/attach on mac as otherwise messages can go unaccounced\n if (isMac) {\n removeElementFromParent(this._liveRegion);\n }\n }\n\n private _handleKey(keyChar: string): void {\n this._clearLiveRegion();\n // Only add the char if there is no control character.\n if (!/\\p{Control}/u.test(keyChar)) {\n this._charsToConsume.push(keyChar);\n }\n }\n\n private _refreshRows(start?: number, end?: number): void {\n this._renderRowsDebouncer.refresh(start, end, this._terminal.rows);\n }\n\n private _renderRows(start: number, end: number): void {\n const buffer: IBuffer = this._terminal.buffer;\n const setSize = buffer.lines.length.toString();\n for (let i = start; i <= end; i++) {\n const lineData = buffer.translateBufferLineToString(buffer.ydisp + i, true);\n const posInSet = (buffer.ydisp + i + 1).toString();\n const element = this._rowElements[i];\n if (element) {\n if (lineData.length === 0) {\n element.innerText = '\\u00a0';\n } else {\n element.textContent = lineData;\n }\n element.setAttribute('aria-posinset', posInSet);\n element.setAttribute('aria-setsize', setSize);\n }\n }\n this._announceCharacters();\n }\n\n private _refreshRowsDimensions(): void {\n if (!this._renderService.dimensions.css.cell.height) {\n return;\n }\n this._accessibilityTreeRoot.style.width = `${this._renderService.dimensions.css.canvas.width}px`;\n if (this._rowElements.length !== this._terminal.rows) {\n this._handleResize(this._terminal.rows);\n }\n for (let i = 0; i < this._terminal.rows; i++) {\n this._refreshRowDimensions(this._rowElements[i]);\n }\n }\n\n private _refreshRowDimensions(element: HTMLElement): void {\n element.style.height = `${this._renderService.dimensions.css.cell.height}px`;\n }\n\n private _announceCharacters(): void {\n if (this._charsToAnnounce.length === 0) {\n return;\n }\n this._liveRegion.textContent += this._charsToAnnounce;\n this._charsToAnnounce = '';\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionService } from 'browser/services/Services';\nimport { ICoreService } from 'common/services/Services';\n\n/**\n * Prepares text to be pasted into the terminal by normalizing the line endings\n * @param text The pasted text that needs processing before inserting into the terminal\n */\nexport function prepareTextForTerminal(text: string): string {\n return text.replace(/\\r?\\n/g, '\\r');\n}\n\n/**\n * Bracket text for paste, if necessary, as per https://cirw.in/blog/bracketed-paste\n * @param text The pasted text to bracket\n */\nexport function bracketTextForPaste(text: string, bracketedPasteMode: boolean): string {\n if (bracketedPasteMode) {\n return '\\x1b[200~' + text + '\\x1b[201~';\n }\n return text;\n}\n\n/**\n * Binds copy functionality to the given terminal.\n * @param ev The original copy event to be handled\n */\nexport function copyHandler(ev: ClipboardEvent, selectionService: ISelectionService): void {\n if (ev.clipboardData) {\n ev.clipboardData.setData('text/plain', selectionService.selectionText);\n }\n // Prevent or the original text will be copied.\n ev.preventDefault();\n}\n\n/**\n * Redirect the clipboard's data to the terminal's input handler.\n */\nexport function handlePasteEvent(ev: ClipboardEvent, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n ev.stopPropagation();\n if (ev.clipboardData) {\n const text = ev.clipboardData.getData('text/plain');\n paste(text, textarea, coreService);\n }\n}\n\nexport function paste(text: string, textarea: HTMLTextAreaElement, coreService: ICoreService): void {\n text = prepareTextForTerminal(text);\n text = bracketTextForPaste(text, coreService.decPrivateModes.bracketedPasteMode);\n coreService.triggerDataEvent(text, true);\n textarea.value = '';\n}\n\n/**\n * Moves the textarea under the mouse cursor and focuses it.\n * @param ev The original right click event to be handled.\n * @param textarea The terminal's textarea.\n */\nexport function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement): void {\n\n // Calculate textarea position relative to the screen element\n const pos = screenElement.getBoundingClientRect();\n const left = ev.clientX - pos.left - 10;\n const top = ev.clientY - pos.top - 10;\n\n // Bring textarea at the cursor position\n textarea.style.width = '20px';\n textarea.style.height = '20px';\n textarea.style.left = `${left}px`;\n textarea.style.top = `${top}px`;\n textarea.style.zIndex = '1000';\n\n textarea.focus();\n}\n\n/**\n * Bind to right-click event and allow right-click copy and paste.\n */\nexport function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement, selectionService: ISelectionService, shouldSelectWord: boolean): void {\n moveTextAreaUnderMouseCursor(ev, textarea, screenElement);\n\n if (shouldSelectWord) {\n selectionService.rightClickSelect(ev);\n }\n\n // Get textarea ready to copy from the context menu\n textarea.value = selectionService.selectionText;\n textarea.select();\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IColorContrastCache } from 'browser/Types';\nimport { IColor } from 'common/Types';\nimport { TwoKeyMap } from 'common/MultiKeyMap';\n\nexport class ColorContrastCache implements IColorContrastCache {\n private _color: TwoKeyMap</* bg */number, /* fg */number, IColor | null> = new TwoKeyMap();\n private _css: TwoKeyMap</* bg */number, /* fg */number, string | null> = new TwoKeyMap();\n\n public setCss(bg: number, fg: number, value: string | null): void {\n this._css.set(bg, fg, value);\n }\n\n public getCss(bg: number, fg: number): string | null | undefined {\n return this._css.get(bg, fg);\n }\n\n public setColor(bg: number, fg: number, value: IColor | null): void {\n this._color.set(bg, fg, value);\n }\n\n public getColor(bg: number, fg: number): IColor | null | undefined {\n return this._color.get(bg, fg);\n }\n\n public clear(): void {\n this._color.clear();\n this._css.clear();\n }\n}\n","/**\n * Copyright (c) 2020 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {\n for (const e of elements) {\n e?.parentElement?.removeChild(e);\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * Adds a disposable listener to a node in the DOM, returning the disposable.\n * @param node The node to add a listener to.\n * @param type The event type.\n * @param handler The handler for the listener.\n * @param options The boolean or options object to pass on to the event\n * listener.\n */\nexport function addDisposableDomListener(\n node: Element | Window | Document,\n type: string,\n handler: (e: any) => void,\n options?: boolean | AddEventListenerOptions\n): IDisposable {\n node.addEventListener(type, handler, options);\n let disposed = false;\n return {\n dispose: () => {\n if (disposed) {\n return;\n }\n disposed = true;\n node.removeEventListener(type, handler, options);\n }\n };\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ILinkifier2, ILinkProvider, IBufferCellPosition, ILink, ILinkifierEvent, ILinkDecorations, ILinkWithState } from 'browser/Types';\nimport { IDisposable } from 'common/Types';\nimport { IMouseService, IRenderService } from './services/Services';\nimport { IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable, getDisposeArrayDisposable, disposeArray, toDisposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\n\nexport class Linkifier2 extends Disposable implements ILinkifier2 {\n private _element: HTMLElement | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _linkProviders: ILinkProvider[] = [];\n public get currentLink(): ILinkWithState | undefined { return this._currentLink; }\n protected _currentLink: ILinkWithState | undefined;\n private _mouseDownLink: ILinkWithState | undefined;\n private _lastMouseEvent: MouseEvent | undefined;\n private _linkCacheDisposables: IDisposable[] = [];\n private _lastBufferCell: IBufferCellPosition | undefined;\n private _isMouseOut: boolean = true;\n private _activeProviderReplies: Map<Number, ILinkWithState[] | undefined> | undefined;\n private _activeLine: number = -1;\n\n private readonly _onShowLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());\n public readonly onShowLinkUnderline = this._onShowLinkUnderline.event;\n private readonly _onHideLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());\n public readonly onHideLinkUnderline = this._onHideLinkUnderline.event;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n super();\n this.register(getDisposeArrayDisposable(this._linkCacheDisposables));\n this.register(toDisposable(() => {\n this._lastMouseEvent = undefined;\n }));\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n this._linkProviders.push(linkProvider);\n return {\n dispose: () => {\n // Remove the link provider from the list\n const providerIndex = this._linkProviders.indexOf(linkProvider);\n\n if (providerIndex !== -1) {\n this._linkProviders.splice(providerIndex, 1);\n }\n }\n };\n }\n\n public attachToDom(element: HTMLElement, mouseService: IMouseService, renderService: IRenderService): void {\n this._element = element;\n this._mouseService = mouseService;\n this._renderService = renderService;\n\n this.register(addDisposableDomListener(this._element, 'mouseleave', () => {\n this._isMouseOut = true;\n this._clearCurrentLink();\n }));\n this.register(addDisposableDomListener(this._element, 'mousemove', this._handleMouseMove.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mousedown', this._handleMouseDown.bind(this)));\n this.register(addDisposableDomListener(this._element, 'mouseup', this._handleMouseUp.bind(this)));\n }\n\n private _handleMouseMove(event: MouseEvent): void {\n this._lastMouseEvent = event;\n\n if (!this._element || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n this._isMouseOut = false;\n\n // Ignore the event if it's an embedder created hover widget\n const composedPath = event.composedPath() as HTMLElement[];\n for (let i = 0; i < composedPath.length; i++) {\n const target = composedPath[i];\n // Hit Terminal.element, break and continue\n if (target.classList.contains('xterm')) {\n break;\n }\n // It's a hover, don't respect hover event\n if (target.classList.contains('xterm-hover')) {\n return;\n }\n }\n\n if (!this._lastBufferCell || (position.x !== this._lastBufferCell.x || position.y !== this._lastBufferCell.y)) {\n this._handleHover(position);\n this._lastBufferCell = position;\n }\n }\n\n private _handleHover(position: IBufferCellPosition): void {\n // TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`\n // Check if we need to clear the link\n if (this._activeLine !== position.y) {\n this._clearCurrentLink();\n this._askForLink(position, false);\n return;\n }\n\n // Check the if the link is in the mouse position\n const isCurrentLinkInPosition = this._currentLink && this._linkAtPosition(this._currentLink.link, position);\n if (!isCurrentLinkInPosition) {\n this._clearCurrentLink();\n this._askForLink(position, true);\n }\n }\n\n private _askForLink(position: IBufferCellPosition, useLineCache: boolean): void {\n if (!this._activeProviderReplies || !useLineCache) {\n this._activeProviderReplies?.forEach(reply => {\n reply?.forEach(linkWithState => {\n if (linkWithState.link.dispose) {\n linkWithState.link.dispose();\n }\n });\n });\n this._activeProviderReplies = new Map();\n this._activeLine = position.y;\n }\n let linkProvided = false;\n\n // There is no link cached, so ask for one\n for (const [i, linkProvider] of this._linkProviders.entries()) {\n if (useLineCache) {\n const existingReply = this._activeProviderReplies?.get(i);\n // If there isn't a reply, the provider hasn't responded yet.\n\n // TODO: If there isn't a reply yet it means that the provider is still resolving. Ensuring\n // provideLinks isn't triggered again saves ILink.hover firing twice though. This probably\n // needs promises to get fixed\n if (existingReply) {\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n }\n } else {\n linkProvider.provideLinks(position.y, (links: ILink[] | undefined) => {\n if (this._isMouseOut) {\n return;\n }\n const linksWithState: ILinkWithState[] | undefined = links?.map(link => ({ link }));\n this._activeProviderReplies?.set(i, linksWithState);\n linkProvided = this._checkLinkProviderResult(i, position, linkProvided);\n\n // If all providers have responded, remove lower priority links that intersect ranges of\n // higher priority links\n if (this._activeProviderReplies?.size === this._linkProviders.length) {\n this._removeIntersectingLinks(position.y, this._activeProviderReplies);\n }\n });\n }\n }\n }\n\n private _removeIntersectingLinks(y: number, replies: Map<Number, ILinkWithState[] | undefined>): void {\n const occupiedCells = new Set<number>();\n for (let i = 0; i < replies.size; i++) {\n const providerReply = replies.get(i);\n if (!providerReply) {\n continue;\n }\n for (let i = 0; i < providerReply.length; i++) {\n const linkWithState = providerReply[i];\n const startX = linkWithState.link.range.start.y < y ? 0 : linkWithState.link.range.start.x;\n const endX = linkWithState.link.range.end.y > y ? this._bufferService.cols : linkWithState.link.range.end.x;\n for (let x = startX; x <= endX; x++) {\n if (occupiedCells.has(x)) {\n providerReply.splice(i--, 1);\n break;\n }\n occupiedCells.add(x);\n }\n }\n }\n }\n\n private _checkLinkProviderResult(index: number, position: IBufferCellPosition, linkProvided: boolean): boolean {\n if (!this._activeProviderReplies) {\n return linkProvided;\n }\n\n const links = this._activeProviderReplies.get(index);\n\n // Check if every provider before this one has come back undefined\n let hasLinkBefore = false;\n for (let j = 0; j < index; j++) {\n if (!this._activeProviderReplies.has(j) || this._activeProviderReplies.get(j)) {\n hasLinkBefore = true;\n }\n }\n\n // If all providers with higher priority came back undefined, then this provider's link for\n // the position should be used\n if (!hasLinkBefore && links) {\n const linkAtPosition = links.find(link => this._linkAtPosition(link.link, position));\n if (linkAtPosition) {\n linkProvided = true;\n this._handleNewLink(linkAtPosition);\n }\n }\n\n // Check if all the providers have responded\n if (this._activeProviderReplies.size === this._linkProviders.length && !linkProvided) {\n // Respect the order of the link providers\n for (let j = 0; j < this._activeProviderReplies.size; j++) {\n const currentLink = this._activeProviderReplies.get(j)?.find(link => this._linkAtPosition(link.link, position));\n if (currentLink) {\n linkProvided = true;\n this._handleNewLink(currentLink);\n break;\n }\n }\n }\n\n return linkProvided;\n }\n\n private _handleMouseDown(): void {\n this._mouseDownLink = this._currentLink;\n }\n\n private _handleMouseUp(event: MouseEvent): void {\n if (!this._element || !this._mouseService || !this._currentLink) {\n return;\n }\n\n const position = this._positionFromMouseEvent(event, this._element, this._mouseService);\n if (!position) {\n return;\n }\n\n if (this._mouseDownLink === this._currentLink && this._linkAtPosition(this._currentLink.link, position)) {\n this._currentLink.link.activate(event, this._currentLink.link.text);\n }\n }\n\n private _clearCurrentLink(startRow?: number, endRow?: number): void {\n if (!this._element || !this._currentLink || !this._lastMouseEvent) {\n return;\n }\n\n // If we have a start and end row, check that the link is within it\n if (!startRow || !endRow || (this._currentLink.link.range.start.y >= startRow && this._currentLink.link.range.end.y <= endRow)) {\n this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent);\n this._currentLink = undefined;\n disposeArray(this._linkCacheDisposables);\n }\n }\n\n private _handleNewLink(linkWithState: ILinkWithState): void {\n if (!this._element || !this._lastMouseEvent || !this._mouseService) {\n return;\n }\n\n const position = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);\n\n if (!position) {\n return;\n }\n\n // Trigger hover if the we have a link at the position\n if (this._linkAtPosition(linkWithState.link, position)) {\n this._currentLink = linkWithState;\n this._currentLink.state = {\n decorations: {\n underline: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.underline,\n pointerCursor: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.pointerCursor\n },\n isHovered: true\n };\n this._linkHover(this._element, linkWithState.link, this._lastMouseEvent);\n\n // Add listener for tracking decorations changes\n linkWithState.link.decorations = {} as ILinkDecorations;\n Object.defineProperties(linkWithState.link.decorations, {\n pointerCursor: {\n get: () => this._currentLink?.state?.decorations.pointerCursor,\n set: v => {\n if (this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== v) {\n this._currentLink.state.decorations.pointerCursor = v;\n if (this._currentLink.state.isHovered) {\n this._element?.classList.toggle('xterm-cursor-pointer', v);\n }\n }\n }\n },\n underline: {\n get: () => this._currentLink?.state?.decorations.underline,\n set: v => {\n if (this._currentLink?.state && this._currentLink?.state?.decorations.underline !== v) {\n this._currentLink.state.decorations.underline = v;\n if (this._currentLink.state.isHovered) {\n this._fireUnderlineEvent(linkWithState.link, v);\n }\n }\n }\n }\n });\n\n // Add listener for rerendering\n if (this._renderService) {\n this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e => {\n // When start is 0 a scroll most likely occurred, make sure links above the fold also get\n // cleared.\n const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp;\n const oldEvent = this._currentLink ? this._lastMouseEvent : undefined;\n this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp);\n if (oldEvent && this._element) {\n // re-eval previously active link after changes\n const position = this._positionFromMouseEvent(oldEvent, this._element, this._mouseService!);\n if (position) {\n this._askForLink(position, false);\n }\n }\n }));\n }\n }\n }\n\n protected _linkHover(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = true;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, true);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.add('xterm-cursor-pointer');\n }\n }\n\n if (link.hover) {\n link.hover(event, link.text);\n }\n }\n\n private _fireUnderlineEvent(link: ILink, showEvent: boolean): void {\n const range = link.range;\n const scrollOffset = this._bufferService.buffer.ydisp;\n const event = this._createLinkUnderlineEvent(range.start.x - 1, range.start.y - scrollOffset - 1, range.end.x, range.end.y - scrollOffset - 1, undefined);\n const emitter = showEvent ? this._onShowLinkUnderline : this._onHideLinkUnderline;\n emitter.fire(event);\n }\n\n protected _linkLeave(element: HTMLElement, link: ILink, event: MouseEvent): void {\n if (this._currentLink?.state) {\n this._currentLink.state.isHovered = false;\n if (this._currentLink.state.decorations.underline) {\n this._fireUnderlineEvent(link, false);\n }\n if (this._currentLink.state.decorations.pointerCursor) {\n element.classList.remove('xterm-cursor-pointer');\n }\n }\n\n if (link.leave) {\n link.leave(event, link.text);\n }\n }\n\n /**\n * Check if the buffer position is within the link\n * @param link\n * @param position\n */\n private _linkAtPosition(link: ILink, position: IBufferCellPosition): boolean {\n const lower = link.range.start.y * this._bufferService.cols + link.range.start.x;\n const upper = link.range.end.y * this._bufferService.cols + link.range.end.x;\n const current = position.y * this._bufferService.cols + position.x;\n return (lower <= current && current <= upper);\n }\n\n /**\n * Get the buffer position from a mouse event\n * @param event\n */\n private _positionFromMouseEvent(event: MouseEvent, element: HTMLElement, mouseService: IMouseService): IBufferCellPosition | undefined {\n const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);\n if (!coords) {\n return;\n }\n\n return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };\n }\n\n private _createLinkUnderlineEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {\n return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// This file contains strings that get exported in the API so they can be localized\n\n// eslint-disable-next-line prefer-const\nexport let promptLabel = 'Terminal input';\n\n// eslint-disable-next-line prefer-const\nexport let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferRange, ILink, ILinkProvider } from 'browser/Types';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService, IOptionsService, IOscLinkService } from 'common/services/Services';\n\nexport class OscLinkProvider implements ILinkProvider {\n constructor(\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IOscLinkService private readonly _oscLinkService: IOscLinkService\n ) {\n }\n\n public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {\n const line = this._bufferService.buffer.lines.get(y - 1);\n if (!line) {\n callback(undefined);\n return;\n }\n\n const result: ILink[] = [];\n const linkHandler = this._optionsService.rawOptions.linkHandler;\n const cell = new CellData();\n const lineLength = line.getTrimmedLength();\n let currentLinkId = -1;\n let currentStart = -1;\n let finishLink = false;\n for (let x = 0; x < lineLength; x++) {\n // Minor optimization, only check for content if there isn't a link in case the link ends with\n // a null cell\n if (currentStart === -1 && !line.hasContent(x)) {\n continue;\n }\n\n line.loadCell(x, cell);\n if (cell.hasExtendedAttrs() && cell.extended.urlId) {\n if (currentStart === -1) {\n currentStart = x;\n currentLinkId = cell.extended.urlId;\n continue;\n } else {\n finishLink = cell.extended.urlId !== currentLinkId;\n }\n } else {\n if (currentStart !== -1) {\n finishLink = true;\n }\n }\n\n if (finishLink || (currentStart !== -1 && x === lineLength - 1)) {\n const text = this._oscLinkService.getLinkData(currentLinkId)?.uri;\n if (text) {\n // These ranges are 1-based\n const range: IBufferRange = {\n start: {\n x: currentStart + 1,\n y\n },\n end: {\n // Offset end x if it's a link that ends on the last cell in the line\n x: x + (!finishLink && x === lineLength - 1 ? 1 : 0),\n y\n }\n };\n\n let ignoreLink = false;\n if (!linkHandler?.allowNonHttpProtocols) {\n try {\n const parsed = new URL(text);\n if (!['http:', 'https:'].includes(parsed.protocol)) {\n ignoreLink = true;\n }\n } catch (e) {\n // Ignore invalid URLs to prevent unexpected behaviors\n ignoreLink = true;\n }\n }\n\n if (!ignoreLink) {\n // OSC links always use underline and pointer decorations\n result.push({\n text,\n range,\n activate: (e, text) => (linkHandler ? linkHandler.activate(e, text, range) : defaultActivate(e, text)),\n hover: (e, text) => linkHandler?.hover?.(e, text, range),\n leave: (e, text) => linkHandler?.leave?.(e, text, range)\n });\n }\n }\n finishLink = false;\n\n // Clear link or start a new link if one starts immediately\n if (cell.hasExtendedAttrs() && cell.extended.urlId) {\n currentStart = x;\n currentLinkId = cell.extended.urlId;\n } else {\n currentStart = -1;\n currentLinkId = -1;\n }\n }\n }\n\n // TODO: Handle fetching and returning other link ranges to underline other links with the same id\n callback(result);\n }\n}\n\nfunction defaultActivate(e: MouseEvent, uri: string): void {\n const answer = confirm(`Do you want to navigate to ${uri}?\\n\\nWARNING: This link could potentially be dangerous`);\n if (answer) {\n const newWindow = window.open();\n if (newWindow) {\n try {\n newWindow.opener = null;\n } catch {\n // no-op, Electron can throw\n }\n newWindow.location.href = uri;\n } else {\n console.warn('Opening link blocked as opener could not be cleared');\n }\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderDebouncerWithCallback } from 'browser/Types';\n\n/**\n * Debounces calls to render terminal rows using animation frames.\n */\nexport class RenderDebouncer implements IRenderDebouncerWithCallback {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n private _animationFrame: number | undefined;\n private _refreshCallbacks: FrameRequestCallback[] = [];\n\n constructor(\n private _parentWindow: Window,\n private _renderCallback: (start: number, end: number) => void\n ) {\n }\n\n public dispose(): void {\n if (this._animationFrame) {\n this._parentWindow.cancelAnimationFrame(this._animationFrame);\n this._animationFrame = undefined;\n }\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n this._refreshCallbacks.push(callback);\n if (!this._animationFrame) {\n this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh());\n }\n return this._animationFrame;\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n if (this._animationFrame) {\n return;\n }\n\n this._animationFrame = this._parentWindow.requestAnimationFrame(() => this._innerRefresh());\n }\n\n private _innerRefresh(): void {\n this._animationFrame = undefined;\n\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n this._runRefreshCallbacks();\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n this._runRefreshCallbacks();\n }\n\n private _runRefreshCallbacks(): void {\n for (const callback of this._refreshCallbacks) {\n callback(0);\n }\n this._refreshCallbacks = [];\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable, toDisposable } from 'common/Lifecycle';\n\nexport type ScreenDprListener = (newDevicePixelRatio?: number, oldDevicePixelRatio?: number) => void;\n\n/**\n * The screen device pixel ratio monitor allows listening for when the\n * window.devicePixelRatio value changes. This is done not with polling but with\n * the use of window.matchMedia to watch media queries. When the event fires,\n * the listener will be reattached using a different media query to ensure that\n * any further changes will register.\n *\n * The listener should fire on both window zoom changes and switching to a\n * monitor with a different DPI.\n */\nexport class ScreenDprMonitor extends Disposable {\n private _currentDevicePixelRatio: number;\n private _outerListener: ((this: MediaQueryList, ev: MediaQueryListEvent) => any) | undefined;\n private _listener: ScreenDprListener | undefined;\n private _resolutionMediaMatchList: MediaQueryList | undefined;\n\n constructor(private _parentWindow: Window) {\n super();\n this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio;\n this.register(toDisposable(() => {\n this.clearListener();\n }));\n }\n\n public setListener(listener: ScreenDprListener): void {\n if (this._listener) {\n this.clearListener();\n }\n this._listener = listener;\n this._outerListener = () => {\n if (!this._listener) {\n return;\n }\n this._listener(this._parentWindow.devicePixelRatio, this._currentDevicePixelRatio);\n this._updateDpr();\n };\n this._updateDpr();\n }\n\n private _updateDpr(): void {\n if (!this._outerListener) {\n return;\n }\n\n // Clear listeners for old DPR\n this._resolutionMediaMatchList?.removeListener(this._outerListener);\n\n // Add listeners for new DPR\n this._currentDevicePixelRatio = this._parentWindow.devicePixelRatio;\n this._resolutionMediaMatchList = this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`);\n this._resolutionMediaMatchList.addListener(this._outerListener);\n }\n\n public clearListener(): void {\n if (!this._resolutionMediaMatchList || !this._listener || !this._outerListener) {\n return;\n }\n this._resolutionMediaMatchList.removeListener(this._outerListener);\n this._resolutionMediaMatchList = undefined;\n this._listener = undefined;\n this._outerListener = undefined;\n }\n}\n","/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { ICompositionHelper, ITerminal, IBrowser, CustomKeyEventHandler, IViewport, ILinkifier2, CharacterJoinerHandler, IBufferRange } from 'browser/Types';\nimport { IRenderer } from 'browser/renderer/shared/Types';\nimport { CompositionHelper } from 'browser/input/CompositionHelper';\nimport { Viewport } from 'browser/Viewport';\nimport { rightClickHandler, moveTextAreaUnderMouseCursor, handlePasteEvent, copyHandler, paste } from 'browser/Clipboard';\nimport { C0, C1_ESCAPED } from 'common/data/EscapeSequences';\nimport { WindowsOptionsReportType } from '../common/InputHandler';\nimport { SelectionService } from 'browser/services/SelectionService';\nimport * as Browser from 'common/Platform';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { AccessibilityManager } from './AccessibilityManager';\nimport { ITheme, IMarker, IDisposable, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm';\nimport { DomRenderer } from 'browser/renderer/dom/DomRenderer';\nimport { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types';\nimport { evaluateKeyboardEvent } from 'common/input/Keyboard';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { RenderService } from 'browser/services/RenderService';\nimport { ICharSizeService, IRenderService, IMouseService, ISelectionService, ICoreBrowserService, ICharacterJoinerService, IThemeService } from 'browser/services/Services';\nimport { CharSizeService } from 'browser/services/CharSizeService';\nimport { IBuffer } from 'common/buffer/Types';\nimport { MouseService } from 'browser/services/MouseService';\nimport { Linkifier2 } from 'browser/Linkifier2';\nimport { CoreBrowserService } from 'browser/services/CoreBrowserService';\nimport { CoreTerminal } from 'common/CoreTerminal';\nimport { color, rgba } from 'common/Color';\nimport { CharacterJoinerService } from 'browser/services/CharacterJoinerService';\nimport { toRgbString } from 'common/input/XParseColor';\nimport { BufferDecorationRenderer } from 'browser/decorations/BufferDecorationRenderer';\nimport { OverviewRulerRenderer } from 'browser/decorations/OverviewRulerRenderer';\nimport { DecorationService } from 'common/services/DecorationService';\nimport { IDecorationService } from 'common/services/Services';\nimport { OscLinkProvider } from 'browser/OscLinkProvider';\nimport { toDisposable } from 'common/Lifecycle';\nimport { ThemeService } from 'browser/services/ThemeService';\n\n// Let it work inside Node.js for automated testing purposes.\nconst document: Document = (typeof window !== 'undefined') ? window.document : null as any;\n\nexport class Terminal extends CoreTerminal implements ITerminal {\n public textarea: HTMLTextAreaElement | undefined;\n public element: HTMLElement | undefined;\n public screenElement: HTMLElement | undefined;\n\n private _document: Document | undefined;\n private _viewportScrollArea: HTMLElement | undefined;\n private _viewportElement: HTMLElement | undefined;\n private _helperContainer: HTMLElement | undefined;\n private _compositionView: HTMLElement | undefined;\n\n private _overviewRulerRenderer: OverviewRulerRenderer | undefined;\n\n // private _visualBellTimer: number;\n\n public browser: IBrowser = Browser as any;\n\n private _customKeyEventHandler: CustomKeyEventHandler | undefined;\n\n // browser services\n private _decorationService: DecorationService;\n private _charSizeService: ICharSizeService | undefined;\n private _coreBrowserService: ICoreBrowserService | undefined;\n private _mouseService: IMouseService | undefined;\n private _renderService: IRenderService | undefined;\n private _themeService: IThemeService | undefined;\n private _characterJoinerService: ICharacterJoinerService | undefined;\n private _selectionService: ISelectionService | undefined;\n\n /**\n * Records whether the keydown event has already been handled and triggered a data event, if so\n * the keypress event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyDownHandled: boolean = false;\n\n /**\n * Records whether a keydown event has occured since the last keyup event, i.e. whether a key\n * is currently \"pressed\".\n */\n private _keyDownSeen: boolean = false;\n\n /**\n * Records whether the keypress event has already been handled and triggered a data event, if so\n * the input event should not trigger a data event but should still print to the textarea so\n * screen readers will announce it.\n */\n private _keyPressHandled: boolean = false;\n\n /**\n * Records whether there has been a keydown event for a dead key without a corresponding keydown\n * event for the composed/alternative character. If we cancel the keydown event for the dead key,\n * no events will be emitted for the final character.\n */\n private _unprocessedDeadKey: boolean = false;\n\n public linkifier2: ILinkifier2;\n public viewport: IViewport | undefined;\n private _compositionHelper: ICompositionHelper | undefined;\n private _accessibilityManager: AccessibilityManager | undefined;\n\n private readonly _onCursorMove = this.register(new EventEmitter<void>());\n public readonly onCursorMove = this._onCursorMove.event;\n private readonly _onKey = this.register(new EventEmitter<{ key: string, domEvent: KeyboardEvent }>());\n public readonly onKey = this._onKey.event;\n private readonly _onRender = this.register(new EventEmitter<{ start: number, end: number }>());\n public readonly onRender = this._onRender.event;\n private readonly _onSelectionChange = this.register(new EventEmitter<void>());\n public readonly onSelectionChange = this._onSelectionChange.event;\n private readonly _onTitleChange = this.register(new EventEmitter<string>());\n public readonly onTitleChange = this._onTitleChange.event;\n private readonly _onBell = this.register(new EventEmitter<void>());\n public readonly onBell = this._onBell.event;\n\n private _onFocus = this.register(new EventEmitter<void>());\n public get onFocus(): IEvent<void> { return this._onFocus.event; }\n private _onBlur = this.register(new EventEmitter<void>());\n public get onBlur(): IEvent<void> { return this._onBlur.event; }\n private _onA11yCharEmitter = this.register(new EventEmitter<string>());\n public get onA11yChar(): IEvent<string> { return this._onA11yCharEmitter.event; }\n private _onA11yTabEmitter = this.register(new EventEmitter<number>());\n public get onA11yTab(): IEvent<number> { return this._onA11yTabEmitter.event; }\n private _onWillOpen = this.register(new EventEmitter<HTMLElement>());\n public get onWillOpen(): IEvent<HTMLElement> { return this._onWillOpen.event; }\n\n /**\n * Creates a new `Terminal` object.\n *\n * @param options An object containing a set of options, the available options are:\n * - `cursorBlink` (boolean): Whether the terminal cursor blinks\n * - `cols` (number): The number of columns of the terminal (horizontal size)\n * - `rows` (number): The number of rows of the terminal (vertical size)\n *\n * @public\n * @class Xterm Xterm\n * @alias module:xterm/src/xterm\n */\n constructor(\n options: Partial<ITerminalOptions> = {}\n ) {\n super(options);\n\n this._setup();\n\n this.linkifier2 = this.register(this._instantiationService.createInstance(Linkifier2));\n this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(OscLinkProvider));\n this._decorationService = this._instantiationService.createInstance(DecorationService);\n this._instantiationService.setService(IDecorationService, this._decorationService);\n\n // Setup InputHandler listeners\n this.register(this._inputHandler.onRequestBell(() => this._onBell.fire()));\n this.register(this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end)));\n this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus()));\n this.register(this._inputHandler.onRequestReset(() => this.reset()));\n this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type)));\n this.register(this._inputHandler.onColor((event) => this._handleColorEvent(event)));\n this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove));\n this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange));\n this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter));\n this.register(forwardEvent(this._inputHandler.onA11yTab, this._onA11yTabEmitter));\n\n // Setup listeners\n this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));\n\n this.register(toDisposable(() => {\n this._customKeyEventHandler = undefined;\n this.element?.parentNode?.removeChild(this.element);\n }));\n }\n\n /**\n * Handle color event from inputhandler for OSC 4|104 | 10|110 | 11|111 | 12|112.\n * An event from OSC 4|104 may contain multiple set or report requests, and multiple\n * or none restore requests (resetting all),\n * while an event from OSC 10|110 | 11|111 | 12|112 always contains a single request.\n */\n private _handleColorEvent(event: IColorEvent): void {\n if (!this._themeService) return;\n for (const req of event) {\n let acc: 'foreground' | 'background' | 'cursor' | 'ansi';\n let ident = '';\n switch (req.index) {\n case ColorIndex.FOREGROUND: // OSC 10 | 110\n acc = 'foreground';\n ident = '10';\n break;\n case ColorIndex.BACKGROUND: // OSC 11 | 111\n acc = 'background';\n ident = '11';\n break;\n case ColorIndex.CURSOR: // OSC 12 | 112\n acc = 'cursor';\n ident = '12';\n break;\n default: // OSC 4 | 104\n // we can skip the [0..255] range check here (already done in inputhandler)\n acc = 'ansi';\n ident = '4;' + req.index;\n }\n switch (req.type) {\n case ColorRequestType.REPORT:\n const channels = color.toColorRGB(acc === 'ansi'\n ? this._themeService.colors.ansi[req.index]\n : this._themeService.colors[acc]);\n this.coreService.triggerDataEvent(`${C0.ESC}]${ident};${toRgbString(channels)}${C1_ESCAPED.ST}`);\n break;\n case ColorRequestType.SET:\n if (acc === 'ansi') {\n this._themeService.modifyColors(colors => colors.ansi[req.index] = rgba.toColor(...req.color));\n } else {\n const narrowedAcc = acc;\n this._themeService.modifyColors(colors => colors[narrowedAcc] = rgba.toColor(...req.color));\n }\n break;\n case ColorRequestType.RESTORE:\n this._themeService.restoreColor(req.index);\n break;\n }\n }\n }\n\n protected _setup(): void {\n super._setup();\n\n this._customKeyEventHandler = undefined;\n }\n\n /**\n * Convenience property to active buffer.\n */\n public get buffer(): IBuffer {\n return this.buffers.active;\n }\n\n /**\n * Focus the terminal. Delegates focus handling to the terminal's DOM element.\n */\n public focus(): void {\n if (this.textarea) {\n this.textarea.focus({ preventScroll: true });\n }\n }\n\n private _handleScreenReaderModeOptionChange(value: boolean): void {\n if (value) {\n if (!this._accessibilityManager && this._renderService) {\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n } else {\n this._accessibilityManager?.dispose();\n this._accessibilityManager = undefined;\n }\n }\n\n /**\n * Binds the desired focus behavior on a given terminal object.\n */\n private _handleTextAreaFocus(ev: KeyboardEvent): void {\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n }\n this.updateCursorStyle(ev);\n this.element!.classList.add('focus');\n this._showCursor();\n this._onFocus.fire();\n }\n\n /**\n * Blur the terminal, calling the blur function on the terminal's underlying\n * textarea.\n */\n public blur(): void {\n return this.textarea?.blur();\n }\n\n /**\n * Binds the desired blur behavior on a given terminal object.\n */\n private _handleTextAreaBlur(): void {\n // Text can safely be removed on blur. Doing it earlier could interfere with\n // screen readers reading it out.\n this.textarea!.value = '';\n this.refresh(this.buffer.y, this.buffer.y);\n if (this.coreService.decPrivateModes.sendFocus) {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n this.element!.classList.remove('focus');\n this._onBlur.fire();\n }\n\n private _syncTextArea(): void {\n if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper!.isComposing || !this._renderService) {\n return;\n }\n const cursorY = this.buffer.ybase + this.buffer.y;\n const bufferLine = this.buffer.lines.get(cursorY);\n if (!bufferLine) {\n return;\n }\n const cursorX = Math.min(this.buffer.x, this.cols - 1);\n const cellHeight = this._renderService.dimensions.css.cell.height;\n const width = bufferLine.getWidth(cursorX);\n const cellWidth = this._renderService.dimensions.css.cell.width * width;\n const cursorTop = this.buffer.y * this._renderService.dimensions.css.cell.height;\n const cursorLeft = cursorX * this._renderService.dimensions.css.cell.width;\n\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n this.textarea.style.left = cursorLeft + 'px';\n this.textarea.style.top = cursorTop + 'px';\n this.textarea.style.width = cellWidth + 'px';\n this.textarea.style.height = cellHeight + 'px';\n this.textarea.style.lineHeight = cellHeight + 'px';\n this.textarea.style.zIndex = '-5';\n }\n\n /**\n * Initialize default behavior\n */\n private _initGlobal(): void {\n this._bindKeys();\n\n // Bind clipboard functionality\n this.register(addDisposableDomListener(this.element!, 'copy', (event: ClipboardEvent) => {\n // If mouse events are active it means the selection manager is disabled and\n // copy should be handled by the host program.\n if (!this.hasSelection()) {\n return;\n }\n copyHandler(event, this._selectionService!);\n }));\n const pasteHandlerWrapper = (event: ClipboardEvent): void => handlePasteEvent(event, this.textarea!, this.coreService);\n this.register(addDisposableDomListener(this.textarea!, 'paste', pasteHandlerWrapper));\n this.register(addDisposableDomListener(this.element!, 'paste', pasteHandlerWrapper));\n\n // Handle right click context menus\n if (Browser.isFirefox) {\n // Firefox doesn't appear to fire the contextmenu event on right click\n this.register(addDisposableDomListener(this.element!, 'mousedown', (event: MouseEvent) => {\n if (event.button === 2) {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }\n }));\n } else {\n this.register(addDisposableDomListener(this.element!, 'contextmenu', (event: MouseEvent) => {\n rightClickHandler(event, this.textarea!, this.screenElement!, this._selectionService!, this.options.rightClickSelectsWord);\n }));\n }\n\n // Move the textarea under the cursor when middle clicking on Linux to ensure\n // middle click to paste selection works. This only appears to work in Chrome\n // at the time is writing.\n if (Browser.isLinux) {\n // Use auxclick event over mousedown the latter doesn't seem to work. Note\n // that the regular click event doesn't fire for the middle mouse button.\n this.register(addDisposableDomListener(this.element!, 'auxclick', (event: MouseEvent) => {\n if (event.button === 1) {\n moveTextAreaUnderMouseCursor(event, this.textarea!, this.screenElement!);\n }\n }));\n }\n }\n\n /**\n * Apply key handling to the terminal\n */\n private _bindKeys(): void {\n this.register(addDisposableDomListener(this.textarea!, 'keyup', (ev: KeyboardEvent) => this._keyUp(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keydown', (ev: KeyboardEvent) => this._keyDown(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'keypress', (ev: KeyboardEvent) => this._keyPress(ev), true));\n this.register(addDisposableDomListener(this.textarea!, 'compositionstart', () => this._compositionHelper!.compositionstart()));\n this.register(addDisposableDomListener(this.textarea!, 'compositionupdate', (e: CompositionEvent) => this._compositionHelper!.compositionupdate(e)));\n this.register(addDisposableDomListener(this.textarea!, 'compositionend', () => this._compositionHelper!.compositionend()));\n this.register(addDisposableDomListener(this.textarea!, 'input', (ev: InputEvent) => this._inputEvent(ev), true));\n this.register(this.onRender(() => this._compositionHelper!.updateCompositionElements()));\n }\n\n /**\n * Opens the terminal within an element.\n *\n * @param parent The element to create the terminal within.\n */\n public open(parent: HTMLElement): void {\n if (!parent) {\n throw new Error('Terminal requires a parent element.');\n }\n\n if (!parent.isConnected) {\n this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');\n }\n\n this._document = parent.ownerDocument!;\n\n // Create main element container\n this.element = this._document.createElement('div');\n this.element.dir = 'ltr'; // xterm.css assumes LTR\n this.element.classList.add('terminal');\n this.element.classList.add('xterm');\n this.element.setAttribute('tabindex', '0');\n parent.appendChild(this.element);\n\n // Performance: Use a document fragment to build the terminal\n // viewport and helper elements detached from the DOM\n const fragment = document.createDocumentFragment();\n this._viewportElement = document.createElement('div');\n this._viewportElement.classList.add('xterm-viewport');\n fragment.appendChild(this._viewportElement);\n\n this._viewportScrollArea = document.createElement('div');\n this._viewportScrollArea.classList.add('xterm-scroll-area');\n this._viewportElement.appendChild(this._viewportScrollArea);\n\n this.screenElement = document.createElement('div');\n this.screenElement.classList.add('xterm-screen');\n // Create the container that will hold helpers like the textarea for\n // capturing DOM Events. Then produce the helpers.\n this._helperContainer = document.createElement('div');\n this._helperContainer.classList.add('xterm-helpers');\n this.screenElement.appendChild(this._helperContainer);\n fragment.appendChild(this.screenElement);\n\n this.textarea = document.createElement('textarea');\n this.textarea.classList.add('xterm-helper-textarea');\n this.textarea.setAttribute('aria-label', Strings.promptLabel);\n if (!Browser.isChromeOS) {\n // ChromeVox on ChromeOS does not like this. See\n // https://issuetracker.google.com/issues/260170397\n this.textarea.setAttribute('aria-multiline', 'false');\n }\n this.textarea.setAttribute('autocorrect', 'off');\n this.textarea.setAttribute('autocapitalize', 'off');\n this.textarea.setAttribute('spellcheck', 'false');\n this.textarea.tabIndex = 0;\n\n // Register the core browser service before the generic textarea handlers are registered so it\n // handles them first. Otherwise the renderers may use the wrong focus state.\n this._coreBrowserService = this._instantiationService.createInstance(CoreBrowserService, this.textarea, this._document.defaultView ?? window);\n this._instantiationService.setService(ICoreBrowserService, this._coreBrowserService);\n\n this.register(addDisposableDomListener(this.textarea, 'focus', (ev: KeyboardEvent) => this._handleTextAreaFocus(ev)));\n this.register(addDisposableDomListener(this.textarea, 'blur', () => this._handleTextAreaBlur()));\n this._helperContainer.appendChild(this.textarea);\n\n\n this._charSizeService = this._instantiationService.createInstance(CharSizeService, this._document, this._helperContainer);\n this._instantiationService.setService(ICharSizeService, this._charSizeService);\n\n this._themeService = this._instantiationService.createInstance(ThemeService);\n this._instantiationService.setService(IThemeService, this._themeService);\n\n this._characterJoinerService = this._instantiationService.createInstance(CharacterJoinerService);\n this._instantiationService.setService(ICharacterJoinerService, this._characterJoinerService);\n\n this._renderService = this.register(this._instantiationService.createInstance(RenderService, this.rows, this.screenElement));\n this._instantiationService.setService(IRenderService, this._renderService);\n this.register(this._renderService.onRenderedViewportChange(e => this._onRender.fire(e)));\n this.onResize(e => this._renderService!.resize(e.cols, e.rows));\n\n this._compositionView = document.createElement('div');\n this._compositionView.classList.add('composition-view');\n this._compositionHelper = this._instantiationService.createInstance(CompositionHelper, this.textarea, this._compositionView);\n this._helperContainer.appendChild(this._compositionView);\n\n // Performance: Add viewport and helper elements from the fragment\n this.element.appendChild(fragment);\n\n try {\n this._onWillOpen.fire(this.element);\n }\n catch { /* fails to load addon for some reason */ }\n if (!this._renderService.hasRenderer()) {\n this._renderService.setRenderer(this._createRenderer());\n }\n\n this._mouseService = this._instantiationService.createInstance(MouseService);\n this._instantiationService.setService(IMouseService, this._mouseService);\n\n this.viewport = this._instantiationService.createInstance(Viewport,\n (amount: number) => this.scrollLines(amount, true, ScrollSource.VIEWPORT),\n this._viewportElement,\n this._viewportScrollArea\n );\n this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport!.syncScrollArea()));\n this.register(this.viewport);\n\n this.register(this.onCursorMove(() => {\n this._renderService!.handleCursorMove();\n this._syncTextArea();\n }));\n this.register(this.onResize(() => this._renderService!.handleResize(this.cols, this.rows)));\n this.register(this.onBlur(() => this._renderService!.handleBlur()));\n this.register(this.onFocus(() => this._renderService!.handleFocus()));\n this.register(this._renderService.onDimensionsChange(() => this.viewport!.syncScrollArea()));\n\n this._selectionService = this.register(this._instantiationService.createInstance(SelectionService,\n this.element,\n this.screenElement,\n this.linkifier2\n ));\n this._instantiationService.setService(ISelectionService, this._selectionService);\n this.register(this._selectionService.onRequestScrollLines(e => this.scrollLines(e.amount, e.suppressScrollEvent)));\n this.register(this._selectionService.onSelectionChange(() => this._onSelectionChange.fire()));\n this.register(this._selectionService.onRequestRedraw(e => this._renderService!.handleSelectionChanged(e.start, e.end, e.columnSelectMode)));\n this.register(this._selectionService.onLinuxMouseSelection(text => {\n // If there's a new selection, put it into the textarea, focus and select it\n // in order to register it as a selection on the OS. This event is fired\n // only on Linux to enable middle click to paste selection.\n this.textarea!.value = text;\n this.textarea!.focus();\n this.textarea!.select();\n }));\n this.register(this._onScroll.event(ev => {\n this.viewport!.syncScrollArea();\n this._selectionService!.refresh();\n }));\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', () => this._selectionService!.refresh()));\n\n this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService);\n this.register(this._instantiationService.createInstance(BufferDecorationRenderer, this.screenElement));\n this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService!.handleMouseDown(e)));\n\n // apply mouse event classes set by escape codes before terminal was attached\n if (this.coreMouseService.areMouseEventsActive) {\n this._selectionService.disable();\n this.element.classList.add('enable-mouse-events');\n } else {\n this._selectionService.enable();\n }\n\n if (this.options.screenReaderMode) {\n // Note that this must be done *after* the renderer is created in order to\n // ensure the correct order of the dprchange event\n this._accessibilityManager = new AccessibilityManager(this, this._renderService);\n }\n this.register(this.optionsService.onSpecificOptionChange('screenReaderMode', e => this._handleScreenReaderModeOptionChange(e)));\n\n if (this.options.overviewRulerWidth) {\n this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement));\n }\n this.optionsService.onSpecificOptionChange('overviewRulerWidth', value => {\n if (!this._overviewRulerRenderer && value && this._viewportElement && this.screenElement) {\n this._overviewRulerRenderer = this.register(this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement));\n }\n });\n // Measure the character size\n this._charSizeService.measure();\n\n // Setup loop that draws to screen\n this.refresh(0, this.rows - 1);\n\n // Initialize global actions that need to be taken on the document.\n this._initGlobal();\n\n // Listen for mouse events and translate\n // them into terminal mouse protocols.\n this.bindMouse();\n }\n\n private _createRenderer(): IRenderer {\n return this._instantiationService.createInstance(DomRenderer, this.element!, this.screenElement!, this._viewportElement!, this.linkifier2);\n }\n\n /**\n * Bind certain mouse events to the terminal.\n * By default only 3 button + wheel up/down is ativated. For higher buttons\n * no mouse report will be created. Typically the standard actions will be active.\n *\n * There are several reasons not to enable support for higher buttons/wheel:\n * - Button 4 and 5 are typically used for history back and forward navigation,\n * there is no straight forward way to supress/intercept those standard actions.\n * - Support for higher buttons does not work in some platform/browser combinations.\n * - Left/right wheel was not tested.\n * - Emulators vary in mouse button support, typically only 3 buttons and\n * wheel up/down work reliable.\n *\n * TODO: Move mouse event code into its own file.\n */\n public bindMouse(): void {\n const self = this;\n const el = this.element!;\n\n // send event to CoreMouseService\n function sendEvent(ev: MouseEvent | WheelEvent): boolean {\n // get mouse coordinates\n const pos = self._mouseService!.getMouseReportCoords(ev, self.screenElement!);\n if (!pos) {\n return false;\n }\n\n let but: CoreMouseButton;\n let action: CoreMouseAction | undefined;\n switch ((ev as any).overrideType || ev.type) {\n case 'mousemove':\n action = CoreMouseAction.MOVE;\n if (ev.buttons === undefined) {\n // buttons is not supported on macOS, try to get a value from button instead\n but = CoreMouseButton.NONE;\n if (ev.button !== undefined) {\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n }\n } else {\n // according to MDN buttons only reports up to button 5 (AUX2)\n but = ev.buttons & 1 ? CoreMouseButton.LEFT :\n ev.buttons & 4 ? CoreMouseButton.MIDDLE :\n ev.buttons & 2 ? CoreMouseButton.RIGHT :\n CoreMouseButton.NONE; // fallback to NONE\n }\n break;\n case 'mouseup':\n action = CoreMouseAction.UP;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'mousedown':\n action = CoreMouseAction.DOWN;\n but = ev.button < 3 ? ev.button : CoreMouseButton.NONE;\n break;\n case 'wheel':\n const amount = self.viewport!.getLinesScrolled(ev as WheelEvent);\n\n if (amount === 0) {\n return false;\n }\n\n action = (ev as WheelEvent).deltaY < 0 ? CoreMouseAction.UP : CoreMouseAction.DOWN;\n but = CoreMouseButton.WHEEL;\n break;\n default:\n // dont handle other event types by accident\n return false;\n }\n\n // exit if we cannot determine valid button/action values\n // do nothing for higher buttons than wheel\n if (action === undefined || but === undefined || but > CoreMouseButton.WHEEL) {\n return false;\n }\n\n return self.coreMouseService.triggerMouseEvent({\n col: pos.col,\n row: pos.row,\n x: pos.x,\n y: pos.y,\n button: but,\n action,\n ctrl: ev.ctrlKey,\n alt: ev.altKey,\n shift: ev.shiftKey\n });\n }\n\n /**\n * Event listener state handling.\n * We listen to the onProtocolChange event of CoreMouseService and put\n * requested listeners in `requestedEvents`. With this the listeners\n * have all bits to do the event listener juggling.\n * Note: 'mousedown' currently is \"always on\" and not managed\n * by onProtocolChange.\n */\n const requestedEvents: { [key: string]: ((ev: Event) => void) | null } = {\n mouseup: null,\n wheel: null,\n mousedrag: null,\n mousemove: null\n };\n const eventListeners: { [key: string]: (ev: any) => void | boolean } = {\n mouseup: (ev: MouseEvent) => {\n sendEvent(ev);\n if (!ev.buttons) {\n // if no other button is held remove global handlers\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n if (requestedEvents.mousedrag) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag);\n }\n }\n return this.cancel(ev);\n },\n wheel: (ev: WheelEvent) => {\n sendEvent(ev);\n return this.cancel(ev, true);\n },\n mousedrag: (ev: MouseEvent) => {\n // deal only with move while a button is held\n if (ev.buttons) {\n sendEvent(ev);\n }\n },\n mousemove: (ev: MouseEvent) => {\n // deal only with move without any button\n if (!ev.buttons) {\n sendEvent(ev);\n }\n }\n };\n this.register(this.coreMouseService.onProtocolChange(events => {\n // apply global changes on events\n if (events) {\n if (this.optionsService.rawOptions.logLevel === 'debug') {\n this._logService.debug('Binding to mouse events:', this.coreMouseService.explainEvents(events));\n }\n this.element!.classList.add('enable-mouse-events');\n this._selectionService!.disable();\n } else {\n this._logService.debug('Unbinding from mouse events.');\n this.element!.classList.remove('enable-mouse-events');\n this._selectionService!.enable();\n }\n\n // add/remove handlers from requestedEvents\n\n if (!(events & CoreMouseEventType.MOVE)) {\n el.removeEventListener('mousemove', requestedEvents.mousemove!);\n requestedEvents.mousemove = null;\n } else if (!requestedEvents.mousemove) {\n el.addEventListener('mousemove', eventListeners.mousemove);\n requestedEvents.mousemove = eventListeners.mousemove;\n }\n\n if (!(events & CoreMouseEventType.WHEEL)) {\n el.removeEventListener('wheel', requestedEvents.wheel!);\n requestedEvents.wheel = null;\n } else if (!requestedEvents.wheel) {\n el.addEventListener('wheel', eventListeners.wheel, { passive: false });\n requestedEvents.wheel = eventListeners.wheel;\n }\n\n if (!(events & CoreMouseEventType.UP)) {\n this._document!.removeEventListener('mouseup', requestedEvents.mouseup!);\n requestedEvents.mouseup = null;\n } else if (!requestedEvents.mouseup) {\n requestedEvents.mouseup = eventListeners.mouseup;\n }\n\n if (!(events & CoreMouseEventType.DRAG)) {\n this._document!.removeEventListener('mousemove', requestedEvents.mousedrag!);\n requestedEvents.mousedrag = null;\n } else if (!requestedEvents.mousedrag) {\n requestedEvents.mousedrag = eventListeners.mousedrag;\n }\n }));\n // force initial onProtocolChange so we dont miss early mouse requests\n this.coreMouseService.activeProtocol = this.coreMouseService.activeProtocol;\n\n /**\n * \"Always on\" event listeners.\n */\n this.register(addDisposableDomListener(el, 'mousedown', (ev: MouseEvent) => {\n ev.preventDefault();\n this.focus();\n\n // Don't send the mouse button to the pty if mouse events are disabled or\n // if the selection manager is having selection forced (ie. a modifier is\n // held).\n if (!this.coreMouseService.areMouseEventsActive || this._selectionService!.shouldForceSelection(ev)) {\n return;\n }\n\n sendEvent(ev);\n\n // Register additional global handlers which should keep reporting outside\n // of the terminal element.\n // Note: Other emulators also do this for 'mousedown' while a button\n // is held, we currently limit 'mousedown' to the terminal only.\n if (requestedEvents.mouseup) {\n this._document!.addEventListener('mouseup', requestedEvents.mouseup);\n }\n if (requestedEvents.mousedrag) {\n this._document!.addEventListener('mousemove', requestedEvents.mousedrag);\n }\n\n return this.cancel(ev);\n }));\n\n this.register(addDisposableDomListener(el, 'wheel', (ev: WheelEvent) => {\n // do nothing, if app side handles wheel itself\n if (requestedEvents.wheel) return;\n\n if (!this.buffer.hasScrollback) {\n // Convert wheel events into up/down events when the buffer does not have scrollback, this\n // enables scrolling in apps hosted in the alt buffer such as vim or tmux.\n const amount = this.viewport!.getLinesScrolled(ev);\n\n // Do nothing if there's no vertical scroll\n if (amount === 0) {\n return;\n }\n\n // Construct and send sequences\n const sequence = C0.ESC + (this.coreService.decPrivateModes.applicationCursorKeys ? 'O' : '[') + (ev.deltaY < 0 ? 'A' : 'B');\n let data = '';\n for (let i = 0; i < Math.abs(amount); i++) {\n data += sequence;\n }\n this.coreService.triggerDataEvent(data, true);\n return this.cancel(ev, true);\n }\n\n // normal viewport scrolling\n // conditionally stop event, if the viewport still had rows to scroll within\n if (this.viewport!.handleWheel(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n\n this.register(addDisposableDomListener(el, 'touchstart', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n this.viewport!.handleTouchStart(ev);\n return this.cancel(ev);\n }, { passive: true }));\n\n this.register(addDisposableDomListener(el, 'touchmove', (ev: TouchEvent) => {\n if (this.coreMouseService.areMouseEventsActive) return;\n if (!this.viewport!.handleTouchMove(ev)) {\n return this.cancel(ev);\n }\n }, { passive: false }));\n }\n\n\n /**\n * Tells the renderer to refresh terminal content between two rows (inclusive) at the next\n * opportunity.\n * @param start The row to start from (between 0 and this.rows - 1).\n * @param end The row to end at (between start and this.rows - 1).\n */\n public refresh(start: number, end: number): void {\n this._renderService?.refreshRows(start, end);\n }\n\n /**\n * Change the cursor style for different selection modes\n */\n public updateCursorStyle(ev: KeyboardEvent): void {\n if (this._selectionService?.shouldColumnSelect(ev)) {\n this.element!.classList.add('column-select');\n } else {\n this.element!.classList.remove('column-select');\n }\n }\n\n /**\n * Display the cursor element\n */\n private _showCursor(): void {\n if (!this.coreService.isCursorInitialized) {\n this.coreService.isCursorInitialized = true;\n this.refresh(this.buffer.y, this.buffer.y);\n }\n }\n\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source = ScrollSource.TERMINAL): void {\n super.scrollLines(disp, suppressScrollEvent, source);\n this.refresh(0, this.rows - 1);\n }\n\n public paste(data: string): void {\n paste(data, this.textarea!, this.coreService);\n }\n\n /**\n * Attaches a custom key event handler which is run before keys are processed,\n * giving consumers of xterm.js ultimate control as to what keys should be\n * processed by the terminal and what keys should not.\n * @param customKeyEventHandler The custom KeyboardEvent handler to attach.\n * This is a function that takes a KeyboardEvent, allowing consumers to stop\n * propagation and/or prevent the default action. The function returns whether\n * the event should be processed by xterm.js.\n */\n public attachCustomKeyEventHandler(customKeyEventHandler: CustomKeyEventHandler): void {\n this._customKeyEventHandler = customKeyEventHandler;\n }\n\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n return this.linkifier2.registerLinkProvider(linkProvider);\n }\n\n public registerCharacterJoiner(handler: CharacterJoinerHandler): number {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n const joinerId = this._characterJoinerService.register(handler);\n this.refresh(0, this.rows - 1);\n return joinerId;\n }\n\n public deregisterCharacterJoiner(joinerId: number): void {\n if (!this._characterJoinerService) {\n throw new Error('Terminal must be opened first');\n }\n if (this._characterJoinerService.deregister(joinerId)) {\n this.refresh(0, this.rows - 1);\n }\n }\n\n public get markers(): IMarker[] {\n return this.buffer.markers;\n }\n\n public addMarker(cursorYOffset: number): IMarker | undefined {\n return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset);\n }\n\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n return this._decorationService.registerDecoration(decorationOptions);\n }\n\n /**\n * Gets whether the terminal has an active selection.\n */\n public hasSelection(): boolean {\n return this._selectionService ? this._selectionService.hasSelection : false;\n }\n\n /**\n * Selects text within the terminal.\n * @param column The column the selection starts at..\n * @param row The row the selection starts at.\n * @param length The length of the selection.\n */\n public select(column: number, row: number, length: number): void {\n this._selectionService!.setSelection(column, row, length);\n }\n\n /**\n * Gets the terminal's current selection, this is useful for implementing copy\n * behavior outside of xterm.js.\n */\n public getSelection(): string {\n return this._selectionService ? this._selectionService.selectionText : '';\n }\n\n public getSelectionPosition(): IBufferRange | undefined {\n if (!this._selectionService || !this._selectionService.hasSelection) {\n return undefined;\n }\n\n return {\n start: {\n x: this._selectionService.selectionStart![0],\n y: this._selectionService.selectionStart![1]\n },\n end: {\n x: this._selectionService.selectionEnd![0],\n y: this._selectionService.selectionEnd![1]\n }\n };\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._selectionService?.clearSelection();\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._selectionService?.selectAll();\n }\n\n public selectLines(start: number, end: number): void {\n this._selectionService?.selectLines(start, end);\n }\n\n /**\n * Handle a keydown [KeyboardEvent].\n *\n * [KeyboardEvent]: https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n */\n protected _keyDown(event: KeyboardEvent): boolean | undefined {\n this._keyDownHandled = false;\n this._keyDownSeen = true;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(event) === false) {\n return false;\n }\n\n // Ignore composing with Alt key on Mac when macOptionIsMeta is enabled\n const shouldIgnoreComposition = this.browser.isMac && this.options.macOptionIsMeta && event.altKey;\n\n if (!shouldIgnoreComposition && !this._compositionHelper!.keydown(event)) {\n if (this.options.scrollOnUserInput && this.buffer.ybase !== this.buffer.ydisp) {\n this._bufferService.scrollToBottom();\n }\n return false;\n }\n\n if (!shouldIgnoreComposition && (event.key === 'Dead' || event.key === 'AltGraph')) {\n this._unprocessedDeadKey = true;\n }\n\n const result = evaluateKeyboardEvent(event, this.coreService.decPrivateModes.applicationCursorKeys, this.browser.isMac, this.options.macOptionIsMeta);\n\n this.updateCursorStyle(event);\n\n if (result.type === KeyboardResultType.PAGE_DOWN || result.type === KeyboardResultType.PAGE_UP) {\n const scrollCount = this.rows - 1;\n this.scrollLines(result.type === KeyboardResultType.PAGE_UP ? -scrollCount : scrollCount);\n return this.cancel(event, true);\n }\n\n if (result.type === KeyboardResultType.SELECT_ALL) {\n this.selectAll();\n }\n\n if (this._isThirdLevelShift(this.browser, event)) {\n return true;\n }\n\n if (result.cancel) {\n // The event is canceled at the end already, is this necessary?\n this.cancel(event, true);\n }\n\n if (!result.key) {\n return true;\n }\n\n // HACK: Process A-Z in the keypress event to fix an issue with macOS IMEs where lower case\n // letters cannot be input while caps lock is on.\n if (event.key && !event.ctrlKey && !event.altKey && !event.metaKey && event.key.length === 1) {\n if (event.key.charCodeAt(0) >= 65 && event.key.charCodeAt(0) <= 90) {\n return true;\n }\n }\n\n if (this._unprocessedDeadKey) {\n this._unprocessedDeadKey = false;\n return true;\n }\n\n // If ctrl+c or enter is being sent, clear out the textarea. This is done so that screen readers\n // will announce deleted characters. This will not work 100% of the time but it should cover\n // most scenarios.\n if (result.key === C0.ETX || result.key === C0.CR) {\n this.textarea!.value = '';\n }\n\n this._onKey.fire({ key: result.key, domEvent: event });\n this._showCursor();\n this.coreService.triggerDataEvent(result.key, true);\n\n // Cancel events when not in screen reader mode so events don't get bubbled up and handled by\n // other listeners. When screen reader mode is enabled, we don't cancel them (unless ctrl or alt\n // is also depressed) so that the cursor textarea can be updated, which triggers the screen\n // reader to read it.\n if (!this.optionsService.rawOptions.screenReaderMode || event.altKey || event.ctrlKey) {\n return this.cancel(event, true);\n }\n\n this._keyDownHandled = true;\n }\n\n private _isThirdLevelShift(browser: IBrowser, ev: KeyboardEvent): boolean {\n const thirdLevelKey =\n (browser.isMac && !this.options.macOptionIsMeta && ev.altKey && !ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.altKey && ev.ctrlKey && !ev.metaKey) ||\n (browser.isWindows && ev.getModifierState('AltGraph'));\n\n if (ev.type === 'keypress') {\n return thirdLevelKey;\n }\n\n // Don't invoke for arrows, pageDown, home, backspace, etc. (on non-keypress events)\n return thirdLevelKey && (!ev.keyCode || ev.keyCode > 47);\n }\n\n protected _keyUp(ev: KeyboardEvent): void {\n this._keyDownSeen = false;\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return;\n }\n\n if (!wasModifierKeyOnlyEvent(ev)) {\n this.focus();\n }\n\n this.updateCursorStyle(ev);\n this._keyPressHandled = false;\n }\n\n /**\n * Handle a keypress event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent\n * @param ev The keypress event to be handled.\n */\n protected _keyPress(ev: KeyboardEvent): boolean {\n let key;\n\n this._keyPressHandled = false;\n\n if (this._keyDownHandled) {\n return false;\n }\n\n if (this._customKeyEventHandler && this._customKeyEventHandler(ev) === false) {\n return false;\n }\n\n this.cancel(ev);\n\n if (ev.charCode) {\n key = ev.charCode;\n } else if (ev.which === null || ev.which === undefined) {\n key = ev.keyCode;\n } else if (ev.which !== 0 && ev.charCode !== 0) {\n key = ev.which;\n } else {\n return false;\n }\n\n if (!key || (\n (ev.altKey || ev.ctrlKey || ev.metaKey) && !this._isThirdLevelShift(this.browser, ev)\n )) {\n return false;\n }\n\n key = String.fromCharCode(key);\n\n this._onKey.fire({ key, domEvent: ev });\n this._showCursor();\n this.coreService.triggerDataEvent(key, true);\n\n this._keyPressHandled = true;\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n return true;\n }\n\n /**\n * Handle an input event.\n * Key Resources:\n * - https://developer.mozilla.org/en-US/docs/Web/API/InputEvent\n * @param ev The input event to be handled.\n */\n protected _inputEvent(ev: InputEvent): boolean {\n // Only support emoji IMEs when screen reader mode is disabled as the event must bubble up to\n // support reading out character input which can doubling up input characters\n // Based on these event traces: https://github.com/xtermjs/xterm.js/issues/3679\n if (ev.data && ev.inputType === 'insertText' && (!ev.composed || !this._keyDownSeen) && !this.optionsService.rawOptions.screenReaderMode) {\n if (this._keyPressHandled) {\n return false;\n }\n\n // The key was handled so clear the dead key state, otherwise certain keystrokes like arrow\n // keys could be ignored\n this._unprocessedDeadKey = false;\n\n const text = ev.data;\n this.coreService.triggerDataEvent(text, true);\n\n this.cancel(ev);\n return true;\n }\n\n return false;\n }\n\n /**\n * Resizes the terminal.\n *\n * @param x The number of columns to resize to.\n * @param y The number of rows to resize to.\n */\n public resize(x: number, y: number): void {\n if (x === this.cols && y === this.rows) {\n // Check if we still need to measure the char size (fixes #785).\n if (this._charSizeService && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n return;\n }\n\n super.resize(x, y);\n }\n\n private _afterResize(x: number, y: number): void {\n this._charSizeService?.measure();\n\n // Sync the scroll area to make sure scroll events don't fire and scroll the viewport to an\n // invalid location\n this.viewport?.syncScrollArea(true);\n }\n\n /**\n * Clear the entire buffer, making the prompt line the new first line.\n */\n public clear(): void {\n if (this.buffer.ybase === 0 && this.buffer.y === 0) {\n // Don't clear if it's already clear\n return;\n }\n this.buffer.clearAllMarkers();\n this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)!);\n this.buffer.lines.length = 1;\n this.buffer.ydisp = 0;\n this.buffer.ybase = 0;\n this.buffer.y = 0;\n for (let i = 1; i < this.rows; i++) {\n this.buffer.lines.push(this.buffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this.refresh(0, this.rows - 1);\n this._onScroll.fire({ position: this.buffer.ydisp, source: ScrollSource.TERMINAL });\n }\n\n /**\n * Reset terminal.\n * Note: Calling this directly from JS is synchronous but does not clear\n * input buffers and does not reset the parser, thus the terminal will\n * continue to apply pending input data.\n * If you need in band reset (synchronous with input data) consider\n * using DECSTR (soft reset, CSI ! p) or RIS instead (hard reset, ESC c).\n */\n public reset(): void {\n /**\n * Since _setup handles a full terminal creation, we have to carry forward\n * a few things that should not reset.\n */\n this.options.rows = this.rows;\n this.options.cols = this.cols;\n const customKeyEventHandler = this._customKeyEventHandler;\n\n this._setup();\n super.reset();\n this._selectionService?.reset();\n this._decorationService.reset();\n\n // reattach\n this._customKeyEventHandler = customKeyEventHandler;\n\n // do a full screen refresh\n this.refresh(0, this.rows - 1);\n this.viewport?.syncScrollArea();\n }\n\n public clearTextureAtlas(): void {\n this._renderService?.clearTextureAtlas();\n }\n\n private _reportFocus(): void {\n if (this.element?.classList.contains('focus')) {\n this.coreService.triggerDataEvent(C0.ESC + '[I');\n } else {\n this.coreService.triggerDataEvent(C0.ESC + '[O');\n }\n }\n\n private _reportWindowsOptions(type: WindowsOptionsReportType): void {\n if (!this._renderService) {\n return;\n }\n\n switch (type) {\n case WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:\n const canvasWidth = this._renderService.dimensions.css.canvas.width.toFixed(0);\n const canvasHeight = this._renderService.dimensions.css.canvas.height.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[4;${canvasHeight};${canvasWidth}t`);\n break;\n case WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:\n const cellWidth = this._renderService.dimensions.css.cell.width.toFixed(0);\n const cellHeight = this._renderService.dimensions.css.cell.height.toFixed(0);\n this.coreService.triggerDataEvent(`${C0.ESC}[6;${cellHeight};${cellWidth}t`);\n break;\n }\n }\n\n // TODO: Remove cancel function and cancelEvents option\n public cancel(ev: Event, force?: boolean): boolean | undefined {\n if (!this.options.cancelEvents && !force) {\n return;\n }\n ev.preventDefault();\n ev.stopPropagation();\n return false;\n }\n}\n\n/**\n * Helpers\n */\n\nfunction wasModifierKeyOnlyEvent(ev: KeyboardEvent): boolean {\n return ev.keyCode === 16 || // Shift\n ev.keyCode === 17 || // Ctrl\n ev.keyCode === 18; // Alt\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nconst RENDER_DEBOUNCE_THRESHOLD_MS = 1000; // 1 Second\n\nimport { IRenderDebouncer } from 'browser/Types';\n\n/**\n * Debounces calls to update screen readers to update at most once configurable interval of time.\n */\nexport class TimeBasedDebouncer implements IRenderDebouncer {\n private _rowStart: number | undefined;\n private _rowEnd: number | undefined;\n private _rowCount: number | undefined;\n\n // The last moment that the Terminal was refreshed at\n private _lastRefreshMs = 0;\n // Whether a trailing refresh should be triggered due to a refresh request that was throttled\n private _additionalRefreshRequested = false;\n\n private _refreshTimeoutID: number | undefined;\n\n constructor(\n private _renderCallback: (start: number, end: number) => void,\n private readonly _debounceThresholdMS = RENDER_DEBOUNCE_THRESHOLD_MS\n ) {\n }\n\n public dispose(): void {\n if (this._refreshTimeoutID) {\n clearTimeout(this._refreshTimeoutID);\n }\n }\n\n public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {\n this._rowCount = rowCount;\n // Get the min/max row start/end for the arg values\n rowStart = rowStart !== undefined ? rowStart : 0;\n rowEnd = rowEnd !== undefined ? rowEnd : this._rowCount - 1;\n // Set the properties to the updated values\n this._rowStart = this._rowStart !== undefined ? Math.min(this._rowStart, rowStart) : rowStart;\n this._rowEnd = this._rowEnd !== undefined ? Math.max(this._rowEnd, rowEnd) : rowEnd;\n\n // Only refresh if the time since last refresh is above a threshold, otherwise wait for\n // enough time to pass before refreshing again.\n const refreshRequestTime: number = Date.now();\n if (refreshRequestTime - this._lastRefreshMs >= this._debounceThresholdMS) {\n // Enough time has lapsed since the last refresh; refresh immediately\n this._lastRefreshMs = refreshRequestTime;\n this._innerRefresh();\n } else if (!this._additionalRefreshRequested) {\n // This is the first additional request throttled; set up trailing refresh\n const elapsed = refreshRequestTime - this._lastRefreshMs;\n const waitPeriodBeforeTrailingRefresh = this._debounceThresholdMS - elapsed;\n this._additionalRefreshRequested = true;\n\n this._refreshTimeoutID = window.setTimeout(() => {\n this._lastRefreshMs = Date.now();\n this._innerRefresh();\n this._additionalRefreshRequested = false;\n this._refreshTimeoutID = undefined; // No longer need to clear the timeout\n }, waitPeriodBeforeTrailingRefresh);\n }\n }\n\n private _innerRefresh(): void {\n // Make sure values are set\n if (this._rowStart === undefined || this._rowEnd === undefined || this._rowCount === undefined) {\n return;\n }\n\n // Clamp values\n const start = Math.max(this._rowStart, 0);\n const end = Math.min(this._rowEnd, this._rowCount - 1);\n\n // Reset debouncer (this happens before render callback as the render could trigger it again)\n this._rowStart = undefined;\n this._rowEnd = undefined;\n\n // Run render callback\n this._renderCallback(start, end);\n }\n}\n\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IViewport, ReadonlyColorSet } from 'browser/Types';\nimport { ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IRenderDimensions } from 'browser/renderer/shared/Types';\n\nconst FALLBACK_SCROLL_BAR_WIDTH = 15;\n\ninterface ISmoothScrollState {\n startTime: number;\n origin: number;\n target: number;\n}\n\n/**\n * Represents the viewport of a terminal, the visible area within the larger buffer of output.\n * Logic for the virtual scroll bar is included in this object.\n */\nexport class Viewport extends Disposable implements IViewport {\n public scrollBarWidth: number = 0;\n private _currentRowHeight: number = 0;\n private _currentDeviceCellHeight: number = 0;\n private _lastRecordedBufferLength: number = 0;\n private _lastRecordedViewportHeight: number = 0;\n private _lastRecordedBufferHeight: number = 0;\n private _lastTouchY: number = 0;\n private _lastScrollTop: number = 0;\n private _activeBuffer: IBuffer;\n private _renderDimensions: IRenderDimensions;\n\n // Stores a partial line amount when scrolling, this is used to keep track of how much of a line\n // is scrolled so we can \"scroll\" over partial lines and feel natural on touchpads. This is a\n // quick fix and could have a more robust solution in place that reset the value when needed.\n private _wheelPartialScroll: number = 0;\n\n private _refreshAnimationFrame: number | null = null;\n private _ignoreNextScrollEvent: boolean = false;\n private _smoothScrollState: ISmoothScrollState = {\n startTime: 0,\n origin: -1,\n target: -1\n };\n\n constructor(\n private readonly _scrollLines: (amount: number) => void,\n private readonly _viewportElement: HTMLElement,\n private readonly _scrollArea: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IRenderService private readonly _renderService: IRenderService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,\n @IThemeService themeService: IThemeService\n ) {\n super();\n\n // Measure the width of the scrollbar. If it is 0 we can assume it's an OSX overlay scrollbar.\n // Unfortunately the overlay scrollbar would be hidden underneath the screen element in that case,\n // therefore we account for a standard amount to make it visible\n this.scrollBarWidth = (this._viewportElement.offsetWidth - this._scrollArea.offsetWidth) || FALLBACK_SCROLL_BAR_WIDTH;\n this.register(addDisposableDomListener(this._viewportElement, 'scroll', this._handleScroll.bind(this)));\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n this._renderDimensions = this._renderService.dimensions;\n this.register(this._renderService.onDimensionsChange(e => this._renderDimensions = e));\n\n this._handleThemeChange(themeService.colors);\n this.register(themeService.onChangeColors(e => this._handleThemeChange(e)));\n this.register(this._optionsService.onSpecificOptionChange('scrollback', () => this.syncScrollArea()));\n\n // Perform this async to ensure the ICharSizeService is ready.\n setTimeout(() => this.syncScrollArea(), 0);\n }\n\n private _handleThemeChange(colors: ReadonlyColorSet): void {\n this._viewportElement.style.backgroundColor = colors.background.css;\n }\n\n /**\n * Refreshes row height, setting line-height, viewport height and scroll area height if\n * necessary.\n */\n private _refresh(immediate: boolean): void {\n if (immediate) {\n this._innerRefresh();\n if (this._refreshAnimationFrame !== null) {\n this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame);\n }\n return;\n }\n if (this._refreshAnimationFrame === null) {\n this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._innerRefresh());\n }\n }\n\n private _innerRefresh(): void {\n if (this._charSizeService.height > 0) {\n this._currentRowHeight = this._renderService.dimensions.device.cell.height / this._coreBrowserService.dpr;\n this._currentDeviceCellHeight = this._renderService.dimensions.device.cell.height;\n this._lastRecordedViewportHeight = this._viewportElement.offsetHeight;\n const newBufferHeight = Math.round(this._currentRowHeight * this._lastRecordedBufferLength) + (this._lastRecordedViewportHeight - this._renderService.dimensions.css.canvas.height);\n if (this._lastRecordedBufferHeight !== newBufferHeight) {\n this._lastRecordedBufferHeight = newBufferHeight;\n this._scrollArea.style.height = this._lastRecordedBufferHeight + 'px';\n }\n }\n\n // Sync scrollTop\n const scrollTop = this._bufferService.buffer.ydisp * this._currentRowHeight;\n if (this._viewportElement.scrollTop !== scrollTop) {\n // Ignore the next scroll event which will be triggered by setting the scrollTop as we do not\n // want this event to scroll the terminal\n this._ignoreNextScrollEvent = true;\n this._viewportElement.scrollTop = scrollTop;\n }\n\n this._refreshAnimationFrame = null;\n }\n\n /**\n * Updates dimensions and synchronizes the scroll area if necessary.\n */\n public syncScrollArea(immediate: boolean = false): void {\n // If buffer height changed\n if (this._lastRecordedBufferLength !== this._bufferService.buffer.lines.length) {\n this._lastRecordedBufferLength = this._bufferService.buffer.lines.length;\n this._refresh(immediate);\n return;\n }\n\n // If viewport height changed\n if (this._lastRecordedViewportHeight !== this._renderService.dimensions.css.canvas.height) {\n this._refresh(immediate);\n return;\n }\n\n // If the buffer position doesn't match last scroll top\n if (this._lastScrollTop !== this._activeBuffer.ydisp * this._currentRowHeight) {\n this._refresh(immediate);\n return;\n }\n\n // If row height changed\n if (this._renderDimensions.device.cell.height !== this._currentDeviceCellHeight) {\n this._refresh(immediate);\n return;\n }\n }\n\n /**\n * Handles scroll events on the viewport, calculating the new viewport and requesting the\n * terminal to scroll to it.\n * @param ev The scroll event.\n */\n private _handleScroll(ev: Event): void {\n // Record current scroll top position\n this._lastScrollTop = this._viewportElement.scrollTop;\n\n // Don't attempt to scroll if the element is not visible, otherwise scrollTop will be corrupt\n // which causes the terminal to scroll the buffer to the top\n if (!this._viewportElement.offsetParent) {\n return;\n }\n\n // Ignore the event if it was flagged to ignore (when the source of the event is from Viewport)\n if (this._ignoreNextScrollEvent) {\n this._ignoreNextScrollEvent = false;\n // Still trigger the scroll so lines get refreshed\n this._scrollLines(0);\n return;\n }\n\n const newRow = Math.round(this._lastScrollTop / this._currentRowHeight);\n const diff = newRow - this._bufferService.buffer.ydisp;\n this._scrollLines(diff);\n }\n\n private _smoothScroll(): void {\n // Check valid state\n if (this._isDisposed || this._smoothScrollState.origin === -1 || this._smoothScrollState.target === -1) {\n return;\n }\n\n // Calculate position complete\n const percent = this._smoothScrollPercent();\n this._viewportElement.scrollTop = this._smoothScrollState.origin + Math.round(percent * (this._smoothScrollState.target - this._smoothScrollState.origin));\n\n // Continue or finish smooth scroll\n if (percent < 1) {\n this._coreBrowserService.window.requestAnimationFrame(() => this._smoothScroll());\n } else {\n this._clearSmoothScrollState();\n }\n }\n\n private _smoothScrollPercent(): number {\n if (!this._optionsService.rawOptions.smoothScrollDuration || !this._smoothScrollState.startTime) {\n return 1;\n }\n return Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0);\n }\n\n private _clearSmoothScrollState(): void {\n this._smoothScrollState.startTime = 0;\n this._smoothScrollState.origin = -1;\n this._smoothScrollState.target = -1;\n }\n\n /**\n * Handles bubbling of scroll event in case the viewport has reached top or bottom\n * @param ev The scroll event.\n * @param amount The amount scrolled\n */\n private _bubbleScroll(ev: Event, amount: number): boolean {\n const scrollPosFromTop = this._viewportElement.scrollTop + this._lastRecordedViewportHeight;\n if ((amount < 0 && this._viewportElement.scrollTop !== 0) ||\n (amount > 0 && scrollPosFromTop < this._lastRecordedBufferHeight)) {\n if (ev.cancelable) {\n ev.preventDefault();\n }\n return false;\n }\n return true;\n }\n\n /**\n * Handles mouse wheel events by adjusting the viewport's scrollTop and delegating the actual\n * scrolling to `onScroll`, this event needs to be attached manually by the consumer of\n * `Viewport`.\n * @param ev The mouse wheel event.\n */\n public handleWheel(ev: WheelEvent): boolean {\n const amount = this._getPixelsScrolled(ev);\n if (amount === 0) {\n return false;\n }\n if (!this._optionsService.rawOptions.smoothScrollDuration) {\n this._viewportElement.scrollTop += amount;\n } else {\n this._smoothScrollState.startTime = Date.now();\n if (this._smoothScrollPercent() < 1) {\n this._smoothScrollState.origin = this._viewportElement.scrollTop;\n if (this._smoothScrollState.target === -1) {\n this._smoothScrollState.target = this._viewportElement.scrollTop + amount;\n } else {\n this._smoothScrollState.target += amount;\n }\n this._smoothScrollState.target = Math.max(Math.min(this._smoothScrollState.target, this._viewportElement.scrollHeight), 0);\n this._smoothScroll();\n } else {\n this._clearSmoothScrollState();\n }\n }\n return this._bubbleScroll(ev, amount);\n }\n\n private _getPixelsScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_PIXEL\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n amount *= this._currentRowHeight;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._currentRowHeight * this._bufferService.rows;\n }\n return amount;\n }\n\n /**\n * Gets the number of pixels scrolled by the mouse event taking into account what type of delta\n * is being used.\n * @param ev The mouse wheel event.\n */\n public getLinesScrolled(ev: WheelEvent): number {\n // Do nothing if it's not a vertical scroll event\n if (ev.deltaY === 0 || ev.shiftKey) {\n return 0;\n }\n\n // Fallback to WheelEvent.DOM_DELTA_LINE\n let amount = this._applyScrollModifier(ev.deltaY, ev);\n if (ev.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n amount /= this._currentRowHeight + 0.0; // Prevent integer division\n this._wheelPartialScroll += amount;\n amount = Math.floor(Math.abs(this._wheelPartialScroll)) * (this._wheelPartialScroll > 0 ? 1 : -1);\n this._wheelPartialScroll %= 1;\n } else if (ev.deltaMode === WheelEvent.DOM_DELTA_PAGE) {\n amount *= this._bufferService.rows;\n }\n return amount;\n }\n\n private _applyScrollModifier(amount: number, ev: WheelEvent): number {\n const modifier = this._optionsService.rawOptions.fastScrollModifier;\n // Multiply the scroll speed when the modifier is down\n if ((modifier === 'alt' && ev.altKey) ||\n (modifier === 'ctrl' && ev.ctrlKey) ||\n (modifier === 'shift' && ev.shiftKey)) {\n return amount * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n return amount * this._optionsService.rawOptions.scrollSensitivity;\n }\n\n /**\n * Handles the touchstart event, recording the touch occurred.\n * @param ev The touch event.\n */\n public handleTouchStart(ev: TouchEvent): void {\n this._lastTouchY = ev.touches[0].pageY;\n }\n\n /**\n * Handles the touchmove event, scrolling the viewport if the position shifted.\n * @param ev The touch event.\n */\n public handleTouchMove(ev: TouchEvent): boolean {\n const deltaY = this._lastTouchY - ev.touches[0].pageY;\n this._lastTouchY = ev.touches[0].pageY;\n if (deltaY === 0) {\n return false;\n }\n this._viewportElement.scrollTop += deltaY;\n return this._bubbleScroll(ev, deltaY);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IRenderService } from 'browser/services/Services';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IInternalDecoration } from 'common/services/Services';\n\nexport class BufferDecorationRenderer extends Disposable {\n private readonly _container: HTMLElement;\n private readonly _decorationElements: Map<IInternalDecoration, HTMLElement> = new Map();\n\n private _animationFrame: number | undefined;\n private _altBufferIsActive: boolean = false;\n private _dimensionsChanged: boolean = false;\n\n constructor(\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n super();\n\n this._container = document.createElement('div');\n this._container.classList.add('xterm-decoration-container');\n this._screenElement.appendChild(this._container);\n\n this.register(this._renderService.onRenderedViewportChange(() => this._doRefreshDecorations()));\n this.register(this._renderService.onDimensionsChange(() => {\n this._dimensionsChanged = true;\n this._queueRefresh();\n }));\n this.register(addDisposableDomListener(window, 'resize', () => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._altBufferIsActive = this._bufferService.buffer === this._bufferService.buffers.alt;\n }));\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh()));\n this.register(this._decorationService.onDecorationRemoved(decoration => this._removeDecoration(decoration)));\n this.register(toDisposable(() => {\n this._container.remove();\n this._decorationElements.clear();\n }));\n }\n\n private _queueRefresh(): void {\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = this._renderService.addRefreshCallback(() => {\n this._doRefreshDecorations();\n this._animationFrame = undefined;\n });\n }\n\n private _doRefreshDecorations(): void {\n for (const decoration of this._decorationService.decorations) {\n this._renderDecoration(decoration);\n }\n this._dimensionsChanged = false;\n }\n\n private _renderDecoration(decoration: IInternalDecoration): void {\n this._refreshStyle(decoration);\n if (this._dimensionsChanged) {\n this._refreshXPosition(decoration);\n }\n }\n\n private _createElement(decoration: IInternalDecoration): HTMLElement {\n const element = document.createElement('div');\n element.classList.add('xterm-decoration');\n element.style.width = `${Math.round((decoration.options.width || 1) * this._renderService.dimensions.css.cell.width)}px`;\n element.style.height = `${(decoration.options.height || 1) * this._renderService.dimensions.css.cell.height}px`;\n element.style.top = `${(decoration.marker.line - this._bufferService.buffers.active.ydisp) * this._renderService.dimensions.css.cell.height}px`;\n element.style.lineHeight = `${this._renderService.dimensions.css.cell.height}px`;\n\n const x = decoration.options.x ?? 0;\n if (x && x > this._bufferService.cols) {\n // exceeded the container width, so hide\n element.style.display = 'none';\n }\n this._refreshXPosition(decoration, element);\n\n return element;\n }\n\n private _refreshStyle(decoration: IInternalDecoration): void {\n const line = decoration.marker.line - this._bufferService.buffers.active.ydisp;\n if (line < 0 || line >= this._bufferService.rows) {\n // outside of viewport\n if (decoration.element) {\n decoration.element.style.display = 'none';\n decoration.onRenderEmitter.fire(decoration.element);\n }\n } else {\n let element = this._decorationElements.get(decoration);\n if (!element) {\n element = this._createElement(decoration);\n decoration.element = element;\n this._decorationElements.set(decoration, element);\n this._container.appendChild(element);\n }\n element.style.top = `${line * this._renderService.dimensions.css.cell.height}px`;\n element.style.display = this._altBufferIsActive ? 'none' : 'block';\n decoration.onRenderEmitter.fire(element);\n }\n }\n\n private _refreshXPosition(decoration: IInternalDecoration, element: HTMLElement | undefined = decoration.element): void {\n if (!element) {\n return;\n }\n const x = decoration.options.x ?? 0;\n if ((decoration.options.anchor || 'left') === 'right') {\n element.style.right = x ? `${x * this._renderService.dimensions.css.cell.width}px` : '';\n } else {\n element.style.left = x ? `${x * this._renderService.dimensions.css.cell.width}px` : '';\n }\n }\n\n private _removeDecoration(decoration: IInternalDecoration): void {\n this._decorationElements.get(decoration)?.remove();\n this._decorationElements.delete(decoration);\n decoration.dispose();\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInternalDecoration } from 'common/services/Services';\n\nexport interface IColorZoneStore {\n readonly zones: IColorZone[];\n clear(): void;\n addDecoration(decoration: IInternalDecoration): void;\n /**\n * Sets the amount of padding in lines that will be added between zones, if new lines intersect\n * the padding they will be merged into the same zone.\n */\n setPadding(padding: { [position: string]: number }): void;\n}\n\nexport interface IColorZone {\n /** Color in a format supported by canvas' fillStyle. */\n color: string;\n position: 'full' | 'left' | 'center' | 'right' | undefined;\n startBufferLine: number;\n endBufferLine: number;\n}\n\ninterface IMinimalDecorationForColorZone {\n marker: Pick<IInternalDecoration['marker'], 'line'>;\n options: Pick<IInternalDecoration['options'], 'overviewRulerOptions'>;\n}\n\nexport class ColorZoneStore implements IColorZoneStore {\n private _zones: IColorZone[] = [];\n\n // The zone pool is used to keep zone objects from being freed between clearing the color zone\n // store and fetching the zones. This helps reduce GC pressure since the color zones are\n // accumulated on potentially every scroll event.\n private _zonePool: IColorZone[] = [];\n private _zonePoolIndex = 0;\n\n private _linePadding: { [position: string]: number } = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n };\n\n public get zones(): IColorZone[] {\n // Trim the zone pool to free unused memory\n this._zonePool.length = Math.min(this._zonePool.length, this._zones.length);\n return this._zones;\n }\n\n public clear(): void {\n this._zones.length = 0;\n this._zonePoolIndex = 0;\n }\n\n public addDecoration(decoration: IMinimalDecorationForColorZone): void {\n if (!decoration.options.overviewRulerOptions) {\n return;\n }\n for (const z of this._zones) {\n if (z.color === decoration.options.overviewRulerOptions.color &&\n z.position === decoration.options.overviewRulerOptions.position) {\n if (this._lineIntersectsZone(z, decoration.marker.line)) {\n return;\n }\n if (this._lineAdjacentToZone(z, decoration.marker.line, decoration.options.overviewRulerOptions.position)) {\n this._addLineToZone(z, decoration.marker.line);\n return;\n }\n }\n }\n // Create using zone pool if possible\n if (this._zonePoolIndex < this._zonePool.length) {\n this._zonePool[this._zonePoolIndex].color = decoration.options.overviewRulerOptions.color;\n this._zonePool[this._zonePoolIndex].position = decoration.options.overviewRulerOptions.position;\n this._zonePool[this._zonePoolIndex].startBufferLine = decoration.marker.line;\n this._zonePool[this._zonePoolIndex].endBufferLine = decoration.marker.line;\n this._zones.push(this._zonePool[this._zonePoolIndex++]);\n return;\n }\n // Create\n this._zones.push({\n color: decoration.options.overviewRulerOptions.color,\n position: decoration.options.overviewRulerOptions.position,\n startBufferLine: decoration.marker.line,\n endBufferLine: decoration.marker.line\n });\n this._zonePool.push(this._zones[this._zones.length - 1]);\n this._zonePoolIndex++;\n }\n\n public setPadding(padding: { [position: string]: number }): void {\n this._linePadding = padding;\n }\n\n private _lineIntersectsZone(zone: IColorZone, line: number): boolean {\n return (\n line >= zone.startBufferLine &&\n line <= zone.endBufferLine\n );\n }\n\n private _lineAdjacentToZone(zone: IColorZone, line: number, position: IColorZone['position']): boolean {\n return (\n (line >= zone.startBufferLine - this._linePadding[position || 'full']) &&\n (line <= zone.endBufferLine + this._linePadding[position || 'full'])\n );\n }\n\n private _addLineToZone(zone: IColorZone, line: number): void {\n zone.startBufferLine = Math.min(zone.startBufferLine, line);\n zone.endBufferLine = Math.max(zone.endBufferLine, line);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { ColorZoneStore, IColorZone, IColorZoneStore } from 'browser/decorations/ColorZoneStore';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { ICoreBrowserService, IRenderService } from 'browser/services/Services';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IBufferService, IDecorationService, IOptionsService } from 'common/services/Services';\n\n// Helper objects to avoid excessive calculation and garbage collection during rendering. These are\n// static values for each render and can be accessed using the decoration position as the key.\nconst drawHeight = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawWidth = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\nconst drawX = {\n full: 0,\n left: 0,\n center: 0,\n right: 0\n};\n\nexport class OverviewRulerRenderer extends Disposable {\n private readonly _canvas: HTMLCanvasElement;\n private readonly _ctx: CanvasRenderingContext2D;\n private readonly _colorZoneStore: IColorZoneStore = new ColorZoneStore();\n private get _width(): number {\n return this._optionsService.options.overviewRulerWidth || 0;\n }\n private _animationFrame: number | undefined;\n\n private _shouldUpdateDimensions: boolean | undefined = true;\n private _shouldUpdateAnchor: boolean | undefined = true;\n private _lastKnownBufferLength: number = 0;\n\n private _containerHeight: number | undefined;\n\n constructor(\n private readonly _viewportElement: HTMLElement,\n private readonly _screenElement: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IRenderService private readonly _renderService: IRenderService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreBrowserService private readonly _coreBrowseService: ICoreBrowserService\n ) {\n super();\n this._canvas = document.createElement('canvas');\n this._canvas.classList.add('xterm-decoration-overview-ruler');\n this._refreshCanvasDimensions();\n this._viewportElement.parentElement?.insertBefore(this._canvas, this._viewportElement);\n const ctx = this._canvas.getContext('2d');\n if (!ctx) {\n throw new Error('Ctx cannot be null');\n } else {\n this._ctx = ctx;\n }\n this._registerDecorationListeners();\n this._registerBufferChangeListeners();\n this._registerDimensionChangeListeners();\n this.register(toDisposable(() => {\n this._canvas?.remove();\n }));\n }\n\n /**\n * On decoration add or remove, redraw\n */\n private _registerDecorationListeners(): void {\n this.register(this._decorationService.onDecorationRegistered(() => this._queueRefresh(undefined, true)));\n this.register(this._decorationService.onDecorationRemoved(() => this._queueRefresh(undefined, true)));\n }\n\n /**\n * On buffer change, redraw\n * and hide the canvas if the alt buffer is active\n */\n private _registerBufferChangeListeners(): void {\n this.register(this._renderService.onRenderedViewportChange(() => this._queueRefresh()));\n this.register(this._bufferService.buffers.onBufferActivate(() => {\n this._canvas!.style.display = this._bufferService.buffer === this._bufferService.buffers.alt ? 'none' : 'block';\n }));\n this.register(this._bufferService.onScroll(() => {\n if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {\n this._refreshDrawHeightConstants();\n this._refreshColorZonePadding();\n }\n }));\n }\n /**\n * On dimension change, update canvas dimensions\n * and then redraw\n */\n private _registerDimensionChangeListeners(): void {\n // container height changed\n this.register(this._renderService.onRender((): void => {\n if (!this._containerHeight || this._containerHeight !== this._screenElement.clientHeight) {\n this._queueRefresh(true);\n this._containerHeight = this._screenElement.clientHeight;\n }\n }));\n // overview ruler width changed\n this.register(this._optionsService.onSpecificOptionChange('overviewRulerWidth', () => this._queueRefresh(true)));\n // device pixel ratio changed\n this.register(addDisposableDomListener(this._coreBrowseService.window, 'resize', () => this._queueRefresh(true)));\n // set the canvas dimensions\n this._queueRefresh(true);\n }\n\n private _refreshDrawConstants(): void {\n // width\n const outerWidth = Math.floor(this._canvas.width / 3);\n const innerWidth = Math.ceil(this._canvas.width / 3);\n drawWidth.full = this._canvas.width;\n drawWidth.left = outerWidth;\n drawWidth.center = innerWidth;\n drawWidth.right = outerWidth;\n // height\n this._refreshDrawHeightConstants();\n // x\n drawX.full = 0;\n drawX.left = 0;\n drawX.center = drawWidth.left;\n drawX.right = drawWidth.left + drawWidth.center;\n }\n\n private _refreshDrawHeightConstants(): void {\n drawHeight.full = Math.round(2 * this._coreBrowseService.dpr);\n // Calculate actual pixels per line\n const pixelsPerLine = this._canvas.height / this._bufferService.buffer.lines.length;\n // Clamp actual pixels within a range\n const nonFullHeight = Math.round(Math.max(Math.min(pixelsPerLine, 12), 6) * this._coreBrowseService.dpr);\n drawHeight.left = nonFullHeight;\n drawHeight.center = nonFullHeight;\n drawHeight.right = nonFullHeight;\n }\n\n private _refreshColorZonePadding(): void {\n this._colorZoneStore.setPadding({\n full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),\n left: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.left),\n center: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.center),\n right: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.right)\n });\n this._lastKnownBufferLength = this._bufferService.buffers.normal.lines.length;\n }\n\n private _refreshCanvasDimensions(): void {\n this._canvas.style.width = `${this._width}px`;\n this._canvas.width = Math.round(this._width * this._coreBrowseService.dpr);\n this._canvas.style.height = `${this._screenElement.clientHeight}px`;\n this._canvas.height = Math.round(this._screenElement.clientHeight * this._coreBrowseService.dpr);\n this._refreshDrawConstants();\n this._refreshColorZonePadding();\n }\n\n private _refreshDecorations(): void {\n if (this._shouldUpdateDimensions) {\n this._refreshCanvasDimensions();\n }\n this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height);\n this._colorZoneStore.clear();\n for (const decoration of this._decorationService.decorations) {\n this._colorZoneStore.addDecoration(decoration);\n }\n this._ctx.lineWidth = 1;\n const zones = this._colorZoneStore.zones;\n for (const zone of zones) {\n if (zone.position !== 'full') {\n this._renderColorZone(zone);\n }\n }\n for (const zone of zones) {\n if (zone.position === 'full') {\n this._renderColorZone(zone);\n }\n }\n this._shouldUpdateDimensions = false;\n this._shouldUpdateAnchor = false;\n }\n\n private _renderColorZone(zone: IColorZone): void {\n this._ctx.fillStyle = zone.color;\n this._ctx.fillRect(\n /* x */ drawX[zone.position || 'full'],\n /* y */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n (zone.startBufferLine / this._bufferService.buffers.active.lines.length) - drawHeight[zone.position || 'full'] / 2\n ),\n /* w */ drawWidth[zone.position || 'full'],\n /* h */ Math.round(\n (this._canvas.height - 1) * // -1 to ensure at least 2px are allowed for decoration on last line\n ((zone.endBufferLine - zone.startBufferLine) / this._bufferService.buffers.active.lines.length) + drawHeight[zone.position || 'full']\n )\n );\n }\n\n private _queueRefresh(updateCanvasDimensions?: boolean, updateAnchor?: boolean): void {\n this._shouldUpdateDimensions = updateCanvasDimensions || this._shouldUpdateDimensions;\n this._shouldUpdateAnchor = updateAnchor || this._shouldUpdateAnchor;\n if (this._animationFrame !== undefined) {\n return;\n }\n this._animationFrame = this._coreBrowseService.window.requestAnimationFrame(() => {\n this._refreshDecorations();\n this._animationFrame = undefined;\n });\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderService } from 'browser/services/Services';\nimport { IBufferService, ICoreService, IOptionsService } from 'common/services/Services';\nimport { C0 } from 'common/data/EscapeSequences';\n\ninterface IPosition {\n start: number;\n end: number;\n}\n\n/**\n * Encapsulates the logic for handling compositionstart, compositionupdate and compositionend\n * events, displaying the in-progress composition to the UI and forwarding the final composition\n * to the handler.\n */\nexport class CompositionHelper {\n /**\n * Whether input composition is currently happening, eg. via a mobile keyboard, speech input or\n * IME. This variable determines whether the compositionText should be displayed on the UI.\n */\n private _isComposing: boolean;\n public get isComposing(): boolean { return this._isComposing; }\n\n /**\n * The position within the input textarea's value of the current composition.\n */\n private _compositionPosition: IPosition;\n\n /**\n * Whether a composition is in the process of being sent, setting this to false will cancel any\n * in-progress composition.\n */\n private _isSendingComposition: boolean;\n\n /**\n * Data already sent due to keydown event.\n */\n private _dataAlreadySent: string;\n\n constructor(\n private readonly _textarea: HTMLTextAreaElement,\n private readonly _compositionView: HTMLElement,\n @IBufferService private readonly _bufferService: IBufferService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreService private readonly _coreService: ICoreService,\n @IRenderService private readonly _renderService: IRenderService\n ) {\n this._isComposing = false;\n this._isSendingComposition = false;\n this._compositionPosition = { start: 0, end: 0 };\n this._dataAlreadySent = '';\n }\n\n /**\n * Handles the compositionstart event, activating the composition view.\n */\n public compositionstart(): void {\n this._isComposing = true;\n this._compositionPosition.start = this._textarea.value.length;\n this._compositionView.textContent = '';\n this._dataAlreadySent = '';\n this._compositionView.classList.add('active');\n }\n\n /**\n * Handles the compositionupdate event, updating the composition view.\n * @param ev The event.\n */\n public compositionupdate(ev: Pick<CompositionEvent, 'data'>): void {\n this._compositionView.textContent = ev.data;\n this.updateCompositionElements();\n setTimeout(() => {\n this._compositionPosition.end = this._textarea.value.length;\n }, 0);\n }\n\n /**\n * Handles the compositionend event, hiding the composition view and sending the composition to\n * the handler.\n */\n public compositionend(): void {\n this._finalizeComposition(true);\n }\n\n /**\n * Handles the keydown event, routing any necessary events to the CompositionHelper functions.\n * @param ev The keydown event.\n * @returns Whether the Terminal should continue processing the keydown event.\n */\n public keydown(ev: KeyboardEvent): boolean {\n if (this._isComposing || this._isSendingComposition) {\n if (ev.keyCode === 229) {\n // Continue composing if the keyCode is the \"composition character\"\n return false;\n }\n if (ev.keyCode === 16 || ev.keyCode === 17 || ev.keyCode === 18) {\n // Continue composing if the keyCode is a modifier key\n return false;\n }\n // Finish composition immediately. This is mainly here for the case where enter is\n // pressed and the handler needs to be triggered before the command is executed.\n this._finalizeComposition(false);\n }\n\n if (ev.keyCode === 229) {\n // If the \"composition character\" is used but gets to this point it means a non-composition\n // character (eg. numbers and punctuation) was pressed when the IME was active.\n this._handleAnyTextareaChanges();\n return false;\n }\n\n return true;\n }\n\n /**\n * Finalizes the composition, resuming regular input actions. This is called when a composition\n * is ending.\n * @param waitForPropagation Whether to wait for events to propagate before sending\n * the input. This should be false if a non-composition keystroke is entered before the\n * compositionend event is triggered, such as enter, so that the composition is sent before\n * the command is executed.\n */\n private _finalizeComposition(waitForPropagation: boolean): void {\n this._compositionView.classList.remove('active');\n this._isComposing = false;\n\n if (!waitForPropagation) {\n // Cancel any delayed composition send requests and send the input immediately.\n this._isSendingComposition = false;\n const input = this._textarea.value.substring(this._compositionPosition.start, this._compositionPosition.end);\n this._coreService.triggerDataEvent(input, true);\n } else {\n // Make a deep copy of the composition position here as a new compositionstart event may\n // fire before the setTimeout executes.\n const currentCompositionPosition = {\n start: this._compositionPosition.start,\n end: this._compositionPosition.end\n };\n\n // Since composition* events happen before the changes take place in the textarea on most\n // browsers, use a setTimeout with 0ms time to allow the native compositionend event to\n // complete. This ensures the correct character is retrieved.\n // This solution was used because:\n // - The compositionend event's data property is unreliable, at least on Chromium\n // - The last compositionupdate event's data property does not always accurately describe\n // the character, a counter example being Korean where an ending consonsant can move to\n // the following character if the following input is a vowel.\n this._isSendingComposition = true;\n setTimeout(() => {\n // Ensure that the input has not already been sent\n if (this._isSendingComposition) {\n this._isSendingComposition = false;\n let input;\n // Add length of data already sent due to keydown event,\n // otherwise input characters can be duplicated. (Issue #3191)\n currentCompositionPosition.start += this._dataAlreadySent.length;\n if (this._isComposing) {\n // Use the end position to get the string if a new composition has started.\n input = this._textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);\n } else {\n // Don't use the end position here in order to pick up any characters after the\n // composition has finished, for example when typing a non-composition character\n // (eg. 2) after a composition character.\n input = this._textarea.value.substring(currentCompositionPosition.start);\n }\n if (input.length > 0) {\n this._coreService.triggerDataEvent(input, true);\n }\n }\n }, 0);\n }\n }\n\n /**\n * Apply any changes made to the textarea after the current event chain is allowed to complete.\n * This should be called when not currently composing but a keydown event with the \"composition\n * character\" (229) is triggered, in order to allow non-composition text to be entered when an\n * IME is active.\n */\n private _handleAnyTextareaChanges(): void {\n const oldValue = this._textarea.value;\n setTimeout(() => {\n // Ignore if a composition has started since the timeout\n if (!this._isComposing) {\n const newValue = this._textarea.value;\n\n const diff = newValue.replace(oldValue, '');\n\n this._dataAlreadySent = diff;\n\n if (newValue.length > oldValue.length) {\n this._coreService.triggerDataEvent(diff, true);\n } else if (newValue.length < oldValue.length) {\n this._coreService.triggerDataEvent(`${C0.DEL}`, true);\n } else if ((newValue.length === oldValue.length) && (newValue !== oldValue)) {\n this._coreService.triggerDataEvent(newValue, true);\n }\n\n }\n }, 0);\n }\n\n /**\n * Positions the composition view on top of the cursor and the textarea just below it (so the\n * IME helper dialog is positioned correctly).\n * @param dontRecurse Whether to use setTimeout to recursively trigger another update, this is\n * necessary as the IME events across browsers are not consistently triggered.\n */\n public updateCompositionElements(dontRecurse?: boolean): void {\n if (!this._isComposing) {\n return;\n }\n\n if (this._bufferService.buffer.isCursorInViewport) {\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n\n const cellHeight = this._renderService.dimensions.css.cell.height;\n const cursorTop = this._bufferService.buffer.y * this._renderService.dimensions.css.cell.height;\n const cursorLeft = cursorX * this._renderService.dimensions.css.cell.width;\n\n this._compositionView.style.left = cursorLeft + 'px';\n this._compositionView.style.top = cursorTop + 'px';\n this._compositionView.style.height = cellHeight + 'px';\n this._compositionView.style.lineHeight = cellHeight + 'px';\n this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + 'px';\n // Sync the textarea to the exact position of the composition view so the IME knows where the\n // text is.\n const compositionViewBounds = this._compositionView.getBoundingClientRect();\n this._textarea.style.left = cursorLeft + 'px';\n this._textarea.style.top = cursorTop + 'px';\n // Ensure the text area is at least 1x1, otherwise certain IMEs may break\n this._textarea.style.width = Math.max(compositionViewBounds.width, 1) + 'px';\n this._textarea.style.height = Math.max(compositionViewBounds.height, 1) + 'px';\n this._textarea.style.lineHeight = compositionViewBounds.height + 'px';\n }\n\n if (!dontRecurse) {\n setTimeout(() => this.updateCompositionElements(true), 0);\n }\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport function getCoordsRelativeToElement(window: Pick<Window, 'getComputedStyle'>, event: {clientX: number, clientY: number}, element: HTMLElement): [number, number] {\n const rect = element.getBoundingClientRect();\n const elementStyle = window.getComputedStyle(element);\n const leftPadding = parseInt(elementStyle.getPropertyValue('padding-left'));\n const topPadding = parseInt(elementStyle.getPropertyValue('padding-top'));\n return [\n event.clientX - rect.left - leftPadding,\n event.clientY - rect.top - topPadding\n ];\n}\n\n/**\n * Gets coordinates within the terminal for a particular mouse event. The result\n * is returned as an array in the form [x, y] instead of an object as it's a\n * little faster and this function is used in some low level code.\n * @param window The window object the element belongs to.\n * @param event The mouse event.\n * @param element The terminal's container element.\n * @param colCount The number of columns in the terminal.\n * @param rowCount The number of rows n the terminal.\n * @param hasValidCharSize Whether there is a valid character size available.\n * @param cssCellWidth The cell width device pixel render dimensions.\n * @param cssCellHeight The cell height device pixel render dimensions.\n * @param isSelection Whether the request is for the selection or not. This will\n * apply an offset to the x value such that the left half of the cell will\n * select that cell and the right half will select the next cell.\n */\nexport function getCoords(window: Pick<Window, 'getComputedStyle'>, event: Pick<MouseEvent, 'clientX' | 'clientY'>, element: HTMLElement, colCount: number, rowCount: number, hasValidCharSize: boolean, cssCellWidth: number, cssCellHeight: number, isSelection?: boolean): [number, number] | undefined {\n // Coordinates cannot be measured if there are no valid\n if (!hasValidCharSize) {\n return undefined;\n }\n\n const coords = getCoordsRelativeToElement(window, event, element);\n if (!coords) {\n return undefined;\n }\n\n coords[0] = Math.ceil((coords[0] + (isSelection ? cssCellWidth / 2 : 0)) / cssCellWidth);\n coords[1] = Math.ceil(coords[1] / cssCellHeight);\n\n // Ensure coordinates are within the terminal viewport. Note that selections\n // need an addition point of precision to cover the end point (as characters\n // cover half of one char and half of the next).\n coords[0] = Math.min(Math.max(coords[0], 1), colCount + (isSelection ? 1 : 0));\n coords[1] = Math.min(Math.max(coords[1], 1), rowCount);\n\n return coords;\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { C0 } from 'common/data/EscapeSequences';\nimport { IBufferService } from 'common/services/Services';\n\nconst enum Direction {\n UP = 'A',\n DOWN = 'B',\n RIGHT = 'C',\n LEFT = 'D'\n}\n\n/**\n * Concatenates all the arrow sequences together.\n * Resets the starting row to an unwrapped row, moves to the requested row,\n * then moves to requested col.\n */\nexport function moveToCellSequence(targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startX = bufferService.buffer.x;\n const startY = bufferService.buffer.y;\n\n // The alt buffer should try to navigate between rows\n if (!bufferService.buffer.hasScrollback) {\n return resetStartingRow(startX, startY, targetX, targetY, bufferService, applicationCursor) +\n moveToRequestedRow(startY, targetY, bufferService, applicationCursor) +\n moveToRequestedCol(startX, startY, targetX, targetY, bufferService, applicationCursor);\n }\n\n // Only move horizontally for the normal buffer\n let direction;\n if (startY === targetY) {\n direction = startX > targetX ? Direction.LEFT : Direction.RIGHT;\n return repeat(Math.abs(startX - targetX), sequence(direction, applicationCursor));\n }\n direction = startY > targetY ? Direction.LEFT : Direction.RIGHT;\n const rowDifference = Math.abs(startY - targetY);\n const cellsToMove = colsFromRowEnd(startY > targetY ? targetX : startX, bufferService) +\n (rowDifference - 1) * bufferService.cols + 1 /* wrap around 1 row */ +\n colsFromRowBeginning(startY > targetY ? startX : targetX, bufferService);\n return repeat(cellsToMove, sequence(direction, applicationCursor));\n}\n\n/**\n * Find the number of cols from a row beginning to a col.\n */\nfunction colsFromRowBeginning(currX: number, bufferService: IBufferService): number {\n return currX - 1;\n}\n\n/**\n * Find the number of cols from a col to row end.\n */\nfunction colsFromRowEnd(currX: number, bufferService: IBufferService): number {\n return bufferService.cols - currX;\n}\n\n/**\n * If the initial position of the cursor is on a row that is wrapped, move the\n * cursor up to the first row that is not wrapped to have accurate vertical\n * positioning.\n */\nfunction resetStartingRow(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length === 0) {\n return '';\n }\n return repeat(bufferLine(\n startX, startY, startX,\n startY - wrappedRowsForRow(startY, bufferService), false, bufferService\n ).length, sequence(Direction.LEFT, applicationCursor));\n}\n\n/**\n * Using the reset starting and ending row, move to the requested row,\n * ignoring wrapped rows\n */\nfunction moveToRequestedRow(startY: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n const startRow = startY - wrappedRowsForRow(startY, bufferService);\n const endRow = targetY - wrappedRowsForRow(targetY, bufferService);\n\n const rowsToMove = Math.abs(startRow - endRow) - wrappedRowsCount(startY, targetY, bufferService);\n\n return repeat(rowsToMove, sequence(verticalDirection(startY, targetY), applicationCursor));\n}\n\n/**\n * Move to the requested col on the ending row\n */\nfunction moveToRequestedCol(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): string {\n let startRow;\n if (moveToRequestedRow(startY, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(targetY, bufferService);\n } else {\n startRow = startY;\n }\n\n const endRow = targetY;\n const direction = horizontalDirection(startX, startY, targetX, targetY, bufferService, applicationCursor);\n\n return repeat(bufferLine(\n startX, startRow, targetX, endRow,\n direction === Direction.RIGHT, bufferService\n ).length, sequence(direction, applicationCursor));\n}\n\n/**\n * Utility functions\n */\n\n/**\n * Calculates the number of wrapped rows between the unwrapped starting and\n * ending rows. These rows need to ignored since the cursor skips over them.\n */\nfunction wrappedRowsCount(startY: number, targetY: number, bufferService: IBufferService): number {\n let wrappedRows = 0;\n const startRow = startY - wrappedRowsForRow(startY, bufferService);\n const endRow = targetY - wrappedRowsForRow(targetY, bufferService);\n\n for (let i = 0; i < Math.abs(startRow - endRow); i++) {\n const direction = verticalDirection(startY, targetY) === Direction.UP ? -1 : 1;\n const line = bufferService.buffer.lines.get(startRow + (direction * i));\n if (line?.isWrapped) {\n wrappedRows++;\n }\n }\n\n return wrappedRows;\n}\n\n/**\n * Calculates the number of wrapped rows that make up a given row.\n * @param currentRow The row to determine how many wrapped rows make it up\n */\nfunction wrappedRowsForRow(currentRow: number, bufferService: IBufferService): number {\n let rowCount = 0;\n let line = bufferService.buffer.lines.get(currentRow);\n let lineWraps = line?.isWrapped;\n\n while (lineWraps && currentRow >= 0 && currentRow < bufferService.rows) {\n rowCount++;\n line = bufferService.buffer.lines.get(--currentRow);\n lineWraps = line?.isWrapped;\n }\n\n return rowCount;\n}\n\n/**\n * Direction determiners\n */\n\n/**\n * Determines if the right or left arrow is needed\n */\nfunction horizontalDirection(startX: number, startY: number, targetX: number, targetY: number, bufferService: IBufferService, applicationCursor: boolean): Direction {\n let startRow;\n if (moveToRequestedRow(targetX, targetY, bufferService, applicationCursor).length > 0) {\n startRow = targetY - wrappedRowsForRow(targetY, bufferService);\n } else {\n startRow = startY;\n }\n\n if ((startX < targetX &&\n startRow <= targetY) || // down/right or same y/right\n (startX >= targetX &&\n startRow < targetY)) { // down/left or same y/left\n return Direction.RIGHT;\n }\n return Direction.LEFT;\n}\n\n/**\n * Determines if the up or down arrow is needed\n */\nfunction verticalDirection(startY: number, targetY: number): Direction {\n return startY > targetY ? Direction.UP : Direction.DOWN;\n}\n\n/**\n * Constructs the string of chars in the buffer from a starting row and col\n * to an ending row and col\n * @param startCol The starting column position\n * @param startRow The starting row position\n * @param endCol The ending column position\n * @param endRow The ending row position\n * @param forward Direction to move\n */\nfunction bufferLine(\n startCol: number,\n startRow: number,\n endCol: number,\n endRow: number,\n forward: boolean,\n bufferService: IBufferService\n): string {\n let currentCol = startCol;\n let currentRow = startRow;\n let bufferStr = '';\n\n while (currentCol !== endCol || currentRow !== endRow) {\n currentCol += forward ? 1 : -1;\n\n if (forward && currentCol > bufferService.cols - 1) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n currentCol = 0;\n startCol = 0;\n currentRow++;\n } else if (!forward && currentCol < 0) {\n bufferStr += bufferService.buffer.translateBufferLineToString(\n currentRow, false, 0, startCol + 1\n );\n currentCol = bufferService.cols - 1;\n startCol = currentCol;\n currentRow--;\n }\n }\n\n return bufferStr + bufferService.buffer.translateBufferLineToString(\n currentRow, false, startCol, currentCol\n );\n}\n\n/**\n * Constructs the escape sequence for clicking an arrow\n * @param direction The direction to move\n */\nfunction sequence(direction: Direction, applicationCursor: boolean): string {\n const mod = applicationCursor ? 'O' : '[';\n return C0.ESC + mod + direction;\n}\n\n/**\n * Returns a string repeated a given number of times\n * Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat\n * @param count The number of times to repeat the string\n * @param str The string that is to be repeated\n */\nfunction repeat(count: number, str: string): string {\n count = Math.floor(count);\n let rpt = '';\n for (let i = 0; i < count; i++) {\n rpt += str;\n }\n return rpt;\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { removeElementFromParent } from 'browser/Dom';\nimport { BOLD_CLASS, CURSOR_BLINK_CLASS, CURSOR_CLASS, CURSOR_STYLE_BAR_CLASS, CURSOR_STYLE_BLOCK_CLASS, CURSOR_STYLE_UNDERLINE_CLASS, DomRendererRowFactory, ITALIC_CLASS } from 'browser/renderer/dom/DomRendererRowFactory';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants';\nimport { createRenderDimensions } from 'browser/renderer/shared/RendererUtils';\nimport { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/shared/Types';\nimport { ICharSizeService, ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { ILinkifier2, ILinkifierEvent, ReadonlyColorSet } from 'browser/Types';\nimport { color } from 'common/Color';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IBufferService, IInstantiationService, IOptionsService } from 'common/services/Services';\n\nconst TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-';\nconst ROW_CONTAINER_CLASS = 'xterm-rows';\nconst FG_CLASS_PREFIX = 'xterm-fg-';\nconst BG_CLASS_PREFIX = 'xterm-bg-';\nconst FOCUS_CLASS = 'xterm-focus';\nconst SELECTION_CLASS = 'xterm-selection';\n\nlet nextTerminalId = 1;\n\n/**\n * A fallback renderer for when canvas is slow. This is not meant to be\n * particularly fast or feature complete, more just stable and usable for when\n * canvas is not an option.\n */\nexport class DomRenderer extends Disposable implements IRenderer {\n private _rowFactory: DomRendererRowFactory;\n private _terminalClass: number = nextTerminalId++;\n\n private _themeStyleElement!: HTMLStyleElement;\n private _dimensionsStyleElement!: HTMLStyleElement;\n private _rowContainer: HTMLElement;\n private _rowElements: HTMLElement[] = [];\n private _selectionContainer: HTMLElement;\n private _cellToRowElements: Int16Array[] = [];\n\n public dimensions: IRenderDimensions;\n\n public readonly onRequestRedraw = this.register(new EventEmitter<IRequestRedrawEvent>()).event;\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _viewportElement: HTMLElement,\n private readonly _linkifier2: ILinkifier2,\n @IInstantiationService instantiationService: IInstantiationService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,\n @IThemeService themeService: IThemeService\n ) {\n super();\n this._rowContainer = document.createElement('div');\n this._rowContainer.classList.add(ROW_CONTAINER_CLASS);\n this._rowContainer.style.lineHeight = 'normal';\n this._rowContainer.setAttribute('aria-hidden', 'true');\n this._refreshRowElements(this._bufferService.cols, this._bufferService.rows);\n this._selectionContainer = document.createElement('div');\n this._selectionContainer.classList.add(SELECTION_CLASS);\n this._selectionContainer.setAttribute('aria-hidden', 'true');\n\n this.dimensions = createRenderDimensions();\n this._updateDimensions();\n this.register(this._optionsService.onOptionChange(() => this._handleOptionsChanged()));\n\n this.register(themeService.onChangeColors(e => this._injectCss(e)));\n this._injectCss(themeService.colors);\n\n this._rowFactory = instantiationService.createInstance(DomRendererRowFactory, document);\n\n this._element.classList.add(TERMINAL_CLASS_PREFIX + this._terminalClass);\n this._screenElement.appendChild(this._rowContainer);\n this._screenElement.appendChild(this._selectionContainer);\n\n this.register(this._linkifier2.onShowLinkUnderline(e => this._handleLinkHover(e)));\n this.register(this._linkifier2.onHideLinkUnderline(e => this._handleLinkLeave(e)));\n\n this.register(toDisposable(() => {\n this._element.classList.remove(TERMINAL_CLASS_PREFIX + this._terminalClass);\n\n // Outside influences such as React unmounts may manipulate the DOM before our disposal.\n // https://github.com/xtermjs/xterm.js/issues/2960\n removeElementFromParent(this._rowContainer, this._selectionContainer, this._themeStyleElement, this._dimensionsStyleElement);\n }));\n }\n\n private _updateDimensions(): void {\n const dpr = this._coreBrowserService.dpr;\n this.dimensions.device.char.width = this._charSizeService.width * dpr;\n this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * dpr);\n this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing);\n this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight);\n this.dimensions.device.char.left = 0;\n this.dimensions.device.char.top = 0;\n this.dimensions.device.canvas.width = this.dimensions.device.cell.width * this._bufferService.cols;\n this.dimensions.device.canvas.height = this.dimensions.device.cell.height * this._bufferService.rows;\n this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / dpr);\n this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / dpr);\n this.dimensions.css.cell.width = this.dimensions.css.canvas.width / this._bufferService.cols;\n this.dimensions.css.cell.height = this.dimensions.css.canvas.height / this._bufferService.rows;\n\n for (const element of this._rowElements) {\n element.style.width = `${this.dimensions.css.canvas.width}px`;\n element.style.height = `${this.dimensions.css.cell.height}px`;\n element.style.lineHeight = `${this.dimensions.css.cell.height}px`;\n // Make sure rows don't overflow onto following row\n element.style.overflow = 'hidden';\n }\n\n if (!this._dimensionsStyleElement) {\n this._dimensionsStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._dimensionsStyleElement);\n }\n\n const styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} span {` +\n ` display: inline-block;` +\n ` height: 100%;` +\n ` vertical-align: top;` +\n ` width: ${this.dimensions.css.cell.width}px` +\n `}`;\n\n this._dimensionsStyleElement.textContent = styles;\n\n this._selectionContainer.style.height = this._viewportElement.style.height;\n this._screenElement.style.width = `${this.dimensions.css.canvas.width}px`;\n this._screenElement.style.height = `${this.dimensions.css.canvas.height}px`;\n }\n\n private _injectCss(colors: ReadonlyColorSet): void {\n if (!this._themeStyleElement) {\n this._themeStyleElement = document.createElement('style');\n this._screenElement.appendChild(this._themeStyleElement);\n }\n\n // Base CSS\n let styles =\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} {` +\n ` color: ${colors.foreground.css};` +\n ` font-family: ${this._optionsService.rawOptions.fontFamily};` +\n ` font-size: ${this._optionsService.rawOptions.fontSize}px;` +\n `}`;\n // Text styles\n styles +=\n `${this._terminalSelector} span:not(.${BOLD_CLASS}) {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeight};` +\n `}` +\n `${this._terminalSelector} span.${BOLD_CLASS} {` +\n ` font-weight: ${this._optionsService.rawOptions.fontWeightBold};` +\n `}` +\n `${this._terminalSelector} span.${ITALIC_CLASS} {` +\n ` font-style: italic;` +\n `}`;\n // Blink animation\n styles +=\n `@keyframes blink_box_shadow` + `_` + this._terminalClass + ` {` +\n ` 50% {` +\n ` box-shadow: none;` +\n ` }` +\n `}`;\n styles +=\n `@keyframes blink_block` + `_` + this._terminalClass + ` {` +\n ` 0% {` +\n ` background-color: ${colors.cursor.css};` +\n ` color: ${colors.cursorAccent.css};` +\n ` }` +\n ` 50% {` +\n ` background-color: ${colors.cursorAccent.css};` +\n ` color: ${colors.cursor.css};` +\n ` }` +\n `}`;\n // Cursor\n styles +=\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}:not(.${FOCUS_CLASS}) .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` outline: 1px solid ${colors.cursor.css};` +\n ` outline-offset: -1px;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}:not(.${CURSOR_STYLE_BLOCK_CLASS}) {` +\n ` animation: blink_box_shadow` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_BLINK_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` animation: blink_block` + `_` + this._terminalClass + ` 1s step-end infinite;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS}.${FOCUS_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BLOCK_CLASS} {` +\n ` background-color: ${colors.cursor.css};` +\n ` color: ${colors.cursorAccent.css};` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_BAR_CLASS} {` +\n ` box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${colors.cursor.css} inset;` +\n `}` +\n `${this._terminalSelector} .${ROW_CONTAINER_CLASS} .${CURSOR_CLASS}.${CURSOR_STYLE_UNDERLINE_CLASS} {` +\n ` box-shadow: 0 -1px 0 ${colors.cursor.css} inset;` +\n `}`;\n // Selection\n styles +=\n `${this._terminalSelector} .${SELECTION_CLASS} {` +\n ` position: absolute;` +\n ` top: 0;` +\n ` left: 0;` +\n ` z-index: 1;` +\n ` pointer-events: none;` +\n `}` +\n `${this._terminalSelector}.focus .${SELECTION_CLASS} div {` +\n ` position: absolute;` +\n ` background-color: ${colors.selectionBackgroundOpaque.css};` +\n `}` +\n `${this._terminalSelector} .${SELECTION_CLASS} div {` +\n ` position: absolute;` +\n ` background-color: ${colors.selectionInactiveBackgroundOpaque.css};` +\n `}`;\n // Colors\n for (const [i, c] of colors.ansi.entries()) {\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${i} { color: ${c.css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${i} { background-color: ${c.css}; }`;\n }\n styles +=\n `${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { color: ${color.opaque(colors.background).css}; }` +\n `${this._terminalSelector} .${BG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { background-color: ${colors.foreground.css}; }`;\n\n this._themeStyleElement.textContent = styles;\n }\n\n public handleDevicePixelRatioChange(): void {\n this._updateDimensions();\n }\n\n private _refreshRowElements(cols: number, rows: number): void {\n // Add missing elements\n for (let i = this._rowElements.length; i <= rows; i++) {\n const row = document.createElement('div');\n this._rowContainer.appendChild(row);\n this._rowElements.push(row);\n }\n // Remove excess elements\n while (this._rowElements.length > rows) {\n this._rowContainer.removeChild(this._rowElements.pop()!);\n }\n }\n\n public handleResize(cols: number, rows: number): void {\n this._refreshRowElements(cols, rows);\n this._updateDimensions();\n }\n\n public handleCharSizeChanged(): void {\n this._updateDimensions();\n }\n\n public handleBlur(): void {\n this._rowContainer.classList.remove(FOCUS_CLASS);\n }\n\n public handleFocus(): void {\n this._rowContainer.classList.add(FOCUS_CLASS);\n }\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n // Remove all selections\n while (this._selectionContainer.children.length) {\n this._selectionContainer.removeChild(this._selectionContainer.children[0]);\n }\n\n this._rowFactory.handleSelectionChanged(start, end, columnSelectMode);\n this.renderRows(0, this._bufferService.rows - 1);\n\n // Selection does not exist\n if (!start || !end) {\n return;\n }\n\n // Translate from buffer position to viewport position\n const viewportStartRow = start[1] - this._bufferService.buffer.ydisp;\n const viewportEndRow = end[1] - this._bufferService.buffer.ydisp;\n const viewportCappedStartRow = Math.max(viewportStartRow, 0);\n const viewportCappedEndRow = Math.min(viewportEndRow, this._bufferService.rows - 1);\n\n // No need to draw the selection\n if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {\n return;\n }\n\n // Create the selections\n const documentFragment = document.createDocumentFragment();\n\n if (columnSelectMode) {\n const isXFlipped = start[0] > end[0];\n documentFragment.appendChild(\n this._createSelectionElement(viewportCappedStartRow, isXFlipped ? end[0] : start[0], isXFlipped ? start[0] : end[0], viewportCappedEndRow - viewportCappedStartRow + 1)\n );\n } else {\n // Draw first row\n const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;\n const endCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow, startCol, endCol));\n // Draw middle rows\n const middleRowsCount = viewportCappedEndRow - viewportCappedStartRow - 1;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow + 1, 0, this._bufferService.cols, middleRowsCount));\n // Draw final row\n if (viewportCappedStartRow !== viewportCappedEndRow) {\n // Only draw viewportEndRow if it's not the same as viewporttartRow\n const endCol = viewportEndRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;\n documentFragment.appendChild(this._createSelectionElement(viewportCappedEndRow, 0, endCol));\n }\n }\n this._selectionContainer.appendChild(documentFragment);\n }\n\n /**\n * Creates a selection element at the specified position.\n * @param row The row of the selection.\n * @param colStart The start column.\n * @param colEnd The end columns.\n */\n private _createSelectionElement(row: number, colStart: number, colEnd: number, rowCount: number = 1): HTMLElement {\n const element = document.createElement('div');\n element.style.height = `${rowCount * this.dimensions.css.cell.height}px`;\n element.style.top = `${row * this.dimensions.css.cell.height}px`;\n element.style.left = `${colStart * this.dimensions.css.cell.width}px`;\n element.style.width = `${this.dimensions.css.cell.width * (colEnd - colStart)}px`;\n return element;\n }\n\n public handleCursorMove(): void {\n // No-op, the cursor is drawn when rows are drawn\n }\n\n private _handleOptionsChanged(): void {\n // Force a refresh\n this._updateDimensions();\n }\n\n public clear(): void {\n for (const e of this._rowElements) {\n /**\n * NOTE: This used to be `e.innerText = '';` but that doesn't work when using `jsdom` and `@testing-library/react`\n *\n * references:\n * - https://github.com/testing-library/react-testing-library/issues/1146\n * - https://github.com/jsdom/jsdom/issues/1245\n */\n e.replaceChildren();\n }\n }\n\n public renderRows(start: number, end: number): void {\n const cursorAbsoluteY = this._bufferService.buffer.ybase + this._bufferService.buffer.y;\n const cursorX = Math.min(this._bufferService.buffer.x, this._bufferService.cols - 1);\n const cursorBlink = this._optionsService.rawOptions.cursorBlink;\n\n for (let y = start; y <= end; y++) {\n const rowElement = this._rowElements[y];\n const row = y + this._bufferService.buffer.ydisp;\n const lineData = this._bufferService.buffer.lines.get(row);\n const cursorStyle = this._optionsService.rawOptions.cursorStyle;\n if (!this._cellToRowElements[y] || this._cellToRowElements[y].length !== this._bufferService.cols) {\n this._cellToRowElements[y] = new Int16Array(this._bufferService.cols);\n }\n rowElement.replaceChildren(this._rowFactory.createRow(lineData!, row, row === cursorAbsoluteY, cursorStyle, cursorX, cursorBlink, this.dimensions.css.cell.width, this._bufferService.cols, this._cellToRowElements[y]));\n }\n }\n\n private get _terminalSelector(): string {\n return `.${TERMINAL_CLASS_PREFIX}${this._terminalClass}`;\n }\n\n private _handleLinkHover(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, true);\n }\n\n private _handleLinkLeave(e: ILinkifierEvent): void {\n this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, false);\n }\n\n private _setCellUnderline(x: number, x2: number, y: number, y2: number, cols: number, enabled: boolean): void {\n x = this._cellToRowElements[y][x];\n x2 = this._cellToRowElements[y2][x2];\n\n if (x === -1 || x2 === -1) {\n return;\n }\n\n while (x !== x2 || y !== y2) {\n const row = this._rowElements[y];\n if (!row) {\n return;\n }\n const span = row.children[x] as HTMLElement;\n if (span) {\n span.style.textDecoration = enabled ? 'underline' : 'none';\n }\n if (++x >= cols) {\n x = 0;\n y++;\n }\n }\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, IColor } from 'common/Types';\nimport { INVERTED_DEFAULT_COLOR } from 'browser/renderer/shared/Constants';\nimport { NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Attributes } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';\nimport { color, rgba } from 'common/Color';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { ICharacterJoinerService, ICoreBrowserService, IThemeService } from 'browser/services/Services';\nimport { JoinedCellData } from 'browser/services/CharacterJoinerService';\nimport { excludeFromContrastRatioDemands } from 'browser/renderer/shared/RendererUtils';\nimport { AttributeData } from 'common/buffer/AttributeData';\n\nexport const BOLD_CLASS = 'xterm-bold';\nexport const DIM_CLASS = 'xterm-dim';\nexport const ITALIC_CLASS = 'xterm-italic';\nexport const UNDERLINE_CLASS = 'xterm-underline';\nexport const STRIKETHROUGH_CLASS = 'xterm-strikethrough';\nexport const CURSOR_CLASS = 'xterm-cursor';\nexport const CURSOR_BLINK_CLASS = 'xterm-cursor-blink';\nexport const CURSOR_STYLE_BLOCK_CLASS = 'xterm-cursor-block';\nexport const CURSOR_STYLE_BAR_CLASS = 'xterm-cursor-bar';\nexport const CURSOR_STYLE_UNDERLINE_CLASS = 'xterm-cursor-underline';\n\nexport class DomRendererRowFactory {\n private _workCell: CellData = new CellData();\n\n private _selectionStart: [number, number] | undefined;\n private _selectionEnd: [number, number] | undefined;\n private _columnSelectMode: boolean = false;\n\n constructor(\n private readonly _document: Document,\n @ICharacterJoinerService private readonly _characterJoinerService: ICharacterJoinerService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService,\n @ICoreService private readonly _coreService: ICoreService,\n @IDecorationService private readonly _decorationService: IDecorationService,\n @IThemeService private readonly _themeService: IThemeService\n ) {}\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionStart = start;\n this._selectionEnd = end;\n this._columnSelectMode = columnSelectMode;\n }\n\n public createRow(lineData: IBufferLine, row: number, isCursorRow: boolean, cursorStyle: string | undefined, cursorX: number, cursorBlink: boolean, cellWidth: number, cols: number, cellMap: Int16Array): DocumentFragment {\n // NOTE: `cellMap` maps cell positions to a span element index in a row.\n // All positions should be updated, even skipped ones after wide chars or left overs at the end,\n // otherwise the mouse hover logic might mark the wrong elements as underlined.\n\n const fragment = this._document.createDocumentFragment();\n\n const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);\n // Find the line length first, this prevents the need to output a bunch of\n // empty cells at the end. This cannot easily be integrated into the main\n // loop below because of the colCount feature (which can be removed after we\n // properly support reflow and disallow data to go beyond the right-side of\n // the viewport).\n let lineLength = 0;\n for (let x = Math.min(lineData.length, cols) - 1; x >= 0; x--) {\n if (lineData.loadCell(x, this._workCell).getCode() !== NULL_CELL_CODE || (isCursorRow && x === cursorX)) {\n lineLength = x + 1;\n break;\n }\n }\n\n const colors = this._themeService.colors;\n let elemIndex = -1;\n\n let x = 0;\n for (; x < lineLength; x++) {\n lineData.loadCell(x, this._workCell);\n let width = this._workCell.getWidth();\n\n // The character to the left is a wide character, drawing is owned by the char at x-1\n // still have to update cellMap with current element index\n if (width === 0) {\n cellMap[x] = elemIndex;\n continue;\n }\n\n // If true, indicates that the current character(s) to draw were joined.\n let isJoined = false;\n let lastCharX = x;\n\n // Process any joined character ranges as needed. Because of how the\n // ranges are produced, we know that they are valid for the characters\n // and attributes of our input.\n let cell = this._workCell;\n if (joinedRanges.length > 0 && x === joinedRanges[0][0]) {\n isJoined = true;\n const range = joinedRanges.shift()!;\n\n // We already know the exact start and end column of the joined range,\n // so we get the string and width representing it directly\n cell = new JoinedCellData(\n this._workCell,\n lineData.translateToString(true, range[0], range[1]),\n range[1] - range[0]\n );\n\n // Skip over the cells occupied by this range in the loop\n lastCharX = range[1] - 1;\n\n // Recalculate width\n width = cell.getWidth();\n }\n\n const charElement = this._document.createElement('span');\n if (width > 1) {\n charElement.style.width = `${cellWidth * width}px`;\n }\n\n if (isJoined) {\n // Ligatures in the DOM renderer must use display inline, as they may not show with\n // inline-block if they are outside the bounds of the element\n charElement.style.display = 'inline';\n\n // The DOM renderer colors the background of the cursor but for ligatures all cells are\n // joined. The workaround here is to show a cursor around the whole ligature so it shows up,\n // the cursor looks the same when on any character of the ligature though\n if (cursorX >= x && cursorX <= lastCharX) {\n cursorX = x;\n }\n }\n\n if (!this._coreService.isCursorHidden && isCursorRow && x === cursorX) {\n charElement.classList.add(CURSOR_CLASS);\n\n if (cursorBlink) {\n charElement.classList.add(CURSOR_BLINK_CLASS);\n }\n\n switch (cursorStyle) {\n case 'bar':\n charElement.classList.add(CURSOR_STYLE_BAR_CLASS);\n break;\n case 'underline':\n charElement.classList.add(CURSOR_STYLE_UNDERLINE_CLASS);\n break;\n default:\n charElement.classList.add(CURSOR_STYLE_BLOCK_CLASS);\n break;\n }\n }\n\n if (cell.isBold()) {\n charElement.classList.add(BOLD_CLASS);\n }\n\n if (cell.isItalic()) {\n charElement.classList.add(ITALIC_CLASS);\n }\n\n if (cell.isDim()) {\n charElement.classList.add(DIM_CLASS);\n }\n\n if (cell.isInvisible()) {\n charElement.textContent = WHITESPACE_CELL_CHAR;\n } else {\n charElement.textContent = cell.getChars() || WHITESPACE_CELL_CHAR;\n }\n\n if (cell.isUnderline()) {\n charElement.classList.add(`${UNDERLINE_CLASS}-${cell.extended.underlineStyle}`);\n if (charElement.textContent === ' ') {\n charElement.textContent = '\\xa0'; // = &nbsp;\n }\n if (!cell.isUnderlineColorDefault()) {\n if (cell.isUnderlineColorRGB()) {\n charElement.style.textDecorationColor = `rgb(${AttributeData.toColorRGB(cell.getUnderlineColor()).join(',')})`;\n } else {\n let fg = cell.getUnderlineColor();\n if (this._optionsService.rawOptions.drawBoldTextInBrightColors && cell.isBold() && fg < 8) {\n fg += 8;\n }\n charElement.style.textDecorationColor = colors.ansi[fg].css;\n }\n }\n }\n\n if (cell.isStrikethrough()) {\n charElement.classList.add(STRIKETHROUGH_CLASS);\n }\n\n let fg = cell.getFgColor();\n let fgColorMode = cell.getFgColorMode();\n let bg = cell.getBgColor();\n let bgColorMode = cell.getBgColorMode();\n const isInverse = !!cell.isInverse();\n if (isInverse) {\n const temp = fg;\n fg = bg;\n bg = temp;\n const temp2 = fgColorMode;\n fgColorMode = bgColorMode;\n bgColorMode = temp2;\n }\n\n // Apply any decoration foreground/background overrides, this must happen after inverse has\n // been applied\n let bgOverride: IColor | undefined;\n let fgOverride: IColor | undefined;\n let isTop = false;\n this._decorationService.forEachDecorationAtCell(x, row, undefined, d => {\n if (d.options.layer !== 'top' && isTop) {\n return;\n }\n if (d.backgroundColorRGB) {\n bgColorMode = Attributes.CM_RGB;\n bg = d.backgroundColorRGB.rgba >> 8 & 0xFFFFFF;\n bgOverride = d.backgroundColorRGB;\n }\n if (d.foregroundColorRGB) {\n fgColorMode = Attributes.CM_RGB;\n fg = d.foregroundColorRGB.rgba >> 8 & 0xFFFFFF;\n fgOverride = d.foregroundColorRGB;\n }\n isTop = d.options.layer === 'top';\n });\n\n // Apply selection foreground if applicable\n const isInSelection = this._isCellInSelection(x, row);\n if (!isTop) {\n if (colors.selectionForeground && isInSelection) {\n fgColorMode = Attributes.CM_RGB;\n fg = colors.selectionForeground.rgba >> 8 & 0xFFFFFF;\n fgOverride = colors.selectionForeground;\n }\n }\n\n // If in the selection, force the element to be above the selection to improve contrast and\n // support opaque selections\n if (isInSelection) {\n bgOverride = this._coreBrowserService.isFocused ? colors.selectionBackgroundOpaque : colors.selectionInactiveBackgroundOpaque;\n isTop = true;\n }\n\n // If it's a top decoration, render above the selection\n if (isTop) {\n charElement.classList.add(`xterm-decoration-top`);\n }\n\n // Background\n let resolvedBg: IColor;\n switch (bgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n resolvedBg = colors.ansi[bg];\n charElement.classList.add(`xterm-bg-${bg}`);\n break;\n case Attributes.CM_RGB:\n resolvedBg = rgba.toColor(bg >> 16, bg >> 8 & 0xFF, bg & 0xFF);\n this._addStyle(charElement, `background-color:#${padStart((bg >>> 0).toString(16), '0', 6)}`);\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (isInverse) {\n resolvedBg = colors.foreground;\n charElement.classList.add(`xterm-bg-${INVERTED_DEFAULT_COLOR}`);\n } else {\n resolvedBg = colors.background;\n }\n }\n\n // If there is no background override by now it's the original color, so apply dim if needed\n if (!bgOverride) {\n if (cell.isDim()) {\n bgOverride = color.multiplyOpacity(resolvedBg, 0.5);\n }\n }\n\n // Foreground\n switch (fgColorMode) {\n case Attributes.CM_P16:\n case Attributes.CM_P256:\n if (cell.isBold() && fg < 8 && this._optionsService.rawOptions.drawBoldTextInBrightColors) {\n fg += 8;\n }\n if (!this._applyMinimumContrast(charElement, resolvedBg, colors.ansi[fg], cell, bgOverride, undefined)) {\n charElement.classList.add(`xterm-fg-${fg}`);\n }\n break;\n case Attributes.CM_RGB:\n const color = rgba.toColor(\n (fg >> 16) & 0xFF,\n (fg >> 8) & 0xFF,\n (fg ) & 0xFF\n );\n if (!this._applyMinimumContrast(charElement, resolvedBg, color, cell, bgOverride, fgOverride)) {\n this._addStyle(charElement, `color:#${padStart(fg.toString(16), '0', 6)}`);\n }\n break;\n case Attributes.CM_DEFAULT:\n default:\n if (!this._applyMinimumContrast(charElement, resolvedBg, colors.foreground, cell, bgOverride, undefined)) {\n if (isInverse) {\n charElement.classList.add(`xterm-fg-${INVERTED_DEFAULT_COLOR}`);\n }\n }\n }\n\n fragment.appendChild(charElement);\n cellMap[x] = ++elemIndex;\n\n x = lastCharX;\n }\n\n // since the loop above might exit early not handling all cells,\n // also set remaining cell positions to last element index\n if (x < cols - 1) {\n cellMap.subarray(x).fill(++elemIndex);\n }\n\n return fragment;\n }\n\n private _applyMinimumContrast(element: HTMLElement, bg: IColor, fg: IColor, cell: ICellData, bgOverride: IColor | undefined, fgOverride: IColor | undefined): boolean {\n if (this._optionsService.rawOptions.minimumContrastRatio === 1 || excludeFromContrastRatioDemands(cell.getCode())) {\n return false;\n }\n\n // Try get from cache first, only use the cache when there are no decoration overrides\n let adjustedColor: IColor | undefined | null = undefined;\n if (!bgOverride && !fgOverride) {\n adjustedColor = this._themeService.colors.contrastCache.getColor(bg.rgba, fg.rgba);\n }\n\n // Calculate and store in cache\n if (adjustedColor === undefined) {\n adjustedColor = color.ensureContrastRatio(bgOverride || bg, fgOverride || fg, this._optionsService.rawOptions.minimumContrastRatio);\n this._themeService.colors.contrastCache.setColor((bgOverride || bg).rgba, (fgOverride || fg).rgba, adjustedColor ?? null);\n }\n\n if (adjustedColor) {\n this._addStyle(element, `color:${adjustedColor.css}`);\n return true;\n }\n\n return false;\n }\n\n private _addStyle(element: HTMLElement, style: string): void {\n element.setAttribute('style', `${element.getAttribute('style') || ''}${style};`);\n }\n\n private _isCellInSelection(x: number, y: number): boolean {\n const start = this._selectionStart;\n const end = this._selectionEnd;\n if (!start || !end) {\n return false;\n }\n if (this._columnSelectMode) {\n if (start[0] <= end[0]) {\n return x >= start[0] && y >= start[1] &&\n x < end[0] && y <= end[1];\n }\n return x < start[0] && y >= start[1] &&\n x >= end[0] && y <= end[1];\n }\n return (y > start[1] && y < end[1]) ||\n (start[1] === end[1] && y === start[1] && x >= start[0] && x < end[0]) ||\n (start[1] < end[1] && y === end[1] && x < end[0]) ||\n (start[1] < end[1] && y === start[1] && x >= start[0]);\n }\n}\n\nfunction padStart(text: string, padChar: string, length: number): string {\n while (text.length < length) {\n text = padChar + text;\n }\n return text;\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isFirefox, isLegacyEdge } from 'common/Platform';\n\nexport const INVERTED_DEFAULT_COLOR = 257;\n\nexport const DIM_OPACITY = 0.5;\n// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge would\n// result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly\n// unaligned Powerline fonts (PR 3356#issuecomment-850928179).\nexport const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDimensions, IOffset, IRenderDimensions } from 'browser/renderer/shared/Types';\n\nexport function throwIfFalsy<T>(value: T | undefined | null): T {\n if (!value) {\n throw new Error('value must not be falsy');\n }\n return value;\n}\n\nexport function isPowerlineGlyph(codepoint: number): boolean {\n // Only return true for Powerline symbols which require\n // different padding and should be excluded from minimum contrast\n // ratio standards\n return 0xE0A4 <= codepoint && codepoint <= 0xE0D6;\n}\n\nexport function isRestrictedPowerlineGlyph(codepoint: number): boolean {\n return 0xE0B0 <= codepoint && codepoint <= 0xE0B7;\n}\n\nfunction isBoxOrBlockGlyph(codepoint: number): boolean {\n return 0x2500 <= codepoint && codepoint <= 0x259F;\n}\n\nexport function excludeFromContrastRatioDemands(codepoint: number): boolean {\n return isPowerlineGlyph(codepoint) || isBoxOrBlockGlyph(codepoint);\n}\n\nexport function createRenderDimensions(): IRenderDimensions {\n return {\n css: {\n canvas: createDimension(),\n cell: createDimension()\n },\n device: {\n canvas: createDimension(),\n cell: createDimension(),\n char: {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n }\n }\n };\n}\n\nfunction createDimension(): IDimensions {\n return {\n width: 0,\n height: 0\n };\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService } from 'common/services/Services';\n\n/**\n * Represents a selection within the buffer. This model only cares about column\n * and row coordinates, not wide characters.\n */\nexport class SelectionModel {\n /**\n * Whether select all is currently active.\n */\n public isSelectAllActive: boolean = false;\n\n /**\n * The minimal length of the selection from the start position. When double\n * clicking on a word, the word will be selected which makes the selection\n * start at the start of the word and makes this variable the length.\n */\n public selectionStartLength: number = 0;\n\n /**\n * The [x, y] position the selection starts at.\n */\n public selectionStart: [number, number] | undefined;\n\n /**\n * The [x, y] position the selection ends at.\n */\n public selectionEnd: [number, number] | undefined;\n\n constructor(\n private _bufferService: IBufferService\n ) {\n }\n\n /**\n * Clears the current selection.\n */\n public clearSelection(): void {\n this.selectionStart = undefined;\n this.selectionEnd = undefined;\n this.isSelectAllActive = false;\n this.selectionStartLength = 0;\n }\n\n /**\n * The final selection start, taking into consideration select all.\n */\n public get finalSelectionStart(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [0, 0];\n }\n\n if (!this.selectionEnd || !this.selectionStart) {\n return this.selectionStart;\n }\n\n return this.areSelectionValuesReversed() ? this.selectionEnd : this.selectionStart;\n }\n\n /**\n * The final selection end, taking into consideration select all, double click\n * word selection and triple click line selection.\n */\n public get finalSelectionEnd(): [number, number] | undefined {\n if (this.isSelectAllActive) {\n return [this._bufferService.cols, this._bufferService.buffer.ybase + this._bufferService.rows - 1];\n }\n\n if (!this.selectionStart) {\n return undefined;\n }\n\n // Use the selection start + length if the end doesn't exist or they're reversed\n if (!this.selectionEnd || this.areSelectionValuesReversed()) {\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n // Ensure the trailing EOL isn't included when the selection ends on the right edge\n if (startPlusLength % this._bufferService.cols === 0) {\n return [this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols) - 1];\n }\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [startPlusLength, this.selectionStart[1]];\n }\n\n // Ensure the the word/line is selected after a double/triple click\n if (this.selectionStartLength) {\n // Select the larger of the two when start and end are on the same line\n if (this.selectionEnd[1] === this.selectionStart[1]) {\n // Keep the whole wrapped word/line selected if the content wraps multiple lines\n const startPlusLength = this.selectionStart[0] + this.selectionStartLength;\n if (startPlusLength > this._bufferService.cols) {\n return [startPlusLength % this._bufferService.cols, this.selectionStart[1] + Math.floor(startPlusLength / this._bufferService.cols)];\n }\n return [Math.max(startPlusLength, this.selectionEnd[0]), this.selectionEnd[1]];\n }\n }\n return this.selectionEnd;\n }\n\n /**\n * Returns whether the selection start and end are reversed.\n */\n public areSelectionValuesReversed(): boolean {\n const start = this.selectionStart;\n const end = this.selectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[1] > end[1] || (start[1] === end[1] && start[0] > end[0]);\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n * @returns Whether a refresh is necessary.\n */\n public handleTrim(amount: number): boolean {\n // Adjust the selection position based on the trimmed amount.\n if (this.selectionStart) {\n this.selectionStart[1] -= amount;\n }\n if (this.selectionEnd) {\n this.selectionEnd[1] -= amount;\n }\n\n // The selection has moved off the buffer, clear it.\n if (this.selectionEnd && this.selectionEnd[1] < 0) {\n this.clearSelection();\n return true;\n }\n\n // If the selection start is trimmed, ensure the start column is 0.\n if (this.selectionStart && this.selectionStart[1] < 0) {\n this.selectionStart[1] = 0;\n }\n return false;\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService } from 'common/services/Services';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { ICharSizeService } from 'browser/services/Services';\nimport { Disposable } from 'common/Lifecycle';\nimport { ITerminalOptions } from 'common/Types';\n\nexport class CharSizeService extends Disposable implements ICharSizeService {\n public serviceBrand: undefined;\n\n public width: number = 0;\n public height: number = 0;\n private _measureStrategy: IMeasureStrategy;\n\n public get hasValidSize(): boolean { return this.width > 0 && this.height > 0; }\n\n private readonly _onCharSizeChange = this.register(new EventEmitter<void>());\n public readonly onCharSizeChange = this._onCharSizeChange.event;\n\n constructor(\n document: Document,\n parentElement: HTMLElement,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._measureStrategy = new DomMeasureStrategy(document, parentElement, this._optionsService);\n this.register(this._optionsService.onMultipleOptionChange(['fontFamily', 'fontSize'], () => this.measure()));\n }\n\n public measure(): void {\n const result = this._measureStrategy.measure();\n if (result.width !== this.width || result.height !== this.height) {\n this.width = result.width;\n this.height = result.height;\n this._onCharSizeChange.fire();\n }\n }\n}\n\ninterface IMeasureStrategy {\n measure(): IReadonlyMeasureResult;\n}\n\ninterface IReadonlyMeasureResult {\n readonly width: number;\n readonly height: number;\n}\n\ninterface IMeasureResult {\n width: number;\n height: number;\n}\n\n// TODO: For supporting browsers we should also provide a CanvasCharDimensionsProvider that uses ctx.measureText\nclass DomMeasureStrategy implements IMeasureStrategy {\n private _result: IMeasureResult = { width: 0, height: 0 };\n private _measureElement: HTMLElement;\n\n constructor(\n private _document: Document,\n private _parentElement: HTMLElement,\n private _optionsService: IOptionsService\n ) {\n this._measureElement = this._document.createElement('span');\n this._measureElement.classList.add('xterm-char-measure-element');\n this._measureElement.textContent = 'W';\n this._measureElement.setAttribute('aria-hidden', 'true');\n this._parentElement.appendChild(this._measureElement);\n }\n\n public measure(): IReadonlyMeasureResult {\n this._measureElement.style.fontFamily = this._optionsService.rawOptions.fontFamily;\n this._measureElement.style.fontSize = `${this._optionsService.rawOptions.fontSize}px`;\n\n // Note that this triggers a synchronous layout\n const geometry = this._measureElement.getBoundingClientRect();\n\n // If values are 0 then the element is likely currently display:none, in which case we should\n // retain the previous value.\n if (geometry.width !== 0 && geometry.height !== 0) {\n this._result.width = geometry.width;\n this._result.height = Math.ceil(geometry.height);\n }\n\n return this._result;\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferLine, ICellData, CharData } from 'common/Types';\nimport { ICharacterJoiner } from 'browser/Types';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { WHITESPACE_CELL_CHAR, Content } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferService } from 'common/services/Services';\nimport { ICharacterJoinerService } from 'browser/services/Services';\n\nexport class JoinedCellData extends AttributeData implements ICellData {\n private _width: number;\n // .content carries no meaning for joined CellData, simply nullify it\n // thus we have to overload all other .content accessors\n public content: number = 0;\n public fg: number;\n public bg: number;\n public combinedData: string = '';\n\n constructor(firstCell: ICellData, chars: string, width: number) {\n super();\n this.fg = firstCell.fg;\n this.bg = firstCell.bg;\n this.combinedData = chars;\n this._width = width;\n }\n\n public isCombined(): number {\n // always mark joined cell data as combined\n return Content.IS_COMBINED_MASK;\n }\n\n public getWidth(): number {\n return this._width;\n }\n\n public getChars(): string {\n return this.combinedData;\n }\n\n public getCode(): number {\n // code always gets the highest possible fake codepoint (read as -1)\n // this is needed as code is used by caches as identifier\n return 0x1FFFFF;\n }\n\n public setFromCharData(value: CharData): void {\n throw new Error('not implemented');\n }\n\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n\nexport class CharacterJoinerService implements ICharacterJoinerService {\n public serviceBrand: undefined;\n\n private _characterJoiners: ICharacterJoiner[] = [];\n private _nextCharacterJoinerId: number = 0;\n private _workCell: CellData = new CellData();\n\n constructor(\n @IBufferService private _bufferService: IBufferService\n ) { }\n\n public register(handler: (text: string) => [number, number][]): number {\n const joiner: ICharacterJoiner = {\n id: this._nextCharacterJoinerId++,\n handler\n };\n\n this._characterJoiners.push(joiner);\n return joiner.id;\n }\n\n public deregister(joinerId: number): boolean {\n for (let i = 0; i < this._characterJoiners.length; i++) {\n if (this._characterJoiners[i].id === joinerId) {\n this._characterJoiners.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n public getJoinedCharacters(row: number): [number, number][] {\n if (this._characterJoiners.length === 0) {\n return [];\n }\n\n const line = this._bufferService.buffer.lines.get(row);\n if (!line || line.length === 0) {\n return [];\n }\n\n const ranges: [number, number][] = [];\n const lineStr = line.translateToString(true);\n\n // Because some cells can be represented by multiple javascript characters,\n // we track the cell and the string indexes separately. This allows us to\n // translate the string ranges we get from the joiners back into cell ranges\n // for use when rendering\n let rangeStartColumn = 0;\n let currentStringIndex = 0;\n let rangeStartStringIndex = 0;\n let rangeAttrFG = line.getFg(0);\n let rangeAttrBG = line.getBg(0);\n\n for (let x = 0; x < line.getTrimmedLength(); x++) {\n line.loadCell(x, this._workCell);\n\n if (this._workCell.getWidth() === 0) {\n // If this character is of width 0, skip it.\n continue;\n }\n\n // End of range\n if (this._workCell.fg !== rangeAttrFG || this._workCell.bg !== rangeAttrBG) {\n // If we ended up with a sequence of more than one character,\n // look for ranges to join.\n if (x - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n // Reset our markers for a new range.\n rangeStartColumn = x;\n rangeStartStringIndex = currentStringIndex;\n rangeAttrFG = this._workCell.fg;\n rangeAttrBG = this._workCell.bg;\n }\n\n currentStringIndex += this._workCell.getChars().length || WHITESPACE_CELL_CHAR.length;\n }\n\n // Process any trailing ranges.\n if (this._bufferService.cols - rangeStartColumn > 1) {\n const joinedRanges = this._getJoinedRanges(\n lineStr,\n rangeStartStringIndex,\n currentStringIndex,\n line,\n rangeStartColumn\n );\n for (let i = 0; i < joinedRanges.length; i++) {\n ranges.push(joinedRanges[i]);\n }\n }\n\n return ranges;\n }\n\n /**\n * Given a segment of a line of text, find all ranges of text that should be\n * joined in a single rendering unit. Ranges are internally converted to\n * column ranges, rather than string ranges.\n * @param line String representation of the full line of text\n * @param startIndex Start position of the range to search in the string (inclusive)\n * @param endIndex End position of the range to search in the string (exclusive)\n */\n private _getJoinedRanges(line: string, startIndex: number, endIndex: number, lineData: IBufferLine, startCol: number): [number, number][] {\n const text = line.substring(startIndex, endIndex);\n // At this point we already know that there is at least one joiner so\n // we can just pull its value and assign it directly rather than\n // merging it into an empty array, which incurs unnecessary writes.\n let allJoinedRanges: [number, number][] = [];\n try {\n allJoinedRanges = this._characterJoiners[0].handler(text);\n } catch (error) {\n console.error(error);\n }\n for (let i = 1; i < this._characterJoiners.length; i++) {\n // We merge any overlapping ranges across the different joiners\n try {\n const joinerRanges = this._characterJoiners[i].handler(text);\n for (let j = 0; j < joinerRanges.length; j++) {\n CharacterJoinerService._mergeRanges(allJoinedRanges, joinerRanges[j]);\n }\n } catch (error) {\n console.error(error);\n }\n }\n this._stringRangesToCellRanges(allJoinedRanges, lineData, startCol);\n return allJoinedRanges;\n }\n\n /**\n * Modifies the provided ranges in-place to adjust for variations between\n * string length and cell width so that the range represents a cell range,\n * rather than the string range the joiner provides.\n * @param ranges String ranges containing start (inclusive) and end (exclusive) index\n * @param line Cell data for the relevant line in the terminal\n * @param startCol Offset within the line to start from\n */\n private _stringRangesToCellRanges(ranges: [number, number][], line: IBufferLine, startCol: number): void {\n let currentRangeIndex = 0;\n let currentRangeStarted = false;\n let currentStringIndex = 0;\n let currentRange = ranges[currentRangeIndex];\n\n // If we got through all of the ranges, stop searching\n if (!currentRange) {\n return;\n }\n\n for (let x = startCol; x < this._bufferService.cols; x++) {\n const width = line.getWidth(x);\n const length = line.getString(x).length || WHITESPACE_CELL_CHAR.length;\n\n // We skip zero-width characters when creating the string to join the text\n // so we do the same here\n if (width === 0) {\n continue;\n }\n\n // Adjust the start of the range\n if (!currentRangeStarted && currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n }\n\n // Adjust the end of the range\n if (currentRange[1] <= currentStringIndex) {\n currentRange[1] = x;\n\n // We're finished with this range, so we move to the next one\n currentRange = ranges[++currentRangeIndex];\n\n // If there are no more ranges left, stop searching\n if (!currentRange) {\n break;\n }\n\n // Ranges can be on adjacent characters. Because the end index of the\n // ranges are exclusive, this means that the index for the start of a\n // range can be the same as the end index of the previous range. To\n // account for the start of the next range, we check here just in case.\n if (currentRange[0] <= currentStringIndex) {\n currentRange[0] = x;\n currentRangeStarted = true;\n } else {\n currentRangeStarted = false;\n }\n }\n\n // Adjust the string index based on the character length to line up with\n // the column adjustment\n currentStringIndex += length;\n }\n\n // If there is still a range left at the end, it must extend all the way to\n // the end of the line.\n if (currentRange) {\n currentRange[1] = this._bufferService.cols;\n }\n }\n\n /**\n * Merges the range defined by the provided start and end into the list of\n * existing ranges. The merge is done in place on the existing range for\n * performance and is also returned.\n * @param ranges Existing range list\n * @param newRange Tuple of two numbers representing the new range to merge in.\n * @returns The ranges input with the new range merged in place\n */\n private static _mergeRanges(ranges: [number, number][], newRange: [number, number]): [number, number][] {\n let inRange = false;\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n if (!inRange) {\n if (newRange[1] <= range[0]) {\n // Case 1: New range is before the search range\n ranges.splice(i, 0, newRange);\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 2: New range is either wholly contained within the\n // search range or overlaps with the front of it\n range[0] = Math.min(newRange[0], range[0]);\n return ranges;\n }\n\n if (newRange[0] < range[1]) {\n // Case 3: New range either wholly contains the search range\n // or overlaps with the end of it\n range[0] = Math.min(newRange[0], range[0]);\n inRange = true;\n }\n\n // Case 4: New range starts after the search range\n continue;\n } else {\n if (newRange[1] <= range[0]) {\n // Case 5: New range extends from previous range but doesn't\n // reach the current one\n ranges[i - 1][1] = newRange[1];\n return ranges;\n }\n\n if (newRange[1] <= range[1]) {\n // Case 6: New range extends from prvious range into the\n // current range\n ranges[i - 1][1] = Math.max(newRange[1], range[1]);\n ranges.splice(i, 1);\n return ranges;\n }\n\n // Case 7: New range extends from previous range past the\n // end of the current range\n ranges.splice(i, 1);\n i--;\n }\n }\n\n if (inRange) {\n // Case 8: New range extends past the last existing range\n ranges[ranges.length - 1][1] = newRange[1];\n } else {\n // Case 9: New range starts after the last existing range\n ranges.push(newRange);\n }\n\n return ranges;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreBrowserService } from './Services';\n\nexport class CoreBrowserService implements ICoreBrowserService {\n public serviceBrand: undefined;\n\n private _isFocused = false;\n private _cachedIsFocused: boolean | undefined = undefined;\n\n constructor(\n private _textarea: HTMLTextAreaElement,\n public readonly window: Window & typeof globalThis\n ) {\n this._textarea.addEventListener('focus', () => this._isFocused = true);\n this._textarea.addEventListener('blur', () => this._isFocused = false);\n }\n\n public get dpr(): number {\n return this.window.devicePixelRatio;\n }\n\n public get isFocused(): boolean {\n if (this._cachedIsFocused === undefined) {\n this._cachedIsFocused = this._isFocused && this._textarea.ownerDocument.hasFocus();\n queueMicrotask(() => this._cachedIsFocused = undefined);\n }\n return this._cachedIsFocused;\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharSizeService, IRenderService, IMouseService } from './Services';\nimport { getCoords, getCoordsRelativeToElement } from 'browser/input/Mouse';\n\nexport class MouseService implements IMouseService {\n public serviceBrand: undefined;\n\n constructor(\n @IRenderService private readonly _renderService: IRenderService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService\n ) {\n }\n\n public getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined {\n return getCoords(\n window,\n event,\n element,\n colCount,\n rowCount,\n this._charSizeService.hasValidSize,\n this._renderService.dimensions.css.cell.width,\n this._renderService.dimensions.css.cell.height,\n isSelection\n );\n }\n\n public getMouseReportCoords(event: MouseEvent, element: HTMLElement): { col: number, row: number, x: number, y: number } | undefined {\n const coords = getCoordsRelativeToElement(window, event, element);\n\n // due to rounding issues in zoom states pixel values might be negative or overflow actual canvas\n // ignore those events effectively narrowing mouse area a tiny bit at the edges\n if (!this._charSizeService.hasValidSize\n || coords[0] < 0\n || coords[1] < 0\n || coords[0] >= this._renderService.dimensions.css.canvas.width\n || coords[1] >= this._renderService.dimensions.css.canvas.height) {\n return undefined;\n }\n\n return {\n col: Math.floor(coords[0] / this._renderService.dimensions.css.cell.width),\n row: Math.floor(coords[1] / this._renderService.dimensions.css.cell.height),\n x: Math.floor(coords[0]),\n y: Math.floor(coords[1])\n };\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IRenderer, IRenderDimensions } from 'browser/renderer/shared/Types';\nimport { RenderDebouncer } from 'browser/RenderDebouncer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { ScreenDprMonitor } from 'browser/ScreenDprMonitor';\nimport { addDisposableDomListener } from 'browser/Lifecycle';\nimport { IColorSet, IRenderDebouncerWithCallback, ReadonlyColorSet } from 'browser/Types';\nimport { IOptionsService, IBufferService, IDecorationService } from 'common/services/Services';\nimport { ICharSizeService, ICoreBrowserService, IRenderService, IThemeService } from 'browser/services/Services';\nimport { DebouncedIdleTask } from 'common/TaskQueue';\nimport { ThemeService } from 'browser/services/ThemeService';\n\ninterface ISelectionState {\n start: [number, number] | undefined;\n end: [number, number] | undefined;\n columnSelectMode: boolean;\n}\n\nexport class RenderService extends Disposable implements IRenderService {\n public serviceBrand: undefined;\n\n private _renderer: IRenderer | undefined;\n private _renderDebouncer: IRenderDebouncerWithCallback;\n private _screenDprMonitor: ScreenDprMonitor;\n private _pausedResizeTask = new DebouncedIdleTask();\n\n private _isPaused: boolean = false;\n private _needsFullRefresh: boolean = false;\n private _isNextRenderRedrawOnly: boolean = true;\n private _needsSelectionRefresh: boolean = false;\n private _canvasWidth: number = 0;\n private _canvasHeight: number = 0;\n private _selectionState: ISelectionState = {\n start: undefined,\n end: undefined,\n columnSelectMode: false\n };\n\n private readonly _onDimensionsChange = this.register(new EventEmitter<IRenderDimensions>());\n public readonly onDimensionsChange = this._onDimensionsChange.event;\n private readonly _onRenderedViewportChange = this.register(new EventEmitter<{ start: number, end: number }>());\n public readonly onRenderedViewportChange = this._onRenderedViewportChange.event;\n private readonly _onRender = this.register(new EventEmitter<{ start: number, end: number }>());\n public readonly onRender = this._onRender.event;\n private readonly _onRefreshRequest = this.register(new EventEmitter<{ start: number, end: number }>());\n public readonly onRefreshRequest = this._onRefreshRequest.event;\n\n public get dimensions(): IRenderDimensions { return this._renderer!.dimensions; }\n\n constructor(\n private _rowCount: number,\n screenElement: HTMLElement,\n @IOptionsService optionsService: IOptionsService,\n @ICharSizeService private readonly _charSizeService: ICharSizeService,\n @IDecorationService decorationService: IDecorationService,\n @IBufferService bufferService: IBufferService,\n @ICoreBrowserService coreBrowserService: ICoreBrowserService,\n @IThemeService themeService: IThemeService\n ) {\n super();\n\n this.register({ dispose: () => this._renderer?.dispose() });\n\n this._renderDebouncer = new RenderDebouncer(coreBrowserService.window, (start, end) => this._renderRows(start, end));\n this.register(this._renderDebouncer);\n\n this._screenDprMonitor = new ScreenDprMonitor(coreBrowserService.window);\n this._screenDprMonitor.setListener(() => this.handleDevicePixelRatioChange());\n this.register(this._screenDprMonitor);\n\n this.register(bufferService.onResize(() => this._fullRefresh()));\n this.register(bufferService.buffers.onBufferActivate(() => this._renderer?.clear()));\n this.register(optionsService.onOptionChange(() => this._handleOptionsChanged()));\n this.register(this._charSizeService.onCharSizeChange(() => this.handleCharSizeChanged()));\n\n // Do a full refresh whenever any decoration is added or removed. This may not actually result\n // in changes but since decorations should be used sparingly or added/removed all in the same\n // frame this should have minimal performance impact.\n this.register(decorationService.onDecorationRegistered(() => this._fullRefresh()));\n this.register(decorationService.onDecorationRemoved(() => this._fullRefresh()));\n\n // Clear the renderer when the a change that could affect glyphs occurs\n this.register(optionsService.onMultipleOptionChange([\n 'customGlyphs',\n 'drawBoldTextInBrightColors',\n 'letterSpacing',\n 'lineHeight',\n 'fontFamily',\n 'fontSize',\n 'fontWeight',\n 'fontWeightBold',\n 'minimumContrastRatio'\n ], () => {\n this.clear();\n this.handleResize(bufferService.cols, bufferService.rows);\n this._fullRefresh();\n }));\n\n // Refresh the cursor line when the cursor changes\n this.register(optionsService.onMultipleOptionChange([\n 'cursorBlink',\n 'cursorStyle'\n ], () => this.refreshRows(bufferService.buffer.y, bufferService.buffer.y, true)));\n\n // dprchange should handle this case, we need this as well for browsers that don't support the\n // matchMedia query.\n this.register(addDisposableDomListener(coreBrowserService.window, 'resize', () => this.handleDevicePixelRatioChange()));\n\n this.register(themeService.onChangeColors(() => this._fullRefresh()));\n\n // Detect whether IntersectionObserver is detected and enable renderer pause\n // and resume based on terminal visibility if so\n if ('IntersectionObserver' in coreBrowserService.window) {\n const observer = new coreBrowserService.window.IntersectionObserver(e => this._handleIntersectionChange(e[e.length - 1]), { threshold: 0 });\n observer.observe(screenElement);\n this.register({ dispose: () => observer.disconnect() });\n }\n }\n\n private _handleIntersectionChange(entry: IntersectionObserverEntry): void {\n this._isPaused = entry.isIntersecting === undefined ? (entry.intersectionRatio === 0) : !entry.isIntersecting;\n\n // Terminal was hidden on open\n if (!this._isPaused && !this._charSizeService.hasValidSize) {\n this._charSizeService.measure();\n }\n\n if (!this._isPaused && this._needsFullRefresh) {\n this._pausedResizeTask.flush();\n this.refreshRows(0, this._rowCount - 1);\n this._needsFullRefresh = false;\n }\n }\n\n public refreshRows(start: number, end: number, isRedrawOnly: boolean = false): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n return;\n }\n if (!isRedrawOnly) {\n this._isNextRenderRedrawOnly = false;\n }\n this._renderDebouncer.refresh(start, end, this._rowCount);\n }\n\n private _renderRows(start: number, end: number): void {\n if (!this._renderer) {\n return;\n }\n this._renderer.renderRows(start, end);\n\n // Update selection if needed\n if (this._needsSelectionRefresh) {\n this._renderer.handleSelectionChanged(this._selectionState.start, this._selectionState.end, this._selectionState.columnSelectMode);\n this._needsSelectionRefresh = false;\n }\n\n // Fire render event only if it was not a redraw\n if (!this._isNextRenderRedrawOnly) {\n this._onRenderedViewportChange.fire({ start, end });\n }\n this._onRender.fire({ start, end });\n this._isNextRenderRedrawOnly = true;\n }\n\n public resize(cols: number, rows: number): void {\n this._rowCount = rows;\n this._fireOnCanvasResize();\n }\n\n private _handleOptionsChanged(): void {\n if (!this._renderer) {\n return;\n }\n this.refreshRows(0, this._rowCount - 1);\n this._fireOnCanvasResize();\n }\n\n private _fireOnCanvasResize(): void {\n if (!this._renderer) {\n return;\n }\n // Don't fire the event if the dimensions haven't changed\n if (this._renderer.dimensions.css.canvas.width === this._canvasWidth && this._renderer.dimensions.css.canvas.height === this._canvasHeight) {\n return;\n }\n this._onDimensionsChange.fire(this._renderer.dimensions);\n }\n\n public hasRenderer(): boolean {\n return !!this._renderer;\n }\n\n public setRenderer(renderer: IRenderer): void {\n // TODO: RenderService should be the only one to dispose the renderer\n this._renderer?.dispose();\n this._renderer = renderer;\n this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));\n\n // Force a refresh\n this._needsSelectionRefresh = true;\n this._fullRefresh();\n }\n\n public addRefreshCallback(callback: FrameRequestCallback): number {\n return this._renderDebouncer.addRefreshCallback(callback);\n }\n\n private _fullRefresh(): void {\n if (this._isPaused) {\n this._needsFullRefresh = true;\n } else {\n this.refreshRows(0, this._rowCount - 1);\n }\n }\n\n public clearTextureAtlas(): void {\n if (!this._renderer) {\n return;\n }\n this._renderer.clearTextureAtlas?.();\n this._fullRefresh();\n }\n\n public handleDevicePixelRatioChange(): void {\n // Force char size measurement as DomMeasureStrategy(getBoundingClientRect) is not stable\n // when devicePixelRatio changes\n this._charSizeService.measure();\n\n if (!this._renderer) {\n return;\n }\n this._renderer.handleDevicePixelRatioChange();\n this.refreshRows(0, this._rowCount - 1);\n }\n\n public handleResize(cols: number, rows: number): void {\n if (!this._renderer) {\n return;\n }\n if (this._isPaused) {\n this._pausedResizeTask.set(() => this._renderer!.handleResize(cols, rows));\n } else {\n this._renderer.handleResize(cols, rows);\n }\n this._fullRefresh();\n }\n\n // TODO: Is this useful when we have onResize?\n public handleCharSizeChanged(): void {\n this._renderer?.handleCharSizeChanged();\n }\n\n public handleBlur(): void {\n this._renderer?.handleBlur();\n }\n\n public handleFocus(): void {\n this._renderer?.handleFocus();\n }\n\n public handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {\n this._selectionState.start = start;\n this._selectionState.end = end;\n this._selectionState.columnSelectMode = columnSelectMode;\n this._renderer?.handleSelectionChanged(start, end, columnSelectMode);\n }\n\n public handleCursorMove(): void {\n this._renderer?.handleCursorMove();\n }\n\n public clear(): void {\n this._renderer?.clear();\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ISelectionRedrawRequestEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { IBuffer } from 'common/buffer/Types';\nimport { IBufferLine, IDisposable } from 'common/Types';\nimport * as Browser from 'common/Platform';\nimport { SelectionModel } from 'browser/selection/SelectionModel';\nimport { CellData } from 'common/buffer/CellData';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IMouseService, ISelectionService, IRenderService, ICoreBrowserService } from 'browser/services/Services';\nimport { IBufferRange, ILinkifier2 } from 'browser/Types';\nimport { IBufferService, IOptionsService, ICoreService } from 'common/services/Services';\nimport { getCoordsRelativeToElement } from 'browser/input/Mouse';\nimport { moveToCellSequence } from 'browser/input/MoveToCell';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { getRangeLength } from 'common/buffer/BufferRange';\n\n/**\n * The number of pixels the mouse needs to be above or below the viewport in\n * order to scroll at the maximum speed.\n */\nconst DRAG_SCROLL_MAX_THRESHOLD = 50;\n\n/**\n * The maximum scrolling speed\n */\nconst DRAG_SCROLL_MAX_SPEED = 15;\n\n/**\n * The number of milliseconds between drag scroll updates.\n */\nconst DRAG_SCROLL_INTERVAL = 50;\n\n/**\n * The maximum amount of time that can have elapsed for an alt click to move the\n * cursor.\n */\nconst ALT_CLICK_MOVE_CURSOR_TIME = 500;\n\nconst NON_BREAKING_SPACE_CHAR = String.fromCharCode(160);\nconst ALL_NON_BREAKING_SPACE_REGEX = new RegExp(NON_BREAKING_SPACE_CHAR, 'g');\n\n/**\n * Represents a position of a word on a line.\n */\ninterface IWordPosition {\n start: number;\n length: number;\n}\n\n/**\n * A selection mode, this drives how the selection behaves on mouse move.\n */\nexport const enum SelectionMode {\n NORMAL,\n WORD,\n LINE,\n COLUMN\n}\n\n/**\n * A class that manages the selection of the terminal. With help from\n * SelectionModel, SelectionService handles with all logic associated with\n * dealing with the selection, including handling mouse interaction, wide\n * characters and fetching the actual text within the selection. Rendering is\n * not handled by the SelectionService but the onRedrawRequest event is fired\n * when the selection is ready to be redrawn (on an animation frame).\n */\nexport class SelectionService extends Disposable implements ISelectionService {\n public serviceBrand: undefined;\n\n protected _model: SelectionModel;\n\n /**\n * The amount to scroll every drag scroll update (depends on how far the mouse\n * drag is above or below the terminal).\n */\n private _dragScrollAmount: number = 0;\n\n /**\n * The current selection mode.\n */\n protected _activeSelectionMode: SelectionMode;\n\n /**\n * A setInterval timer that is active while the mouse is down whose callback\n * scrolls the viewport when necessary.\n */\n private _dragScrollIntervalTimer: number | undefined;\n\n /**\n * The animation frame ID used for refreshing the selection.\n */\n private _refreshAnimationFrame: number | undefined;\n\n /**\n * Whether selection is enabled.\n */\n private _enabled = true;\n\n private _mouseMoveListener: EventListener;\n private _mouseUpListener: EventListener;\n private _trimListener: IDisposable;\n private _workCell: CellData = new CellData();\n\n private _mouseDownTimeStamp: number = 0;\n private _oldHasSelection: boolean = false;\n private _oldSelectionStart: [number, number] | undefined = undefined;\n private _oldSelectionEnd: [number, number] | undefined = undefined;\n\n private readonly _onLinuxMouseSelection = this.register(new EventEmitter<string>());\n public readonly onLinuxMouseSelection = this._onLinuxMouseSelection.event;\n private readonly _onRedrawRequest = this.register(new EventEmitter<ISelectionRedrawRequestEvent>());\n public readonly onRequestRedraw = this._onRedrawRequest.event;\n private readonly _onSelectionChange = this.register(new EventEmitter<void>());\n public readonly onSelectionChange = this._onSelectionChange.event;\n private readonly _onRequestScrollLines = this.register(new EventEmitter<ISelectionRequestScrollLinesEvent>());\n public readonly onRequestScrollLines = this._onRequestScrollLines.event;\n\n constructor(\n private readonly _element: HTMLElement,\n private readonly _screenElement: HTMLElement,\n private readonly _linkifier: ILinkifier2,\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService,\n @IMouseService private readonly _mouseService: IMouseService,\n @IOptionsService private readonly _optionsService: IOptionsService,\n @IRenderService private readonly _renderService: IRenderService,\n @ICoreBrowserService private readonly _coreBrowserService: ICoreBrowserService\n ) {\n super();\n\n // Init listeners\n this._mouseMoveListener = event => this._handleMouseMove(event as MouseEvent);\n this._mouseUpListener = event => this._handleMouseUp(event as MouseEvent);\n this._coreService.onUserInput(() => {\n if (this.hasSelection) {\n this.clearSelection();\n }\n });\n this._trimListener = this._bufferService.buffer.lines.onTrim(amount => this._handleTrim(amount));\n this.register(this._bufferService.buffers.onBufferActivate(e => this._handleBufferActivate(e)));\n\n this.enable();\n\n this._model = new SelectionModel(this._bufferService);\n this._activeSelectionMode = SelectionMode.NORMAL;\n\n this.register(toDisposable(() => {\n this._removeMouseDownListeners();\n }));\n }\n\n public reset(): void {\n this.clearSelection();\n }\n\n /**\n * Disables the selection manager. This is useful for when terminal mouse\n * are enabled.\n */\n public disable(): void {\n this.clearSelection();\n this._enabled = false;\n }\n\n /**\n * Enable the selection manager.\n */\n public enable(): void {\n this._enabled = true;\n }\n\n public get selectionStart(): [number, number] | undefined { return this._model.finalSelectionStart; }\n public get selectionEnd(): [number, number] | undefined { return this._model.finalSelectionEnd; }\n\n /**\n * Gets whether there is an active text selection.\n */\n public get hasSelection(): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return start[0] !== end[0] || start[1] !== end[1];\n }\n\n /**\n * Gets the text currently selected.\n */\n public get selectionText(): string {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return '';\n }\n\n const buffer = this._bufferService.buffer;\n const result: string[] = [];\n\n if (this._activeSelectionMode === SelectionMode.COLUMN) {\n // Ignore zero width selections\n if (start[0] === end[0]) {\n return '';\n }\n\n // For column selection it's not enough to rely on final selection's swapping of reversed\n // values, it also needs the x coordinates to swap independently of the y coordinate is needed\n const startCol = start[0] < end[0] ? start[0] : end[0];\n const endCol = start[0] < end[0] ? end[0] : start[0];\n for (let i = start[1]; i <= end[1]; i++) {\n const lineText = buffer.translateBufferLineToString(i, true, startCol, endCol);\n result.push(lineText);\n }\n } else {\n // Get first row\n const startRowEndCol = start[1] === end[1] ? end[0] : undefined;\n result.push(buffer.translateBufferLineToString(start[1], true, start[0], startRowEndCol));\n\n // Get middle rows\n for (let i = start[1] + 1; i <= end[1] - 1; i++) {\n const bufferLine = buffer.lines.get(i);\n const lineText = buffer.translateBufferLineToString(i, true);\n if (bufferLine?.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n\n // Get final row\n if (start[1] !== end[1]) {\n const bufferLine = buffer.lines.get(end[1]);\n const lineText = buffer.translateBufferLineToString(end[1], true, 0, end[0]);\n if (bufferLine && bufferLine!.isWrapped) {\n result[result.length - 1] += lineText;\n } else {\n result.push(lineText);\n }\n }\n }\n\n // Format string by replacing non-breaking space chars with regular spaces\n // and joining the array into a multi-line string.\n const formattedResult = result.map(line => {\n return line.replace(ALL_NON_BREAKING_SPACE_REGEX, ' ');\n }).join(Browser.isWindows ? '\\r\\n' : '\\n');\n\n return formattedResult;\n }\n\n /**\n * Clears the current terminal selection.\n */\n public clearSelection(): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Queues a refresh, redrawing the selection on the next opportunity.\n * @param isLinuxMouseSelection Whether the selection should be registered as a new\n * selection on Linux.\n */\n public refresh(isLinuxMouseSelection?: boolean): void {\n // Queue the refresh for the renderer\n if (!this._refreshAnimationFrame) {\n this._refreshAnimationFrame = this._coreBrowserService.window.requestAnimationFrame(() => this._refresh());\n }\n\n // If the platform is Linux and the refresh call comes from a mouse event,\n // we need to update the selection for middle click to paste selection.\n if (Browser.isLinux && isLinuxMouseSelection) {\n const selectionText = this.selectionText;\n if (selectionText.length) {\n this._onLinuxMouseSelection.fire(this.selectionText);\n }\n }\n }\n\n /**\n * Fires the refresh event, causing consumers to pick it up and redraw the\n * selection state.\n */\n private _refresh(): void {\n this._refreshAnimationFrame = undefined;\n this._onRedrawRequest.fire({\n start: this._model.finalSelectionStart,\n end: this._model.finalSelectionEnd,\n columnSelectMode: this._activeSelectionMode === SelectionMode.COLUMN\n });\n }\n\n /**\n * Checks if the current click was inside the current selection\n * @param event The mouse event\n */\n private _isClickInSelection(event: MouseEvent): boolean {\n const coords = this._getMouseBufferCoords(event);\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n\n if (!start || !end || !coords) {\n return false;\n }\n\n return this._areCoordsInSelection(coords, start, end);\n }\n\n public isCellInSelection(x: number, y: number): boolean {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n if (!start || !end) {\n return false;\n }\n return this._areCoordsInSelection([x, y], start, end);\n }\n\n protected _areCoordsInSelection(coords: [number, number], start: [number, number], end: [number, number]): boolean {\n return (coords[1] > start[1] && coords[1] < end[1]) ||\n (start[1] === end[1] && coords[1] === start[1] && coords[0] >= start[0] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === end[1] && coords[0] < end[0]) ||\n (start[1] < end[1] && coords[1] === start[1] && coords[0] >= start[0]);\n }\n\n /**\n * Selects word at the current mouse event coordinates.\n * @param event The mouse event.\n */\n private _selectWordAtCursor(event: MouseEvent, allowWhitespaceOnlySelection: boolean): boolean {\n // Check if there is a link under the cursor first and select that if so\n const range = this._linkifier.currentLink?.link?.range;\n if (range) {\n this._model.selectionStart = [range.start.x - 1, range.start.y - 1];\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n this._model.selectionEnd = undefined;\n return true;\n }\n\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._selectWordAt(coords, allowWhitespaceOnlySelection);\n this._model.selectionEnd = undefined;\n return true;\n }\n return false;\n }\n\n /**\n * Selects all text within the terminal.\n */\n public selectAll(): void {\n this._model.isSelectAllActive = true;\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n public selectLines(start: number, end: number): void {\n this._model.clearSelection();\n start = Math.max(start, 0);\n end = Math.min(end, this._bufferService.buffer.lines.length - 1);\n this._model.selectionStart = [0, start];\n this._model.selectionEnd = [this._bufferService.cols, end];\n this.refresh();\n this._onSelectionChange.fire();\n }\n\n /**\n * Handle the buffer being trimmed, adjust the selection position.\n * @param amount The amount the buffer is being trimmed.\n */\n private _handleTrim(amount: number): void {\n const needsRefresh = this._model.handleTrim(amount);\n if (needsRefresh) {\n this.refresh();\n }\n }\n\n /**\n * Gets the 0-based [x, y] buffer coordinates of the current mouse event.\n * @param event The mouse event.\n */\n private _getMouseBufferCoords(event: MouseEvent): [number, number] | undefined {\n const coords = this._mouseService.getCoords(event, this._screenElement, this._bufferService.cols, this._bufferService.rows, true);\n if (!coords) {\n return undefined;\n }\n\n // Convert to 0-based\n coords[0]--;\n coords[1]--;\n\n // Convert viewport coords to buffer coords\n coords[1] += this._bufferService.buffer.ydisp;\n return coords;\n }\n\n /**\n * Gets the amount the viewport should be scrolled based on how far out of the\n * terminal the mouse is.\n * @param event The mouse event.\n */\n private _getMouseEventScrollAmount(event: MouseEvent): number {\n let offset = getCoordsRelativeToElement(this._coreBrowserService.window, event, this._screenElement)[1];\n const terminalHeight = this._renderService.dimensions.css.canvas.height;\n if (offset >= 0 && offset <= terminalHeight) {\n return 0;\n }\n if (offset > terminalHeight) {\n offset -= terminalHeight;\n }\n\n offset = Math.min(Math.max(offset, -DRAG_SCROLL_MAX_THRESHOLD), DRAG_SCROLL_MAX_THRESHOLD);\n offset /= DRAG_SCROLL_MAX_THRESHOLD;\n return (offset / Math.abs(offset)) + Math.round(offset * (DRAG_SCROLL_MAX_SPEED - 1));\n }\n\n /**\n * Returns whether the selection manager should force selection, regardless of\n * whether the terminal is in mouse events mode.\n * @param event The mouse event.\n */\n public shouldForceSelection(event: MouseEvent): boolean {\n if (Browser.isMac) {\n return event.altKey && this._optionsService.rawOptions.macOptionClickForcesSelection;\n }\n\n return event.shiftKey;\n }\n\n /**\n * Handles te mousedown event, setting up for a new selection.\n * @param event The mousedown event.\n */\n public handleMouseDown(event: MouseEvent): void {\n this._mouseDownTimeStamp = event.timeStamp;\n // If we have selection, we want the context menu on right click even if the\n // terminal is in mouse mode.\n if (event.button === 2 && this.hasSelection) {\n return;\n }\n\n // Only action the primary button\n if (event.button !== 0) {\n return;\n }\n\n // Allow selection when using a specific modifier key, even when disabled\n if (!this._enabled) {\n if (!this.shouldForceSelection(event)) {\n return;\n }\n\n // Don't send the mouse down event to the current process, we want to select\n event.stopPropagation();\n }\n\n // Tell the browser not to start a regular selection\n event.preventDefault();\n\n // Reset drag scroll state\n this._dragScrollAmount = 0;\n\n if (this._enabled && event.shiftKey) {\n this._handleIncrementalClick(event);\n } else {\n if (event.detail === 1) {\n this._handleSingleClick(event);\n } else if (event.detail === 2) {\n this._handleDoubleClick(event);\n } else if (event.detail === 3) {\n this._handleTripleClick(event);\n }\n }\n\n this._addMouseDownListeners();\n this.refresh(true);\n }\n\n /**\n * Adds listeners when mousedown is triggered.\n */\n private _addMouseDownListeners(): void {\n // Listen on the document so that dragging outside of viewport works\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.addEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.addEventListener('mouseup', this._mouseUpListener);\n }\n this._dragScrollIntervalTimer = this._coreBrowserService.window.setInterval(() => this._dragScroll(), DRAG_SCROLL_INTERVAL);\n }\n\n /**\n * Removes the listeners that are registered when mousedown is triggered.\n */\n private _removeMouseDownListeners(): void {\n if (this._screenElement.ownerDocument) {\n this._screenElement.ownerDocument.removeEventListener('mousemove', this._mouseMoveListener);\n this._screenElement.ownerDocument.removeEventListener('mouseup', this._mouseUpListener);\n }\n this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer);\n this._dragScrollIntervalTimer = undefined;\n }\n\n /**\n * Performs an incremental click, setting the selection end position to the mouse\n * position.\n * @param event The mouse event.\n */\n private _handleIncrementalClick(event: MouseEvent): void {\n if (this._model.selectionStart) {\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n }\n }\n\n /**\n * Performs a single click, resetting relevant state and setting the selection\n * start position.\n * @param event The mouse event.\n */\n private _handleSingleClick(event: MouseEvent): void {\n this._model.selectionStartLength = 0;\n this._model.isSelectAllActive = false;\n this._activeSelectionMode = this.shouldColumnSelect(event) ? SelectionMode.COLUMN : SelectionMode.NORMAL;\n\n // Initialize the new selection\n this._model.selectionStart = this._getMouseBufferCoords(event);\n if (!this._model.selectionStart) {\n return;\n }\n this._model.selectionEnd = undefined;\n\n // Ensure the line exists\n const line = this._bufferService.buffer.lines.get(this._model.selectionStart[1]);\n if (!line) {\n return;\n }\n\n // Return early if the click event is not in the buffer (eg. in scroll bar)\n if (line.length === this._model.selectionStart[0]) {\n return;\n }\n\n // If the mouse is over the second half of a wide character, adjust the\n // selection to cover the whole character\n if (line.hasWidth(this._model.selectionStart[0]) === 0) {\n this._model.selectionStart[0]++;\n }\n }\n\n /**\n * Performs a double click, selecting the current word.\n * @param event The mouse event.\n */\n private _handleDoubleClick(event: MouseEvent): void {\n if (this._selectWordAtCursor(event, true)) {\n this._activeSelectionMode = SelectionMode.WORD;\n }\n }\n\n /**\n * Performs a triple click, selecting the current line and activating line\n * select mode.\n * @param event The mouse event.\n */\n private _handleTripleClick(event: MouseEvent): void {\n const coords = this._getMouseBufferCoords(event);\n if (coords) {\n this._activeSelectionMode = SelectionMode.LINE;\n this._selectLineAt(coords[1]);\n }\n }\n\n /**\n * Returns whether the selection manager should operate in column select mode\n * @param event the mouse or keyboard event\n */\n public shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean {\n return event.altKey && !(Browser.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);\n }\n\n /**\n * Handles the mousemove event when the mouse button is down, recording the\n * end of the selection and refreshing the selection.\n * @param event The mousemove event.\n */\n private _handleMouseMove(event: MouseEvent): void {\n // If the mousemove listener is active it means that a selection is\n // currently being made, we should stop propagation to prevent mouse events\n // to be sent to the pty.\n event.stopImmediatePropagation();\n\n // Do nothing if there is no selection start, this can happen if the first\n // click in the terminal is an incremental click\n if (!this._model.selectionStart) {\n return;\n }\n\n // Record the previous position so we know whether to redraw the selection\n // at the end.\n const previousSelectionEnd = this._model.selectionEnd ? [this._model.selectionEnd[0], this._model.selectionEnd[1]] : null;\n\n // Set the initial selection end based on the mouse coordinates\n this._model.selectionEnd = this._getMouseBufferCoords(event);\n if (!this._model.selectionEnd) {\n this.refresh(true);\n return;\n }\n\n // Select the entire line if line select mode is active.\n if (this._activeSelectionMode === SelectionMode.LINE) {\n if (this._model.selectionEnd[1] < this._model.selectionStart[1]) {\n this._model.selectionEnd[0] = 0;\n } else {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n } else if (this._activeSelectionMode === SelectionMode.WORD) {\n this._selectToWordAt(this._model.selectionEnd);\n }\n\n // Determine the amount of scrolling that will happen.\n this._dragScrollAmount = this._getMouseEventScrollAmount(event);\n\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n if (this._dragScrollAmount > 0) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n } else if (this._dragScrollAmount < 0) {\n this._model.selectionEnd[0] = 0;\n }\n }\n\n // If the character is a wide character include the cell to the right in the\n // selection. Note that selections at the very end of the line will never\n // have a character.\n const buffer = this._bufferService.buffer;\n if (this._model.selectionEnd[1] < buffer.lines.length) {\n const line = buffer.lines.get(this._model.selectionEnd[1]);\n if (line && line.hasWidth(this._model.selectionEnd[0]) === 0) {\n this._model.selectionEnd[0]++;\n }\n }\n\n // Only draw here if the selection changes.\n if (!previousSelectionEnd ||\n previousSelectionEnd[0] !== this._model.selectionEnd[0] ||\n previousSelectionEnd[1] !== this._model.selectionEnd[1]) {\n this.refresh(true);\n }\n }\n\n /**\n * The callback that occurs every DRAG_SCROLL_INTERVAL ms that does the\n * scrolling of the viewport.\n */\n private _dragScroll(): void {\n if (!this._model.selectionEnd || !this._model.selectionStart) {\n return;\n }\n if (this._dragScrollAmount) {\n this._onRequestScrollLines.fire({ amount: this._dragScrollAmount, suppressScrollEvent: false });\n // Re-evaluate selection\n // If the cursor was above or below the viewport, make sure it's at the\n // start or end of the viewport respectively. This should only happen when\n // NOT in column select mode.\n const buffer = this._bufferService.buffer;\n if (this._dragScrollAmount > 0) {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = this._bufferService.cols;\n }\n this._model.selectionEnd[1] = Math.min(buffer.ydisp + this._bufferService.rows, buffer.lines.length - 1);\n } else {\n if (this._activeSelectionMode !== SelectionMode.COLUMN) {\n this._model.selectionEnd[0] = 0;\n }\n this._model.selectionEnd[1] = buffer.ydisp;\n }\n this.refresh();\n }\n }\n\n /**\n * Handles the mouseup event, removing the mousedown listeners.\n * @param event The mouseup event.\n */\n private _handleMouseUp(event: MouseEvent): void {\n const timeElapsed = event.timeStamp - this._mouseDownTimeStamp;\n\n this._removeMouseDownListeners();\n\n if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME && event.altKey && this._optionsService.rawOptions.altClickMovesCursor) {\n if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {\n const coordinates = this._mouseService.getCoords(\n event,\n this._element,\n this._bufferService.cols,\n this._bufferService.rows,\n false\n );\n if (coordinates && coordinates[0] !== undefined && coordinates[1] !== undefined) {\n const sequence = moveToCellSequence(coordinates[0] - 1, coordinates[1] - 1, this._bufferService, this._coreService.decPrivateModes.applicationCursorKeys);\n this._coreService.triggerDataEvent(sequence, true);\n }\n }\n } else {\n this._fireEventIfSelectionChanged();\n }\n }\n\n private _fireEventIfSelectionChanged(): void {\n const start = this._model.finalSelectionStart;\n const end = this._model.finalSelectionEnd;\n const hasSelection = !!start && !!end && (start[0] !== end[0] || start[1] !== end[1]);\n\n if (!hasSelection) {\n if (this._oldHasSelection) {\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n return;\n }\n\n // Sanity check, these should not be undefined as there is a selection\n if (!start || !end) {\n return;\n }\n\n if (!this._oldSelectionStart || !this._oldSelectionEnd || (\n start[0] !== this._oldSelectionStart[0] || start[1] !== this._oldSelectionStart[1] ||\n end[0] !== this._oldSelectionEnd[0] || end[1] !== this._oldSelectionEnd[1])) {\n\n this._fireOnSelectionChange(start, end, hasSelection);\n }\n }\n\n private _fireOnSelectionChange(start: [number, number] | undefined, end: [number, number] | undefined, hasSelection: boolean): void {\n this._oldSelectionStart = start;\n this._oldSelectionEnd = end;\n this._oldHasSelection = hasSelection;\n this._onSelectionChange.fire();\n }\n\n private _handleBufferActivate(e: {activeBuffer: IBuffer, inactiveBuffer: IBuffer}): void {\n this.clearSelection();\n // Only adjust the selection on trim, shiftElements is rarely used (only in\n // reverseIndex) and delete in a splice is only ever used when the same\n // number of elements was just added. Given this is could actually be\n // beneficial to leave the selection as is for these cases.\n this._trimListener.dispose();\n this._trimListener = e.activeBuffer.lines.onTrim(amount => this._handleTrim(amount));\n }\n\n /**\n * Converts a viewport column (0 to cols - 1) to the character index on the\n * buffer line, the latter takes into account wide and null characters.\n * @param bufferLine The buffer line to use.\n * @param x The x index in the buffer line to convert.\n */\n private _convertViewportColToCharacterIndex(bufferLine: IBufferLine, x: number): number {\n let charIndex = x;\n for (let i = 0; x >= i; i++) {\n const length = bufferLine.loadCell(i, this._workCell).getChars().length;\n if (this._workCell.getWidth() === 0) {\n // Wide characters aren't included in the line string so decrement the\n // index so the index is back on the wide character.\n charIndex--;\n } else if (length > 1 && x !== i) {\n // Emojis take up multiple characters, so adjust accordingly. For these\n // we don't want ot include the character at the column as we're\n // returning the start index in the string, not the end index.\n charIndex += length - 1;\n }\n }\n return charIndex;\n }\n\n public setSelection(col: number, row: number, length: number): void {\n this._model.clearSelection();\n this._removeMouseDownListeners();\n this._model.selectionStart = [col, row];\n this._model.selectionStartLength = length;\n this.refresh();\n this._fireEventIfSelectionChanged();\n }\n\n public rightClickSelect(ev: MouseEvent): void {\n if (!this._isClickInSelection(ev)) {\n if (this._selectWordAtCursor(ev, false)) {\n this.refresh(true);\n }\n this._fireEventIfSelectionChanged();\n }\n }\n\n /**\n * Gets positional information for the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _getWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean, followWrappedLinesAbove: boolean = true, followWrappedLinesBelow: boolean = true): IWordPosition | undefined {\n // Ensure coords are within viewport (eg. not within scroll bar)\n if (coords[0] >= this._bufferService.cols) {\n return undefined;\n }\n\n const buffer = this._bufferService.buffer;\n const bufferLine = buffer.lines.get(coords[1]);\n if (!bufferLine) {\n return undefined;\n }\n\n const line = buffer.translateBufferLineToString(coords[1], false);\n\n // Get actual index, taking into consideration wide characters\n let startIndex = this._convertViewportColToCharacterIndex(bufferLine, coords[0]);\n let endIndex = startIndex;\n\n // Record offset to be used later\n const charOffset = coords[0] - startIndex;\n let leftWideCharCount = 0;\n let rightWideCharCount = 0;\n let leftLongCharOffset = 0;\n let rightLongCharOffset = 0;\n\n if (line.charAt(startIndex) === ' ') {\n // Expand until non-whitespace is hit\n while (startIndex > 0 && line.charAt(startIndex - 1) === ' ') {\n startIndex--;\n }\n while (endIndex < line.length && line.charAt(endIndex + 1) === ' ') {\n endIndex++;\n }\n } else {\n // Expand until whitespace is hit. This algorithm works by scanning left\n // and right from the starting position, keeping both the index format\n // (line) and the column format (bufferLine) in sync. When a wide\n // character is hit, it is recorded and the column index is adjusted.\n let startCol = coords[0];\n let endCol = coords[0];\n\n // Consider the initial position, skip it and increment the wide char\n // variable\n if (bufferLine.getWidth(startCol) === 0) {\n leftWideCharCount++;\n startCol--;\n }\n if (bufferLine.getWidth(endCol) === 2) {\n rightWideCharCount++;\n endCol++;\n }\n\n // Adjust the end index for characters whose length are > 1 (emojis)\n const length = bufferLine.getString(endCol).length;\n if (length > 1) {\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n\n // Expand the string in both directions until a space is hit\n while (startCol > 0 && startIndex > 0 && !this._isCharWordSeparator(bufferLine.loadCell(startCol - 1, this._workCell))) {\n bufferLine.loadCell(startCol - 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 0) {\n // If the next character is a wide char, record it and skip the column\n leftWideCharCount++;\n startCol--;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n leftLongCharOffset += length - 1;\n startIndex -= length - 1;\n }\n startIndex--;\n startCol--;\n }\n while (endCol < bufferLine.length && endIndex + 1 < line.length && !this._isCharWordSeparator(bufferLine.loadCell(endCol + 1, this._workCell))) {\n bufferLine.loadCell(endCol + 1, this._workCell);\n const length = this._workCell.getChars().length;\n if (this._workCell.getWidth() === 2) {\n // If the next character is a wide char, record it and skip the column\n rightWideCharCount++;\n endCol++;\n } else if (length > 1) {\n // If the next character's string is longer than 1 char (eg. emoji),\n // adjust the index\n rightLongCharOffset += length - 1;\n endIndex += length - 1;\n }\n endIndex++;\n endCol++;\n }\n }\n\n // Incremenet the end index so it is at the start of the next character\n endIndex++;\n\n // Calculate the start _column_, converting the the string indexes back to\n // column coordinates.\n let start =\n startIndex // The index of the selection's start char in the line string\n + charOffset // The difference between the initial char's column and index\n - leftWideCharCount // The number of wide chars left of the initial char\n + leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n\n // Calculate the length in _columns_, converting the the string indexes back\n // to column coordinates.\n let length = Math.min(this._bufferService.cols, // Disallow lengths larger than the terminal cols\n endIndex // The index of the selection's end char in the line string\n - startIndex // The index of the selection's start char in the line string\n + leftWideCharCount // The number of wide chars left of the initial char\n + rightWideCharCount // The number of wide chars right of the initial char (inclusive)\n - leftLongCharOffset // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)\n - rightLongCharOffset); // The number of additional chars right of the initial char (inclusive) added by columns with strings longer than 1 (emojis)\n\n if (!allowWhitespaceOnlySelection && line.slice(startIndex, endIndex).trim() === '') {\n return undefined;\n }\n\n // Recurse upwards if the line is wrapped and the word wraps to the above line\n if (followWrappedLinesAbove) {\n if (start === 0 && bufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const previousBufferLine = buffer.lines.get(coords[1] - 1);\n if (previousBufferLine && bufferLine.isWrapped && previousBufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const previousLineWordPosition = this._getWordAt([this._bufferService.cols - 1, coords[1] - 1], false, true, false);\n if (previousLineWordPosition) {\n const offset = this._bufferService.cols - previousLineWordPosition.start;\n start -= offset;\n length += offset;\n }\n }\n }\n }\n\n // Recurse downwards if the line is wrapped and the word wraps to the next line\n if (followWrappedLinesBelow) {\n if (start + length === this._bufferService.cols && bufferLine.getCodePoint(this._bufferService.cols - 1) !== 32 /* ' ' */) {\n const nextBufferLine = buffer.lines.get(coords[1] + 1);\n if (nextBufferLine?.isWrapped && nextBufferLine.getCodePoint(0) !== 32 /* ' ' */) {\n const nextLineWordPosition = this._getWordAt([0, coords[1] + 1], false, false, true);\n if (nextLineWordPosition) {\n length += nextLineWordPosition.length;\n }\n }\n }\n }\n\n return { start, length };\n }\n\n /**\n * Selects the word at the coordinates specified.\n * @param coords The coordinates to get the word at.\n * @param allowWhitespaceOnlySelection If whitespace should be selected\n */\n protected _selectWordAt(coords: [number, number], allowWhitespaceOnlySelection: boolean): void {\n const wordPosition = this._getWordAt(coords, allowWhitespaceOnlySelection);\n if (wordPosition) {\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n coords[1]--;\n }\n this._model.selectionStart = [wordPosition.start, coords[1]];\n this._model.selectionStartLength = wordPosition.length;\n }\n }\n\n /**\n * Sets the selection end to the word at the coordinated specified.\n * @param coords The coordinates to get the word at.\n */\n private _selectToWordAt(coords: [number, number]): void {\n const wordPosition = this._getWordAt(coords, true);\n if (wordPosition) {\n let endRow = coords[1];\n\n // Adjust negative start value\n while (wordPosition.start < 0) {\n wordPosition.start += this._bufferService.cols;\n endRow--;\n }\n\n // Adjust wrapped length value, this only needs to happen when values are reversed as in that\n // case we're interested in the start of the word, not the end\n if (!this._model.areSelectionValuesReversed()) {\n while (wordPosition.start + wordPosition.length > this._bufferService.cols) {\n wordPosition.length -= this._bufferService.cols;\n endRow++;\n }\n }\n\n this._model.selectionEnd = [this._model.areSelectionValuesReversed() ? wordPosition.start : wordPosition.start + wordPosition.length, endRow];\n }\n }\n\n /**\n * Gets whether the character is considered a word separator by the select\n * word logic.\n * @param cell The cell to check.\n */\n private _isCharWordSeparator(cell: CellData): boolean {\n // Zero width characters are never separators as they are always to the\n // right of wide characters\n if (cell.getWidth() === 0) {\n return false;\n }\n return this._optionsService.rawOptions.wordSeparator.indexOf(cell.getChars()) >= 0;\n }\n\n /**\n * Selects the line specified.\n * @param line The line index.\n */\n protected _selectLineAt(line: number): void {\n const wrappedRange = this._bufferService.buffer.getWrappedRangeForLine(line);\n const range: IBufferRange = {\n start: { x: 0, y: wrappedRange.first },\n end: { x: this._bufferService.cols - 1, y: wrappedRange.last }\n };\n this._model.selectionStart = [0, wrappedRange.first];\n this._model.selectionEnd = undefined;\n this._model.selectionStartLength = getRangeLength(range, this._bufferService.cols);\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent } from 'common/EventEmitter';\nimport { IRenderDimensions, IRenderer } from 'browser/renderer/shared/Types';\nimport { IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { ISelectionRedrawRequestEvent as ISelectionRequestRedrawEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { ColorIndex, IDisposable } from 'common/Types';\nimport { ITheme } from 'common/services/Services';\n\nexport const ICharSizeService = createDecorator<ICharSizeService>('CharSizeService');\nexport interface ICharSizeService {\n serviceBrand: undefined;\n\n readonly width: number;\n readonly height: number;\n readonly hasValidSize: boolean;\n\n readonly onCharSizeChange: IEvent<void>;\n\n measure(): void;\n}\n\nexport const ICoreBrowserService = createDecorator<ICoreBrowserService>('CoreBrowserService');\nexport interface ICoreBrowserService {\n serviceBrand: undefined;\n\n readonly isFocused: boolean;\n /**\n * Parent window that the terminal is rendered into. DOM and rendering APIs\n * (e.g. requestAnimationFrame) should be invoked in the context of this\n * window.\n */\n readonly window: Window & typeof globalThis;\n /**\n * Helper for getting the devicePixelRatio of the parent window.\n */\n readonly dpr: number;\n}\n\nexport const IMouseService = createDecorator<IMouseService>('MouseService');\nexport interface IMouseService {\n serviceBrand: undefined;\n\n getCoords(event: {clientX: number, clientY: number}, element: HTMLElement, colCount: number, rowCount: number, isSelection?: boolean): [number, number] | undefined;\n getMouseReportCoords(event: MouseEvent, element: HTMLElement): { col: number, row: number, x: number, y: number } | undefined;\n}\n\nexport const IRenderService = createDecorator<IRenderService>('RenderService');\nexport interface IRenderService extends IDisposable {\n serviceBrand: undefined;\n\n onDimensionsChange: IEvent<IRenderDimensions>;\n /**\n * Fires when buffer changes are rendered. This does not fire when only cursor\n * or selections are rendered.\n */\n onRenderedViewportChange: IEvent<{ start: number, end: number }>;\n /**\n * Fires on render\n */\n onRender: IEvent<{ start: number, end: number }>;\n onRefreshRequest: IEvent<{ start: number, end: number }>;\n\n dimensions: IRenderDimensions;\n\n addRefreshCallback(callback: FrameRequestCallback): number;\n\n refreshRows(start: number, end: number): void;\n clearTextureAtlas(): void;\n resize(cols: number, rows: number): void;\n hasRenderer(): boolean;\n setRenderer(renderer: IRenderer): void;\n handleDevicePixelRatioChange(): void;\n handleResize(cols: number, rows: number): void;\n handleCharSizeChanged(): void;\n handleBlur(): void;\n handleFocus(): void;\n handleSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;\n handleCursorMove(): void;\n clear(): void;\n}\n\nexport const ISelectionService = createDecorator<ISelectionService>('SelectionService');\nexport interface ISelectionService {\n serviceBrand: undefined;\n\n readonly selectionText: string;\n readonly hasSelection: boolean;\n readonly selectionStart: [number, number] | undefined;\n readonly selectionEnd: [number, number] | undefined;\n\n readonly onLinuxMouseSelection: IEvent<string>;\n readonly onRequestRedraw: IEvent<ISelectionRequestRedrawEvent>;\n readonly onRequestScrollLines: IEvent<ISelectionRequestScrollLinesEvent>;\n readonly onSelectionChange: IEvent<void>;\n\n disable(): void;\n enable(): void;\n reset(): void;\n setSelection(row: number, col: number, length: number): void;\n selectAll(): void;\n selectLines(start: number, end: number): void;\n clearSelection(): void;\n rightClickSelect(event: MouseEvent): void;\n shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean;\n shouldForceSelection(event: MouseEvent): boolean;\n refresh(isLinuxMouseSelection?: boolean): void;\n handleMouseDown(event: MouseEvent): void;\n isCellInSelection(x: number, y: number): boolean;\n}\n\nexport const ICharacterJoinerService = createDecorator<ICharacterJoinerService>('CharacterJoinerService');\nexport interface ICharacterJoinerService {\n serviceBrand: undefined;\n\n register(handler: (text: string) => [number, number][]): number;\n deregister(joinerId: number): boolean;\n getJoinedCharacters(row: number): [number, number][];\n}\n\nexport const IThemeService = createDecorator<IThemeService>('ThemeService');\nexport interface IThemeService {\n serviceBrand: undefined;\n\n readonly colors: ReadonlyColorSet;\n\n readonly onChangeColors: IEvent<ReadonlyColorSet>;\n\n restoreColor(slot?: ColorIndex): void;\n /**\n * Allows external modifying of colors in the theme, this is used instead of {@link colors} to\n * prevent accidental writes.\n */\n modifyColors(callback: (colors: IColorSet) => void): void;\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ColorContrastCache } from 'browser/ColorContrastCache';\nimport { IThemeService } from 'browser/services/Services';\nimport { IColorContrastCache, IColorSet, ReadonlyColorSet } from 'browser/Types';\nimport { channels, color, css, NULL_COLOR } from 'common/Color';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IOptionsService, ITheme } from 'common/services/Services';\nimport { ColorIndex, IColor } from 'common/Types';\n\ninterface IRestoreColorSet {\n foreground: IColor;\n background: IColor;\n cursor: IColor;\n ansi: IColor[];\n}\n\n\nconst DEFAULT_FOREGROUND = css.toColor('#ffffff');\nconst DEFAULT_BACKGROUND = css.toColor('#000000');\nconst DEFAULT_CURSOR = css.toColor('#ffffff');\nconst DEFAULT_CURSOR_ACCENT = css.toColor('#000000');\nconst DEFAULT_SELECTION = {\n css: 'rgba(255, 255, 255, 0.3)',\n rgba: 0xFFFFFF4D\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\nexport class ThemeService extends Disposable implements IThemeService {\n public serviceBrand: undefined;\n\n private _colors: IColorSet;\n private _contrastCache: IColorContrastCache;\n private _restoreColors!: IRestoreColorSet;\n\n public get colors(): ReadonlyColorSet { return this._colors; }\n\n private readonly _onChangeColors = this.register(new EventEmitter<ReadonlyColorSet>());\n public readonly onChangeColors = this._onChangeColors.event;\n\n constructor(\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n\n this._contrastCache = new ColorContrastCache();\n this._colors = {\n foreground: DEFAULT_FOREGROUND,\n background: DEFAULT_BACKGROUND,\n cursor: DEFAULT_CURSOR,\n cursorAccent: DEFAULT_CURSOR_ACCENT,\n selectionForeground: undefined,\n selectionBackgroundTransparent: DEFAULT_SELECTION,\n selectionBackgroundOpaque: color.blend(DEFAULT_BACKGROUND, DEFAULT_SELECTION),\n selectionInactiveBackgroundTransparent: DEFAULT_SELECTION,\n selectionInactiveBackgroundOpaque: color.blend(DEFAULT_BACKGROUND, DEFAULT_SELECTION),\n ansi: DEFAULT_ANSI_COLORS.slice(),\n contrastCache: this._contrastCache\n };\n this._updateRestoreColors();\n this._setTheme(this._optionsService.rawOptions.theme);\n\n this.register(this._optionsService.onSpecificOptionChange('minimumContrastRatio', () => this._contrastCache.clear()));\n this.register(this._optionsService.onSpecificOptionChange('theme', () => this._setTheme(this._optionsService.rawOptions.theme)));\n }\n\n /**\n * Sets the terminal's theme.\n * @param theme The theme to use. If a partial theme is provided then default\n * colors will be used where colors are not defined.\n */\n private _setTheme(theme: ITheme = {}): void {\n const colors = this._colors;\n colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND);\n colors.background = parseColor(theme.background, DEFAULT_BACKGROUND);\n colors.cursor = parseColor(theme.cursor, DEFAULT_CURSOR);\n colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);\n colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION);\n colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent);\n colors.selectionInactiveBackgroundTransparent = parseColor(theme.selectionInactiveBackground, colors.selectionBackgroundTransparent);\n colors.selectionInactiveBackgroundOpaque = color.blend(colors.background, colors.selectionInactiveBackgroundTransparent);\n colors.selectionForeground = theme.selectionForeground ? parseColor(theme.selectionForeground, NULL_COLOR) : undefined;\n if (colors.selectionForeground === NULL_COLOR) {\n colors.selectionForeground = undefined;\n }\n\n /**\n * If selection color is opaque, blend it with background with 0.3 opacity\n * Issue #2737\n */\n if (color.isOpaque(colors.selectionBackgroundTransparent)) {\n const opacity = 0.3;\n colors.selectionBackgroundTransparent = color.opacity(colors.selectionBackgroundTransparent, opacity);\n }\n if (color.isOpaque(colors.selectionInactiveBackgroundTransparent)) {\n const opacity = 0.3;\n colors.selectionInactiveBackgroundTransparent = color.opacity(colors.selectionInactiveBackgroundTransparent, opacity);\n }\n colors.ansi = DEFAULT_ANSI_COLORS.slice();\n colors.ansi[0] = parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);\n colors.ansi[1] = parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);\n colors.ansi[2] = parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);\n colors.ansi[3] = parseColor(theme.yellow, DEFAULT_ANSI_COLORS[3]);\n colors.ansi[4] = parseColor(theme.blue, DEFAULT_ANSI_COLORS[4]);\n colors.ansi[5] = parseColor(theme.magenta, DEFAULT_ANSI_COLORS[5]);\n colors.ansi[6] = parseColor(theme.cyan, DEFAULT_ANSI_COLORS[6]);\n colors.ansi[7] = parseColor(theme.white, DEFAULT_ANSI_COLORS[7]);\n colors.ansi[8] = parseColor(theme.brightBlack, DEFAULT_ANSI_COLORS[8]);\n colors.ansi[9] = parseColor(theme.brightRed, DEFAULT_ANSI_COLORS[9]);\n colors.ansi[10] = parseColor(theme.brightGreen, DEFAULT_ANSI_COLORS[10]);\n colors.ansi[11] = parseColor(theme.brightYellow, DEFAULT_ANSI_COLORS[11]);\n colors.ansi[12] = parseColor(theme.brightBlue, DEFAULT_ANSI_COLORS[12]);\n colors.ansi[13] = parseColor(theme.brightMagenta, DEFAULT_ANSI_COLORS[13]);\n colors.ansi[14] = parseColor(theme.brightCyan, DEFAULT_ANSI_COLORS[14]);\n colors.ansi[15] = parseColor(theme.brightWhite, DEFAULT_ANSI_COLORS[15]);\n if (theme.extendedAnsi) {\n const colorCount = Math.min(colors.ansi.length - 16, theme.extendedAnsi.length);\n for (let i = 0; i < colorCount; i++) {\n colors.ansi[i + 16] = parseColor(theme.extendedAnsi[i], DEFAULT_ANSI_COLORS[i + 16]);\n }\n }\n // Clear our the cache\n this._contrastCache.clear();\n this._updateRestoreColors();\n this._onChangeColors.fire(this.colors);\n }\n\n public restoreColor(slot?: ColorIndex): void {\n this._restoreColor(slot);\n this._onChangeColors.fire(this.colors);\n }\n\n private _restoreColor(slot: ColorIndex | undefined): void {\n // unset slot restores all ansi colors\n if (slot === undefined) {\n for (let i = 0; i < this._restoreColors.ansi.length; ++i) {\n this._colors.ansi[i] = this._restoreColors.ansi[i];\n }\n return;\n }\n switch (slot) {\n case ColorIndex.FOREGROUND:\n this._colors.foreground = this._restoreColors.foreground;\n break;\n case ColorIndex.BACKGROUND:\n this._colors.background = this._restoreColors.background;\n break;\n case ColorIndex.CURSOR:\n this._colors.cursor = this._restoreColors.cursor;\n break;\n default:\n this._colors.ansi[slot] = this._restoreColors.ansi[slot];\n }\n }\n\n public modifyColors(callback: (colors: IColorSet) => void): void {\n callback(this._colors);\n // Assume the change happened\n this._onChangeColors.fire(this.colors);\n }\n\n private _updateRestoreColors(): void {\n this._restoreColors = {\n foreground: this._colors.foreground,\n background: this._colors.background,\n cursor: this._colors.cursor,\n ansi: this._colors.ansi.slice()\n };\n }\n}\n\nfunction parseColor(\n cssString: string | undefined,\n fallback: IColor\n): IColor {\n if (cssString !== undefined) {\n try {\n return css.toColor(cssString);\n } catch {\n // no-op\n }\n }\n return fallback;\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICircularList } from 'common/Types';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\n\nexport interface IInsertEvent {\n index: number;\n amount: number;\n}\n\nexport interface IDeleteEvent {\n index: number;\n amount: number;\n}\n\n/**\n * Represents a circular list; a list with a maximum size that wraps around when push is called,\n * overriding values at the start of the list.\n */\nexport class CircularList<T> extends Disposable implements ICircularList<T> {\n protected _array: (T | undefined)[];\n private _startIndex: number;\n private _length: number;\n\n public readonly onDeleteEmitter = this.register(new EventEmitter<IDeleteEvent>());\n public readonly onDelete = this.onDeleteEmitter.event;\n public readonly onInsertEmitter = this.register(new EventEmitter<IInsertEvent>());\n public readonly onInsert = this.onInsertEmitter.event;\n public readonly onTrimEmitter = this.register(new EventEmitter<number>());\n public readonly onTrim = this.onTrimEmitter.event;\n\n constructor(\n private _maxLength: number\n ) {\n super();\n this._array = new Array<T>(this._maxLength);\n this._startIndex = 0;\n this._length = 0;\n }\n\n public get maxLength(): number {\n return this._maxLength;\n }\n\n public set maxLength(newMaxLength: number) {\n // There was no change in maxLength, return early.\n if (this._maxLength === newMaxLength) {\n return;\n }\n\n // Reconstruct array, starting at index 0. Only transfer values from the\n // indexes 0 to length.\n const newArray = new Array<T | undefined>(newMaxLength);\n for (let i = 0; i < Math.min(newMaxLength, this.length); i++) {\n newArray[i] = this._array[this._getCyclicIndex(i)];\n }\n this._array = newArray;\n this._maxLength = newMaxLength;\n this._startIndex = 0;\n }\n\n public get length(): number {\n return this._length;\n }\n\n public set length(newLength: number) {\n if (newLength > this._length) {\n for (let i = this._length; i < newLength; i++) {\n this._array[i] = undefined;\n }\n }\n this._length = newLength;\n }\n\n /**\n * Gets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index of the value to get.\n * @returns The value corresponding to the index.\n */\n public get(index: number): T | undefined {\n return this._array[this._getCyclicIndex(index)];\n }\n\n /**\n * Sets the value at an index.\n *\n * Note that for performance reasons there is no bounds checking here, the index reference is\n * circular so this should always return a value and never throw.\n * @param index The index to set.\n * @param value The value to set.\n */\n public set(index: number, value: T | undefined): void {\n this._array[this._getCyclicIndex(index)] = value;\n }\n\n /**\n * Pushes a new value onto the list, wrapping around to the start of the array, overriding index 0\n * if the maximum length is reached.\n * @param value The value to push onto the list.\n */\n public push(value: T): void {\n this._array[this._getCyclicIndex(this._length)] = value;\n if (this._length === this._maxLength) {\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n } else {\n this._length++;\n }\n }\n\n /**\n * Advance ringbuffer index and return current element for recycling.\n * Note: The buffer must be full for this method to work.\n * @throws When the buffer is not full.\n */\n public recycle(): T {\n if (this._length !== this._maxLength) {\n throw new Error('Can only recycle when the buffer is full');\n }\n this._startIndex = ++this._startIndex % this._maxLength;\n this.onTrimEmitter.fire(1);\n return this._array[this._getCyclicIndex(this._length - 1)]!;\n }\n\n /**\n * Ringbuffer is at max length.\n */\n public get isFull(): boolean {\n return this._length === this._maxLength;\n }\n\n /**\n * Removes and returns the last value on the list.\n * @returns The popped value.\n */\n public pop(): T | undefined {\n return this._array[this._getCyclicIndex(this._length-- - 1)];\n }\n\n /**\n * Deletes and/or inserts items at a particular index (in that order). Unlike\n * Array.prototype.splice, this operation does not return the deleted items as a new array in\n * order to save creating a new array. Note that this operation may shift all values in the list\n * in the worst case.\n * @param start The index to delete and/or insert.\n * @param deleteCount The number of elements to delete.\n * @param items The items to insert.\n */\n public splice(start: number, deleteCount: number, ...items: T[]): void {\n // Delete items\n if (deleteCount) {\n for (let i = start; i < this._length - deleteCount; i++) {\n this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];\n }\n this._length -= deleteCount;\n this.onDeleteEmitter.fire({ index: start, amount: deleteCount });\n }\n\n // Add items\n for (let i = this._length - 1; i >= start; i--) {\n this._array[this._getCyclicIndex(i + items.length)] = this._array[this._getCyclicIndex(i)];\n }\n for (let i = 0; i < items.length; i++) {\n this._array[this._getCyclicIndex(start + i)] = items[i];\n }\n if (items.length) {\n this.onInsertEmitter.fire({ index: start, amount: items.length });\n }\n\n // Adjust length as needed\n if (this._length + items.length > this._maxLength) {\n const countToTrim = (this._length + items.length) - this._maxLength;\n this._startIndex += countToTrim;\n this._length = this._maxLength;\n this.onTrimEmitter.fire(countToTrim);\n } else {\n this._length += items.length;\n }\n }\n\n /**\n * Trims a number of items from the start of the list.\n * @param count The number of items to remove.\n */\n public trimStart(count: number): void {\n if (count > this._length) {\n count = this._length;\n }\n this._startIndex += count;\n this._length -= count;\n this.onTrimEmitter.fire(count);\n }\n\n public shiftElements(start: number, count: number, offset: number): void {\n if (count <= 0) {\n return;\n }\n if (start < 0 || start >= this._length) {\n throw new Error('start argument out of range');\n }\n if (start + offset < 0) {\n throw new Error('Cannot shift elements in list beyond index 0');\n }\n\n if (offset > 0) {\n for (let i = count - 1; i >= 0; i--) {\n this.set(start + i + offset, this.get(start + i));\n }\n const expandListBy = (start + count + offset) - this._length;\n if (expandListBy > 0) {\n this._length += expandListBy;\n while (this._length > this._maxLength) {\n this._length--;\n this._startIndex++;\n this.onTrimEmitter.fire(1);\n }\n }\n } else {\n for (let i = 0; i < count; i++) {\n this.set(start + i + offset, this.get(start + i));\n }\n }\n }\n\n /**\n * Gets the cyclic index for the specified regular index. The cyclic index can then be used on the\n * backing array to get the element associated with the regular index.\n * @param index The regular index.\n * @returns The cyclic index.\n */\n private _getCyclicIndex(index: number): number {\n return (this._startIndex + index) % this._maxLength;\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/*\n * A simple utility for cloning values\n */\nexport function clone<T>(val: T, depth: number = 5): T {\n if (typeof val !== 'object') {\n return val;\n }\n\n // If we're cloning an array, use an array as the base, otherwise use an object\n const clonedObject: any = Array.isArray(val) ? [] : {};\n\n for (const key in val) {\n // Recursively clone eack item unless we're at the maximum depth\n clonedObject[key] = depth <= 1 ? val[key] : (val[key] && clone(val[key], depth - 1));\n }\n\n return clonedObject as T;\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isNode } from 'common/Platform';\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\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 rgba.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', '#rrggbbaa').\n */\nexport namespace css {\n let $ctx: CanvasRenderingContext2D | undefined;\n let $litmusColor: CanvasGradient | undefined;\n if (!isNode) {\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\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 rgba.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 rgba.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 rgba.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 /**\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 // FIXME: Move this to channels NS?\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 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\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","/**\n * Copyright (c) 2014-2020 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n *\n * Originally forked from (with the author's permission):\n * Fabrice Bellard's javascript vt100 for jslinux:\n * http://bellard.org/jslinux/\n * Copyright (c) 2011 Fabrice Bellard\n * The original design remains. The terminal itself\n * has been extended to include xterm CSI codes, among\n * other features.\n *\n * Terminal Emulation References:\n * http://vt100.net/\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.txt\n * http://invisible-island.net/xterm/ctlseqs/ctlseqs.html\n * http://invisible-island.net/vttest/\n * http://www.inwap.com/pdp10/ansicode.txt\n * http://linux.die.net/man/4/console_codes\n * http://linux.die.net/man/7/urxvt\n */\n\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IInstantiationService, IOptionsService, IBufferService, ILogService, ICharsetService, ICoreService, ICoreMouseService, IUnicodeService, LogLevelEnum, ITerminalOptions, IOscLinkService } from 'common/services/Services';\nimport { InstantiationService } from 'common/services/InstantiationService';\nimport { LogService } from 'common/services/LogService';\nimport { BufferService, MINIMUM_COLS, MINIMUM_ROWS } from 'common/services/BufferService';\nimport { OptionsService } from 'common/services/OptionsService';\nimport { IDisposable, IAttributeData, ICoreTerminal, IScrollEvent, ScrollSource } from 'common/Types';\nimport { CoreService } from 'common/services/CoreService';\nimport { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';\nimport { CoreMouseService } from 'common/services/CoreMouseService';\nimport { UnicodeService } from 'common/services/UnicodeService';\nimport { CharsetService } from 'common/services/CharsetService';\nimport { updateWindowsModeWrappedState } from 'common/WindowsMode';\nimport { IFunctionIdentifier, IParams } from 'common/parser/Types';\nimport { IBufferSet } from 'common/buffer/Types';\nimport { InputHandler } from 'common/InputHandler';\nimport { WriteBuffer } from 'common/input/WriteBuffer';\nimport { OscLinkService } from 'common/services/OscLinkService';\n\n// Only trigger this warning a single time per session\nlet hasWriteSyncWarnHappened = false;\n\nexport abstract class CoreTerminal extends Disposable implements ICoreTerminal {\n protected readonly _instantiationService: IInstantiationService;\n protected readonly _bufferService: IBufferService;\n protected readonly _logService: ILogService;\n protected readonly _charsetService: ICharsetService;\n protected readonly _oscLinkService: IOscLinkService;\n\n public readonly coreMouseService: ICoreMouseService;\n public readonly coreService: ICoreService;\n public readonly unicodeService: IUnicodeService;\n public readonly optionsService: IOptionsService;\n\n protected _inputHandler: InputHandler;\n private _writeBuffer: WriteBuffer;\n private _windowsMode: IDisposable | undefined;\n\n private readonly _onBinary = this.register(new EventEmitter<string>());\n public readonly onBinary = this._onBinary.event;\n private readonly _onData = this.register(new EventEmitter<string>());\n public readonly onData = this._onData.event;\n protected _onLineFeed = this.register(new EventEmitter<void>());\n public readonly onLineFeed = this._onLineFeed.event;\n private readonly _onResize = this.register(new EventEmitter<{ cols: number, rows: number }>());\n public readonly onResize = this._onResize.event;\n protected readonly _onWriteParsed = this.register(new EventEmitter<void>());\n public readonly onWriteParsed = this._onWriteParsed.event;\n\n /**\n * Internally we track the source of the scroll but this is meaningless outside the library so\n * it's filtered out.\n */\n protected _onScrollApi?: EventEmitter<number, void>;\n protected _onScroll = this.register(new EventEmitter<IScrollEvent, void>());\n public get onScroll(): IEvent<number, void> {\n if (!this._onScrollApi) {\n this._onScrollApi = this.register(new EventEmitter<number, void>());\n this._onScroll.event(ev => {\n this._onScrollApi?.fire(ev.position);\n });\n }\n return this._onScrollApi.event;\n }\n\n public get cols(): number { return this._bufferService.cols; }\n public get rows(): number { return this._bufferService.rows; }\n public get buffers(): IBufferSet { return this._bufferService.buffers; }\n public get options(): Required<ITerminalOptions> { return this.optionsService.options; }\n public set options(options: ITerminalOptions) {\n for (const key in options) {\n this.optionsService.options[key] = options[key];\n }\n }\n\n constructor(\n options: Partial<ITerminalOptions>\n ) {\n super();\n\n // Setup and initialize services\n this._instantiationService = new InstantiationService();\n this.optionsService = this.register(new OptionsService(options));\n this._instantiationService.setService(IOptionsService, this.optionsService);\n this._bufferService = this.register(this._instantiationService.createInstance(BufferService));\n this._instantiationService.setService(IBufferService, this._bufferService);\n this._logService = this.register(this._instantiationService.createInstance(LogService));\n this._instantiationService.setService(ILogService, this._logService);\n this.coreService = this.register(this._instantiationService.createInstance(CoreService));\n this._instantiationService.setService(ICoreService, this.coreService);\n this.coreMouseService = this.register(this._instantiationService.createInstance(CoreMouseService));\n this._instantiationService.setService(ICoreMouseService, this.coreMouseService);\n this.unicodeService = this.register(this._instantiationService.createInstance(UnicodeService));\n this._instantiationService.setService(IUnicodeService, this.unicodeService);\n this._charsetService = this._instantiationService.createInstance(CharsetService);\n this._instantiationService.setService(ICharsetService, this._charsetService);\n this._oscLinkService = this._instantiationService.createInstance(OscLinkService);\n this._instantiationService.setService(IOscLinkService, this._oscLinkService);\n\n // Register input handler and handle/forward events\n this._inputHandler = this.register(new InputHandler(this._bufferService, this._charsetService, this.coreService, this._logService, this.optionsService, this._oscLinkService, this.coreMouseService, this.unicodeService));\n this.register(forwardEvent(this._inputHandler.onLineFeed, this._onLineFeed));\n this.register(this._inputHandler);\n\n // Setup listeners\n this.register(forwardEvent(this._bufferService.onResize, this._onResize));\n this.register(forwardEvent(this.coreService.onData, this._onData));\n this.register(forwardEvent(this.coreService.onBinary, this._onBinary));\n this.register(this.coreService.onRequestScrollToBottom(() => this.scrollToBottom()));\n this.register(this.coreService.onUserInput(() => this._writeBuffer.handleUserInput()));\n this.register(this.optionsService.onSpecificOptionChange('windowsMode', e => this._handleWindowsModeOptionChange(e)));\n this.register(this._bufferService.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n this.register(this._inputHandler.onScroll(event => {\n this._onScroll.fire({ position: this._bufferService.buffer.ydisp, source: ScrollSource.TERMINAL });\n this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop, this._bufferService.buffer.scrollBottom);\n }));\n\n // Setup WriteBuffer\n this._writeBuffer = this.register(new WriteBuffer((data, promiseResult) => this._inputHandler.parse(data, promiseResult)));\n this.register(forwardEvent(this._writeBuffer.onWriteParsed, this._onWriteParsed));\n\n this.register(toDisposable(() => {\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }));\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._writeBuffer.write(data, callback);\n }\n\n /**\n * Write data to terminal synchonously.\n *\n * This method is unreliable with async parser handlers, thus should not\n * be used anymore. If you need blocking semantics on data input consider\n * `write` with a callback instead.\n *\n * @deprecated Unreliable, will be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n if (this._logService.logLevel <= LogLevelEnum.WARN && !hasWriteSyncWarnHappened) {\n this._logService.warn('writeSync is unreliable and will be removed soon.');\n hasWriteSyncWarnHappened = true;\n }\n this._writeBuffer.writeSync(data, maxSubsequentCalls);\n }\n\n public resize(x: number, y: number): void {\n if (isNaN(x) || isNaN(y)) {\n return;\n }\n\n x = Math.max(x, MINIMUM_COLS);\n y = Math.max(y, MINIMUM_ROWS);\n\n this._bufferService.resize(x, y);\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param eraseAttr The attribute data to use the for blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n this._bufferService.scroll(eraseAttr, isWrapped);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n this._bufferService.scrollLines(disp, suppressScrollEvent, source);\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this._bufferService.scrollPages(pageCount);\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this._bufferService.scrollToTop();\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this._bufferService.scrollToBottom();\n }\n\n public scrollToLine(line: number): void {\n this._bufferService.scrollToLine(line);\n }\n\n /** Add handler for ESC escape sequence. See xterm.d.ts for details. */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise<boolean>): IDisposable {\n return this._inputHandler.registerEscHandler(id, callback);\n }\n\n /** Add handler for DCS escape sequence. See xterm.d.ts for details. */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable {\n return this._inputHandler.registerDcsHandler(id, callback);\n }\n\n /** Add handler for CSI escape sequence. See xterm.d.ts for details. */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable {\n return this._inputHandler.registerCsiHandler(id, callback);\n }\n\n /** Add handler for OSC escape sequence. See xterm.d.ts for details. */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {\n return this._inputHandler.registerOscHandler(ident, callback);\n }\n\n protected _setup(): void {\n if (this.optionsService.rawOptions.windowsMode) {\n this._enableWindowsMode();\n }\n }\n\n public reset(): void {\n this._inputHandler.reset();\n this._bufferService.reset();\n this._charsetService.reset();\n this.coreService.reset();\n this.coreMouseService.reset();\n }\n\n private _handleWindowsModeOptionChange(value: boolean): void {\n if (value) {\n this._enableWindowsMode();\n } else {\n this._windowsMode?.dispose();\n this._windowsMode = undefined;\n }\n }\n\n protected _enableWindowsMode(): void {\n if (!this._windowsMode) {\n const disposables: IDisposable[] = [];\n disposables.push(this.onLineFeed(updateWindowsModeWrappedState.bind(null, this._bufferService)));\n disposables.push(this.registerCsiHandler({ final: 'H' }, () => {\n updateWindowsModeWrappedState(this._bufferService);\n return false;\n }));\n this._windowsMode = {\n dispose: () => {\n for (const d of disposables) {\n d.dispose();\n }\n }\n };\n }\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\ninterface IListener<T, U = void> {\n (arg1: T, arg2: U): void;\n}\n\nexport interface IEvent<T, U = void> {\n (listener: (arg1: T, arg2: U) => any): IDisposable;\n}\n\nexport interface IEventEmitter<T, U = void> {\n event: IEvent<T, U>;\n fire(arg1: T, arg2: U): void;\n dispose(): void;\n}\n\nexport class EventEmitter<T, U = void> implements IEventEmitter<T, U> {\n private _listeners: IListener<T, U>[] = [];\n private _event?: IEvent<T, U>;\n private _disposed: boolean = false;\n\n public get event(): IEvent<T, U> {\n if (!this._event) {\n this._event = (listener: (arg1: T, arg2: U) => any) => {\n this._listeners.push(listener);\n const disposable = {\n dispose: () => {\n if (!this._disposed) {\n for (let i = 0; i < this._listeners.length; i++) {\n if (this._listeners[i] === listener) {\n this._listeners.splice(i, 1);\n return;\n }\n }\n }\n }\n };\n return disposable;\n };\n }\n return this._event;\n }\n\n public fire(arg1: T, arg2: U): void {\n const queue: IListener<T, U>[] = [];\n for (let i = 0; i < this._listeners.length; i++) {\n queue.push(this._listeners[i]);\n }\n for (let i = 0; i < queue.length; i++) {\n queue[i].call(undefined, arg1, arg2);\n }\n }\n\n public dispose(): void {\n if (this._listeners) {\n this._listeners.length = 0;\n }\n this._disposed = true;\n }\n}\n\nexport function forwardEvent<T>(from: IEvent<T>, to: IEventEmitter<T>): IDisposable {\n return from(e => to.fire(e));\n}\n","/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IInputHandler, IAttributeData, IDisposable, IWindowOptions, IColorEvent, IParseStack, ColorIndex, ColorRequestType } from 'common/Types';\nimport { C0, C1 } from 'common/data/EscapeSequences';\nimport { CHARSETS, DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { EscapeSequenceParser } from 'common/parser/EscapeSequenceParser';\nimport { Disposable } from 'common/Lifecycle';\nimport { StringToUtf32, stringFromCodePoint, Utf8ToUtf32 } from 'common/input/TextDecoder';\nimport { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { IParsingState, IEscapeSequenceParser, IParams, IFunctionIdentifier } from 'common/parser/Types';\nimport { NULL_CELL_CODE, NULL_CELL_WIDTH, Attributes, FgFlags, BgFlags, Content, UnderlineStyle } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData } from 'common/buffer/AttributeData';\nimport { ICoreService, IBufferService, IOptionsService, ILogService, ICoreMouseService, ICharsetService, IUnicodeService, LogLevelEnum, IOscLinkService } from 'common/services/Services';\nimport { OscHandler } from 'common/parser/OscParser';\nimport { DcsHandler } from 'common/parser/DcsParser';\nimport { IBuffer } from 'common/buffer/Types';\nimport { parseColor } from 'common/input/XParseColor';\n\n/**\n * Map collect to glevel. Used in `selectCharset`.\n */\nconst GLEVEL: { [key: string]: number } = { '(': 0, ')': 1, '*': 2, '+': 3, '-': 1, '.': 2 };\n\n/**\n * VT commands done by the parser - FIXME: move this to the parser?\n */\n// @vt: #Y ESC CSI \"Control Sequence Introducer\" \"ESC [\" \"Start of a CSI sequence.\"\n// @vt: #Y ESC OSC \"Operating System Command\" \"ESC ]\" \"Start of an OSC sequence.\"\n// @vt: #Y ESC DCS \"Device Control String\" \"ESC P\" \"Start of a DCS sequence.\"\n// @vt: #Y ESC ST \"String Terminator\" \"ESC \\\" \"Terminator used for string type sequences.\"\n// @vt: #Y ESC PM \"Privacy Message\" \"ESC ^\" \"Start of a privacy message.\"\n// @vt: #Y ESC APC \"Application Program Command\" \"ESC _\" \"Start of an APC sequence.\"\n// @vt: #Y C1 CSI \"Control Sequence Introducer\" \"\\x9B\" \"Start of a CSI sequence.\"\n// @vt: #Y C1 OSC \"Operating System Command\" \"\\x9D\" \"Start of an OSC sequence.\"\n// @vt: #Y C1 DCS \"Device Control String\" \"\\x90\" \"Start of a DCS sequence.\"\n// @vt: #Y C1 ST \"String Terminator\" \"\\x9C\" \"Terminator used for string type sequences.\"\n// @vt: #Y C1 PM \"Privacy Message\" \"\\x9E\" \"Start of a privacy message.\"\n// @vt: #Y C1 APC \"Application Program Command\" \"\\x9F\" \"Start of an APC sequence.\"\n// @vt: #Y C0 NUL \"Null\" \"\\0, \\x00\" \"NUL is ignored.\"\n// @vt: #Y C0 ESC \"Escape\" \"\\e, \\x1B\" \"Start of a sequence. Cancels any other sequence.\"\n\n/**\n * Document xterm VT features here that are currently unsupported\n */\n// @vt: #E[Supported via xterm-addon-image.] DCS SIXEL \"SIXEL Graphics\" \"DCS Ps ; Ps ; Ps ; q \tPt ST\" \"Draw SIXEL image.\"\n// @vt: #N DCS DECUDK \"User Defined Keys\" \"DCS Ps ; Ps \\| Pt ST\" \"Definitions for user-defined keys.\"\n// @vt: #N DCS XTGETTCAP \"Request Terminfo String\" \"DCS + q Pt ST\" \"Request Terminfo String.\"\n// @vt: #N DCS XTSETTCAP \"Set Terminfo Data\" \"DCS + p Pt ST\" \"Set Terminfo Data.\"\n// @vt: #N OSC 1 \"Set Icon Name\" \"OSC 1 ; Pt BEL\" \"Set icon name.\"\n\n/**\n * Max length of the UTF32 input buffer. Real memory consumption is 4 times higher.\n */\nconst MAX_PARSEBUFFER_LENGTH = 131072;\n\n/**\n * Limit length of title and icon name stacks.\n */\nconst STACK_LIMIT = 10;\n\n// map params to window option\nfunction paramToWindowOption(n: number, opts: IWindowOptions): boolean {\n if (n > 24) {\n return opts.setWinLines || false;\n }\n switch (n) {\n case 1: return !!opts.restoreWin;\n case 2: return !!opts.minimizeWin;\n case 3: return !!opts.setWinPosition;\n case 4: return !!opts.setWinSizePixels;\n case 5: return !!opts.raiseWin;\n case 6: return !!opts.lowerWin;\n case 7: return !!opts.refreshWin;\n case 8: return !!opts.setWinSizeChars;\n case 9: return !!opts.maximizeWin;\n case 10: return !!opts.fullscreenWin;\n case 11: return !!opts.getWinState;\n case 13: return !!opts.getWinPosition;\n case 14: return !!opts.getWinSizePixels;\n case 15: return !!opts.getScreenSizePixels;\n case 16: return !!opts.getCellSizePixels;\n case 18: return !!opts.getWinSizeChars;\n case 19: return !!opts.getScreenSizeChars;\n case 20: return !!opts.getIconTitle;\n case 21: return !!opts.getWinTitle;\n case 22: return !!opts.pushTitle;\n case 23: return !!opts.popTitle;\n case 24: return !!opts.setWinLines;\n }\n return false;\n}\n\nexport enum WindowsOptionsReportType {\n GET_WIN_SIZE_PIXELS = 0,\n GET_CELL_SIZE_PIXELS = 1\n}\n\n// create a warning log if an async handler takes longer than the limit (in ms)\nconst SLOW_ASYNC_LIMIT = 5000;\n\n// Work variables to avoid garbage collection\nlet $temp = 0;\n\n/**\n * The terminal's standard implementation of IInputHandler, this handles all\n * input from the Parser.\n *\n * Refer to http://invisible-island.net/xterm/ctlseqs/ctlseqs.html to understand\n * each function's header comment.\n */\nexport class InputHandler extends Disposable implements IInputHandler {\n private _parseBuffer: Uint32Array = new Uint32Array(4096);\n private _stringDecoder: StringToUtf32 = new StringToUtf32();\n private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32();\n private _workCell: CellData = new CellData();\n private _windowTitle = '';\n private _iconName = '';\n private _dirtyRowTracker: IDirtyRowTracker;\n protected _windowTitleStack: string[] = [];\n protected _iconNameStack: string[] = [];\n\n private _curAttrData: IAttributeData = DEFAULT_ATTR_DATA.clone();\n public getAttrData(): IAttributeData { return this._curAttrData; }\n private _eraseAttrDataInternal: IAttributeData = DEFAULT_ATTR_DATA.clone();\n\n private _activeBuffer: IBuffer;\n\n private readonly _onRequestBell = this.register(new EventEmitter<void>());\n public readonly onRequestBell = this._onRequestBell.event;\n private readonly _onRequestRefreshRows = this.register(new EventEmitter<number, number>());\n public readonly onRequestRefreshRows = this._onRequestRefreshRows.event;\n private readonly _onRequestReset = this.register(new EventEmitter<void>());\n public readonly onRequestReset = this._onRequestReset.event;\n private readonly _onRequestSendFocus = this.register(new EventEmitter<void>());\n public readonly onRequestSendFocus = this._onRequestSendFocus.event;\n private readonly _onRequestSyncScrollBar = this.register(new EventEmitter<void>());\n public readonly onRequestSyncScrollBar = this._onRequestSyncScrollBar.event;\n private readonly _onRequestWindowsOptionsReport = this.register(new EventEmitter<WindowsOptionsReportType>());\n public readonly onRequestWindowsOptionsReport = this._onRequestWindowsOptionsReport.event;\n\n private readonly _onA11yChar = this.register(new EventEmitter<string>());\n public readonly onA11yChar = this._onA11yChar.event;\n private readonly _onA11yTab = this.register(new EventEmitter<number>());\n public readonly onA11yTab = this._onA11yTab.event;\n private readonly _onCursorMove = this.register(new EventEmitter<void>());\n public readonly onCursorMove = this._onCursorMove.event;\n private readonly _onLineFeed = this.register(new EventEmitter<void>());\n public readonly onLineFeed = this._onLineFeed.event;\n private readonly _onScroll = this.register(new EventEmitter<number>());\n public readonly onScroll = this._onScroll.event;\n private readonly _onTitleChange = this.register(new EventEmitter<string>());\n public readonly onTitleChange = this._onTitleChange.event;\n private readonly _onColor = this.register(new EventEmitter<IColorEvent>());\n public readonly onColor = this._onColor.event;\n\n private _parseStack: IParseStack = {\n paused: false,\n cursorStartX: 0,\n cursorStartY: 0,\n decodedLength: 0,\n position: 0\n };\n\n constructor(\n private readonly _bufferService: IBufferService,\n private readonly _charsetService: ICharsetService,\n private readonly _coreService: ICoreService,\n private readonly _logService: ILogService,\n private readonly _optionsService: IOptionsService,\n private readonly _oscLinkService: IOscLinkService,\n private readonly _coreMouseService: ICoreMouseService,\n private readonly _unicodeService: IUnicodeService,\n private readonly _parser: IEscapeSequenceParser = new EscapeSequenceParser()\n ) {\n super();\n this.register(this._parser);\n this._dirtyRowTracker = new DirtyRowTracker(this._bufferService);\n\n // Track properties used in performance critical code manually to avoid using slow getters\n this._activeBuffer = this._bufferService.buffer;\n this.register(this._bufferService.buffers.onBufferActivate(e => this._activeBuffer = e.activeBuffer));\n\n /**\n * custom fallback handlers\n */\n this._parser.setCsiHandlerFallback((ident, params) => {\n this._logService.debug('Unknown CSI code: ', { identifier: this._parser.identToString(ident), params: params.toArray() });\n });\n this._parser.setEscHandlerFallback(ident => {\n this._logService.debug('Unknown ESC code: ', { identifier: this._parser.identToString(ident) });\n });\n this._parser.setExecuteHandlerFallback(code => {\n this._logService.debug('Unknown EXECUTE code: ', { code });\n });\n this._parser.setOscHandlerFallback((identifier, action, data) => {\n this._logService.debug('Unknown OSC code: ', { identifier, action, data });\n });\n this._parser.setDcsHandlerFallback((ident, action, payload) => {\n if (action === 'HOOK') {\n payload = payload.toArray();\n }\n this._logService.debug('Unknown DCS code: ', { identifier: this._parser.identToString(ident), action, payload });\n });\n\n /**\n * print handler\n */\n this._parser.setPrintHandler((data, start, end) => this.print(data, start, end));\n\n /**\n * CSI handler\n */\n this._parser.registerCsiHandler({ final: '@' }, params => this.insertChars(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: '@' }, params => this.scrollLeft(params));\n this._parser.registerCsiHandler({ final: 'A' }, params => this.cursorUp(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'A' }, params => this.scrollRight(params));\n this._parser.registerCsiHandler({ final: 'B' }, params => this.cursorDown(params));\n this._parser.registerCsiHandler({ final: 'C' }, params => this.cursorForward(params));\n this._parser.registerCsiHandler({ final: 'D' }, params => this.cursorBackward(params));\n this._parser.registerCsiHandler({ final: 'E' }, params => this.cursorNextLine(params));\n this._parser.registerCsiHandler({ final: 'F' }, params => this.cursorPrecedingLine(params));\n this._parser.registerCsiHandler({ final: 'G' }, params => this.cursorCharAbsolute(params));\n this._parser.registerCsiHandler({ final: 'H' }, params => this.cursorPosition(params));\n this._parser.registerCsiHandler({ final: 'I' }, params => this.cursorForwardTab(params));\n this._parser.registerCsiHandler({ final: 'J' }, params => this.eraseInDisplay(params, false));\n this._parser.registerCsiHandler({ prefix: '?', final: 'J' }, params => this.eraseInDisplay(params, true));\n this._parser.registerCsiHandler({ final: 'K' }, params => this.eraseInLine(params, false));\n this._parser.registerCsiHandler({ prefix: '?', final: 'K' }, params => this.eraseInLine(params, true));\n this._parser.registerCsiHandler({ final: 'L' }, params => this.insertLines(params));\n this._parser.registerCsiHandler({ final: 'M' }, params => this.deleteLines(params));\n this._parser.registerCsiHandler({ final: 'P' }, params => this.deleteChars(params));\n this._parser.registerCsiHandler({ final: 'S' }, params => this.scrollUp(params));\n this._parser.registerCsiHandler({ final: 'T' }, params => this.scrollDown(params));\n this._parser.registerCsiHandler({ final: 'X' }, params => this.eraseChars(params));\n this._parser.registerCsiHandler({ final: 'Z' }, params => this.cursorBackwardTab(params));\n this._parser.registerCsiHandler({ final: '`' }, params => this.charPosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'a' }, params => this.hPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'b' }, params => this.repeatPrecedingCharacter(params));\n this._parser.registerCsiHandler({ final: 'c' }, params => this.sendDeviceAttributesPrimary(params));\n this._parser.registerCsiHandler({ prefix: '>', final: 'c' }, params => this.sendDeviceAttributesSecondary(params));\n this._parser.registerCsiHandler({ final: 'd' }, params => this.linePosAbsolute(params));\n this._parser.registerCsiHandler({ final: 'e' }, params => this.vPositionRelative(params));\n this._parser.registerCsiHandler({ final: 'f' }, params => this.hVPosition(params));\n this._parser.registerCsiHandler({ final: 'g' }, params => this.tabClear(params));\n this._parser.registerCsiHandler({ final: 'h' }, params => this.setMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'h' }, params => this.setModePrivate(params));\n this._parser.registerCsiHandler({ final: 'l' }, params => this.resetMode(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'l' }, params => this.resetModePrivate(params));\n this._parser.registerCsiHandler({ final: 'm' }, params => this.charAttributes(params));\n this._parser.registerCsiHandler({ final: 'n' }, params => this.deviceStatus(params));\n this._parser.registerCsiHandler({ prefix: '?', final: 'n' }, params => this.deviceStatusPrivate(params));\n this._parser.registerCsiHandler({ intermediates: '!', final: 'p' }, params => this.softReset(params));\n this._parser.registerCsiHandler({ intermediates: ' ', final: 'q' }, params => this.setCursorStyle(params));\n this._parser.registerCsiHandler({ final: 'r' }, params => this.setScrollRegion(params));\n this._parser.registerCsiHandler({ final: 's' }, params => this.saveCursor(params));\n this._parser.registerCsiHandler({ final: 't' }, params => this.windowOptions(params));\n this._parser.registerCsiHandler({ final: 'u' }, params => this.restoreCursor(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '}' }, params => this.insertColumns(params));\n this._parser.registerCsiHandler({ intermediates: '\\'', final: '~' }, params => this.deleteColumns(params));\n this._parser.registerCsiHandler({ intermediates: '\"', final: 'q' }, params => this.selectProtected(params));\n this._parser.registerCsiHandler({ intermediates: '$', final: 'p' }, params => this.requestMode(params, true));\n this._parser.registerCsiHandler({ prefix: '?', intermediates: '$', final: 'p' }, params => this.requestMode(params, false));\n\n /**\n * execute handler\n */\n this._parser.setExecuteHandler(C0.BEL, () => this.bell());\n this._parser.setExecuteHandler(C0.LF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.VT, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.FF, () => this.lineFeed());\n this._parser.setExecuteHandler(C0.CR, () => this.carriageReturn());\n this._parser.setExecuteHandler(C0.BS, () => this.backspace());\n this._parser.setExecuteHandler(C0.HT, () => this.tab());\n this._parser.setExecuteHandler(C0.SO, () => this.shiftOut());\n this._parser.setExecuteHandler(C0.SI, () => this.shiftIn());\n // FIXME: What do to with missing? Old code just added those to print.\n\n this._parser.setExecuteHandler(C1.IND, () => this.index());\n this._parser.setExecuteHandler(C1.NEL, () => this.nextLine());\n this._parser.setExecuteHandler(C1.HTS, () => this.tabSet());\n\n /**\n * OSC handler\n */\n // 0 - icon name + title\n this._parser.registerOscHandler(0, new OscHandler(data => { this.setTitle(data); this.setIconName(data); return true; }));\n // 1 - icon name\n this._parser.registerOscHandler(1, new OscHandler(data => this.setIconName(data)));\n // 2 - title\n this._parser.registerOscHandler(2, new OscHandler(data => this.setTitle(data)));\n // 3 - set property X in the form \"prop=value\"\n // 4 - Change Color Number\n this._parser.registerOscHandler(4, new OscHandler(data => this.setOrReportIndexedColor(data)));\n // 5 - Change Special Color Number\n // 6 - Enable/disable Special Color Number c\n // 7 - current directory? (not in xterm spec, see https://gitlab.com/gnachman/iterm2/issues/3939)\n // 8 - create hyperlink (not in xterm spec, see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)\n this._parser.registerOscHandler(8, new OscHandler(data => this.setHyperlink(data)));\n // 10 - Change VT100 text foreground color to Pt.\n this._parser.registerOscHandler(10, new OscHandler(data => this.setOrReportFgColor(data)));\n // 11 - Change VT100 text background color to Pt.\n this._parser.registerOscHandler(11, new OscHandler(data => this.setOrReportBgColor(data)));\n // 12 - Change text cursor color to Pt.\n this._parser.registerOscHandler(12, new OscHandler(data => this.setOrReportCursorColor(data)));\n // 13 - Change mouse foreground color to Pt.\n // 14 - Change mouse background color to Pt.\n // 15 - Change Tektronix foreground color to Pt.\n // 16 - Change Tektronix background color to Pt.\n // 17 - Change highlight background color to Pt.\n // 18 - Change Tektronix cursor color to Pt.\n // 19 - Change highlight foreground color to Pt.\n // 46 - Change Log File to Pt.\n // 50 - Set Font to Pt.\n // 51 - reserved for Emacs shell.\n // 52 - Manipulate Selection Data.\n // 104 ; c - Reset Color Number c.\n this._parser.registerOscHandler(104, new OscHandler(data => this.restoreIndexedColor(data)));\n // 105 ; c - Reset Special Color Number c.\n // 106 ; c; f - Enable/disable Special Color Number c.\n // 110 - Reset VT100 text foreground color.\n this._parser.registerOscHandler(110, new OscHandler(data => this.restoreFgColor(data)));\n // 111 - Reset VT100 text background color.\n this._parser.registerOscHandler(111, new OscHandler(data => this.restoreBgColor(data)));\n // 112 - Reset text cursor color.\n this._parser.registerOscHandler(112, new OscHandler(data => this.restoreCursorColor(data)));\n // 113 - Reset mouse foreground color.\n // 114 - Reset mouse background color.\n // 115 - Reset Tektronix foreground color.\n // 116 - Reset Tektronix background color.\n // 117 - Reset highlight color.\n // 118 - Reset Tektronix cursor color.\n // 119 - Reset highlight foreground color.\n\n /**\n * ESC handlers\n */\n this._parser.registerEscHandler({ final: '7' }, () => this.saveCursor());\n this._parser.registerEscHandler({ final: '8' }, () => this.restoreCursor());\n this._parser.registerEscHandler({ final: 'D' }, () => this.index());\n this._parser.registerEscHandler({ final: 'E' }, () => this.nextLine());\n this._parser.registerEscHandler({ final: 'H' }, () => this.tabSet());\n this._parser.registerEscHandler({ final: 'M' }, () => this.reverseIndex());\n this._parser.registerEscHandler({ final: '=' }, () => this.keypadApplicationMode());\n this._parser.registerEscHandler({ final: '>' }, () => this.keypadNumericMode());\n this._parser.registerEscHandler({ final: 'c' }, () => this.fullReset());\n this._parser.registerEscHandler({ final: 'n' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: 'o' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '|' }, () => this.setgLevel(3));\n this._parser.registerEscHandler({ final: '}' }, () => this.setgLevel(2));\n this._parser.registerEscHandler({ final: '~' }, () => this.setgLevel(1));\n this._parser.registerEscHandler({ intermediates: '%', final: '@' }, () => this.selectDefaultCharset());\n this._parser.registerEscHandler({ intermediates: '%', final: 'G' }, () => this.selectDefaultCharset());\n for (const flag in CHARSETS) {\n this._parser.registerEscHandler({ intermediates: '(', final: flag }, () => this.selectCharset('(' + flag));\n this._parser.registerEscHandler({ intermediates: ')', final: flag }, () => this.selectCharset(')' + flag));\n this._parser.registerEscHandler({ intermediates: '*', final: flag }, () => this.selectCharset('*' + flag));\n this._parser.registerEscHandler({ intermediates: '+', final: flag }, () => this.selectCharset('+' + flag));\n this._parser.registerEscHandler({ intermediates: '-', final: flag }, () => this.selectCharset('-' + flag));\n this._parser.registerEscHandler({ intermediates: '.', final: flag }, () => this.selectCharset('.' + flag));\n this._parser.registerEscHandler({ intermediates: '/', final: flag }, () => this.selectCharset('/' + flag)); // TODO: supported?\n }\n this._parser.registerEscHandler({ intermediates: '#', final: '8' }, () => this.screenAlignmentPattern());\n\n /**\n * error handler\n */\n this._parser.setErrorHandler((state: IParsingState) => {\n this._logService.error('Parsing error: ', state);\n return state;\n });\n\n /**\n * DCS handler\n */\n this._parser.registerDcsHandler({ intermediates: '$', final: 'q' }, new DcsHandler((data, params) => this.requestStatusString(data, params)));\n }\n\n /**\n * Async parse support.\n */\n private _preserveStack(cursorStartX: number, cursorStartY: number, decodedLength: number, position: number): void {\n this._parseStack.paused = true;\n this._parseStack.cursorStartX = cursorStartX;\n this._parseStack.cursorStartY = cursorStartY;\n this._parseStack.decodedLength = decodedLength;\n this._parseStack.position = position;\n }\n\n private _logSlowResolvingAsync(p: Promise<boolean>): void {\n // log a limited warning about an async handler taking too long\n if (this._logService.logLevel <= LogLevelEnum.WARN) {\n Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])\n .catch(err => {\n if (err !== '#SLOW_TIMEOUT') {\n throw err;\n }\n console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);\n });\n }\n }\n\n private _getCurrentLinkId(): number {\n return this._curAttrData.extended.urlId;\n }\n\n /**\n * Parse call with async handler support.\n *\n * Whether the stack state got preserved for the next call, is indicated by the return value:\n * - undefined (void):\n * all handlers were sync, no stack save, continue normally with next chunk\n * - Promise\\<boolean\\>:\n * execution stopped at async handler, stack saved, continue with\n * same chunk and the promise resolve value as `promiseResult` until the method returns `undefined`\n *\n * Note: This method should only be called by `Terminal.write` to ensure correct execution order and\n * proper continuation of async parser handlers.\n */\n public parse(data: string | Uint8Array, promiseResult?: boolean): void | Promise<boolean> {\n let result: void | Promise<boolean>;\n let cursorStartX = this._activeBuffer.x;\n let cursorStartY = this._activeBuffer.y;\n let start = 0;\n const wasPaused = this._parseStack.paused;\n\n if (wasPaused) {\n // assumption: _parseBuffer never mutates between async calls\n if (result = this._parser.parse(this._parseBuffer, this._parseStack.decodedLength, promiseResult)) {\n this._logSlowResolvingAsync(result);\n return result;\n }\n cursorStartX = this._parseStack.cursorStartX;\n cursorStartY = this._parseStack.cursorStartY;\n this._parseStack.paused = false;\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n start = this._parseStack.position + MAX_PARSEBUFFER_LENGTH;\n }\n }\n\n // Log debug data, the log level gate is to prevent extra work in this hot path\n if (this._logService.logLevel <= LogLevelEnum.DEBUG) {\n this._logService.debug(`parsing data${typeof data === 'string' ? ` \"${data}\"` : ` \"${Array.prototype.map.call(data, e => String.fromCharCode(e)).join('')}\"`}`, typeof data === 'string'\n ? data.split('').map(e => e.charCodeAt(0))\n : data\n );\n }\n\n // resize input buffer if needed\n if (this._parseBuffer.length < data.length) {\n if (this._parseBuffer.length < MAX_PARSEBUFFER_LENGTH) {\n this._parseBuffer = new Uint32Array(Math.min(data.length, MAX_PARSEBUFFER_LENGTH));\n }\n }\n\n // Clear the dirty row service so we know which lines changed as a result of parsing\n // Important: do not clear between async calls, otherwise we lost pending update information.\n if (!wasPaused) {\n this._dirtyRowTracker.clearRange();\n }\n\n // process big data in smaller chunks\n if (data.length > MAX_PARSEBUFFER_LENGTH) {\n for (let i = start; i < data.length; i += MAX_PARSEBUFFER_LENGTH) {\n const end = i + MAX_PARSEBUFFER_LENGTH < data.length ? i + MAX_PARSEBUFFER_LENGTH : data.length;\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data.substring(i, end), this._parseBuffer)\n : this._utf8Decoder.decode(data.subarray(i, end), this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, i);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n } else {\n if (!wasPaused) {\n const len = (typeof data === 'string')\n ? this._stringDecoder.decode(data, this._parseBuffer)\n : this._utf8Decoder.decode(data, this._parseBuffer);\n if (result = this._parser.parse(this._parseBuffer, len)) {\n this._preserveStack(cursorStartX, cursorStartY, len, 0);\n this._logSlowResolvingAsync(result);\n return result;\n }\n }\n }\n\n if (this._activeBuffer.x !== cursorStartX || this._activeBuffer.y !== cursorStartY) {\n this._onCursorMove.fire();\n }\n\n // Refresh any dirty rows accumulated as part of parsing\n this._onRequestRefreshRows.fire(this._dirtyRowTracker.start, this._dirtyRowTracker.end);\n }\n\n public print(data: Uint32Array, start: number, end: number): void {\n let code: number;\n let chWidth: number;\n const charset = this._charsetService.charset;\n const screenReaderMode = this._optionsService.rawOptions.screenReaderMode;\n const cols = this._bufferService.cols;\n const wraparoundMode = this._coreService.decPrivateModes.wraparound;\n const insertMode = this._coreService.modes.insertMode;\n const curAttr = this._curAttrData;\n let bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n\n // handle wide chars: reset start_cell-1 if we would overwrite the second cell of a wide char\n if (this._activeBuffer.x && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x - 1) === 2) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x - 1, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n for (let pos = start; pos < end; ++pos) {\n code = data[pos];\n\n // calculate print space\n // expensive call, therefore we save width in line buffer\n chWidth = this._unicodeService.wcwidth(code);\n\n // get charset replacement character\n // charset is only defined for ASCII, therefore we only\n // search for an replacement char if code < 127\n if (code < 127 && charset) {\n const ch = charset[String.fromCharCode(code)];\n if (ch) {\n code = ch.charCodeAt(0);\n }\n }\n\n if (screenReaderMode) {\n this._onA11yChar.fire(stringFromCodePoint(code));\n }\n if (this._getCurrentLinkId()) {\n this._oscLinkService.addLineToLink(this._getCurrentLinkId(), this._activeBuffer.ybase + this._activeBuffer.y);\n }\n\n // insert combining char at last cursor position\n // this._activeBuffer.x should never be 0 for a combining char\n // since they always follow a cell consuming char\n // therefore we can test for this._activeBuffer.x to avoid overflow left\n if (!chWidth && this._activeBuffer.x) {\n if (!bufferRow.getWidth(this._activeBuffer.x - 1)) {\n // found empty cell after fullwidth, need to go 2 cells back\n // it is save to step 2 cells back here\n // since an empty cell is only set by fullwidth chars\n bufferRow.addCodepointToCell(this._activeBuffer.x - 2, code);\n } else {\n bufferRow.addCodepointToCell(this._activeBuffer.x - 1, code);\n }\n continue;\n }\n\n // goto next line if ch would overflow\n // NOTE: To avoid costly width checks here,\n // the terminal does not allow a cols < 2.\n if (this._activeBuffer.x + chWidth - 1 >= cols) {\n // autowrap - DECAWM\n // automatically wraps to the beginning of the next line\n if (wraparoundMode) {\n // clear left over cells to the right\n while (this._activeBuffer.x < cols) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n this._activeBuffer.x = 0;\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData(), true);\n } else {\n if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // The line already exists (eg. the initial viewport), mark it as a\n // wrapped line\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = true;\n }\n // row changed, get it again\n bufferRow = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n } else {\n this._activeBuffer.x = cols - 1;\n if (chWidth === 2) {\n // FIXME: check for xterm behavior\n // What to do here? We got a wide char that does not fit into last cell\n continue;\n }\n }\n }\n\n // insert mode: move characters to right\n if (insertMode) {\n // right shift cells according to the width\n bufferRow.insertCells(this._activeBuffer.x, chWidth, this._activeBuffer.getNullCell(curAttr), curAttr);\n // test last cell - since the last cell has only room for\n // a halfwidth char any fullwidth shifted there is lost\n // and will be set to empty cell\n if (bufferRow.getWidth(cols - 1) === 2) {\n bufferRow.setCellFromCodePoint(cols - 1, NULL_CELL_CODE, NULL_CELL_WIDTH, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n\n // write current char to buffer and advance cursor\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, code, chWidth, curAttr.fg, curAttr.bg, curAttr.extended);\n\n // fullwidth char - also set next cell to placeholder stub and advance cursor\n // for graphemes bigger than fullwidth we can simply loop to zero\n // we already made sure above, that this._activeBuffer.x + chWidth will not overflow right\n if (chWidth > 0) {\n while (--chWidth) {\n // other than a regular empty cell a cell following a wide char has no width\n bufferRow.setCellFromCodePoint(this._activeBuffer.x++, 0, 0, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n }\n }\n // store last char in Parser.precedingCodepoint for REP to work correctly\n // This needs to check whether:\n // - fullwidth + surrogates: reset\n // - combining: only base char gets carried on (bug in xterm?)\n if (end - start > 0) {\n bufferRow.loadCell(this._activeBuffer.x - 1, this._workCell);\n if (this._workCell.getWidth() === 2 || this._workCell.getCode() > 0xFFFF) {\n this._parser.precedingCodepoint = 0;\n } else if (this._workCell.isCombined()) {\n this._parser.precedingCodepoint = this._workCell.getChars().charCodeAt(0);\n } else {\n this._parser.precedingCodepoint = this._workCell.content;\n }\n }\n\n // handle wide chars: reset cell to the right if it is second cell of a wide char\n if (this._activeBuffer.x < cols && end - start > 0 && bufferRow.getWidth(this._activeBuffer.x) === 0 && !bufferRow.hasContent(this._activeBuffer.x)) {\n bufferRow.setCellFromCodePoint(this._activeBuffer.x, 0, 1, curAttr.fg, curAttr.bg, curAttr.extended);\n }\n\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Forward registerCsiHandler from parser.\n */\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean | Promise<boolean>): IDisposable {\n if (id.final === 't' && !id.prefix && !id.intermediates) {\n // security: always check whether window option is allowed\n return this._parser.registerCsiHandler(id, params => {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n return callback(params);\n });\n }\n return this._parser.registerCsiHandler(id, callback);\n }\n\n /**\n * Forward registerDcsHandler from parser.\n */\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean | Promise<boolean>): IDisposable {\n return this._parser.registerDcsHandler(id, new DcsHandler(callback));\n }\n\n /**\n * Forward registerEscHandler from parser.\n */\n public registerEscHandler(id: IFunctionIdentifier, callback: () => boolean | Promise<boolean>): IDisposable {\n return this._parser.registerEscHandler(id, callback);\n }\n\n /**\n * Forward registerOscHandler from parser.\n */\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {\n return this._parser.registerOscHandler(ident, new OscHandler(callback));\n }\n\n /**\n * BEL\n * Bell (Ctrl-G).\n *\n * @vt: #Y C0 BEL \"Bell\" \"\\a, \\x07\" \"Ring the bell.\"\n * The behavior of the bell is further customizable with `ITerminalOptions.bellStyle`\n * and `ITerminalOptions.bellSound`.\n */\n public bell(): boolean {\n this._onRequestBell.fire();\n return true;\n }\n\n /**\n * LF\n * Line Feed or New Line (NL). (LF is Ctrl-J).\n *\n * @vt: #Y C0 LF \"Line Feed\" \"\\n, \\x0A\" \"Move the cursor one row down, scrolling if needed.\"\n * Scrolling is restricted to scroll margins and will only happen on the bottom line.\n *\n * @vt: #Y C0 VT \"Vertical Tabulation\" \"\\v, \\x0B\" \"Treated as LF.\"\n * @vt: #Y C0 FF \"Form Feed\" \"\\f, \\x0C\" \"Treated as LF.\"\n */\n public lineFeed(): boolean {\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n if (this._optionsService.rawOptions.convertEol) {\n this._activeBuffer.x = 0;\n }\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n // If the end of the line is hit, prevent this action from wrapping around to the next line.\n if (this._activeBuffer.x >= this._bufferService.cols) {\n this._activeBuffer.x--;\n }\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n\n this._onLineFeed.fire();\n return true;\n }\n\n /**\n * CR\n * Carriage Return (Ctrl-M).\n *\n * @vt: #Y C0 CR \"Carriage Return\" \"\\r, \\x0D\" \"Move the cursor to the beginning of the row.\"\n */\n public carriageReturn(): boolean {\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * BS\n * Backspace (Ctrl-H).\n *\n * @vt: #Y C0 BS \"Backspace\" \"\\b, \\x08\" \"Move the cursor one position to the left.\"\n * By default it is not possible to move the cursor past the leftmost position.\n * If `reverse wrap-around` (`CSI ? 45 h`) is set, a previous soft line wrap (DECAWM)\n * can be undone with BS within the scroll margins. In that case the cursor will wrap back\n * to the end of the previous row. Note that it is not possible to peek back into the scrollbuffer\n * with the cursor, thus at the home position (top-leftmost cell) this has no effect.\n */\n public backspace(): boolean {\n // reverse wrap-around is disabled\n if (!this._coreService.decPrivateModes.reverseWraparound) {\n this._restrictCursor();\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n }\n return true;\n }\n\n // reverse wrap-around is enabled\n // other than for normal operation mode, reverse wrap-around allows the cursor\n // to be at x=cols to be able to address the last cell of a row by BS\n this._restrictCursor(this._bufferService.cols);\n\n if (this._activeBuffer.x > 0) {\n this._activeBuffer.x--;\n } else {\n /**\n * reverse wrap-around handling:\n * Our implementation deviates from xterm on purpose. Details:\n * - only previous soft NLs can be reversed (isWrapped=true)\n * - only works within scrollborders (top/bottom, left/right not yet supported)\n * - cannot peek into scrollbuffer\n * - any cursor movement sequence keeps working as expected\n */\n if (this._activeBuffer.x === 0\n && this._activeBuffer.y > this._activeBuffer.scrollTop\n && this._activeBuffer.y <= this._activeBuffer.scrollBottom\n && this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)?.isWrapped) {\n this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!.isWrapped = false;\n this._activeBuffer.y--;\n this._activeBuffer.x = this._bufferService.cols - 1;\n // find last taken cell - last cell can have 3 different states:\n // - hasContent(true) + hasWidth(1): narrow char - we are done\n // - hasWidth(0): second part of wide char - we are done\n // - hasContent(false) + hasWidth(1): empty cell due to early wrapping wide char, go one cell further back\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y)!;\n if (line.hasWidth(this._activeBuffer.x) && !line.hasContent(this._activeBuffer.x)) {\n this._activeBuffer.x--;\n // We do this only once, since width=1 + hasContent=false currently happens only once before\n // early wrapping of a wide char.\n // This needs to be fixed once we support graphemes taking more than 2 cells.\n }\n }\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * TAB\n * Horizontal Tab (HT) (Ctrl-I).\n *\n * @vt: #Y C0 HT \"Horizontal Tabulation\" \"\\t, \\x09\" \"Move the cursor to the next character tab stop.\"\n */\n public tab(): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n const originalX = this._activeBuffer.x;\n this._activeBuffer.x = this._activeBuffer.nextStop();\n if (this._optionsService.rawOptions.screenReaderMode) {\n this._onA11yTab.fire(this._activeBuffer.x - originalX);\n }\n return true;\n }\n\n /**\n * SO\n * Shift Out (Ctrl-N) -> Switch to Alternate Character Set. This invokes the\n * G1 character set.\n *\n * @vt: #P[Only limited ISO-2022 charset support.] C0 SO \"Shift Out\" \"\\x0E\" \"Switch to an alternative character set.\"\n */\n public shiftOut(): boolean {\n this._charsetService.setgLevel(1);\n return true;\n }\n\n /**\n * SI\n * Shift In (Ctrl-O) -> Switch to Standard Character Set. This invokes the G0\n * character set (the default).\n *\n * @vt: #Y C0 SI \"Shift In\" \"\\x0F\" \"Return to regular character set after Shift Out.\"\n */\n public shiftIn(): boolean {\n this._charsetService.setgLevel(0);\n return true;\n }\n\n /**\n * Restrict cursor to viewport size / scroll margin (origin mode).\n */\n private _restrictCursor(maxCol: number = this._bufferService.cols - 1): void {\n this._activeBuffer.x = Math.min(maxCol, Math.max(0, this._activeBuffer.x));\n this._activeBuffer.y = this._coreService.decPrivateModes.origin\n ? Math.min(this._activeBuffer.scrollBottom, Math.max(this._activeBuffer.scrollTop, this._activeBuffer.y))\n : Math.min(this._bufferService.rows - 1, Math.max(0, this._activeBuffer.y));\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set absolute cursor position.\n */\n private _setCursor(x: number, y: number): void {\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n if (this._coreService.decPrivateModes.origin) {\n this._activeBuffer.x = x;\n this._activeBuffer.y = this._activeBuffer.scrollTop + y;\n } else {\n this._activeBuffer.x = x;\n this._activeBuffer.y = y;\n }\n this._restrictCursor();\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n\n /**\n * Set relative cursor position.\n */\n private _moveCursor(x: number, y: number): void {\n // for relative changes we have to make sure we are within 0 .. cols/rows - 1\n // before calculating the new position\n this._restrictCursor();\n this._setCursor(this._activeBuffer.x + x, this._activeBuffer.y + y);\n }\n\n /**\n * CSI Ps A\n * Cursor Up Ps Times (default = 1) (CUU).\n *\n * @vt: #Y CSI CUU \"Cursor Up\" \"CSI Ps A\" \"Move cursor `Ps` times up (default=1).\"\n * If the cursor would pass the top scroll margin, it will stop there.\n */\n public cursorUp(params: IParams): boolean {\n // stop at scrollTop\n const diffToTop = this._activeBuffer.y - this._activeBuffer.scrollTop;\n if (diffToTop >= 0) {\n this._moveCursor(0, -Math.min(diffToTop, params.params[0] || 1));\n } else {\n this._moveCursor(0, -(params.params[0] || 1));\n }\n return true;\n }\n\n /**\n * CSI Ps B\n * Cursor Down Ps Times (default = 1) (CUD).\n *\n * @vt: #Y CSI CUD \"Cursor Down\" \"CSI Ps B\" \"Move cursor `Ps` times down (default=1).\"\n * If the cursor would pass the bottom scroll margin, it will stop there.\n */\n public cursorDown(params: IParams): boolean {\n // stop at scrollBottom\n const diffToBottom = this._activeBuffer.scrollBottom - this._activeBuffer.y;\n if (diffToBottom >= 0) {\n this._moveCursor(0, Math.min(diffToBottom, params.params[0] || 1));\n } else {\n this._moveCursor(0, params.params[0] || 1);\n }\n return true;\n }\n\n /**\n * CSI Ps C\n * Cursor Forward Ps Times (default = 1) (CUF).\n *\n * @vt: #Y CSI CUF \"Cursor Forward\" \"CSI Ps C\" \"Move cursor `Ps` times forward (default=1).\"\n */\n public cursorForward(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Ps D\n * Cursor Backward Ps Times (default = 1) (CUB).\n *\n * @vt: #Y CSI CUB \"Cursor Backward\" \"CSI Ps D\" \"Move cursor `Ps` times backward (default=1).\"\n */\n public cursorBackward(params: IParams): boolean {\n this._moveCursor(-(params.params[0] || 1), 0);\n return true;\n }\n\n /**\n * CSI Ps E\n * Cursor Next Line Ps Times (default = 1) (CNL).\n * Other than cursorDown (CUD) also set the cursor to first column.\n *\n * @vt: #Y CSI CNL \"Cursor Next Line\" \"CSI Ps E\" \"Move cursor `Ps` times down (default=1) and to the first column.\"\n * Same as CUD, additionally places the cursor at the first column.\n */\n public cursorNextLine(params: IParams): boolean {\n this.cursorDown(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps F\n * Cursor Previous Line Ps Times (default = 1) (CPL).\n * Other than cursorUp (CUU) also set the cursor to first column.\n *\n * @vt: #Y CSI CPL \"Cursor Backward\" \"CSI Ps F\" \"Move cursor `Ps` times up (default=1) and to the first column.\"\n * Same as CUU, additionally places the cursor at the first column.\n */\n public cursorPrecedingLine(params: IParams): boolean {\n this.cursorUp(params);\n this._activeBuffer.x = 0;\n return true;\n }\n\n /**\n * CSI Ps G\n * Cursor Character Absolute [column] (default = [row,1]) (CHA).\n *\n * @vt: #Y CSI CHA \"Cursor Horizontal Absolute\" \"CSI Ps G\" \"Move cursor to `Ps`-th column of the active row (default=1).\"\n */\n public cursorCharAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps ; Ps H\n * Cursor Position [row;column] (default = [1,1]) (CUP).\n *\n * @vt: #Y CSI CUP \"Cursor Position\" \"CSI Ps ; Ps H\" \"Set cursor to position [`Ps`, `Ps`] (default = [1, 1]).\"\n * If ORIGIN mode is set, places the cursor to the absolute position within the scroll margins.\n * If ORIGIN mode is not set, places the cursor to the absolute position within the viewport.\n * Note that the coordinates are 1-based, thus the top left position starts at `1 ; 1`.\n */\n public cursorPosition(params: IParams): boolean {\n this._setCursor(\n // col\n (params.length >= 2) ? (params.params[1] || 1) - 1 : 0,\n // row\n (params.params[0] || 1) - 1\n );\n return true;\n }\n\n /**\n * CSI Pm ` Character Position Absolute\n * [column] (default = [row,1]) (HPA).\n * Currently same functionality as CHA.\n *\n * @vt: #Y CSI HPA \"Horizontal Position Absolute\" \"CSI Ps ` \" \"Same as CHA.\"\n */\n public charPosAbsolute(params: IParams): boolean {\n this._setCursor((params.params[0] || 1) - 1, this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Pm a Character Position Relative\n * [columns] (default = [row,col+1]) (HPR)\n *\n * @vt: #Y CSI HPR \"Horizontal Position Relative\" \"CSI Ps a\" \"Same as CUF.\"\n */\n public hPositionRelative(params: IParams): boolean {\n this._moveCursor(params.params[0] || 1, 0);\n return true;\n }\n\n /**\n * CSI Pm d Vertical Position Absolute (VPA)\n * [row] (default = [1,column])\n *\n * @vt: #Y CSI VPA \"Vertical Position Absolute\" \"CSI Ps d\" \"Move cursor to `Ps`-th row (default=1).\"\n */\n public linePosAbsolute(params: IParams): boolean {\n this._setCursor(this._activeBuffer.x, (params.params[0] || 1) - 1);\n return true;\n }\n\n /**\n * CSI Pm e Vertical Position Relative (VPR)\n * [rows] (default = [row+1,column])\n * reuse CSI Ps B ?\n *\n * @vt: #Y CSI VPR \"Vertical Position Relative\" \"CSI Ps e\" \"Move cursor `Ps` times down (default=1).\"\n */\n public vPositionRelative(params: IParams): boolean {\n this._moveCursor(0, params.params[0] || 1);\n return true;\n }\n\n /**\n * CSI Ps ; Ps f\n * Horizontal and Vertical Position [row;column] (default =\n * [1,1]) (HVP).\n * Same as CUP.\n *\n * @vt: #Y CSI HVP \"Horizontal and Vertical Position\" \"CSI Ps ; Ps f\" \"Same as CUP.\"\n */\n public hVPosition(params: IParams): boolean {\n this.cursorPosition(params);\n return true;\n }\n\n /**\n * CSI Ps g Tab Clear (TBC).\n * Ps = 0 -> Clear Current Column (default).\n * Ps = 3 -> Clear All.\n * Potentially:\n * Ps = 2 -> Clear Stops on Line.\n * http://vt100.net/annarbor/aaa-ug/section6.html\n *\n * @vt: #Y CSI TBC \"Tab Clear\" \"CSI Ps g\" \"Clear tab stops at current position (0) or all (3) (default=0).\"\n * Clearing tabstops off the active row (Ps = 2, VT100) is currently not supported.\n */\n public tabClear(params: IParams): boolean {\n const param = params.params[0];\n if (param === 0) {\n delete this._activeBuffer.tabs[this._activeBuffer.x];\n } else if (param === 3) {\n this._activeBuffer.tabs = {};\n }\n return true;\n }\n\n /**\n * CSI Ps I\n * Cursor Forward Tabulation Ps tab stops (default = 1) (CHT).\n *\n * @vt: #Y CSI CHT \"Cursor Horizontal Tabulation\" \"CSI Ps I\" \"Move cursor `Ps` times tabs forward (default=1).\"\n */\n public cursorForwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.nextStop();\n }\n return true;\n }\n\n /**\n * CSI Ps Z Cursor Backward Tabulation Ps tab stops (default = 1) (CBT).\n *\n * @vt: #Y CSI CBT \"Cursor Backward Tabulation\" \"CSI Ps Z\" \"Move cursor `Ps` tabs backward (default=1).\"\n */\n public cursorBackwardTab(params: IParams): boolean {\n if (this._activeBuffer.x >= this._bufferService.cols) {\n return true;\n }\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.x = this._activeBuffer.prevStop();\n }\n return true;\n }\n\n /**\n * CSI Ps \" q Select Character Protection Attribute (DECSCA).\n *\n * @vt: #Y CSI DECSCA \"Select Character Protection Attribute\" \"CSI Ps \" q\" \"Whether DECSED and DECSEL can erase (0=default, 2) or not (1).\"\n */\n public selectProtected(params: IParams): boolean {\n const p = params.params[0];\n if (p === 1) this._curAttrData.bg |= BgFlags.PROTECTED;\n if (p === 2 || p === 0) this._curAttrData.bg &= ~BgFlags.PROTECTED;\n return true;\n }\n\n\n /**\n * Helper method to erase cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal.\n * @param y The row index relative to the viewport.\n * @param start The start x index of the range to be erased.\n * @param end The end x index of the range to be erased (exclusive).\n * @param clearWrap clear the isWrapped flag\n * @param respectProtect Whether to respect the protection attribute (DECSCA).\n */\n private _eraseInBufferLine(y: number, start: number, end: number, clearWrap: boolean = false, respectProtect: boolean = false): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.replaceCells(\n start,\n end,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData(),\n respectProtect\n );\n if (clearWrap) {\n line.isWrapped = false;\n }\n }\n\n /**\n * Helper method to reset cells in a terminal row.\n * The cell gets replaced with the eraseChar of the terminal and the isWrapped property is set to false.\n * @param y row index\n */\n private _resetBufferLine(y: number, respectProtect: boolean = false): void {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), respectProtect);\n this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);\n line.isWrapped = false;\n }\n\n /**\n * CSI Ps J Erase in Display (ED).\n * Ps = 0 -> Erase Below (default).\n * Ps = 1 -> Erase Above.\n * Ps = 2 -> Erase All.\n * Ps = 3 -> Erase Saved Lines (xterm).\n * CSI ? Ps J\n * Erase in Display (DECSED).\n * Ps = 0 -> Selective Erase Below (default).\n * Ps = 1 -> Selective Erase Above.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI ED \"Erase In Display\" \"CSI Ps J\" \"Erase various parts of the viewport.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | ------------------------------------------------------------ |\n * | 0 | Erase from the cursor through the end of the viewport. |\n * | 1 | Erase from the beginning of the viewport through the cursor. |\n * | 2 | Erase complete viewport. |\n * | 3 | Erase scrollback. |\n *\n * @vt: #Y CSI DECSED \"Selective Erase In Display\" \"CSI ? Ps J\" \"Same as ED with respecting protection flag.\"\n */\n public eraseInDisplay(params: IParams, respectProtect: boolean = false): boolean {\n this._restrictCursor(this._bufferService.cols);\n let j;\n switch (params.params[0]) {\n case 0:\n j = this._activeBuffer.y;\n this._dirtyRowTracker.markDirty(j);\n this._eraseInBufferLine(j++, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, respectProtect);\n for (; j < this._bufferService.rows; j++) {\n this._resetBufferLine(j, respectProtect);\n }\n this._dirtyRowTracker.markDirty(j);\n break;\n case 1:\n j = this._activeBuffer.y;\n this._dirtyRowTracker.markDirty(j);\n // Deleted front part of line and everything before. This line will no longer be wrapped.\n this._eraseInBufferLine(j, 0, this._activeBuffer.x + 1, true, respectProtect);\n if (this._activeBuffer.x + 1 >= this._bufferService.cols) {\n // Deleted entire previous line. This next line can no longer be wrapped.\n this._activeBuffer.lines.get(j + 1)!.isWrapped = false;\n }\n while (j--) {\n this._resetBufferLine(j, respectProtect);\n }\n this._dirtyRowTracker.markDirty(0);\n break;\n case 2:\n j = this._bufferService.rows;\n this._dirtyRowTracker.markDirty(j - 1);\n while (j--) {\n this._resetBufferLine(j, respectProtect);\n }\n this._dirtyRowTracker.markDirty(0);\n break;\n case 3:\n // Clear scrollback (everything not in viewport)\n const scrollBackSize = this._activeBuffer.lines.length - this._bufferService.rows;\n if (scrollBackSize > 0) {\n this._activeBuffer.lines.trimStart(scrollBackSize);\n this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - scrollBackSize, 0);\n this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - scrollBackSize, 0);\n // Force a scroll event to refresh viewport\n this._onScroll.fire(0);\n }\n break;\n }\n return true;\n }\n\n /**\n * CSI Ps K Erase in Line (EL).\n * Ps = 0 -> Erase to Right (default).\n * Ps = 1 -> Erase to Left.\n * Ps = 2 -> Erase All.\n * CSI ? Ps K\n * Erase in Line (DECSEL).\n * Ps = 0 -> Selective Erase to Right (default).\n * Ps = 1 -> Selective Erase to Left.\n * Ps = 2 -> Selective Erase All.\n *\n * @vt: #Y CSI EL \"Erase In Line\" \"CSI Ps K\" \"Erase various parts of the active row.\"\n * Supported param values:\n *\n * | Ps | Effect |\n * | -- | -------------------------------------------------------- |\n * | 0 | Erase from the cursor through the end of the row. |\n * | 1 | Erase from the beginning of the line through the cursor. |\n * | 2 | Erase complete line. |\n *\n * @vt: #Y CSI DECSEL \"Selective Erase In Line\" \"CSI ? Ps K\" \"Same as EL with respecting protecting flag.\"\n */\n public eraseInLine(params: IParams, respectProtect: boolean = false): boolean {\n this._restrictCursor(this._bufferService.cols);\n switch (params.params[0]) {\n case 0:\n this._eraseInBufferLine(this._activeBuffer.y, this._activeBuffer.x, this._bufferService.cols, this._activeBuffer.x === 0, respectProtect);\n break;\n case 1:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false, respectProtect);\n break;\n case 2:\n this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true, respectProtect);\n break;\n }\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n return true;\n }\n\n /**\n * CSI Ps L\n * Insert Ps Line(s) (default = 1) (IL).\n *\n * @vt: #Y CSI IL \"Insert Line\" \"CSI Ps L\" \"Insert `Ps` blank lines at active row (default=1).\"\n * For every inserted line at the scroll top one line at the scroll bottom gets removed.\n * The cursor is set to the first column.\n * IL has no effect if the cursor is outside the scroll margins.\n */\n public insertLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n const scrollBottomRowsOffset = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n const scrollBottomAbsolute = this._bufferService.rows - 1 + this._activeBuffer.ybase - scrollBottomRowsOffset + 1;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1L\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(scrollBottomAbsolute - 1, 1);\n this._activeBuffer.lines.splice(row, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps M\n * Delete Ps Line(s) (default = 1) (DL).\n *\n * @vt: #Y CSI DL \"Delete Line\" \"CSI Ps M\" \"Delete `Ps` lines at active row (default=1).\"\n * For every deleted line at the scroll top one blank line at the scroll bottom gets appended.\n * The cursor is set to the first column.\n * DL has no effect if the cursor is outside the scroll margins.\n */\n public deleteLines(params: IParams): boolean {\n this._restrictCursor();\n let param = params.params[0] || 1;\n\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n\n const row: number = this._activeBuffer.ybase + this._activeBuffer.y;\n\n let j: number;\n j = this._bufferService.rows - 1 - this._activeBuffer.scrollBottom;\n j = this._bufferService.rows - 1 + this._activeBuffer.ybase - j;\n while (param--) {\n // test: echo -e '\\e[44m\\e[1M\\e[0m'\n // blankLine(true) - xterm/linux behavior\n this._activeBuffer.lines.splice(row, 1);\n this._activeBuffer.lines.splice(j, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y, this._activeBuffer.scrollBottom);\n this._activeBuffer.x = 0; // see https://vt100.net/docs/vt220-rm/chapter4.html - vt220 only?\n return true;\n }\n\n /**\n * CSI Ps @\n * Insert Ps (Blank) Character(s) (default = 1) (ICH).\n *\n * @vt: #Y CSI ICH \"Insert Characters\" \"CSI Ps @\" \"Insert `Ps` (blank) characters (default = 1).\"\n * The ICH sequence inserts `Ps` blank characters. The cursor remains at the beginning of the blank characters.\n * Text between the cursor and right margin moves to the right. Characters moved past the right margin are lost.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public insertChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.insertCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps P\n * Delete Ps Character(s) (default = 1) (DCH).\n *\n * @vt: #Y CSI DCH \"Delete Character\" \"CSI Ps P\" \"Delete `Ps` characters (default=1).\"\n * As characters are deleted, the remaining characters between the cursor and right margin move to the left.\n * Character attributes move with the characters. The terminal adds blank characters at the right margin.\n *\n *\n * FIXME: check against xterm - should not work outside of scroll margins (see VT520 manual)\n */\n public deleteChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.deleteCells(\n this._activeBuffer.x,\n params.params[0] || 1,\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps S Scroll up Ps lines (default = 1) (SU).\n *\n * @vt: #Y CSI SU \"Scroll Up\" \"CSI Ps S\" \"Scroll `Ps` lines up (default=1).\"\n *\n *\n * FIXME: scrolled out lines at top = 1 should add to scrollback (xterm)\n */\n public scrollUp(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 0, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps T Scroll down Ps lines (default = 1) (SD).\n *\n * @vt: #Y CSI SD \"Scroll Down\" \"CSI Ps T\" \"Scroll `Ps` lines down (default=1).\"\n */\n public scrollDown(params: IParams): boolean {\n let param = params.params[0] || 1;\n\n while (param--) {\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollBottom, 1);\n this._activeBuffer.lines.splice(this._activeBuffer.ybase + this._activeBuffer.scrollTop, 0, this._activeBuffer.getBlankLine(DEFAULT_ATTR_DATA));\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP @ Scroll left Ps columns (default = 1) (SL) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/00\n * Parameter default value: Pn = 1\n * SL causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the left; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always left shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SL \"Scroll Left\" \"CSI Ps SP @\" \"Scroll viewport `Ps` times to the left.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the left.\n * SL has no effect outside of the scroll margins.\n */\n public scrollLeft(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps SP A Scroll right Ps columns (default = 1) (SR) ECMA-48\n *\n * Notation: (Pn)\n * Representation: CSI Pn 02/00 04/01\n * Parameter default value: Pn = 1\n * SR causes the data in the presentation component to be moved by n character positions\n * if the line orientation is horizontal, or by n line positions if the line orientation\n * is vertical, such that the data appear to move to the right; where n equals the value of Pn.\n * The active presentation position is not affected by this control function.\n *\n * Supported:\n * - always right shift (no line orientation setting respected)\n *\n * @vt: #Y CSI SR \"Scroll Right\" \"CSI Ps SP A\" \"Scroll viewport `Ps` times to the right.\"\n * SL moves the content of all lines within the scroll margins `Ps` times to the right.\n * Content at the right margin is lost.\n * SL has no effect outside of the scroll margins.\n */\n public scrollRight(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(0, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' }\n * Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.\n *\n * @vt: #Y CSI DECIC \"Insert Columns\" \"CSI Ps ' }\" \"Insert `Ps` columns at cursor position.\"\n * DECIC inserts `Ps` times blank columns at the cursor position for all lines with the scroll margins,\n * moving content to the right. Content at the right margin is lost.\n * DECIC has no effect outside the scrolling margins.\n */\n public insertColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.insertCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Pm ' ~\n * Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.\n *\n * @vt: #Y CSI DECDC \"Delete Columns\" \"CSI Ps ' ~\" \"Delete `Ps` columns at cursor position.\"\n * DECDC deletes `Ps` times columns at the cursor position for all lines with the scroll margins,\n * moving content to the left. Blank columns are added at the right margin.\n * DECDC has no effect outside the scrolling margins.\n */\n public deleteColumns(params: IParams): boolean {\n if (this._activeBuffer.y > this._activeBuffer.scrollBottom || this._activeBuffer.y < this._activeBuffer.scrollTop) {\n return true;\n }\n const param = params.params[0] || 1;\n for (let y = this._activeBuffer.scrollTop; y <= this._activeBuffer.scrollBottom; ++y) {\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;\n line.deleteCells(this._activeBuffer.x, param, this._activeBuffer.getNullCell(this._eraseAttrData()), this._eraseAttrData());\n line.isWrapped = false;\n }\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n return true;\n }\n\n /**\n * CSI Ps X\n * Erase Ps Character(s) (default = 1) (ECH).\n *\n * @vt: #Y CSI ECH \"Erase Character\" \"CSI Ps X\" \"Erase `Ps` characters from current cursor position to the right (default=1).\"\n * ED erases `Ps` characters from current cursor position to the right.\n * ED works inside or outside the scrolling margins.\n */\n public eraseChars(params: IParams): boolean {\n this._restrictCursor();\n const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y);\n if (line) {\n line.replaceCells(\n this._activeBuffer.x,\n this._activeBuffer.x + (params.params[0] || 1),\n this._activeBuffer.getNullCell(this._eraseAttrData()),\n this._eraseAttrData()\n );\n this._dirtyRowTracker.markDirty(this._activeBuffer.y);\n }\n return true;\n }\n\n /**\n * CSI Ps b Repeat the preceding graphic character Ps times (REP).\n * From ECMA 48 (@see http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf)\n * Notation: (Pn)\n * Representation: CSI Pn 06/02\n * Parameter default value: Pn = 1\n * REP is used to indicate that the preceding character in the data stream,\n * if it is a graphic character (represented by one or more bit combinations) including SPACE,\n * is to be repeated n times, where n equals the value of Pn.\n * If the character preceding REP is a control function or part of a control function,\n * the effect of REP is not defined by this Standard.\n *\n * Since we propagate the terminal as xterm-256color we have to follow xterm's behavior:\n * - fullwidth + surrogate chars are ignored\n * - for combining chars only the base char gets repeated\n * - text attrs are applied normally\n * - wrap around is respected\n * - any valid sequence resets the carried forward char\n *\n * Note: To get reset on a valid sequence working correctly without much runtime penalty,\n * the preceding codepoint is stored on the parser in `this.print` and reset during `parser.parse`.\n *\n * @vt: #Y CSI REP \"Repeat Preceding Character\" \"CSI Ps b\" \"Repeat preceding character `Ps` times (default=1).\"\n * REP repeats the previous character `Ps` times advancing the cursor, also wrapping if DECAWM is set.\n * REP has no effect if the sequence does not follow a printable ASCII character\n * (NOOP for any other sequence in between or NON ASCII characters).\n */\n public repeatPrecedingCharacter(params: IParams): boolean {\n if (!this._parser.precedingCodepoint) {\n return true;\n }\n // call print to insert the chars and handle correct wrapping\n const length = params.params[0] || 1;\n const data = new Uint32Array(length);\n for (let i = 0; i < length; ++i) {\n data[i] = this._parser.precedingCodepoint;\n }\n this.print(data, 0, data.length);\n return true;\n }\n\n /**\n * CSI Ps c Send Device Attributes (Primary DA).\n * Ps = 0 or omitted -> request attributes from terminal. The\n * response depends on the decTerminalID resource setting.\n * -> CSI ? 1 ; 2 c (``VT100 with Advanced Video Option'')\n * -> CSI ? 1 ; 0 c (``VT101 with No Options'')\n * -> CSI ? 6 c (``VT102'')\n * -> CSI ? 6 0 ; 1 ; 2 ; 6 ; 8 ; 9 ; 1 5 ; c (``VT220'')\n * The VT100-style response parameters do not mean anything by\n * themselves. VT220 parameters do, telling the host what fea-\n * tures the terminal supports:\n * Ps = 1 -> 132-columns.\n * Ps = 2 -> Printer.\n * Ps = 6 -> Selective erase.\n * Ps = 8 -> User-defined keys.\n * Ps = 9 -> National replacement character sets.\n * Ps = 1 5 -> Technical characters.\n * Ps = 2 2 -> ANSI color, e.g., VT525.\n * Ps = 2 9 -> ANSI text locator (i.e., DEC Locator mode).\n *\n * @vt: #Y CSI DA1 \"Primary Device Attributes\" \"CSI c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesPrimary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n if (this._is('xterm') || this._is('rxvt-unicode') || this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?1;2c');\n } else if (this._is('linux')) {\n this._coreService.triggerDataEvent(C0.ESC + '[?6c');\n }\n return true;\n }\n\n /**\n * CSI > Ps c\n * Send Device Attributes (Secondary DA).\n * Ps = 0 or omitted -> request the terminal's identification\n * code. The response depends on the decTerminalID resource set-\n * ting. It should apply only to VT220 and up, but xterm extends\n * this to VT100.\n * -> CSI > Pp ; Pv ; Pc c\n * where Pp denotes the terminal type\n * Pp = 0 -> ``VT100''.\n * Pp = 1 -> ``VT220''.\n * and Pv is the firmware version (for xterm, this was originally\n * the XFree86 patch number, starting with 95). In a DEC termi-\n * nal, Pc indicates the ROM cartridge registration number and is\n * always zero.\n * More information:\n * xterm/charproc.c - line 2012, for more information.\n * vim responds with ^[[?0c or ^[[?1c after the terminal's response (?)\n *\n * @vt: #Y CSI DA2 \"Secondary Device Attributes\" \"CSI > c\" \"Send primary device attributes.\"\n *\n *\n * TODO: fix and cleanup response\n */\n public sendDeviceAttributesSecondary(params: IParams): boolean {\n if (params.params[0] > 0) {\n return true;\n }\n // xterm and urxvt\n // seem to spit this\n // out around ~370 times (?).\n if (this._is('xterm')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>0;276;0c');\n } else if (this._is('rxvt-unicode')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>85;95;0c');\n } else if (this._is('linux')) {\n // not supported by linux console.\n // linux console echoes parameters.\n this._coreService.triggerDataEvent(params.params[0] + 'c');\n } else if (this._is('screen')) {\n this._coreService.triggerDataEvent(C0.ESC + '[>83;40003;0c');\n }\n return true;\n }\n\n /**\n * Evaluate if the current terminal is the given argument.\n * @param term The terminal name to evaluate\n */\n private _is(term: string): boolean {\n return (this._optionsService.rawOptions.termName + '').indexOf(term) === 0;\n }\n\n /**\n * CSI Pm h Set Mode (SM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Insert Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Automatic Newline (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI SM \"Set Mode\" \"CSI Pm h\" \"Set various terminal modes.\"\n * Supported param values by SM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Insert Mode (IRM). | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Automatic Newline (LNM). | #Y |\n */\n public setMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = true;\n break;\n case 20:\n this._optionsService.options.convertEol = true;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm h\n * DEC Private Mode Set (DECSET).\n * Ps = 1 -> Application Cursor Keys (DECCKM).\n * Ps = 2 -> Designate USASCII for character sets G0-G3\n * (DECANM), and set VT100 mode.\n * Ps = 3 -> 132 Column Mode (DECCOLM).\n * Ps = 4 -> Smooth (Slow) Scroll (DECSCLM).\n * Ps = 5 -> Reverse Video (DECSCNM).\n * Ps = 6 -> Origin Mode (DECOM).\n * Ps = 7 -> Wraparound Mode (DECAWM).\n * Ps = 8 -> Auto-repeat Keys (DECARM).\n * Ps = 9 -> Send Mouse X & Y on button press. See the sec-\n * tion Mouse Tracking.\n * Ps = 1 0 -> Show toolbar (rxvt).\n * Ps = 1 2 -> Start Blinking Cursor (att610).\n * Ps = 1 8 -> Print form feed (DECPFF).\n * Ps = 1 9 -> Set print extent to full screen (DECPEX).\n * Ps = 2 5 -> Show Cursor (DECTCEM).\n * Ps = 3 0 -> Show scrollbar (rxvt).\n * Ps = 3 5 -> Enable font-shifting functions (rxvt).\n * Ps = 3 8 -> Enter Tektronix Mode (DECTEK).\n * Ps = 4 0 -> Allow 80 -> 132 Mode.\n * Ps = 4 1 -> more(1) fix (see curses resource).\n * Ps = 4 2 -> Enable Nation Replacement Character sets (DECN-\n * RCM).\n * Ps = 4 4 -> Turn On Margin Bell.\n * Ps = 4 5 -> Reverse-wraparound Mode.\n * Ps = 4 6 -> Start Logging. This is normally disabled by a\n * compile-time option.\n * Ps = 4 7 -> Use Alternate Screen Buffer. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 6 6 -> Application keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends backspace (DECBKM).\n * Ps = 1 0 0 0 -> Send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Enable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Scroll to bottom on tty output (rxvt).\n * Ps = 1 0 1 1 -> Scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Interpret \"meta\" key, sets eighth bit.\n * (enables the eightBitInput resource).\n * Ps = 1 0 3 5 -> Enable special modifiers for Alt and Num-\n * Lock keys. (This enables the numLock resource).\n * Ps = 1 0 3 6 -> Send ESC when Meta modifies a key. (This\n * enables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send DEL from the editing-keypad Delete\n * key.\n * Ps = 1 0 3 9 -> Send ESC when Alt modifies a key. (This\n * enables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Keep selection even if not highlighted.\n * (This enables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the CLIPBOARD selection. (This enables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Enable Urgency window manager hint when\n * Control-G is received. (This enables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Enable raising of the window when Control-G\n * is received. (enables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Alternate Screen Buffer. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 8 -> Save cursor as in DECSC. (This may be dis-\n * abled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Save cursor as in DECSC and use Alternate\n * Screen Buffer, clearing it first. (This may be disabled by\n * the titeInhibit resource). This combines the effects of the 1\n * 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based\n * applications rather than the 4 7 mode.\n * Ps = 1 0 5 0 -> Set terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Set Sun function-key mode.\n * Ps = 1 0 5 2 -> Set HP function-key mode.\n * Ps = 1 0 5 3 -> Set SCO function-key mode.\n * Ps = 1 0 6 0 -> Set legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Set VT220 keyboard emulation.\n * Ps = 2 0 0 4 -> Set bracketed paste mode.\n * Modes:\n * http: *vt100.net/docs/vt220-rm/chapter4.html\n *\n * @vt: #P[See below for supported modes.] CSI DECSET \"DEC Private Set Mode\" \"CSI ? Pm h\" \"Set various terminal attributes.\"\n * Supported param values by DECSET:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | --------|\n * | 1 | Application Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate US-ASCII for character sets G0-G3 (DECANM). | #Y |\n * | 3 | 132 Column Mode (DECCOLM). | #Y |\n * | 6 | Origin Mode (DECOM). | #Y |\n * | 7 | Auto-wrap Mode (DECAWM). | #Y |\n * | 8 | Auto-repeat Keys (DECARM). Always on. | #N |\n * | 9 | X10 xterm mouse protocol. | #Y |\n * | 12 | Start Blinking Cursor. | #Y |\n * | 25 | Show Cursor (DECTCEM). | #Y |\n * | 45 | Reverse wrap-around. | #Y |\n * | 47 | Use Alternate Screen Buffer. | #Y |\n * | 66 | Application keypad (DECNKM). | #Y |\n * | 1000 | X11 xterm mouse protocol. | #Y |\n * | 1002 | Use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Use All Motion Mouse Tracking. | #Y |\n * | 1004 | Send FocusIn/FocusOut events | #Y |\n * | 1005 | Enable UTF-8 Mouse Mode. | #N |\n * | 1006 | Enable SGR Mouse Mode. | #Y |\n * | 1015 | Enable urxvt Mouse Mode. | #N |\n * | 1016 | Enable SGR-Pixels Mouse Mode. | #Y |\n * | 1047 | Use Alternate Screen Buffer. | #Y |\n * | 1048 | Save cursor as in DECSC. | #Y |\n * | 1049 | Save cursor and switch to alternate buffer clearing it. | #P[Does not clear the alternate buffer.] |\n * | 2004 | Set bracketed paste mode. | #Y |\n *\n *\n * FIXME: implement DECSCNM, 1049 should clear altbuffer\n */\n public setModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = true;\n break;\n case 2:\n this._charsetService.setgCharset(0, DEFAULT_CHARSET);\n this._charsetService.setgCharset(1, DEFAULT_CHARSET);\n this._charsetService.setgCharset(2, DEFAULT_CHARSET);\n this._charsetService.setgCharset(3, DEFAULT_CHARSET);\n // set VT100 mode here\n break;\n case 3:\n /**\n * DECCOLM - 132 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(132, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = true;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = true;\n break;\n case 12:\n this._optionsService.options.cursorBlink = true;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = true;\n break;\n case 66:\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n // no release, no motion, no wheel, no modifiers.\n this._coreMouseService.activeProtocol = 'X10';\n break;\n case 1000: // vt200 mouse\n // no motion.\n this._coreMouseService.activeProtocol = 'VT200';\n break;\n case 1002: // button event mouse\n this._coreMouseService.activeProtocol = 'DRAG';\n break;\n case 1003: // any event mouse\n // any event - sends motion events,\n // even if there is no button held down.\n this._coreMouseService.activeProtocol = 'ANY';\n break;\n case 1004: // send focusin/focusout events\n // focusin: ^[[I\n // focusout: ^[[O\n this._coreService.decPrivateModes.sendFocus = true;\n this._onRequestSendFocus.fire();\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'SGR';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECSET 1015 not supported (see #2507)');\n break;\n case 1016: // sgr pixels mode mouse\n this._coreMouseService.activeEncoding = 'SGR_PIXELS';\n break;\n case 25: // show cursor\n this._coreService.isCursorHidden = false;\n break;\n case 1048: // alt screen cursor\n this.saveCursor();\n break;\n case 1049: // alt screen buffer cursor\n this.saveCursor();\n // FALL-THROUGH\n case 47: // alt screen buffer\n case 1047: // alt screen buffer\n this._bufferService.buffers.activateAltBuffer(this._eraseAttrData());\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = true;\n break;\n }\n }\n return true;\n }\n\n\n /**\n * CSI Pm l Reset Mode (RM).\n * Ps = 2 -> Keyboard Action Mode (AM).\n * Ps = 4 -> Replace Mode (IRM).\n * Ps = 1 2 -> Send/receive (SRM).\n * Ps = 2 0 -> Normal Linefeed (LNM).\n *\n * @vt: #P[Only IRM is supported.] CSI RM \"Reset Mode\" \"CSI Pm l\" \"Set various terminal attributes.\"\n * Supported param values by RM:\n *\n * | Param | Action | Support |\n * | ----- | -------------------------------------- | ------- |\n * | 2 | Keyboard Action Mode (KAM). Always on. | #N |\n * | 4 | Replace Mode (IRM). (default) | #Y |\n * | 12 | Send/receive (SRM). Always off. | #N |\n * | 20 | Normal Linefeed (LNM). | #Y |\n *\n *\n * FIXME: why is LNM commented out?\n */\n public resetMode(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 4:\n this._coreService.modes.insertMode = false;\n break;\n case 20:\n this._optionsService.options.convertEol = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI ? Pm l\n * DEC Private Mode Reset (DECRST).\n * Ps = 1 -> Normal Cursor Keys (DECCKM).\n * Ps = 2 -> Designate VT52 mode (DECANM).\n * Ps = 3 -> 80 Column Mode (DECCOLM).\n * Ps = 4 -> Jump (Fast) Scroll (DECSCLM).\n * Ps = 5 -> Normal Video (DECSCNM).\n * Ps = 6 -> Normal Cursor Mode (DECOM).\n * Ps = 7 -> No Wraparound Mode (DECAWM).\n * Ps = 8 -> No Auto-repeat Keys (DECARM).\n * Ps = 9 -> Don't send Mouse X & Y on button press.\n * Ps = 1 0 -> Hide toolbar (rxvt).\n * Ps = 1 2 -> Stop Blinking Cursor (att610).\n * Ps = 1 8 -> Don't print form feed (DECPFF).\n * Ps = 1 9 -> Limit print to scrolling region (DECPEX).\n * Ps = 2 5 -> Hide Cursor (DECTCEM).\n * Ps = 3 0 -> Don't show scrollbar (rxvt).\n * Ps = 3 5 -> Disable font-shifting functions (rxvt).\n * Ps = 4 0 -> Disallow 80 -> 132 Mode.\n * Ps = 4 1 -> No more(1) fix (see curses resource).\n * Ps = 4 2 -> Disable Nation Replacement Character sets (DEC-\n * NRCM).\n * Ps = 4 4 -> Turn Off Margin Bell.\n * Ps = 4 5 -> No Reverse-wraparound Mode.\n * Ps = 4 6 -> Stop Logging. (This is normally disabled by a\n * compile-time option).\n * Ps = 4 7 -> Use Normal Screen Buffer.\n * Ps = 6 6 -> Numeric keypad (DECNKM).\n * Ps = 6 7 -> Backarrow key sends delete (DECBKM).\n * Ps = 1 0 0 0 -> Don't send Mouse X & Y on button press and\n * release. See the section Mouse Tracking.\n * Ps = 1 0 0 1 -> Don't use Hilite Mouse Tracking.\n * Ps = 1 0 0 2 -> Don't use Cell Motion Mouse Tracking.\n * Ps = 1 0 0 3 -> Don't use All Motion Mouse Tracking.\n * Ps = 1 0 0 4 -> Don't send FocusIn/FocusOut events.\n * Ps = 1 0 0 5 -> Disable Extended Mouse Mode.\n * Ps = 1 0 1 0 -> Don't scroll to bottom on tty output\n * (rxvt).\n * Ps = 1 0 1 1 -> Don't scroll to bottom on key press (rxvt).\n * Ps = 1 0 3 4 -> Don't interpret \"meta\" key. (This disables\n * the eightBitInput resource).\n * Ps = 1 0 3 5 -> Disable special modifiers for Alt and Num-\n * Lock keys. (This disables the numLock resource).\n * Ps = 1 0 3 6 -> Don't send ESC when Meta modifies a key.\n * (This disables the metaSendsEscape resource).\n * Ps = 1 0 3 7 -> Send VT220 Remove from the editing-keypad\n * Delete key.\n * Ps = 1 0 3 9 -> Don't send ESC when Alt modifies a key.\n * (This disables the altSendsEscape resource).\n * Ps = 1 0 4 0 -> Do not keep selection when not highlighted.\n * (This disables the keepSelection resource).\n * Ps = 1 0 4 1 -> Use the PRIMARY selection. (This disables\n * the selectToClipboard resource).\n * Ps = 1 0 4 2 -> Disable Urgency window manager hint when\n * Control-G is received. (This disables the bellIsUrgent\n * resource).\n * Ps = 1 0 4 3 -> Disable raising of the window when Control-\n * G is received. (This disables the popOnBell resource).\n * Ps = 1 0 4 7 -> Use Normal Screen Buffer, clearing screen\n * first if in the Alternate Screen. (This may be disabled by\n * the titeInhibit resource).\n * Ps = 1 0 4 8 -> Restore cursor as in DECRC. (This may be\n * disabled by the titeInhibit resource).\n * Ps = 1 0 4 9 -> Use Normal Screen Buffer and restore cursor\n * as in DECRC. (This may be disabled by the titeInhibit\n * resource). This combines the effects of the 1 0 4 7 and 1 0\n * 4 8 modes. Use this with terminfo-based applications rather\n * than the 4 7 mode.\n * Ps = 1 0 5 0 -> Reset terminfo/termcap function-key mode.\n * Ps = 1 0 5 1 -> Reset Sun function-key mode.\n * Ps = 1 0 5 2 -> Reset HP function-key mode.\n * Ps = 1 0 5 3 -> Reset SCO function-key mode.\n * Ps = 1 0 6 0 -> Reset legacy keyboard emulation (X11R6).\n * Ps = 1 0 6 1 -> Reset keyboard emulation to Sun/PC style.\n * Ps = 2 0 0 4 -> Reset bracketed paste mode.\n *\n * @vt: #P[See below for supported modes.] CSI DECRST \"DEC Private Reset Mode\" \"CSI ? Pm l\" \"Reset various terminal attributes.\"\n * Supported param values by DECRST:\n *\n * | param | Action | Support |\n * | ----- | ------------------------------------------------------- | ------- |\n * | 1 | Normal Cursor Keys (DECCKM). | #Y |\n * | 2 | Designate VT52 mode (DECANM). | #N |\n * | 3 | 80 Column Mode (DECCOLM). | #B[Switches to old column width instead of 80.] |\n * | 6 | Normal Cursor Mode (DECOM). | #Y |\n * | 7 | No Wraparound Mode (DECAWM). | #Y |\n * | 8 | No Auto-repeat Keys (DECARM). | #N |\n * | 9 | Don't send Mouse X & Y on button press. | #Y |\n * | 12 | Stop Blinking Cursor. | #Y |\n * | 25 | Hide Cursor (DECTCEM). | #Y |\n * | 45 | No reverse wrap-around. | #Y |\n * | 47 | Use Normal Screen Buffer. | #Y |\n * | 66 | Numeric keypad (DECNKM). | #Y |\n * | 1000 | Don't send Mouse reports. | #Y |\n * | 1002 | Don't use Cell Motion Mouse Tracking. | #Y |\n * | 1003 | Don't use All Motion Mouse Tracking. | #Y |\n * | 1004 | Don't send FocusIn/FocusOut events. | #Y |\n * | 1005 | Disable UTF-8 Mouse Mode. | #N |\n * | 1006 | Disable SGR Mouse Mode. | #Y |\n * | 1015 | Disable urxvt Mouse Mode. | #N |\n * | 1016 | Disable SGR-Pixels Mouse Mode. | #Y |\n * | 1047 | Use Normal Screen Buffer (clearing screen if in alt). | #Y |\n * | 1048 | Restore cursor as in DECRC. | #Y |\n * | 1049 | Use Normal Screen Buffer and restore cursor. | #Y |\n * | 2004 | Reset bracketed paste mode. | #Y |\n *\n *\n * FIXME: DECCOLM is currently broken (already fixed in window options PR)\n */\n public resetModePrivate(params: IParams): boolean {\n for (let i = 0; i < params.length; i++) {\n switch (params.params[i]) {\n case 1:\n this._coreService.decPrivateModes.applicationCursorKeys = false;\n break;\n case 3:\n /**\n * DECCOLM - 80 column mode.\n * This is only active if 'SetWinLines' (24) is enabled\n * through `options.windowsOptions`.\n */\n if (this._optionsService.rawOptions.windowOptions.setWinLines) {\n this._bufferService.resize(80, this._bufferService.rows);\n this._onRequestReset.fire();\n }\n break;\n case 6:\n this._coreService.decPrivateModes.origin = false;\n this._setCursor(0, 0);\n break;\n case 7:\n this._coreService.decPrivateModes.wraparound = false;\n break;\n case 12:\n this._optionsService.options.cursorBlink = false;\n break;\n case 45:\n this._coreService.decPrivateModes.reverseWraparound = false;\n break;\n case 66:\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n break;\n case 9: // X10 Mouse\n case 1000: // vt200 mouse\n case 1002: // button event mouse\n case 1003: // any event mouse\n this._coreMouseService.activeProtocol = 'NONE';\n break;\n case 1004: // send focusin/focusout events\n this._coreService.decPrivateModes.sendFocus = false;\n break;\n case 1005: // utf8 ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1005 not supported (see #2507)');\n break;\n case 1006: // sgr ext mode mouse\n this._coreMouseService.activeEncoding = 'DEFAULT';\n break;\n case 1015: // urxvt ext mode mouse - removed in #2507\n this._logService.debug('DECRST 1015 not supported (see #2507)');\n break;\n case 1016: // sgr pixels mode mouse\n this._coreMouseService.activeEncoding = 'DEFAULT';\n break;\n case 25: // hide cursor\n this._coreService.isCursorHidden = true;\n break;\n case 1048: // alt screen cursor\n this.restoreCursor();\n break;\n case 1049: // alt screen buffer cursor\n // FALL-THROUGH\n case 47: // normal screen buffer\n case 1047: // normal screen buffer - clearing it first\n // Ensure the selection manager has the correct buffer\n this._bufferService.buffers.activateNormalBuffer();\n if (params.params[i] === 1049) {\n this.restoreCursor();\n }\n this._coreService.isCursorInitialized = true;\n this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1);\n this._onRequestSyncScrollBar.fire();\n break;\n case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)\n this._coreService.decPrivateModes.bracketedPasteMode = false;\n break;\n }\n }\n return true;\n }\n\n /**\n * CSI Ps $ p Request ANSI Mode (DECRQM).\n *\n * Reports CSI Ps; Pm $ y (DECRPM), where Ps is the mode number as in SM/RM,\n * and Pm is the mode value:\n * 0 - not recognized\n * 1 - set\n * 2 - reset\n * 3 - permanently set\n * 4 - permanently reset\n *\n * @vt: #Y CSI DECRQM \"Request Mode\" \"CSI Ps $p\" \"Request mode state.\"\n * Returns a report as `CSI Ps; Pm $ y` (DECRPM), where `Ps` is the mode number as in SM/RM\n * or DECSET/DECRST, and `Pm` is the mode value:\n * - 0: not recognized\n * - 1: set\n * - 2: reset\n * - 3: permanently set\n * - 4: permanently reset\n *\n * For modes not understood xterm.js always returns `notRecognized`. In general this means,\n * that a certain operation mode is not implemented and cannot be used.\n *\n * Modes changing the active terminal buffer (47, 1047, 1049) are not subqueried\n * and only report, whether the alternate buffer is set.\n *\n * Mouse encodings and mouse protocols are handled mutual exclusive,\n * thus only one of each of those can be set at a given time.\n *\n * There is a chance, that some mode reports are not fully in line with xterm.js' behavior,\n * e.g. if the default implementation already exposes a certain behavior. If you find\n * discrepancies in the mode reports, please file a bug.\n */\n public requestMode(params: IParams, ansi: boolean): boolean {\n // return value as in DECRPM\n const enum V {\n NOT_RECOGNIZED = 0,\n SET = 1,\n RESET = 2,\n PERMANENTLY_SET = 3,\n PERMANENTLY_RESET = 4\n }\n\n // access helpers\n const dm = this._coreService.decPrivateModes;\n const { activeProtocol: mouseProtocol, activeEncoding: mouseEncoding } = this._coreMouseService;\n const cs = this._coreService;\n const { buffers, cols } = this._bufferService;\n const { active, alt } = buffers;\n const opts = this._optionsService.rawOptions;\n\n const f = (m: number, v: V): boolean => {\n cs.triggerDataEvent(`${C0.ESC}[${ansi ? '' : '?'}${m};${v}$y`);\n return true;\n };\n const b2v = (value: boolean): V => value ? V.SET : V.RESET;\n\n const p = params.params[0];\n\n if (ansi) {\n if (p === 2) return f(p, V.PERMANENTLY_SET);\n if (p === 4) return f(p, b2v(cs.modes.insertMode));\n if (p === 12) return f(p, V.PERMANENTLY_RESET);\n if (p === 20) return f(p, b2v(opts.convertEol));\n return f(p, V.NOT_RECOGNIZED);\n }\n\n if (p === 1) return f(p, b2v(dm.applicationCursorKeys));\n if (p === 3) return f(p, opts.windowOptions.setWinLines ? (cols === 80 ? V.RESET : cols === 132 ? V.SET : V.NOT_RECOGNIZED) : V.NOT_RECOGNIZED);\n if (p === 6) return f(p, b2v(dm.origin));\n if (p === 7) return f(p, b2v(dm.wraparound));\n if (p === 8) return f(p, V.PERMANENTLY_SET);\n if (p === 9) return f(p, b2v(mouseProtocol === 'X10'));\n if (p === 12) return f(p, b2v(opts.cursorBlink));\n if (p === 25) return f(p, b2v(!cs.isCursorHidden));\n if (p === 45) return f(p, b2v(dm.reverseWraparound));\n if (p === 66) return f(p, b2v(dm.applicationKeypad));\n if (p === 1000) return f(p, b2v(mouseProtocol === 'VT200'));\n if (p === 1002) return f(p, b2v(mouseProtocol === 'DRAG'));\n if (p === 1003) return f(p, b2v(mouseProtocol === 'ANY'));\n if (p === 1004) return f(p, b2v(dm.sendFocus));\n if (p === 1005) return f(p, V.PERMANENTLY_RESET);\n if (p === 1006) return f(p, b2v(mouseEncoding === 'SGR'));\n if (p === 1015) return f(p, V.PERMANENTLY_RESET);\n if (p === 1016) return f(p, b2v(mouseEncoding === 'SGR_PIXELS'));\n if (p === 1048) return f(p, V.SET); // xterm always returns SET here\n if (p === 47 || p === 1047 || p === 1049) return f(p, b2v(active === alt));\n if (p === 2004) return f(p, b2v(dm.bracketedPasteMode));\n return f(p, V.NOT_RECOGNIZED);\n }\n\n /**\n * Helper to write color information packed with color mode.\n */\n private _updateAttrColor(color: number, mode: number, c1: number, c2: number, c3: number): number {\n if (mode === 2) {\n color |= Attributes.CM_RGB;\n color &= ~Attributes.RGB_MASK;\n color |= AttributeData.fromColorRGB([c1, c2, c3]);\n } else if (mode === 5) {\n color &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n color |= Attributes.CM_P256 | (c1 & 0xff);\n }\n return color;\n }\n\n /**\n * Helper to extract and apply color params/subparams.\n * Returns advance for params index.\n */\n private _extractColor(params: IParams, pos: number, attr: IAttributeData): number {\n // normalize params\n // meaning: [target, CM, ign, val, val, val]\n // RGB : [ 38/48, 2, ign, r, g, b]\n // P256 : [ 38/48, 5, ign, v, ign, ign]\n const accu = [0, 0, -1, 0, 0, 0];\n\n // alignment placeholder for non color space sequences\n let cSpace = 0;\n\n // return advance we took in params\n let advance = 0;\n\n do {\n accu[advance + cSpace] = params.params[pos + advance];\n if (params.hasSubParams(pos + advance)) {\n const subparams = params.getSubParams(pos + advance)!;\n let i = 0;\n do {\n if (accu[1] === 5) {\n cSpace = 1;\n }\n accu[advance + i + 1 + cSpace] = subparams[i];\n } while (++i < subparams.length && i + advance + 1 + cSpace < accu.length);\n break;\n }\n // exit early if can decide color mode with semicolons\n if ((accu[1] === 5 && advance + cSpace >= 2)\n || (accu[1] === 2 && advance + cSpace >= 5)) {\n break;\n }\n // offset colorSpace slot for semicolon mode\n if (accu[1]) {\n cSpace = 1;\n }\n } while (++advance + pos < params.length && advance + cSpace < accu.length);\n\n // set default values to 0\n for (let i = 2; i < accu.length; ++i) {\n if (accu[i] === -1) {\n accu[i] = 0;\n }\n }\n\n // apply colors\n switch (accu[0]) {\n case 38:\n attr.fg = this._updateAttrColor(attr.fg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 48:\n attr.bg = this._updateAttrColor(attr.bg, accu[1], accu[3], accu[4], accu[5]);\n break;\n case 58:\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = this._updateAttrColor(attr.extended.underlineColor, accu[1], accu[3], accu[4], accu[5]);\n }\n\n return advance;\n }\n\n /**\n * SGR 4 subparams:\n * 4:0 - equal to SGR 24 (turn off all underline)\n * 4:1 - equal to SGR 4 (single underline)\n * 4:2 - equal to SGR 21 (double underline)\n * 4:3 - curly underline\n * 4:4 - dotted underline\n * 4:5 - dashed underline\n */\n private _processUnderline(style: number, attr: IAttributeData): void {\n // treat extended attrs as immutable, thus always clone from old one\n // this is needed since the buffer only holds references to it\n attr.extended = attr.extended.clone();\n\n // default to 1 == single underline\n if (!~style || style > 5) {\n style = 1;\n }\n attr.extended.underlineStyle = style;\n attr.fg |= FgFlags.UNDERLINE;\n\n // 0 deactivates underline\n if (style === 0) {\n attr.fg &= ~FgFlags.UNDERLINE;\n }\n\n // update HAS_EXTENDED in BG\n attr.updateExtended();\n }\n\n private _processSGR0(attr: IAttributeData): void {\n attr.fg = DEFAULT_ATTR_DATA.fg;\n attr.bg = DEFAULT_ATTR_DATA.bg;\n attr.extended = attr.extended.clone();\n // Reset underline style and color. Note that we don't want to reset other\n // fields such as the url id.\n attr.extended.underlineStyle = UnderlineStyle.NONE;\n attr.extended.underlineColor &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.updateExtended();\n }\n\n /**\n * CSI Pm m Character Attributes (SGR).\n *\n * @vt: #P[See below for supported attributes.] CSI SGR \"Select Graphic Rendition\" \"CSI Pm m\" \"Set/Reset various text attributes.\"\n * SGR selects one or more character attributes at the same time. Multiple params (up to 32)\n * are applied in order from left to right. The changed attributes are applied to all new\n * characters received. If you move characters in the viewport by scrolling or any other means,\n * then the attributes move with the characters.\n *\n * Supported param values by SGR:\n *\n * | Param | Meaning | Support |\n * | --------- | -------------------------------------------------------- | ------- |\n * | 0 | Normal (default). Resets any other preceding SGR. | #Y |\n * | 1 | Bold. (also see `options.drawBoldTextInBrightColors`) | #Y |\n * | 2 | Faint, decreased intensity. | #Y |\n * | 3 | Italic. | #Y |\n * | 4 | Underlined (see below for style support). | #Y |\n * | 5 | Slowly blinking. | #N |\n * | 6 | Rapidly blinking. | #N |\n * | 7 | Inverse. Flips foreground and background color. | #Y |\n * | 8 | Invisible (hidden). | #Y |\n * | 9 | Crossed-out characters (strikethrough). | #Y |\n * | 21 | Doubly underlined. | #Y |\n * | 22 | Normal (neither bold nor faint). | #Y |\n * | 23 | No italic. | #Y |\n * | 24 | Not underlined. | #Y |\n * | 25 | Steady (not blinking). | #Y |\n * | 27 | Positive (not inverse). | #Y |\n * | 28 | Visible (not hidden). | #Y |\n * | 29 | Not Crossed-out (strikethrough). | #Y |\n * | 30 | Foreground color: Black. | #Y |\n * | 31 | Foreground color: Red. | #Y |\n * | 32 | Foreground color: Green. | #Y |\n * | 33 | Foreground color: Yellow. | #Y |\n * | 34 | Foreground color: Blue. | #Y |\n * | 35 | Foreground color: Magenta. | #Y |\n * | 36 | Foreground color: Cyan. | #Y |\n * | 37 | Foreground color: White. | #Y |\n * | 38 | Foreground color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 39 | Foreground color: Default (original). | #Y |\n * | 40 | Background color: Black. | #Y |\n * | 41 | Background color: Red. | #Y |\n * | 42 | Background color: Green. | #Y |\n * | 43 | Background color: Yellow. | #Y |\n * | 44 | Background color: Blue. | #Y |\n * | 45 | Background color: Magenta. | #Y |\n * | 46 | Background color: Cyan. | #Y |\n * | 47 | Background color: White. | #Y |\n * | 48 | Background color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 49 | Background color: Default (original). | #Y |\n * | 58 | Underline color: Extended color. | #P[Support for RGB and indexed colors, see below.] |\n * | 90 - 97 | Bright foreground color (analogous to 30 - 37). | #Y |\n * | 100 - 107 | Bright background color (analogous to 40 - 47). | #Y |\n *\n * Underline supports subparams to denote the style in the form `4 : x`:\n *\n * | x | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | No underline. Same as `SGR 24 m`. | #Y |\n * | 1 | Single underline. Same as `SGR 4 m`. | #Y |\n * | 2 | Double underline. | #Y |\n * | 3 | Curly underline. | #Y |\n * | 4 | Dotted underline. | #Y |\n * | 5 | Dashed underline. | #Y |\n * | other | Single underline. Same as `SGR 4 m`. | #Y |\n *\n * Extended colors are supported for foreground (Ps=38), background (Ps=48) and underline (Ps=58) as follows:\n *\n * | Ps + 1 | Meaning | Support |\n * | ------ | ------------------------------------------------------------- | ------- |\n * | 0 | Implementation defined. | #N |\n * | 1 | Transparent. | #N |\n * | 2 | RGB color as `Ps ; 2 ; R ; G ; B` or `Ps : 2 : : R : G : B`. | #Y |\n * | 3 | CMY color. | #N |\n * | 4 | CMYK color. | #N |\n * | 5 | Indexed (256 colors) as `Ps ; 5 ; INDEX` or `Ps : 5 : INDEX`. | #Y |\n *\n *\n * FIXME: blinking is implemented in attrs, but not working in renderers?\n * FIXME: remove dead branch for p=100\n */\n public charAttributes(params: IParams): boolean {\n // Optimize a single SGR0.\n if (params.length === 1 && params.params[0] === 0) {\n this._processSGR0(this._curAttrData);\n return true;\n }\n\n const l = params.length;\n let p;\n const attr = this._curAttrData;\n\n for (let i = 0; i < l; i++) {\n p = params.params[i];\n if (p >= 30 && p <= 37) {\n // fg color 8\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 30);\n } else if (p >= 40 && p <= 47) {\n // bg color 8\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 40);\n } else if (p >= 90 && p <= 97) {\n // fg color 16\n attr.fg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.fg |= Attributes.CM_P16 | (p - 90) | 8;\n } else if (p >= 100 && p <= 107) {\n // bg color 16\n attr.bg &= ~(Attributes.CM_MASK | Attributes.PCOLOR_MASK);\n attr.bg |= Attributes.CM_P16 | (p - 100) | 8;\n } else if (p === 0) {\n // default\n this._processSGR0(attr);\n } else if (p === 1) {\n // bold text\n attr.fg |= FgFlags.BOLD;\n } else if (p === 3) {\n // italic text\n attr.bg |= BgFlags.ITALIC;\n } else if (p === 4) {\n // underlined text\n attr.fg |= FgFlags.UNDERLINE;\n this._processUnderline(params.hasSubParams(i) ? params.getSubParams(i)![0] : UnderlineStyle.SINGLE, attr);\n } else if (p === 5) {\n // blink\n attr.fg |= FgFlags.BLINK;\n } else if (p === 7) {\n // inverse and positive\n // test with: echo -e '\\e[31m\\e[42mhello\\e[7mworld\\e[27mhi\\e[m'\n attr.fg |= FgFlags.INVERSE;\n } else if (p === 8) {\n // invisible\n attr.fg |= FgFlags.INVISIBLE;\n } else if (p === 9) {\n // strikethrough\n attr.fg |= FgFlags.STRIKETHROUGH;\n } else if (p === 2) {\n // dimmed text\n attr.bg |= BgFlags.DIM;\n } else if (p === 21) {\n // double underline\n this._processUnderline(UnderlineStyle.DOUBLE, attr);\n } else if (p === 22) {\n // not bold nor faint\n attr.fg &= ~FgFlags.BOLD;\n attr.bg &= ~BgFlags.DIM;\n } else if (p === 23) {\n // not italic\n attr.bg &= ~BgFlags.ITALIC;\n } else if (p === 24) {\n // not underlined\n attr.fg &= ~FgFlags.UNDERLINE;\n this._processUnderline(UnderlineStyle.NONE, attr);\n } else if (p === 25) {\n // not blink\n attr.fg &= ~FgFlags.BLINK;\n } else if (p === 27) {\n // not inverse\n attr.fg &= ~FgFlags.INVERSE;\n } else if (p === 28) {\n // not invisible\n attr.fg &= ~FgFlags.INVISIBLE;\n } else if (p === 29) {\n // not strikethrough\n attr.fg &= ~FgFlags.STRIKETHROUGH;\n } else if (p === 39) {\n // reset fg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 49) {\n // reset bg\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else if (p === 38 || p === 48 || p === 58) {\n // fg color 256 and RGB\n i += this._extractColor(params, i, attr);\n } else if (p === 59) {\n attr.extended = attr.extended.clone();\n attr.extended.underlineColor = -1;\n attr.updateExtended();\n } else if (p === 100) { // FIXME: dead branch, p=100 already handled above!\n // reset fg/bg\n attr.fg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.fg |= DEFAULT_ATTR_DATA.fg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n attr.bg &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n attr.bg |= DEFAULT_ATTR_DATA.bg & (Attributes.PCOLOR_MASK | Attributes.RGB_MASK);\n } else {\n this._logService.debug('Unknown SGR attribute: %d.', p);\n }\n }\n return true;\n }\n\n /**\n * CSI Ps n Device Status Report (DSR).\n * Ps = 5 -> Status Report. Result (``OK'') is\n * CSI 0 n\n * Ps = 6 -> Report Cursor Position (CPR) [row;column].\n * Result is\n * CSI r ; c R\n * CSI ? Ps n\n * Device Status Report (DSR, DEC-specific).\n * Ps = 6 -> Report Cursor Position (CPR) [row;column] as CSI\n * ? r ; c R (assumes page is zero).\n * Ps = 1 5 -> Report Printer status as CSI ? 1 0 n (ready).\n * or CSI ? 1 1 n (not ready).\n * Ps = 2 5 -> Report UDK status as CSI ? 2 0 n (unlocked)\n * or CSI ? 2 1 n (locked).\n * Ps = 2 6 -> Report Keyboard status as\n * CSI ? 2 7 ; 1 ; 0 ; 0 n (North American).\n * The last two parameters apply to VT400 & up, and denote key-\n * board ready and LK01 respectively.\n * Ps = 5 3 -> Report Locator status as\n * CSI ? 5 3 n Locator available, if compiled-in, or\n * CSI ? 5 0 n No Locator, if not.\n *\n * @vt: #Y CSI DSR \"Device Status Report\" \"CSI Ps n\" \"Request cursor position (CPR) with `Ps` = 6.\"\n */\n public deviceStatus(params: IParams): boolean {\n switch (params.params[0]) {\n case 5:\n // status report\n this._coreService.triggerDataEvent(`${C0.ESC}[0n`);\n break;\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[${y};${x}R`);\n break;\n }\n return true;\n }\n\n // @vt: #P[Only CPR is supported.] CSI DECDSR \"DEC Device Status Report\" \"CSI ? Ps n\" \"Only CPR is supported (same as DSR).\"\n public deviceStatusPrivate(params: IParams): boolean {\n // modern xterm doesnt seem to\n // respond to any of these except ?6, 6, and 5\n switch (params.params[0]) {\n case 6:\n // cursor position\n const y = this._activeBuffer.y + 1;\n const x = this._activeBuffer.x + 1;\n this._coreService.triggerDataEvent(`${C0.ESC}[?${y};${x}R`);\n break;\n case 15:\n // no printer\n // this.handler(C0.ESC + '[?11n');\n break;\n case 25:\n // dont support user defined keys\n // this.handler(C0.ESC + '[?21n');\n break;\n case 26:\n // north american keyboard\n // this.handler(C0.ESC + '[?27;1;0;0n');\n break;\n case 53:\n // no dec locator/mouse\n // this.handler(C0.ESC + '[?50n');\n break;\n }\n return true;\n }\n\n /**\n * CSI ! p Soft terminal reset (DECSTR).\n * http://vt100.net/docs/vt220-rm/table4-10.html\n *\n * @vt: #Y CSI DECSTR \"Soft Terminal Reset\" \"CSI ! p\" \"Reset several terminal attributes to initial state.\"\n * There are two terminal reset sequences - RIS and DECSTR. While RIS performs almost a full terminal bootstrap,\n * DECSTR only resets certain attributes. For most needs DECSTR should be sufficient.\n *\n * The following terminal attributes are reset to default values:\n * - IRM is reset (dafault = false)\n * - scroll margins are reset (default = viewport size)\n * - erase attributes are reset to default\n * - charsets are reset\n * - DECSC data is reset to initial values\n * - DECOM is reset to absolute mode\n *\n *\n * FIXME: there are several more attributes missing (see VT520 manual)\n */\n public softReset(params: IParams): boolean {\n this._coreService.isCursorHidden = false;\n this._onRequestSyncScrollBar.fire();\n this._activeBuffer.scrollTop = 0;\n this._activeBuffer.scrollBottom = this._bufferService.rows - 1;\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._coreService.reset();\n this._charsetService.reset();\n\n // reset DECSC data\n this._activeBuffer.savedX = 0;\n this._activeBuffer.savedY = this._activeBuffer.ybase;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n\n // reset DECOM\n this._coreService.decPrivateModes.origin = false;\n return true;\n }\n\n /**\n * CSI Ps SP q Set cursor style (DECSCUSR, VT520).\n * Ps = 0 -> blinking block.\n * Ps = 1 -> blinking block (default).\n * Ps = 2 -> steady block.\n * Ps = 3 -> blinking underline.\n * Ps = 4 -> steady underline.\n * Ps = 5 -> blinking bar (xterm).\n * Ps = 6 -> steady bar (xterm).\n *\n * @vt: #Y CSI DECSCUSR \"Set Cursor Style\" \"CSI Ps SP q\" \"Set cursor style.\"\n * Supported cursor styles:\n * - empty, 0 or 1: steady block\n * - 2: blink block\n * - 3: steady underline\n * - 4: blink underline\n * - 5: steady bar\n * - 6: blink bar\n */\n public setCursorStyle(params: IParams): boolean {\n const param = params.params[0] || 1;\n switch (param) {\n case 1:\n case 2:\n this._optionsService.options.cursorStyle = 'block';\n break;\n case 3:\n case 4:\n this._optionsService.options.cursorStyle = 'underline';\n break;\n case 5:\n case 6:\n this._optionsService.options.cursorStyle = 'bar';\n break;\n }\n const isBlinking = param % 2 === 1;\n this._optionsService.options.cursorBlink = isBlinking;\n return true;\n }\n\n /**\n * CSI Ps ; Ps r\n * Set Scrolling Region [top;bottom] (default = full size of win-\n * dow) (DECSTBM).\n *\n * @vt: #Y CSI DECSTBM \"Set Top and Bottom Margin\" \"CSI Ps ; Ps r\" \"Set top and bottom margins of the viewport [top;bottom] (default = viewport size).\"\n */\n public setScrollRegion(params: IParams): boolean {\n const top = params.params[0] || 1;\n let bottom: number;\n\n if (params.length < 2 || (bottom = params.params[1]) > this._bufferService.rows || bottom === 0) {\n bottom = this._bufferService.rows;\n }\n\n if (bottom > top) {\n this._activeBuffer.scrollTop = top - 1;\n this._activeBuffer.scrollBottom = bottom - 1;\n this._setCursor(0, 0);\n }\n return true;\n }\n\n /**\n * CSI Ps ; Ps ; Ps t - Various window manipulations and reports (xterm)\n *\n * Note: Only those listed below are supported. All others are left to integrators and\n * need special treatment based on the embedding environment.\n *\n * Ps = 1 4 supported\n * Report xterm text area size in pixels.\n * Result is CSI 4 ; height ; width t\n * Ps = 14 ; 2 not implemented\n * Ps = 16 supported\n * Report xterm character cell size in pixels.\n * Result is CSI 6 ; height ; width t\n * Ps = 18 supported\n * Report the size of the text area in characters.\n * Result is CSI 8 ; height ; width t\n * Ps = 20 supported\n * Report xterm window's icon label.\n * Result is OSC L label ST\n * Ps = 21 supported\n * Report xterm window's title.\n * Result is OSC l label ST\n * Ps = 22 ; 0 -> Save xterm icon and window title on stack. supported\n * Ps = 22 ; 1 -> Save xterm icon title on stack. supported\n * Ps = 22 ; 2 -> Save xterm window title on stack. supported\n * Ps = 23 ; 0 -> Restore xterm icon and window title from stack. supported\n * Ps = 23 ; 1 -> Restore xterm icon title from stack. supported\n * Ps = 23 ; 2 -> Restore xterm window title from stack. supported\n * Ps >= 24 not implemented\n */\n public windowOptions(params: IParams): boolean {\n if (!paramToWindowOption(params.params[0], this._optionsService.rawOptions.windowOptions)) {\n return true;\n }\n const second = (params.length > 1) ? params.params[1] : 0;\n switch (params.params[0]) {\n case 14: // GetWinSizePixels, returns CSI 4 ; height ; width t\n if (second !== 2) {\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_WIN_SIZE_PIXELS);\n }\n break;\n case 16: // GetCellSizePixels, returns CSI 6 ; height ; width t\n this._onRequestWindowsOptionsReport.fire(WindowsOptionsReportType.GET_CELL_SIZE_PIXELS);\n break;\n case 18: // GetWinSizeChars, returns CSI 8 ; height ; width t\n if (this._bufferService) {\n this._coreService.triggerDataEvent(`${C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);\n }\n break;\n case 22: // PushTitle\n if (second === 0 || second === 2) {\n this._windowTitleStack.push(this._windowTitle);\n if (this._windowTitleStack.length > STACK_LIMIT) {\n this._windowTitleStack.shift();\n }\n }\n if (second === 0 || second === 1) {\n this._iconNameStack.push(this._iconName);\n if (this._iconNameStack.length > STACK_LIMIT) {\n this._iconNameStack.shift();\n }\n }\n break;\n case 23: // PopTitle\n if (second === 0 || second === 2) {\n if (this._windowTitleStack.length) {\n this.setTitle(this._windowTitleStack.pop()!);\n }\n }\n if (second === 0 || second === 1) {\n if (this._iconNameStack.length) {\n this.setIconName(this._iconNameStack.pop()!);\n }\n }\n break;\n }\n return true;\n }\n\n\n /**\n * CSI s\n * ESC 7\n * Save cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCOSC \"Save Cursor\" \"CSI s\" \"Save cursor position, charmap and text attributes.\"\n * @vt: #Y ESC SC \"Save Cursor\" \"ESC 7\" \"Save cursor position, charmap and text attributes.\"\n */\n public saveCursor(params?: IParams): boolean {\n this._activeBuffer.savedX = this._activeBuffer.x;\n this._activeBuffer.savedY = this._activeBuffer.ybase + this._activeBuffer.y;\n this._activeBuffer.savedCurAttrData.fg = this._curAttrData.fg;\n this._activeBuffer.savedCurAttrData.bg = this._curAttrData.bg;\n this._activeBuffer.savedCharset = this._charsetService.charset;\n return true;\n }\n\n\n /**\n * CSI u\n * ESC 8\n * Restore cursor (ANSI.SYS).\n *\n * @vt: #P[TODO...] CSI SCORC \"Restore Cursor\" \"CSI u\" \"Restore cursor position, charmap and text attributes.\"\n * @vt: #Y ESC RC \"Restore Cursor\" \"ESC 8\" \"Restore cursor position, charmap and text attributes.\"\n */\n public restoreCursor(params?: IParams): boolean {\n this._activeBuffer.x = this._activeBuffer.savedX || 0;\n this._activeBuffer.y = Math.max(this._activeBuffer.savedY - this._activeBuffer.ybase, 0);\n this._curAttrData.fg = this._activeBuffer.savedCurAttrData.fg;\n this._curAttrData.bg = this._activeBuffer.savedCurAttrData.bg;\n this._charsetService.charset = (this as any)._savedCharset;\n if (this._activeBuffer.savedCharset) {\n this._charsetService.charset = this._activeBuffer.savedCharset;\n }\n this._restrictCursor();\n return true;\n }\n\n\n /**\n * OSC 2; <data> ST (set window title)\n * Proxy to set window title.\n *\n * @vt: #P[Icon name is not exposed.] OSC 0 \"Set Windows Title and Icon Name\" \"OSC 0 ; Pt BEL\" \"Set window title and icon name.\"\n * Icon name is not supported. For Window Title see below.\n *\n * @vt: #Y OSC 2 \"Set Windows Title\" \"OSC 2 ; Pt BEL\" \"Set window title.\"\n * xterm.js does not manipulate the title directly, instead exposes changes via the event `Terminal.onTitleChange`.\n */\n public setTitle(data: string): boolean {\n this._windowTitle = data;\n this._onTitleChange.fire(data);\n return true;\n }\n\n /**\n * OSC 1; <data> ST\n * Note: Icon name is not exposed.\n */\n public setIconName(data: string): boolean {\n this._iconName = data;\n return true;\n }\n\n /**\n * OSC 4; <num> ; <text> ST (set ANSI color <num> to <text>)\n *\n * @vt: #Y OSC 4 \"Set ANSI color\" \"OSC 4 ; c ; spec BEL\" \"Change color number `c` to the color specified by `spec`.\"\n * `c` is the color index between 0 and 255. The color format of `spec` is derived from `XParseColor` (see OSC 10 for supported formats).\n * There may be multipe `c ; spec` pairs present in the same instruction.\n * If `spec` contains `?` the terminal returns a sequence with the currently set color.\n */\n public setOrReportIndexedColor(data: string): boolean {\n const event: IColorEvent = [];\n const slots = data.split(';');\n while (slots.length > 1) {\n const idx = slots.shift() as string;\n const spec = slots.shift() as string;\n if (/^\\d+$/.exec(idx)) {\n const index = parseInt(idx);\n if (0 <= index && index < 256) {\n if (spec === '?') {\n event.push({ type: ColorRequestType.REPORT, index });\n } else {\n const color = parseColor(spec);\n if (color) {\n event.push({ type: ColorRequestType.SET, index, color });\n }\n }\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n /**\n * OSC 8 ; <params> ; <uri> ST - create hyperlink\n * OSC 8 ; ; ST - finish hyperlink\n *\n * Test case:\n *\n * ```sh\n * printf '\\e]8;;http://example.com\\e\\\\This is a link\\e]8;;\\e\\\\\\n'\n * ```\n *\n * @vt: #Y OSC 8 \"Create hyperlink\" \"OSC 8 ; params ; uri BEL\" \"Create a hyperlink to `uri` using `params`.\"\n * `uri` is a hyperlink starting with `http://`, `https://`, `ftp://`, `file://` or `mailto://`. `params` is an\n * optional list of key=value assignments, separated by the : character. Example: `id=xyz123:foo=bar:baz=quux`.\n * Currently only the id key is defined. Cells that share the same ID and URI share hover feedback.\n * Use `OSC 8 ; ; BEL` to finish the current hyperlink.\n */\n public setHyperlink(data: string): boolean {\n const args = data.split(';');\n if (args.length < 2) {\n return false;\n }\n if (args[1]) {\n return this._createHyperlink(args[0], args[1]);\n }\n if (args[0]) {\n return false;\n }\n return this._finishHyperlink();\n }\n\n private _createHyperlink(params: string, uri: string): boolean {\n // It's legal to open a new hyperlink without explicitly finishing the previous one\n if (this._getCurrentLinkId()) {\n this._finishHyperlink();\n }\n const parsedParams = params.split(':');\n let id: string | undefined;\n const idParamIndex = parsedParams.findIndex(e => e.startsWith('id='));\n if (idParamIndex !== -1) {\n id = parsedParams[idParamIndex].slice(3) || undefined;\n }\n this._curAttrData.extended = this._curAttrData.extended.clone();\n this._curAttrData.extended.urlId = this._oscLinkService.registerLink({ id, uri });\n this._curAttrData.updateExtended();\n return true;\n }\n\n private _finishHyperlink(): boolean {\n this._curAttrData.extended = this._curAttrData.extended.clone();\n this._curAttrData.extended.urlId = 0;\n this._curAttrData.updateExtended();\n return true;\n }\n\n // special colors - OSC 10 | 11 | 12\n private _specialColors = [ColorIndex.FOREGROUND, ColorIndex.BACKGROUND, ColorIndex.CURSOR];\n\n /**\n * Apply colors requests for special colors in OSC 10 | 11 | 12.\n * Since these commands are stacking from multiple parameters,\n * we handle them in a loop with an entry offset to `_specialColors`.\n */\n private _setOrReportSpecialColor(data: string, offset: number): boolean {\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i, ++offset) {\n if (offset >= this._specialColors.length) break;\n if (slots[i] === '?') {\n this._onColor.fire([{ type: ColorRequestType.REPORT, index: this._specialColors[offset] }]);\n } else {\n const color = parseColor(slots[i]);\n if (color) {\n this._onColor.fire([{ type: ColorRequestType.SET, index: this._specialColors[offset], color }]);\n }\n }\n }\n return true;\n }\n\n /**\n * OSC 10 ; <xcolor name>|<?> ST - set or query default foreground color\n *\n * @vt: #Y OSC 10 \"Set or query default foreground color\" \"OSC 10 ; Pt BEL\" \"Set or query default foreground color.\"\n * To set the color, the following color specification formats are supported:\n * - `rgb:<red>/<green>/<blue>` for `<red>, <green>, <blue>` in `h | hh | hhh | hhhh`, where\n * `h` is a single hexadecimal digit (case insignificant). The different widths scale\n * from 4 bit (`h`) to 16 bit (`hhhh`) and get converted to 8 bit (`hh`).\n * - `#RGB` - 4 bits per channel, expanded to `#R0G0B0`\n * - `#RRGGBB` - 8 bits per channel\n * - `#RRRGGGBBB` - 12 bits per channel, truncated to `#RRGGBB`\n * - `#RRRRGGGGBBBB` - 16 bits per channel, truncated to `#RRGGBB`\n *\n * **Note:** X11 named colors are currently unsupported.\n *\n * If `Pt` contains `?` instead of a color specification, the terminal\n * returns a sequence with the current default foreground color\n * (use that sequence to restore the color after changes).\n *\n * **Note:** Other than xterm, xterm.js does not support OSC 12 - 19.\n * Therefore stacking multiple `Pt` separated by `;` only works for the first two entries.\n */\n public setOrReportFgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 0);\n }\n\n /**\n * OSC 11 ; <xcolor name>|<?> ST - set or query default background color\n *\n * @vt: #Y OSC 11 \"Set or query default background color\" \"OSC 11 ; Pt BEL\" \"Same as OSC 10, but for default background.\"\n */\n public setOrReportBgColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 1);\n }\n\n /**\n * OSC 12 ; <xcolor name>|<?> ST - set or query default cursor color\n *\n * @vt: #Y OSC 12 \"Set or query default cursor color\" \"OSC 12 ; Pt BEL\" \"Same as OSC 10, but for default cursor color.\"\n */\n public setOrReportCursorColor(data: string): boolean {\n return this._setOrReportSpecialColor(data, 2);\n }\n\n /**\n * OSC 104 ; <num> ST - restore ANSI color <num>\n *\n * @vt: #Y OSC 104 \"Reset ANSI color\" \"OSC 104 ; c BEL\" \"Reset color number `c` to themed color.\"\n * `c` is the color index between 0 and 255. This function restores the default color for `c` as\n * specified by the loaded theme. Any number of `c` parameters may be given.\n * If no parameters are given, the entire indexed color table will be reset.\n */\n public restoreIndexedColor(data: string): boolean {\n if (!data) {\n this._onColor.fire([{ type: ColorRequestType.RESTORE }]);\n return true;\n }\n const event: IColorEvent = [];\n const slots = data.split(';');\n for (let i = 0; i < slots.length; ++i) {\n if (/^\\d+$/.exec(slots[i])) {\n const index = parseInt(slots[i]);\n if (0 <= index && index < 256) {\n event.push({ type: ColorRequestType.RESTORE, index });\n }\n }\n }\n if (event.length) {\n this._onColor.fire(event);\n }\n return true;\n }\n\n /**\n * OSC 110 ST - restore default foreground color\n *\n * @vt: #Y OSC 110 \"Restore default foreground color\" \"OSC 110 BEL\" \"Restore default foreground to themed color.\"\n */\n public restoreFgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.FOREGROUND }]);\n return true;\n }\n\n /**\n * OSC 111 ST - restore default background color\n *\n * @vt: #Y OSC 111 \"Restore default background color\" \"OSC 111 BEL\" \"Restore default background to themed color.\"\n */\n public restoreBgColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.BACKGROUND }]);\n return true;\n }\n\n /**\n * OSC 112 ST - restore default cursor color\n *\n * @vt: #Y OSC 112 \"Restore default cursor color\" \"OSC 112 BEL\" \"Restore default cursor to themed color.\"\n */\n public restoreCursorColor(data: string): boolean {\n this._onColor.fire([{ type: ColorRequestType.RESTORE, index: ColorIndex.CURSOR }]);\n return true;\n }\n\n /**\n * ESC E\n * C1.NEL\n * DEC mnemonic: NEL (https://vt100.net/docs/vt510-rm/NEL)\n * Moves cursor to first position on next line.\n *\n * @vt: #Y C1 NEL \"Next Line\" \"\\x85\" \"Move the cursor to the beginning of the next row.\"\n * @vt: #Y ESC NEL \"Next Line\" \"ESC E\" \"Move the cursor to the beginning of the next row.\"\n */\n public nextLine(): boolean {\n this._activeBuffer.x = 0;\n this.index();\n return true;\n }\n\n /**\n * ESC =\n * DEC mnemonic: DECKPAM (https://vt100.net/docs/vt510-rm/DECKPAM.html)\n * Enables the numeric keypad to send application sequences to the host.\n */\n public keypadApplicationMode(): boolean {\n this._logService.debug('Serial port requested application keypad.');\n this._coreService.decPrivateModes.applicationKeypad = true;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC >\n * DEC mnemonic: DECKPNM (https://vt100.net/docs/vt510-rm/DECKPNM.html)\n * Enables the keypad to send numeric characters to the host.\n */\n public keypadNumericMode(): boolean {\n this._logService.debug('Switching back to normal keypad.');\n this._coreService.decPrivateModes.applicationKeypad = false;\n this._onRequestSyncScrollBar.fire();\n return true;\n }\n\n /**\n * ESC % @\n * ESC % G\n * Select default character set. UTF-8 is not supported (string are unicode anyways)\n * therefore ESC % G does the same.\n */\n public selectDefaultCharset(): boolean {\n this._charsetService.setgLevel(0);\n this._charsetService.setgCharset(0, DEFAULT_CHARSET); // US (default)\n return true;\n }\n\n /**\n * ESC ( C\n * Designate G0 Character Set, VT100, ISO 2022.\n * ESC ) C\n * Designate G1 Character Set (ISO 2022, VT100).\n * ESC * C\n * Designate G2 Character Set (ISO 2022, VT220).\n * ESC + C\n * Designate G3 Character Set (ISO 2022, VT220).\n * ESC - C\n * Designate G1 Character Set (VT300).\n * ESC . C\n * Designate G2 Character Set (VT300).\n * ESC / C\n * Designate G3 Character Set (VT300). C = A -> ISO Latin-1 Supplemental. - Supported?\n */\n public selectCharset(collectAndFlag: string): boolean {\n if (collectAndFlag.length !== 2) {\n this.selectDefaultCharset();\n return true;\n }\n if (collectAndFlag[0] === '/') {\n return true; // TODO: Is this supported?\n }\n this._charsetService.setgCharset(GLEVEL[collectAndFlag[0]], CHARSETS[collectAndFlag[1]] || DEFAULT_CHARSET);\n return true;\n }\n\n /**\n * ESC D\n * C1.IND\n * DEC mnemonic: IND (https://vt100.net/docs/vt510-rm/IND.html)\n * Moves the cursor down one line in the same column.\n *\n * @vt: #Y C1 IND \"Index\" \"\\x84\" \"Move the cursor one line down scrolling if needed.\"\n * @vt: #Y ESC IND \"Index\" \"ESC D\" \"Move the cursor one line down scrolling if needed.\"\n */\n public index(): boolean {\n this._restrictCursor();\n this._activeBuffer.y++;\n if (this._activeBuffer.y === this._activeBuffer.scrollBottom + 1) {\n this._activeBuffer.y--;\n this._bufferService.scroll(this._eraseAttrData());\n } else if (this._activeBuffer.y >= this._bufferService.rows) {\n this._activeBuffer.y = this._bufferService.rows - 1;\n }\n this._restrictCursor();\n return true;\n }\n\n /**\n * ESC H\n * C1.HTS\n * DEC mnemonic: HTS (https://vt100.net/docs/vt510-rm/HTS.html)\n * Sets a horizontal tab stop at the column position indicated by\n * the value of the active column when the terminal receives an HTS.\n *\n * @vt: #Y C1 HTS \"Horizontal Tabulation Set\" \"\\x88\" \"Places a tab stop at the current cursor position.\"\n * @vt: #Y ESC HTS \"Horizontal Tabulation Set\" \"ESC H\" \"Places a tab stop at the current cursor position.\"\n */\n public tabSet(): boolean {\n this._activeBuffer.tabs[this._activeBuffer.x] = true;\n return true;\n }\n\n /**\n * ESC M\n * C1.RI\n * DEC mnemonic: HTS\n * Moves the cursor up one line in the same column. If the cursor is at the top margin,\n * the page scrolls down.\n *\n * @vt: #Y ESC IR \"Reverse Index\" \"ESC M\" \"Move the cursor one line up scrolling if needed.\"\n */\n public reverseIndex(): boolean {\n this._restrictCursor();\n if (this._activeBuffer.y === this._activeBuffer.scrollTop) {\n // possibly move the code below to term.reverseScroll();\n // test: echo -ne '\\e[1;1H\\e[44m\\eM\\e[0m'\n // blankLine(true) is xterm/linux behavior\n const scrollRegionHeight = this._activeBuffer.scrollBottom - this._activeBuffer.scrollTop;\n this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase + this._activeBuffer.y, scrollRegionHeight, 1);\n this._activeBuffer.lines.set(this._activeBuffer.ybase + this._activeBuffer.y, this._activeBuffer.getBlankLine(this._eraseAttrData()));\n this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop, this._activeBuffer.scrollBottom);\n } else {\n this._activeBuffer.y--;\n this._restrictCursor(); // quickfix to not run out of bounds\n }\n return true;\n }\n\n /**\n * ESC c\n * DEC mnemonic: RIS (https://vt100.net/docs/vt510-rm/RIS.html)\n * Reset to initial state.\n */\n public fullReset(): boolean {\n this._parser.reset();\n this._onRequestReset.fire();\n return true;\n }\n\n public reset(): void {\n this._curAttrData = DEFAULT_ATTR_DATA.clone();\n this._eraseAttrDataInternal = DEFAULT_ATTR_DATA.clone();\n }\n\n /**\n * back_color_erase feature for xterm.\n */\n private _eraseAttrData(): IAttributeData {\n this._eraseAttrDataInternal.bg &= ~(Attributes.CM_MASK | 0xFFFFFF);\n this._eraseAttrDataInternal.bg |= this._curAttrData.bg & ~0xFC000000;\n return this._eraseAttrDataInternal;\n }\n\n /**\n * ESC n\n * ESC o\n * ESC |\n * ESC }\n * ESC ~\n * DEC mnemonic: LS (https://vt100.net/docs/vt510-rm/LS.html)\n * When you use a locking shift, the character set remains in GL or GR until\n * you use another locking shift. (partly supported)\n */\n public setgLevel(level: number): boolean {\n this._charsetService.setgLevel(level);\n return true;\n }\n\n /**\n * ESC # 8\n * DEC mnemonic: DECALN (https://vt100.net/docs/vt510-rm/DECALN.html)\n * This control function fills the complete screen area with\n * a test pattern (E) used for adjusting screen alignment.\n *\n * @vt: #Y ESC DECALN \"Screen Alignment Pattern\" \"ESC # 8\" \"Fill viewport with a test pattern (E).\"\n */\n public screenAlignmentPattern(): boolean {\n // prepare cell data\n const cell = new CellData();\n cell.content = 1 << Content.WIDTH_SHIFT | 'E'.charCodeAt(0);\n cell.fg = this._curAttrData.fg;\n cell.bg = this._curAttrData.bg;\n\n\n this._setCursor(0, 0);\n for (let yOffset = 0; yOffset < this._bufferService.rows; ++yOffset) {\n const row = this._activeBuffer.ybase + this._activeBuffer.y + yOffset;\n const line = this._activeBuffer.lines.get(row);\n if (line) {\n line.fill(cell);\n line.isWrapped = false;\n }\n }\n this._dirtyRowTracker.markAllDirty();\n this._setCursor(0, 0);\n return true;\n }\n\n\n /**\n * DCS $ q Pt ST\n * DECRQSS (https://vt100.net/docs/vt510-rm/DECRQSS.html)\n * Request Status String (DECRQSS), VT420 and up.\n * Response: DECRPSS (https://vt100.net/docs/vt510-rm/DECRPSS.html)\n *\n * @vt: #P[Limited support, see below.] DCS DECRQSS \"Request Selection or Setting\" \"DCS $ q Pt ST\" \"Request several terminal settings.\"\n * Response is in the form `ESC P 1 $ r Pt ST` for valid requests, where `Pt` contains the corresponding CSI string,\n * `ESC P 0 ST` for invalid requests.\n *\n * Supported requests and responses:\n *\n * | Type | Request | Response (`Pt`) |\n * | -------------------------------- | ----------------- | ----------------------------------------------------- |\n * | Graphic Rendition (SGR) | `DCS $ q m ST` | always reporting `0m` (currently broken) |\n * | Top and Bottom Margins (DECSTBM) | `DCS $ q r ST` | `Ps ; Ps r` |\n * | Cursor Style (DECSCUSR) | `DCS $ q SP q ST` | `Ps SP q` |\n * | Protection Attribute (DECSCA) | `DCS $ q \" q ST` | `Ps \" q` (DECSCA 2 is reported as Ps = 0) |\n * | Conformance Level (DECSCL) | `DCS $ q \" p ST` | always reporting `61 ; 1 \" p` (DECSCL is unsupported) |\n *\n *\n * TODO:\n * - fix SGR report\n * - either check which conformance is better suited or remove the report completely\n * --> we are currently a mixture of all up to VT400 but dont follow anyone strictly\n */\n public requestStatusString(data: string, params: IParams): boolean {\n const f = (s: string): boolean => {\n this._coreService.triggerDataEvent(`${C0.ESC}${s}${C0.ESC}\\\\`);\n return true;\n };\n\n // access helpers\n const b = this._bufferService.buffer;\n const opts = this._optionsService.rawOptions;\n const STYLES: { [key: string]: number } = { 'block': 2, 'underline': 4, 'bar': 6 };\n\n if (data === '\"q') return f(`P1$r${this._curAttrData.isProtected() ? 1 : 0}\"q`);\n if (data === '\"p') return f(`P1$r61;1\"p`);\n if (data === 'r') return f(`P1$r${b.scrollTop + 1};${b.scrollBottom + 1}r`);\n // FIXME: report real SGR settings instead of 0m\n if (data === 'm') return f(`P1$r0m`);\n if (data === ' q') return f(`P1$r${STYLES[opts.cursorStyle] - (opts.cursorBlink ? 1 : 0)} q`);\n return f(`P0$r`);\n }\n\n public markRangeDirty(y1: number, y2: number): void {\n this._dirtyRowTracker.markRangeDirty(y1, y2);\n }\n}\n\nexport interface IDirtyRowTracker {\n readonly start: number;\n readonly end: number;\n\n clearRange(): void;\n markDirty(y: number): void;\n markRangeDirty(y1: number, y2: number): void;\n markAllDirty(): void;\n}\n\nclass DirtyRowTracker implements IDirtyRowTracker {\n public start!: number;\n public end!: number;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n this.clearRange();\n }\n\n public clearRange(): void {\n this.start = this._bufferService.buffer.y;\n this.end = this._bufferService.buffer.y;\n }\n\n public markDirty(y: number): void {\n if (y < this.start) {\n this.start = y;\n } else if (y > this.end) {\n this.end = y;\n }\n }\n\n public markRangeDirty(y1: number, y2: number): void {\n if (y1 > y2) {\n $temp = y1;\n y1 = y2;\n y2 = $temp;\n }\n if (y1 < this.start) {\n this.start = y1;\n }\n if (y2 > this.end) {\n this.end = y2;\n }\n }\n\n public markAllDirty(): void {\n this.markRangeDirty(0, this._bufferService.rows - 1);\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\n\n/**\n * A base class that can be extended to provide convenience methods for managing the lifecycle of an\n * object and its components.\n */\nexport abstract class Disposable implements IDisposable {\n protected _disposables: IDisposable[] = [];\n protected _isDisposed: boolean = false;\n\n constructor() {\n }\n\n /**\n * Disposes the object, triggering the `dispose` method on all registered IDisposables.\n */\n public dispose(): void {\n this._isDisposed = true;\n for (const d of this._disposables) {\n d.dispose();\n }\n this._disposables.length = 0;\n }\n\n /**\n * Registers a disposable object.\n * @param d The disposable to register.\n * @returns The disposable.\n */\n public register<T extends IDisposable>(d: T): T {\n this._disposables.push(d);\n return d;\n }\n\n /**\n * Unregisters a disposable object if it has been registered, if not do\n * nothing.\n * @param d The disposable to unregister.\n */\n public unregister<T extends IDisposable>(d: T): void {\n const index = this._disposables.indexOf(d);\n if (index !== -1) {\n this._disposables.splice(index, 1);\n }\n }\n}\n\n/**\n * Wrap a function in a disposable.\n */\nexport function toDisposable(f: () => void): IDisposable {\n return { dispose: f };\n}\n\n/**\n * Dispose of all disposables in an array and set its length to 0.\n */\nexport function disposeArray(disposables: IDisposable[]): void {\n for (const d of disposables) {\n d.dispose();\n }\n disposables.length = 0;\n}\n\n/**\n * Creates a disposable that will dispose of an array of disposables when disposed.\n */\nexport function getDisposeArrayDisposable(array: IDisposable[]): IDisposable {\n return { dispose: () => disposeArray(array) };\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport class TwoKeyMap<TFirst extends string | number, TSecond extends string | number, TValue> {\n private _data: { [bg: string | number]: { [fg: string | number]: TValue | undefined } | undefined } = {};\n\n public set(first: TFirst, second: TSecond, value: TValue): void {\n if (!this._data[first]) {\n this._data[first] = {};\n }\n this._data[first as string | number]![second] = value;\n }\n\n public get(first: TFirst, second: TSecond): TValue | undefined {\n return this._data[first as string | number] ? this._data[first as string | number]![second] : undefined;\n }\n\n public clear(): void {\n this._data = {};\n }\n}\n\nexport class FourKeyMap<TFirst extends string | number, TSecond extends string | number, TThird extends string | number, TFourth extends string | number, TValue> {\n private _data: TwoKeyMap<TFirst, TSecond, TwoKeyMap<TThird, TFourth, TValue>> = new TwoKeyMap();\n\n public set(first: TFirst, second: TSecond, third: TThird, fourth: TFourth, value: TValue): void {\n if (!this._data.get(first, second)) {\n this._data.set(first, second, new TwoKeyMap());\n }\n this._data.get(first, second)!.set(third, fourth, value);\n }\n\n public get(first: TFirst, second: TSecond, third: TThird, fourth: TFourth): TValue | undefined {\n return this._data.get(first, second)?.get(third, fourth);\n }\n\n public clear(): void {\n this._data.clear();\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\ninterface INavigator {\n userAgent: string;\n language: string;\n platform: string;\n}\n\n// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but\n// we want this module to live in common.\ndeclare const navigator: INavigator;\n\nexport const isNode = (typeof navigator === 'undefined') ? true : false;\nconst userAgent = (isNode) ? 'node' : navigator.userAgent;\nconst platform = (isNode) ? 'node' : navigator.platform;\n\nexport const isFirefox = userAgent.includes('Firefox');\nexport const isLegacyEdge = userAgent.includes('Edge');\nexport const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);\nexport function getSafariVersion(): number {\n if (!isSafari) {\n return 0;\n }\n const majorVersion = userAgent.match(/Version\\/(\\d+)/);\n if (majorVersion === null || majorVersion.length < 2) {\n return 0;\n }\n return parseInt(majorVersion[1]);\n}\n\n// Find the users platform. We use this to interpret the meta key\n// and ISO third level shifts.\n// http://stackoverflow.com/q/19877924/577598\nexport const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);\nexport const isIpad = platform === 'iPad';\nexport const isIphone = platform === 'iPhone';\nexport const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);\nexport const isLinux = platform.indexOf('Linux') >= 0;\n// Note that when this is true, isLinux will also be true.\nexport const isChromeOS = /\\bCrOS\\b/.test(userAgent);\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n// Work variables to avoid garbage collection.\nlet i = 0;\n\n/**\n * A generic list that is maintained in sorted order and allows values with duplicate keys. This\n * list is based on binary search and as such locating a key will take O(log n) amortized, this\n * includes the by key iterator.\n */\nexport class SortedList<T> {\n private readonly _array: T[] = [];\n\n constructor(\n private readonly _getKey: (value: T) => number\n ) {\n }\n\n public clear(): void {\n this._array.length = 0;\n }\n\n public insert(value: T): void {\n if (this._array.length === 0) {\n this._array.push(value);\n return;\n }\n i = this._search(this._getKey(value), 0, this._array.length - 1);\n this._array.splice(i, 0, value);\n }\n\n public delete(value: T): boolean {\n if (this._array.length === 0) {\n return false;\n }\n const key = this._getKey(value);\n if (key === undefined) {\n return false;\n }\n i = this._search(key, 0, this._array.length - 1);\n if (i === -1) {\n return false;\n }\n if (this._getKey(this._array[i]) !== key) {\n return false;\n }\n do {\n if (this._array[i] === value) {\n this._array.splice(i, 1);\n return true;\n }\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n return false;\n }\n\n public *getKeyIterator(key: number): IterableIterator<T> {\n if (this._array.length === 0) {\n return;\n }\n i = this._search(key, 0, this._array.length - 1);\n if (i < 0 || i >= this._array.length) {\n return;\n }\n if (this._getKey(this._array[i]) !== key) {\n return;\n }\n do {\n yield this._array[i];\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n }\n\n public forEachByKey(key: number, callback: (value: T) => void): void {\n if (this._array.length === 0) {\n return;\n }\n i = this._search(key, 0, this._array.length - 1);\n if (i < 0 || i >= this._array.length) {\n return;\n }\n if (this._getKey(this._array[i]) !== key) {\n return;\n }\n do {\n callback(this._array[i]);\n } while (++i < this._array.length && this._getKey(this._array[i]) === key);\n }\n\n public values(): IterableIterator<T> {\n return this._array.values();\n }\n\n private _search(key: number, min: number, max: number): number {\n if (max < min) {\n return min;\n }\n let mid = Math.floor((min + max) / 2);\n const midKey = this._getKey(this._array[mid]);\n if (midKey > key) {\n return this._search(key, min, mid - 1);\n }\n if (midKey < key) {\n return this._search(key, mid + 1, max);\n }\n // Value found! Since keys can be duplicates, move the result index back to the lowest index\n // that matches the key.\n while (mid > 0 && this._getKey(this._array[mid - 1]) === key) {\n mid--;\n }\n return mid;\n }\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { isNode } from 'common/Platform';\n\ninterface ITaskQueue {\n /**\n * Adds a task to the queue which will run in a future idle callback.\n * To avoid perceivable stalls on the mainthread, tasks with heavy workload\n * should split their work into smaller pieces and return `true` to get\n * called again until the work is done (on falsy return value).\n */\n enqueue(task: () => boolean | void): void;\n\n /**\n * Flushes the queue, running all remaining tasks synchronously.\n */\n flush(): void;\n\n /**\n * Clears any remaining tasks from the queue, these will not be run.\n */\n clear(): void;\n}\n\ninterface ITaskDeadline {\n timeRemaining(): number;\n}\ntype CallbackWithDeadline = (deadline: ITaskDeadline) => void;\n\nabstract class TaskQueue implements ITaskQueue {\n private _tasks: (() => boolean | void)[] = [];\n private _idleCallback?: number;\n private _i = 0;\n\n protected abstract _requestCallback(callback: CallbackWithDeadline): number;\n protected abstract _cancelCallback(identifier: number): void;\n\n public enqueue(task: () => boolean | void): void {\n this._tasks.push(task);\n this._start();\n }\n\n public flush(): void {\n while (this._i < this._tasks.length) {\n if (!this._tasks[this._i]()) {\n this._i++;\n }\n }\n this.clear();\n }\n\n public clear(): void {\n if (this._idleCallback) {\n this._cancelCallback(this._idleCallback);\n this._idleCallback = undefined;\n }\n this._i = 0;\n this._tasks.length = 0;\n }\n\n private _start(): void {\n if (!this._idleCallback) {\n this._idleCallback = this._requestCallback(this._process.bind(this));\n }\n }\n\n private _process(deadline: ITaskDeadline): void {\n this._idleCallback = undefined;\n let taskDuration = 0;\n let longestTask = 0;\n let lastDeadlineRemaining = deadline.timeRemaining();\n let deadlineRemaining = 0;\n while (this._i < this._tasks.length) {\n taskDuration = Date.now();\n if (!this._tasks[this._i]()) {\n this._i++;\n }\n // other than performance.now, Date.now might not be stable (changes on wall clock changes),\n // this is not an issue here as a clock change during a short running task is very unlikely\n // in case it still happened and leads to negative duration, simply assume 1 msec\n taskDuration = Math.max(1, Date.now() - taskDuration);\n longestTask = Math.max(taskDuration, longestTask);\n // Guess the following task will take a similar time to the longest task in this batch, allow\n // additional room to try avoid exceeding the deadline\n deadlineRemaining = deadline.timeRemaining();\n if (longestTask * 1.5 > deadlineRemaining) {\n // Warn when the time exceeding the deadline is over 20ms, if this happens in practice the\n // task should be split into sub-tasks to ensure the UI remains responsive.\n if (lastDeadlineRemaining - taskDuration < -20) {\n console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(lastDeadlineRemaining - taskDuration))}ms`);\n }\n this._start();\n return;\n }\n lastDeadlineRemaining = deadlineRemaining;\n }\n this.clear();\n }\n}\n\n/**\n * A queue of that runs tasks over several tasks via setTimeout, trying to maintain above 60 frames\n * per second. The tasks will run in the order they are enqueued, but they will run some time later,\n * and care should be taken to ensure they're non-urgent and will not introduce race conditions.\n */\nexport class PriorityTaskQueue extends TaskQueue {\n protected _requestCallback(callback: CallbackWithDeadline): number {\n return setTimeout(() => callback(this._createDeadline(16)));\n }\n\n protected _cancelCallback(identifier: number): void {\n clearTimeout(identifier);\n }\n\n private _createDeadline(duration: number): ITaskDeadline {\n const end = Date.now() + duration;\n return {\n timeRemaining: () => Math.max(0, end - Date.now())\n };\n }\n}\n\nclass IdleTaskQueueInternal extends TaskQueue {\n protected _requestCallback(callback: IdleRequestCallback): number {\n return requestIdleCallback(callback);\n }\n\n protected _cancelCallback(identifier: number): void {\n cancelIdleCallback(identifier);\n }\n}\n\n/**\n * A queue of that runs tasks over several idle callbacks, trying to respect the idle callback's\n * deadline given by the environment. The tasks will run in the order they are enqueued, but they\n * will run some time later, and care should be taken to ensure they're non-urgent and will not\n * introduce race conditions.\n *\n * This reverts to a {@link PriorityTaskQueue} if the environment does not support idle callbacks.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IdleTaskQueue = (!isNode && 'requestIdleCallback' in window) ? IdleTaskQueueInternal : PriorityTaskQueue;\n\n/**\n * An object that tracks a single debounced task that will run on the next idle frame. When called\n * multiple times, only the last set task will run.\n */\nexport class DebouncedIdleTask {\n private _queue: ITaskQueue;\n\n constructor() {\n this._queue = new IdleTaskQueue();\n }\n\n public set(task: () => boolean | void): void {\n this._queue.clear();\n this._queue.enqueue(task);\n }\n\n public flush(): void {\n this._queue.flush();\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CHAR_DATA_CODE_INDEX, NULL_CELL_CODE, WHITESPACE_CELL_CODE } from 'common/buffer/Constants';\nimport { IBufferService } from 'common/services/Services';\n\nexport function updateWindowsModeWrappedState(bufferService: IBufferService): void {\n // Winpty does not support wraparound mode which means that lines will never\n // be marked as wrapped. This causes issues for things like copying a line\n // retaining the wrapped new line characters or if consumers are listening\n // in on the data stream.\n //\n // The workaround for this is to listen to every incoming line feed and mark\n // the line as wrapped if the last character in the previous line is not a\n // space. This is certainly not without its problems, but generally on\n // Windows when text reaches the end of the terminal it's likely going to be\n // wrapped.\n const line = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y - 1);\n const lastChar = line?.get(bufferService.cols - 1);\n\n const nextLine = bufferService.buffer.lines.get(bufferService.buffer.ybase + bufferService.buffer.y);\n if (nextLine && lastChar) {\n nextLine.isWrapped = (lastChar[CHAR_DATA_CODE_INDEX] !== NULL_CELL_CODE && lastChar[CHAR_DATA_CODE_INDEX] !== WHITESPACE_CELL_CODE);\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IAttributeData, IColorRGB, IExtendedAttrs } from 'common/Types';\nimport { Attributes, FgFlags, BgFlags, UnderlineStyle, ExtFlags } from 'common/buffer/Constants';\n\nexport class AttributeData implements IAttributeData {\n public static toColorRGB(value: number): IColorRGB {\n return [\n value >>> Attributes.RED_SHIFT & 255,\n value >>> Attributes.GREEN_SHIFT & 255,\n value & 255\n ];\n }\n\n public static fromColorRGB(value: IColorRGB): number {\n return (value[0] & 255) << Attributes.RED_SHIFT | (value[1] & 255) << Attributes.GREEN_SHIFT | value[2] & 255;\n }\n\n public clone(): IAttributeData {\n const newObj = new AttributeData();\n newObj.fg = this.fg;\n newObj.bg = this.bg;\n newObj.extended = this.extended.clone();\n return newObj;\n }\n\n // data\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n\n // flags\n public isInverse(): number { return this.fg & FgFlags.INVERSE; }\n public isBold(): number { return this.fg & FgFlags.BOLD; }\n public isUnderline(): number {\n if (this.hasExtendedAttrs() && this.extended.underlineStyle !== UnderlineStyle.NONE) {\n return 1;\n }\n return this.fg & FgFlags.UNDERLINE;\n }\n public isBlink(): number { return this.fg & FgFlags.BLINK; }\n public isInvisible(): number { return this.fg & FgFlags.INVISIBLE; }\n public isItalic(): number { return this.bg & BgFlags.ITALIC; }\n public isDim(): number { return this.bg & BgFlags.DIM; }\n public isStrikethrough(): number { return this.fg & FgFlags.STRIKETHROUGH; }\n public isProtected(): number { return this.bg & BgFlags.PROTECTED; }\n\n // color modes\n public getFgColorMode(): number { return this.fg & Attributes.CM_MASK; }\n public getBgColorMode(): number { return this.bg & Attributes.CM_MASK; }\n public isFgRGB(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isBgRGB(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_RGB; }\n public isFgPalette(): boolean { return (this.fg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.fg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isBgPalette(): boolean { return (this.bg & Attributes.CM_MASK) === Attributes.CM_P16 || (this.bg & Attributes.CM_MASK) === Attributes.CM_P256; }\n public isFgDefault(): boolean { return (this.fg & Attributes.CM_MASK) === 0; }\n public isBgDefault(): boolean { return (this.bg & Attributes.CM_MASK) === 0; }\n public isAttributeDefault(): boolean { return this.fg === 0 && this.bg === 0; }\n\n // colors\n public getFgColor(): number {\n switch (this.fg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.fg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.fg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n public getBgColor(): number {\n switch (this.bg & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.bg & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.bg & Attributes.RGB_MASK;\n default: return -1; // CM_DEFAULT defaults to -1\n }\n }\n\n // extended attrs\n public hasExtendedAttrs(): number {\n return this.bg & BgFlags.HAS_EXTENDED;\n }\n public updateExtended(): void {\n if (this.extended.isEmpty()) {\n this.bg &= ~BgFlags.HAS_EXTENDED;\n } else {\n this.bg |= BgFlags.HAS_EXTENDED;\n }\n }\n public getUnderlineColor(): number {\n if ((this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor) {\n switch (this.extended.underlineColor & Attributes.CM_MASK) {\n case Attributes.CM_P16:\n case Attributes.CM_P256: return this.extended.underlineColor & Attributes.PCOLOR_MASK;\n case Attributes.CM_RGB: return this.extended.underlineColor & Attributes.RGB_MASK;\n default: return this.getFgColor();\n }\n }\n return this.getFgColor();\n }\n public getUnderlineColorMode(): number {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? this.extended.underlineColor & Attributes.CM_MASK\n : this.getFgColorMode();\n }\n public isUnderlineColorRGB(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_RGB\n : this.isFgRGB();\n }\n public isUnderlineColorPalette(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P16\n || (this.extended.underlineColor & Attributes.CM_MASK) === Attributes.CM_P256\n : this.isFgPalette();\n }\n public isUnderlineColorDefault(): boolean {\n return (this.bg & BgFlags.HAS_EXTENDED) && ~this.extended.underlineColor\n ? (this.extended.underlineColor & Attributes.CM_MASK) === 0\n : this.isFgDefault();\n }\n public getUnderlineStyle(): UnderlineStyle {\n return this.fg & FgFlags.UNDERLINE\n ? (this.bg & BgFlags.HAS_EXTENDED ? this.extended.underlineStyle : UnderlineStyle.SINGLE)\n : UnderlineStyle.NONE;\n }\n}\n\n\n/**\n * Extended attributes for a cell.\n * Holds information about different underline styles and color.\n */\nexport class ExtendedAttrs implements IExtendedAttrs {\n private _ext: number = 0;\n public get ext(): number {\n if (this._urlId) {\n return (\n (this._ext & ~ExtFlags.UNDERLINE_STYLE) |\n (this.underlineStyle << 26)\n );\n }\n return this._ext;\n }\n public set ext(value: number) { this._ext = value; }\n\n public get underlineStyle(): UnderlineStyle {\n // Always return the URL style if it has one\n if (this._urlId) {\n return UnderlineStyle.DASHED;\n }\n return (this._ext & ExtFlags.UNDERLINE_STYLE) >> 26;\n }\n public set underlineStyle(value: UnderlineStyle) {\n this._ext &= ~ExtFlags.UNDERLINE_STYLE;\n this._ext |= (value << 26) & ExtFlags.UNDERLINE_STYLE;\n }\n\n public get underlineColor(): number {\n return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n public set underlineColor(value: number) {\n this._ext &= ~(Attributes.CM_MASK | Attributes.RGB_MASK);\n this._ext |= value & (Attributes.CM_MASK | Attributes.RGB_MASK);\n }\n\n private _urlId: number = 0;\n public get urlId(): number {\n return this._urlId;\n }\n public set urlId(value: number) {\n this._urlId = value;\n }\n\n constructor(\n ext: number = 0,\n urlId: number = 0\n ) {\n this._ext = ext;\n this._urlId = urlId;\n }\n\n public clone(): IExtendedAttrs {\n return new ExtendedAttrs(this._ext, this._urlId);\n }\n\n /**\n * Convenient method to indicate whether the object holds no additional information,\n * that needs to be persistant in the buffer.\n */\n public isEmpty(): boolean {\n return this.underlineStyle === UnderlineStyle.NONE && this._urlId === 0;\n }\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CircularList, IInsertEvent } from 'common/CircularList';\nimport { IBuffer, BufferIndex, IBufferStringIterator, IBufferStringIteratorResult } from 'common/buffer/Types';\nimport { IBufferLine, ICellData, IAttributeData, ICharset } from 'common/Types';\nimport { BufferLine, DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';\nimport { CellData } from 'common/buffer/CellData';\nimport { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_CHAR_INDEX } from 'common/buffer/Constants';\nimport { reflowLargerApplyNewLayout, reflowLargerCreateNewLayout, reflowLargerGetLinesToRemove, reflowSmallerGetNewLineLengths, getWrappedLineTrimmedLength } from 'common/buffer/BufferReflow';\nimport { Marker } from 'common/buffer/Marker';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { DEFAULT_CHARSET } from 'common/data/Charsets';\nimport { ExtendedAttrs } from 'common/buffer/AttributeData';\nimport { DebouncedIdleTask, IdleTaskQueue } from 'common/TaskQueue';\n\nexport const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1\n\n/**\n * This class represents a terminal buffer (an internal state of the terminal), where the\n * following information is stored (in high-level):\n * - text content of this particular buffer\n * - cursor position\n * - scroll position\n */\nexport class Buffer implements IBuffer {\n public lines: CircularList<IBufferLine>;\n public ydisp: number = 0;\n public ybase: number = 0;\n public y: number = 0;\n public x: number = 0;\n public scrollBottom: number;\n public scrollTop: number;\n public tabs: { [column: number]: boolean | undefined } = {};\n public savedY: number = 0;\n public savedX: number = 0;\n public savedCurAttrData = DEFAULT_ATTR_DATA.clone();\n public savedCharset: ICharset | undefined = DEFAULT_CHARSET;\n public markers: Marker[] = [];\n private _nullCell: ICellData = CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]);\n private _cols: number;\n private _rows: number;\n private _isClearing: boolean = false;\n\n constructor(\n private _hasScrollback: boolean,\n private _optionsService: IOptionsService,\n private _bufferService: IBufferService\n ) {\n this._cols = this._bufferService.cols;\n this._rows = this._bufferService.rows;\n this.lines = new CircularList<IBufferLine>(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n public getNullCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._nullCell.fg = attr.fg;\n this._nullCell.bg = attr.bg;\n this._nullCell.extended = attr.extended;\n } else {\n this._nullCell.fg = 0;\n this._nullCell.bg = 0;\n this._nullCell.extended = new ExtendedAttrs();\n }\n return this._nullCell;\n }\n\n public getWhitespaceCell(attr?: IAttributeData): ICellData {\n if (attr) {\n this._whitespaceCell.fg = attr.fg;\n this._whitespaceCell.bg = attr.bg;\n this._whitespaceCell.extended = attr.extended;\n } else {\n this._whitespaceCell.fg = 0;\n this._whitespaceCell.bg = 0;\n this._whitespaceCell.extended = new ExtendedAttrs();\n }\n return this._whitespaceCell;\n }\n\n public getBlankLine(attr: IAttributeData, isWrapped?: boolean): IBufferLine {\n return new BufferLine(this._bufferService.cols, this.getNullCell(attr), isWrapped);\n }\n\n public get hasScrollback(): boolean {\n return this._hasScrollback && this.lines.maxLength > this._rows;\n }\n\n public get isCursorInViewport(): boolean {\n const absoluteY = this.ybase + this.y;\n const relativeY = absoluteY - this.ydisp;\n return (relativeY >= 0 && relativeY < this._rows);\n }\n\n /**\n * Gets the correct buffer length based on the rows provided, the terminal's\n * scrollback and whether this buffer is flagged to have scrollback or not.\n * @param rows The terminal rows to use in the calculation.\n */\n private _getCorrectBufferLength(rows: number): number {\n if (!this._hasScrollback) {\n return rows;\n }\n\n const correctBufferLength = rows + this._optionsService.rawOptions.scrollback;\n\n return correctBufferLength > MAX_BUFFER_SIZE ? MAX_BUFFER_SIZE : correctBufferLength;\n }\n\n /**\n * Fills the buffer's viewport with blank lines.\n */\n public fillViewportRows(fillAttr?: IAttributeData): void {\n if (this.lines.length === 0) {\n if (fillAttr === undefined) {\n fillAttr = DEFAULT_ATTR_DATA;\n }\n let i = this._rows;\n while (i--) {\n this.lines.push(this.getBlankLine(fillAttr));\n }\n }\n }\n\n /**\n * Clears the buffer to it's initial state, discarding all previous data.\n */\n public clear(): void {\n this.ydisp = 0;\n this.ybase = 0;\n this.y = 0;\n this.x = 0;\n this.lines = new CircularList<IBufferLine>(this._getCorrectBufferLength(this._rows));\n this.scrollTop = 0;\n this.scrollBottom = this._rows - 1;\n this.setupTabStops();\n }\n\n /**\n * Resizes the buffer, adjusting its data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n // store reference to null cell with default attrs\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n\n // count bufferlines with overly big memory to be cleaned afterwards\n let dirtyMemoryLines = 0;\n\n // Increase max length if needed before adjustments to allow space to fill\n // as required.\n const newMaxLength = this._getCorrectBufferLength(newRows);\n if (newMaxLength > this.lines.maxLength) {\n this.lines.maxLength = newMaxLength;\n }\n\n // The following adjustments should only happen if the buffer has been\n // initialized/filled.\n if (this.lines.length > 0) {\n // Deal with columns increasing (reducing needs to happen after reflow)\n if (this._cols < newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n // +boolean for fast 0 or 1 conversion\n dirtyMemoryLines += +this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n\n // Resize rows in both directions as needed\n let addToY = 0;\n if (this._rows < newRows) {\n for (let y = this._rows; y < newRows; y++) {\n if (this.lines.length < newRows + this.ybase) {\n if (this._optionsService.rawOptions.windowsMode) {\n // Just add the new missing rows on Windows as conpty reprints the screen with it's\n // view of the world. Once a line enters scrollback for conpty it remains there\n this.lines.push(new BufferLine(newCols, nullCell));\n } else {\n if (this.ybase > 0 && this.lines.length <= this.ybase + this.y + addToY + 1) {\n // There is room above the buffer and there are no empty elements below the line,\n // scroll up\n this.ybase--;\n addToY++;\n if (this.ydisp > 0) {\n // Viewport is at the top of the buffer, must increase downwards\n this.ydisp--;\n }\n } else {\n // Add a blank line if there is no buffer left at the top to scroll to, or if there\n // are blank lines after the cursor\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n }\n }\n }\n } else { // (this._rows >= newRows)\n for (let y = this._rows; y > newRows; y--) {\n if (this.lines.length > newRows + this.ybase) {\n if (this.lines.length > this.ybase + this.y + 1) {\n // The line is a blank line below the cursor, remove it\n this.lines.pop();\n } else {\n // The line is the cursor, scroll down\n this.ybase++;\n this.ydisp++;\n }\n }\n }\n }\n\n // Reduce max length if needed after adjustments, this is done after as it\n // would otherwise cut data from the bottom of the buffer.\n if (newMaxLength < this.lines.maxLength) {\n // Trim from the top of the buffer and adjust ybase and ydisp.\n const amountToTrim = this.lines.length - newMaxLength;\n if (amountToTrim > 0) {\n this.lines.trimStart(amountToTrim);\n this.ybase = Math.max(this.ybase - amountToTrim, 0);\n this.ydisp = Math.max(this.ydisp - amountToTrim, 0);\n this.savedY = Math.max(this.savedY - amountToTrim, 0);\n }\n this.lines.maxLength = newMaxLength;\n }\n\n // Make sure that the cursor stays on screen\n this.x = Math.min(this.x, newCols - 1);\n this.y = Math.min(this.y, newRows - 1);\n if (addToY) {\n this.y += addToY;\n }\n this.savedX = Math.min(this.savedX, newCols - 1);\n\n this.scrollTop = 0;\n }\n\n this.scrollBottom = newRows - 1;\n\n if (this._isReflowEnabled) {\n this._reflow(newCols, newRows);\n\n // Trim the end of the line off if cols shrunk\n if (this._cols > newCols) {\n for (let i = 0; i < this.lines.length; i++) {\n // +boolean for fast 0 or 1 conversion\n dirtyMemoryLines += +this.lines.get(i)!.resize(newCols, nullCell);\n }\n }\n }\n\n this._cols = newCols;\n this._rows = newRows;\n\n this._memoryCleanupQueue.clear();\n // schedule memory cleanup only, if more than 10% of the lines are affected\n if (dirtyMemoryLines > 0.1 * this.lines.length) {\n this._memoryCleanupPosition = 0;\n this._memoryCleanupQueue.enqueue(() => this._batchedMemoryCleanup());\n }\n }\n\n private _memoryCleanupQueue = new IdleTaskQueue();\n private _memoryCleanupPosition = 0;\n\n private _batchedMemoryCleanup(): boolean {\n let normalRun = true;\n if (this._memoryCleanupPosition >= this.lines.length) {\n // cleanup made it once through all lines, thus rescan in loop below to also catch shifted lines,\n // which should finish rather quick if there are no more cleanups pending\n this._memoryCleanupPosition = 0;\n normalRun = false;\n }\n let counted = 0;\n while (this._memoryCleanupPosition < this.lines.length) {\n counted += this.lines.get(this._memoryCleanupPosition++)!.cleanupMemory();\n // cleanup max 100 lines per batch\n if (counted > 100) {\n return true;\n }\n }\n // normal runs always need another rescan afterwards\n // if we made it here with normalRun=false, we are in a final run\n // and can end the cleanup task for sure\n return normalRun;\n }\n\n private get _isReflowEnabled(): boolean {\n return this._hasScrollback && !this._optionsService.rawOptions.windowsMode;\n }\n\n private _reflow(newCols: number, newRows: number): void {\n if (this._cols === newCols) {\n return;\n }\n\n // Iterate through rows, ignore the last one as it cannot be wrapped\n if (newCols > this._cols) {\n this._reflowLarger(newCols, newRows);\n } else {\n this._reflowSmaller(newCols, newRows);\n }\n }\n\n private _reflowLarger(newCols: number, newRows: number): void {\n const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA));\n if (toRemove.length > 0) {\n const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);\n reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);\n this._reflowLargerAdjustViewport(newCols, newRows, newLayoutResult.countRemoved);\n }\n }\n\n private _reflowLargerAdjustViewport(newCols: number, newRows: number, countRemoved: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Adjust viewport based on number of items removed\n let viewportAdjustments = countRemoved;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y > 0) {\n this.y--;\n }\n if (this.lines.length < newRows) {\n // Add an extra row at the bottom of the viewport\n this.lines.push(new BufferLine(newCols, nullCell));\n }\n } else {\n if (this.ydisp === this.ybase) {\n this.ydisp--;\n }\n this.ybase--;\n }\n }\n this.savedY = Math.max(this.savedY - countRemoved, 0);\n }\n\n private _reflowSmaller(newCols: number, newRows: number): void {\n const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);\n // Gather all BufferLines that need to be inserted into the Buffer here so that they can be\n // batched up and only committed once\n const toInsert = [];\n let countToInsert = 0;\n // Go backwards as many lines may be trimmed and this will avoid considering them\n for (let y = this.lines.length - 1; y >= 0; y--) {\n // Check whether this line is a problem\n let nextLine = this.lines.get(y) as BufferLine;\n if (!nextLine || !nextLine.isWrapped && nextLine.getTrimmedLength() <= newCols) {\n continue;\n }\n\n // Gather wrapped lines and adjust y to be the starting line\n const wrappedLines: BufferLine[] = [nextLine];\n while (nextLine.isWrapped && y > 0) {\n nextLine = this.lines.get(--y) as BufferLine;\n wrappedLines.unshift(nextLine);\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up\n // wrapped lines with the cursor\n const absoluteY = this.ybase + this.y;\n if (absoluteY >= y && absoluteY < y + wrappedLines.length) {\n continue;\n }\n\n const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();\n const destLineLengths = reflowSmallerGetNewLineLengths(wrappedLines, this._cols, newCols);\n const linesToAdd = destLineLengths.length - wrappedLines.length;\n let trimmedLines: number;\n if (this.ybase === 0 && this.y !== this.lines.length - 1) {\n // If the top section of the buffer is not yet filled\n trimmedLines = Math.max(0, this.y - this.lines.maxLength + linesToAdd);\n } else {\n trimmedLines = Math.max(0, this.lines.length - this.lines.maxLength + linesToAdd);\n }\n\n // Add the new lines\n const newLines: BufferLine[] = [];\n for (let i = 0; i < linesToAdd; i++) {\n const newLine = this.getBlankLine(DEFAULT_ATTR_DATA, true) as BufferLine;\n newLines.push(newLine);\n }\n if (newLines.length > 0) {\n toInsert.push({\n // countToInsert here gets the actual index, taking into account other inserted items.\n // using this we can iterate through the list forwards\n start: y + wrappedLines.length + countToInsert,\n newLines\n });\n countToInsert += newLines.length;\n }\n wrappedLines.push(...newLines);\n\n // Copy buffer data to new locations, this needs to happen backwards to do in-place\n let destLineIndex = destLineLengths.length - 1; // Math.floor(cellsNeeded / newCols);\n let destCol = destLineLengths[destLineIndex]; // cellsNeeded % newCols;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n let srcLineIndex = wrappedLines.length - linesToAdd - 1;\n let srcCol = lastLineLength;\n while (srcLineIndex >= 0) {\n const cellsToCopy = Math.min(srcCol, destCol);\n if (wrappedLines[destLineIndex] === undefined) {\n // Sanity check that the line exists, this has been known to fail for an unknown reason\n // which would stop the reflow from happening if an exception would throw.\n break;\n }\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol - cellsToCopy, destCol - cellsToCopy, cellsToCopy, true);\n destCol -= cellsToCopy;\n if (destCol === 0) {\n destLineIndex--;\n destCol = destLineLengths[destLineIndex];\n }\n srcCol -= cellsToCopy;\n if (srcCol === 0) {\n srcLineIndex--;\n const wrappedLinesIndex = Math.max(srcLineIndex, 0);\n srcCol = getWrappedLineTrimmedLength(wrappedLines, wrappedLinesIndex, this._cols);\n }\n }\n\n // Null out the end of the line ends if a wide character wrapped to the following line\n for (let i = 0; i < wrappedLines.length; i++) {\n if (destLineLengths[i] < newCols) {\n wrappedLines[i].setCell(destLineLengths[i], nullCell);\n }\n }\n\n // Adjust viewport as needed\n let viewportAdjustments = linesToAdd - trimmedLines;\n while (viewportAdjustments-- > 0) {\n if (this.ybase === 0) {\n if (this.y < newRows - 1) {\n this.y++;\n this.lines.pop();\n } else {\n this.ybase++;\n this.ydisp++;\n }\n } else {\n // Ensure ybase does not exceed its maximum value\n if (this.ybase < Math.min(this.lines.maxLength, this.lines.length + countToInsert) - newRows) {\n if (this.ybase === this.ydisp) {\n this.ydisp++;\n }\n this.ybase++;\n }\n }\n }\n this.savedY = Math.min(this.savedY + linesToAdd, this.ybase + newRows - 1);\n }\n\n // Rearrange lines in the buffer if there are any insertions, this is done at the end rather\n // than earlier so that it's a single O(n) pass through the buffer, instead of O(n^2) from many\n // costly calls to CircularList.splice.\n if (toInsert.length > 0) {\n // Record buffer insert events and then play them back backwards so that the indexes are\n // correct\n const insertEvents: IInsertEvent[] = [];\n\n // Record original lines so they don't get overridden when we rearrange the list\n const originalLines: BufferLine[] = [];\n for (let i = 0; i < this.lines.length; i++) {\n originalLines.push(this.lines.get(i) as BufferLine);\n }\n const originalLinesLength = this.lines.length;\n\n let originalLineIndex = originalLinesLength - 1;\n let nextToInsertIndex = 0;\n let nextToInsert = toInsert[nextToInsertIndex];\n this.lines.length = Math.min(this.lines.maxLength, this.lines.length + countToInsert);\n let countInsertedSoFar = 0;\n for (let i = Math.min(this.lines.maxLength - 1, originalLinesLength + countToInsert - 1); i >= 0; i--) {\n if (nextToInsert && nextToInsert.start > originalLineIndex + countInsertedSoFar) {\n // Insert extra lines here, adjusting i as needed\n for (let nextI = nextToInsert.newLines.length - 1; nextI >= 0; nextI--) {\n this.lines.set(i--, nextToInsert.newLines[nextI]);\n }\n i++;\n\n // Create insert events for later\n insertEvents.push({\n index: originalLineIndex + 1,\n amount: nextToInsert.newLines.length\n });\n\n countInsertedSoFar += nextToInsert.newLines.length;\n nextToInsert = toInsert[++nextToInsertIndex];\n } else {\n this.lines.set(i, originalLines[originalLineIndex--]);\n }\n }\n\n // Update markers\n let insertCountEmitted = 0;\n for (let i = insertEvents.length - 1; i >= 0; i--) {\n insertEvents[i].index += insertCountEmitted;\n this.lines.onInsertEmitter.fire(insertEvents[i]);\n insertCountEmitted += insertEvents[i].amount;\n }\n const amountToTrim = Math.max(0, originalLinesLength + countToInsert - this.lines.maxLength);\n if (amountToTrim > 0) {\n this.lines.onTrimEmitter.fire(amountToTrim);\n }\n }\n }\n\n // private _reflowSmallerGetLinesNeeded()\n\n /**\n * Translates a string index back to a BufferIndex.\n * To get the correct buffer position the string must start at `startCol` 0\n * (default in translateBufferLineToString).\n * The method also works on wrapped line strings given rows were not trimmed.\n * The method operates on the CharData string length, there are no\n * additional content or boundary checks. Therefore the string and the buffer\n * should not be altered in between.\n * TODO: respect trim flag after fixing #1685\n * @param lineIndex line index the string was retrieved from\n * @param stringIndex index within the string\n * @param trimRight Whether to trim whitespace to the right.\n */\n public stringIndexToBufferIndex(lineIndex: number, stringIndex: number, trimRight: boolean = false): BufferIndex {\n while (stringIndex) {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return [-1, -1];\n }\n const length = (trimRight) ? line.getTrimmedLength() : line.length;\n for (let i = 0; i < length; ++i) {\n if (line.get(i)[CHAR_DATA_WIDTH_INDEX]) {\n // empty cells report a string length of 0, but get replaced\n // with a whitespace in translateToString, thus replace with 1\n stringIndex -= line.get(i)[CHAR_DATA_CHAR_INDEX].length || 1;\n }\n if (stringIndex < 0) {\n return [lineIndex, i];\n }\n }\n lineIndex++;\n }\n return [lineIndex, 0];\n }\n\n /**\n * Translates a buffer line to a string, with optional start and end columns.\n * Wide characters will count as two columns in the resulting string. This\n * function is useful for getting the actual text underneath the raw selection\n * position.\n * @param lineIndex The absolute index of the line being translated.\n * @param trimRight Whether to trim whitespace to the right.\n * @param startCol The column to start at.\n * @param endCol The column to end at.\n */\n public translateBufferLineToString(lineIndex: number, trimRight: boolean, startCol: number = 0, endCol?: number): string {\n const line = this.lines.get(lineIndex);\n if (!line) {\n return '';\n }\n return line.translateToString(trimRight, startCol, endCol);\n }\n\n public getWrappedRangeForLine(y: number): { first: number, last: number } {\n let first = y;\n let last = y;\n // Scan upwards for wrapped lines\n while (first > 0 && this.lines.get(first)!.isWrapped) {\n first--;\n }\n // Scan downwards for wrapped lines\n while (last + 1 < this.lines.length && this.lines.get(last + 1)!.isWrapped) {\n last++;\n }\n return { first, last };\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n if (i !== null && i !== undefined) {\n if (!this.tabs[i]) {\n i = this.prevStop(i);\n }\n } else {\n this.tabs = {};\n i = 0;\n }\n\n for (; i < this._cols; i += this._optionsService.rawOptions.tabStopWidth) {\n this.tabs[i] = true;\n }\n }\n\n /**\n * Move the cursor to the previous tab stop from the given position (default is current).\n * @param x The position to move the cursor to the previous tab stop.\n */\n public prevStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[--x] && x > 0);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Move the cursor one tab stop forward from the given position (default is current).\n * @param x The position to move the cursor one tab stop forward.\n */\n public nextStop(x?: number): number {\n if (x === null || x === undefined) {\n x = this.x;\n }\n while (!this.tabs[++x] && x < this._cols);\n return x >= this._cols ? this._cols - 1 : x < 0 ? 0 : x;\n }\n\n /**\n * Clears markers on single line.\n * @param y The line to clear.\n */\n public clearMarkers(y: number): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n if (this.markers[i].line === y) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n }\n this._isClearing = false;\n }\n\n /**\n * Clears markers on all lines\n */\n public clearAllMarkers(): void {\n this._isClearing = true;\n for (let i = 0; i < this.markers.length; i++) {\n this.markers[i].dispose();\n this.markers.splice(i--, 1);\n }\n this._isClearing = false;\n }\n\n public addMarker(y: number): Marker {\n const marker = new Marker(y);\n this.markers.push(marker);\n marker.register(this.lines.onTrim(amount => {\n marker.line -= amount;\n // The marker should be disposed when the line is trimmed from the buffer\n if (marker.line < 0) {\n marker.dispose();\n }\n }));\n marker.register(this.lines.onInsert(event => {\n if (marker.line >= event.index) {\n marker.line += event.amount;\n }\n }));\n marker.register(this.lines.onDelete(event => {\n // Delete the marker if it's within the range\n if (marker.line >= event.index && marker.line < event.index + event.amount) {\n marker.dispose();\n }\n\n // Shift the marker if it's after the deleted range\n if (marker.line > event.index) {\n marker.line -= event.amount;\n }\n }));\n marker.register(marker.onDispose(() => this._removeMarker(marker)));\n return marker;\n }\n\n private _removeMarker(marker: Marker): void {\n if (!this._isClearing) {\n this.markers.splice(this.markers.indexOf(marker), 1);\n }\n }\n\n public iterator(trimRight: boolean, startIndex?: number, endIndex?: number, startOverscan?: number, endOverscan?: number): IBufferStringIterator {\n return new BufferStringIterator(this, trimRight, startIndex, endIndex, startOverscan, endOverscan);\n }\n}\n\n/**\n * Iterator to get unwrapped content strings from the buffer.\n * The iterator returns at least the string data between the borders\n * `startIndex` and `endIndex` (exclusive) and will expand the lines\n * by `startOverscan` to the top and by `endOverscan` to the bottom,\n * if no new line was found in between.\n * It will never read/return string data beyond `startIndex - startOverscan`\n * or `endIndex + endOverscan`. Therefore the first and last line might be truncated.\n * It is possible to always get the full string for the first and last line as well\n * by setting the overscan values to the actual buffer length. This not recommended\n * since it might return the whole buffer within a single string in a worst case scenario.\n */\nexport class BufferStringIterator implements IBufferStringIterator {\n private _current: number;\n\n constructor(\n private _buffer: IBuffer,\n private _trimRight: boolean,\n private _startIndex: number = 0,\n private _endIndex: number = _buffer.lines.length,\n private _startOverscan: number = 0,\n private _endOverscan: number = 0\n ) {\n if (this._startIndex < 0) {\n this._startIndex = 0;\n }\n if (this._endIndex > this._buffer.lines.length) {\n this._endIndex = this._buffer.lines.length;\n }\n this._current = this._startIndex;\n }\n\n public hasNext(): boolean {\n return this._current < this._endIndex;\n }\n\n public next(): IBufferStringIteratorResult {\n const range = this._buffer.getWrappedRangeForLine(this._current);\n // limit search window to overscan value at both borders\n if (range.first < this._startIndex - this._startOverscan) {\n range.first = this._startIndex - this._startOverscan;\n }\n if (range.last > this._endIndex + this._endOverscan) {\n range.last = this._endIndex + this._endOverscan;\n }\n // limit to current buffer length\n range.first = Math.max(range.first, 0);\n range.last = Math.min(range.last, this._buffer.lines.length);\n let content = '';\n for (let i = range.first; i <= range.last; ++i) {\n content += this._buffer.translateBufferLineToString(i, this._trimRight);\n }\n this._current = range.last + 1;\n return { range, content };\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, IBufferLine, ICellData, IAttributeData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, WHITESPACE_CELL_CHAR, Content, BgFlags, FgFlags } from 'common/buffer/Constants';\nimport { CellData } from 'common/buffer/CellData';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * buffer memory layout:\n *\n * | uint32_t | uint32_t | uint32_t |\n * | `content` | `FG` | `BG` |\n * | wcwidth(2) comb(1) codepoint(21) | flags(8) R(8) G(8) B(8) | flags(8) R(8) G(8) B(8) |\n */\n\n\n/** typed array slots taken by one cell */\nconst CELL_SIZE = 3;\n\n/**\n * Cell member indices.\n *\n * Direct access:\n * `content = data[column * CELL_SIZE + Cell.CONTENT];`\n * `fg = data[column * CELL_SIZE + Cell.FG];`\n * `bg = data[column * CELL_SIZE + Cell.BG];`\n */\nconst enum Cell {\n CONTENT = 0,\n FG = 1, // currently simply holds all known attrs\n BG = 2 // currently unused\n}\n\nexport const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData());\n\n// Work variables to avoid garbage collection\nlet $startIndex = 0;\n\n/** Factor when to cleanup underlying array buffer after shrinking. */\nconst CLEANUP_THRESHOLD = 2;\n\n/**\n * Typed array based bufferline implementation.\n *\n * There are 2 ways to insert data into the cell buffer:\n * - `setCellFromCodepoint` + `addCodepointToCell`\n * Use these for data that is already UTF32.\n * Used during normal input in `InputHandler` for faster buffer access.\n * - `setCell`\n * This method takes a CellData object and stores the data in the buffer.\n * Use `CellData.fromCharData` to create the CellData object (e.g. from JS string).\n *\n * To retrieve data from the buffer use either one of the primitive methods\n * (if only one particular value is needed) or `loadCell`. For `loadCell` in a loop\n * memory allocs / GC pressure can be greatly reduced by reusing the CellData object.\n */\nexport class BufferLine implements IBufferLine {\n protected _data: Uint32Array;\n protected _combined: {[index: number]: string} = {};\n protected _extendedAttrs: {[index: number]: IExtendedAttrs | undefined} = {};\n public length: number;\n\n constructor(cols: number, fillCellData?: ICellData, public isWrapped: boolean = false) {\n this._data = new Uint32Array(cols * CELL_SIZE);\n const cell = fillCellData || CellData.fromCharData([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);\n for (let i = 0; i < cols; ++i) {\n this.setCell(i, cell);\n }\n this.length = cols;\n }\n\n /**\n * Get cell data CharData.\n * @deprecated\n */\n public get(index: number): CharData {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n return [\n this._data[index * CELL_SIZE + Cell.FG],\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index]\n : (cp) ? stringFromCodePoint(cp) : '',\n content >> Content.WIDTH_SHIFT,\n (content & Content.IS_COMBINED_MASK)\n ? this._combined[index].charCodeAt(this._combined[index].length - 1)\n : cp\n ];\n }\n\n /**\n * Set cell data from CharData.\n * @deprecated\n */\n public set(index: number, value: CharData): void {\n this._data[index * CELL_SIZE + Cell.FG] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + Cell.CONTENT] = index | Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n } else {\n this._data[index * CELL_SIZE + Cell.CONTENT] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n\n /**\n * primitive getters\n * use these when only one value is needed, otherwise use `loadCell`\n */\n public getWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT;\n }\n\n /** Test whether content has width. */\n public hasWidth(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.WIDTH_MASK;\n }\n\n /** Get FG cell component. */\n public getFg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.FG];\n }\n\n /** Get BG cell component. */\n public getBg(index: number): number {\n return this._data[index * CELL_SIZE + Cell.BG];\n }\n\n /**\n * Test whether contains any chars.\n * Basically an empty has no content, but other cells might differ in FG/BG\n * from real empty cells.\n */\n public hasContent(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK;\n }\n\n /**\n * Get codepoint of the cell.\n * To be in line with `code` in CharData this either returns\n * a single UTF32 codepoint or the last codepoint of a combined string.\n */\n public getCodePoint(index: number): number {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index].charCodeAt(this._combined[index].length - 1);\n }\n return content & Content.CODEPOINT_MASK;\n }\n\n /** Test whether the cell contains a combined string. */\n public isCombined(index: number): number {\n return this._data[index * CELL_SIZE + Cell.CONTENT] & Content.IS_COMBINED_MASK;\n }\n\n /** Returns the string content of the cell. */\n public getString(index: number): string {\n const content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n return this._combined[index];\n }\n if (content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(content & Content.CODEPOINT_MASK);\n }\n // return empty string for empty cells\n return '';\n }\n\n /** Get state of protected flag. */\n public isProtected(index: number): number {\n return this._data[index * CELL_SIZE + Cell.BG] & BgFlags.PROTECTED;\n }\n\n /**\n * Load data at `index` into `cell`. This is used to access cells in a way that's more friendly\n * to GC as it significantly reduced the amount of new objects/references needed.\n */\n public loadCell(index: number, cell: ICellData): ICellData {\n $startIndex = index * CELL_SIZE;\n cell.content = this._data[$startIndex + Cell.CONTENT];\n cell.fg = this._data[$startIndex + Cell.FG];\n cell.bg = this._data[$startIndex + Cell.BG];\n if (cell.content & Content.IS_COMBINED_MASK) {\n cell.combinedData = this._combined[index];\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n cell.extended = this._extendedAttrs[index]!;\n }\n return cell;\n }\n\n /**\n * Set data at `index` to `cell`.\n */\n public setCell(index: number, cell: ICellData): void {\n if (cell.content & Content.IS_COMBINED_MASK) {\n this._combined[index] = cell.combinedData;\n }\n if (cell.bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = cell.extended;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = cell.content;\n this._data[index * CELL_SIZE + Cell.FG] = cell.fg;\n this._data[index * CELL_SIZE + Cell.BG] = cell.bg;\n }\n\n /**\n * Set cell data from input handler.\n * Since the input handler see the incoming chars as UTF32 codepoints,\n * it gets an optimized access method.\n */\n public setCellFromCodePoint(index: number, codePoint: number, width: number, fg: number, bg: number, eAttrs: IExtendedAttrs): void {\n if (bg & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[index] = eAttrs;\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = codePoint | (width << Content.WIDTH_SHIFT);\n this._data[index * CELL_SIZE + Cell.FG] = fg;\n this._data[index * CELL_SIZE + Cell.BG] = bg;\n }\n\n /**\n * Add a codepoint to a cell from input handler.\n * During input stage combining chars with a width of 0 follow and stack\n * onto a leading char. Since we already set the attrs\n * by the previous `setDataFromCodePoint` call, we can omit it here.\n */\n public addCodepointToCell(index: number, codePoint: number): void {\n let content = this._data[index * CELL_SIZE + Cell.CONTENT];\n if (content & Content.IS_COMBINED_MASK) {\n // we already have a combined string, simply add\n this._combined[index] += stringFromCodePoint(codePoint);\n } else {\n if (content & Content.CODEPOINT_MASK) {\n // normal case for combining chars:\n // - move current leading char + new one into combined string\n // - set combined flag\n this._combined[index] = stringFromCodePoint(content & Content.CODEPOINT_MASK) + stringFromCodePoint(codePoint);\n content &= ~Content.CODEPOINT_MASK; // set codepoint in buffer to 0\n content |= Content.IS_COMBINED_MASK;\n } else {\n // should not happen - we actually have no data in the cell yet\n // simply set the data in the cell buffer with a width of 1\n content = codePoint | (1 << Content.WIDTH_SHIFT);\n }\n this._data[index * CELL_SIZE + Cell.CONTENT] = content;\n }\n }\n\n public insertCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n\n // handle fullwidth at pos: reset cell one to the left if pos is second cell of a wide char\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = this.length - pos - n - 1; i >= 0; --i) {\n this.setCell(pos + n + i, this.loadCell(pos + i, cell));\n }\n for (let i = 0; i < n; ++i) {\n this.setCell(pos + i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at line end: reset last cell if it is first cell of a wide char\n if (this.getWidth(this.length - 1) === 2) {\n this.setCellFromCodePoint(this.length - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public deleteCells(pos: number, n: number, fillCellData: ICellData, eraseAttr?: IAttributeData): void {\n pos %= this.length;\n if (n < this.length - pos) {\n const cell = new CellData();\n for (let i = 0; i < this.length - pos - n; ++i) {\n this.setCell(pos + i, this.loadCell(pos + n + i, cell));\n }\n for (let i = this.length - n; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n for (let i = pos; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n // handle fullwidth at pos:\n // - reset pos-1 if wide char\n // - reset pos if width==0 (previous second cell of a wide char)\n if (pos && this.getWidth(pos - 1) === 2) {\n this.setCellFromCodePoint(pos - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n if (this.getWidth(pos) === 0 && !this.hasContent(pos)) {\n this.setCellFromCodePoint(pos, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n }\n\n public replaceCells(start: number, end: number, fillCellData: ICellData, eraseAttr?: IAttributeData, respectProtect: boolean = false): void {\n // full branching on respectProtect==true, hopefully getting fast JIT for standard case\n if (respectProtect) {\n if (start && this.getWidth(start - 1) === 2 && !this.isProtected(start - 1)) {\n this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n if (end < this.length && this.getWidth(end - 1) === 2 && !this.isProtected(end)) {\n this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n while (start < end && start < this.length) {\n if (!this.isProtected(start)) {\n this.setCell(start, fillCellData);\n }\n start++;\n }\n return;\n }\n\n // handle fullwidth at start: reset cell one to the left if start is second cell of a wide char\n if (start && this.getWidth(start - 1) === 2) {\n this.setCellFromCodePoint(start - 1, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n // handle fullwidth at last cell + 1: reset to empty cell if it is second part of a wide char\n if (end < this.length && this.getWidth(end - 1) === 2) {\n this.setCellFromCodePoint(end, 0, 1, eraseAttr?.fg || 0, eraseAttr?.bg || 0, eraseAttr?.extended || new ExtendedAttrs());\n }\n\n while (start < end && start < this.length) {\n this.setCell(start++, fillCellData);\n }\n }\n\n /**\n * Resize BufferLine to `cols` filling excess cells with `fillCellData`.\n * The underlying array buffer will not change if there is still enough space\n * to hold the new buffer line data.\n * Returns a boolean indicating, whether a `cleanupMemory` call would free\n * excess memory (true after shrinking > CLEANUP_THRESHOLD).\n */\n public resize(cols: number, fillCellData: ICellData): boolean {\n if (cols === this.length) {\n return this._data.length * 4 * CLEANUP_THRESHOLD < this._data.buffer.byteLength;\n }\n const uint32Cells = cols * CELL_SIZE;\n if (cols > this.length) {\n if (this._data.buffer.byteLength >= uint32Cells * 4) {\n // optimization: avoid alloc and data copy if buffer has enough room\n this._data = new Uint32Array(this._data.buffer, 0, uint32Cells);\n } else {\n // slow path: new alloc and full data copy\n const data = new Uint32Array(uint32Cells);\n data.set(this._data);\n this._data = data;\n }\n for (let i = this.length; i < cols; ++i) {\n this.setCell(i, fillCellData);\n }\n } else {\n // optimization: just shrink the view on existing buffer\n this._data = this._data.subarray(0, uint32Cells);\n // Remove any cut off combined data\n const keys = Object.keys(this._combined);\n for (let i = 0; i < keys.length; i++) {\n const key = parseInt(keys[i], 10);\n if (key >= cols) {\n delete this._combined[key];\n }\n }\n // remove any cut off extended attributes\n const extKeys = Object.keys(this._extendedAttrs);\n for (let i = 0; i < extKeys.length; i++) {\n const key = parseInt(extKeys[i], 10);\n if (key >= cols) {\n delete this._extendedAttrs[key];\n }\n }\n }\n this.length = cols;\n return uint32Cells * 4 * CLEANUP_THRESHOLD < this._data.buffer.byteLength;\n }\n\n /**\n * Cleanup underlying array buffer.\n * A cleanup will be triggered if the array buffer exceeds the actual used\n * memory by a factor of CLEANUP_THRESHOLD.\n * Returns 0 or 1 indicating whether a cleanup happened.\n */\n public cleanupMemory(): number {\n if (this._data.length * 4 * CLEANUP_THRESHOLD < this._data.buffer.byteLength) {\n const data = new Uint32Array(this._data.length);\n data.set(this._data);\n this._data = data;\n return 1;\n }\n return 0;\n }\n\n /** fill a line with fillCharData */\n public fill(fillCellData: ICellData, respectProtect: boolean = false): void {\n // full branching on respectProtect==true, hopefully getting fast JIT for standard case\n if (respectProtect) {\n for (let i = 0; i < this.length; ++i) {\n if (!this.isProtected(i)) {\n this.setCell(i, fillCellData);\n }\n }\n return;\n }\n this._combined = {};\n this._extendedAttrs = {};\n for (let i = 0; i < this.length; ++i) {\n this.setCell(i, fillCellData);\n }\n }\n\n /** alter to a full copy of line */\n public copyFrom(line: BufferLine): void {\n if (this.length !== line.length) {\n this._data = new Uint32Array(line._data);\n } else {\n // use high speed copy if lengths are equal\n this._data.set(line._data);\n }\n this.length = line.length;\n this._combined = {};\n for (const el in line._combined) {\n this._combined[el] = line._combined[el];\n }\n this._extendedAttrs = {};\n for (const el in line._extendedAttrs) {\n this._extendedAttrs[el] = line._extendedAttrs[el];\n }\n this.isWrapped = line.isWrapped;\n }\n\n /** create a new clone */\n public clone(): IBufferLine {\n const newLine = new BufferLine(0);\n newLine._data = new Uint32Array(this._data);\n newLine.length = this.length;\n for (const el in this._combined) {\n newLine._combined[el] = this._combined[el];\n }\n for (const el in this._extendedAttrs) {\n newLine._extendedAttrs[el] = this._extendedAttrs[el];\n }\n newLine.isWrapped = this.isWrapped;\n return newLine;\n }\n\n public getTrimmedLength(): number {\n for (let i = this.length - 1; i >= 0; --i) {\n if ((this._data[i * CELL_SIZE + Cell.CONTENT] & Content.HAS_CONTENT_MASK)) {\n return i + (this._data[i * CELL_SIZE + Cell.CONTENT] >> Content.WIDTH_SHIFT);\n }\n }\n return 0;\n }\n\n public copyCellsFrom(src: BufferLine, srcCol: number, destCol: number, length: number, applyInReverse: boolean): void {\n const srcData = src._data;\n if (applyInReverse) {\n for (let cell = length - 1; cell >= 0; cell--) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n if (srcData[(srcCol + cell) * CELL_SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[destCol + cell] = src._extendedAttrs[srcCol + cell];\n }\n }\n } else {\n for (let cell = 0; cell < length; cell++) {\n for (let i = 0; i < CELL_SIZE; i++) {\n this._data[(destCol + cell) * CELL_SIZE + i] = srcData[(srcCol + cell) * CELL_SIZE + i];\n }\n if (srcData[(srcCol + cell) * CELL_SIZE + Cell.BG] & BgFlags.HAS_EXTENDED) {\n this._extendedAttrs[destCol + cell] = src._extendedAttrs[srcCol + cell];\n }\n }\n }\n\n // Move any combined data over as needed, FIXME: repeat for extended attrs\n const srcCombinedKeys = Object.keys(src._combined);\n for (let i = 0; i < srcCombinedKeys.length; i++) {\n const key = parseInt(srcCombinedKeys[i], 10);\n if (key >= srcCol) {\n this._combined[key - srcCol + destCol] = src._combined[key];\n }\n }\n }\n\n public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = this.length): string {\n if (trimRight) {\n endCol = Math.min(endCol, this.getTrimmedLength());\n }\n let result = '';\n while (startCol < endCol) {\n const content = this._data[startCol * CELL_SIZE + Cell.CONTENT];\n const cp = content & Content.CODEPOINT_MASK;\n result += (content & Content.IS_COMBINED_MASK) ? this._combined[startCol] : (cp) ? stringFromCodePoint(cp) : WHITESPACE_CELL_CHAR;\n startCol += (content >> Content.WIDTH_SHIFT) || 1; // always advance by 1\n }\n return result;\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferRange } from 'xterm';\n\nexport function getRangeLength(range: IBufferRange, bufferCols: number): number {\n if (range.start.y > range.end.y) {\n throw new Error(`Buffer range end (${range.end.x}, ${range.end.y}) cannot be before start (${range.start.x}, ${range.start.y})`);\n }\n return bufferCols * (range.end.y - range.start.y) + (range.end.x - range.start.x + 1);\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { BufferLine } from 'common/buffer/BufferLine';\nimport { CircularList } from 'common/CircularList';\nimport { IBufferLine, ICellData } from 'common/Types';\n\nexport interface INewLayoutResult {\n layout: number[];\n countRemoved: number;\n}\n\n/**\n * Evaluates and returns indexes to be removed after a reflow larger occurs. Lines will be removed\n * when a wrapped line unwraps.\n * @param lines The buffer lines.\n * @param oldCols The columns before resize\n * @param newCols The columns after resize.\n * @param bufferAbsoluteY The absolute y position of the cursor (baseY + cursorY).\n * @param nullCell The cell data to use when filling in empty cells.\n */\nexport function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, oldCols: number, newCols: number, bufferAbsoluteY: number, nullCell: ICellData): number[] {\n // Gather all BufferLines that need to be removed from the Buffer here so that they can be\n // batched up and only committed once\n const toRemove: number[] = [];\n\n for (let y = 0; y < lines.length - 1; y++) {\n // Check if this row is wrapped\n let i = y;\n let nextLine = lines.get(++i) as BufferLine;\n if (!nextLine.isWrapped) {\n continue;\n }\n\n // Check how many lines it's wrapped for\n const wrappedLines: BufferLine[] = [lines.get(y) as BufferLine];\n while (i < lines.length && nextLine.isWrapped) {\n wrappedLines.push(nextLine);\n nextLine = lines.get(++i) as BufferLine;\n }\n\n // If these lines contain the cursor don't touch them, the program will handle fixing up wrapped\n // lines with the cursor\n if (bufferAbsoluteY >= y && bufferAbsoluteY < i) {\n y += wrappedLines.length - 1;\n continue;\n }\n\n // Copy buffer data to new locations\n let destLineIndex = 0;\n let destCol = getWrappedLineTrimmedLength(wrappedLines, destLineIndex, oldCols);\n let srcLineIndex = 1;\n let srcCol = 0;\n while (srcLineIndex < wrappedLines.length) {\n const srcTrimmedTineLength = getWrappedLineTrimmedLength(wrappedLines, srcLineIndex, oldCols);\n const srcRemainingCells = srcTrimmedTineLength - srcCol;\n const destRemainingCells = newCols - destCol;\n const cellsToCopy = Math.min(srcRemainingCells, destRemainingCells);\n\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[srcLineIndex], srcCol, destCol, cellsToCopy, false);\n\n destCol += cellsToCopy;\n if (destCol === newCols) {\n destLineIndex++;\n destCol = 0;\n }\n srcCol += cellsToCopy;\n if (srcCol === srcTrimmedTineLength) {\n srcLineIndex++;\n srcCol = 0;\n }\n\n // Make sure the last cell isn't wide, if it is copy it to the current dest\n if (destCol === 0 && destLineIndex !== 0) {\n if (wrappedLines[destLineIndex - 1].getWidth(newCols - 1) === 2) {\n wrappedLines[destLineIndex].copyCellsFrom(wrappedLines[destLineIndex - 1], newCols - 1, destCol++, 1, false);\n // Null out the end of the last row\n wrappedLines[destLineIndex - 1].setCell(newCols - 1, nullCell);\n }\n }\n }\n\n // Clear out remaining cells or fragments could remain;\n wrappedLines[destLineIndex].replaceCells(destCol, newCols, nullCell);\n\n // Work backwards and remove any rows at the end that only contain null cells\n let countToRemove = 0;\n for (let i = wrappedLines.length - 1; i > 0; i--) {\n if (i > destLineIndex || wrappedLines[i].getTrimmedLength() === 0) {\n countToRemove++;\n } else {\n break;\n }\n }\n\n if (countToRemove > 0) {\n toRemove.push(y + wrappedLines.length - countToRemove); // index\n toRemove.push(countToRemove);\n }\n\n y += wrappedLines.length - 1;\n }\n return toRemove;\n}\n\n/**\n * Creates and return the new layout for lines given an array of indexes to be removed.\n * @param lines The buffer lines.\n * @param toRemove The indexes to remove.\n */\nexport function reflowLargerCreateNewLayout(lines: CircularList<IBufferLine>, toRemove: number[]): INewLayoutResult {\n const layout: number[] = [];\n // First iterate through the list and get the actual indexes to use for rows\n let nextToRemoveIndex = 0;\n let nextToRemoveStart = toRemove[nextToRemoveIndex];\n let countRemovedSoFar = 0;\n for (let i = 0; i < lines.length; i++) {\n if (nextToRemoveStart === i) {\n const countToRemove = toRemove[++nextToRemoveIndex];\n\n // Tell markers that there was a deletion\n lines.onDeleteEmitter.fire({\n index: i - countRemovedSoFar,\n amount: countToRemove\n });\n\n i += countToRemove - 1;\n countRemovedSoFar += countToRemove;\n nextToRemoveStart = toRemove[++nextToRemoveIndex];\n } else {\n layout.push(i);\n }\n }\n return {\n layout,\n countRemoved: countRemovedSoFar\n };\n}\n\n/**\n * Applies a new layout to the buffer. This essentially does the same as many splice calls but it's\n * done all at once in a single iteration through the list since splice is very expensive.\n * @param lines The buffer lines.\n * @param newLayout The new layout to apply.\n */\nexport function reflowLargerApplyNewLayout(lines: CircularList<IBufferLine>, newLayout: number[]): void {\n // Record original lines so they don't get overridden when we rearrange the list\n const newLayoutLines: BufferLine[] = [];\n for (let i = 0; i < newLayout.length; i++) {\n newLayoutLines.push(lines.get(newLayout[i]) as BufferLine);\n }\n\n // Rearrange the list\n for (let i = 0; i < newLayoutLines.length; i++) {\n lines.set(i, newLayoutLines[i]);\n }\n lines.length = newLayout.length;\n}\n\n/**\n * Gets the new line lengths for a given wrapped line. The purpose of this function it to pre-\n * compute the wrapping points since wide characters may need to be wrapped onto the following line.\n * This function will return an array of numbers of where each line wraps to, the resulting array\n * will only contain the values `newCols` (when the line does not end with a wide character) and\n * `newCols - 1` (when the line does end with a wide character), except for the last value which\n * will contain the remaining items to fill the line.\n *\n * Calling this with a `newCols` value of `1` will lock up.\n *\n * @param wrappedLines The wrapped lines to evaluate.\n * @param oldCols The columns before resize.\n * @param newCols The columns after resize.\n */\nexport function reflowSmallerGetNewLineLengths(wrappedLines: BufferLine[], oldCols: number, newCols: number): number[] {\n const newLineLengths: number[] = [];\n const cellsNeeded = wrappedLines.map((l, i) => getWrappedLineTrimmedLength(wrappedLines, i, oldCols)).reduce((p, c) => p + c);\n\n // Use srcCol and srcLine to find the new wrapping point, use that to get the cellsAvailable and\n // linesNeeded\n let srcCol = 0;\n let srcLine = 0;\n let cellsAvailable = 0;\n while (cellsAvailable < cellsNeeded) {\n if (cellsNeeded - cellsAvailable < newCols) {\n // Add the final line and exit the loop\n newLineLengths.push(cellsNeeded - cellsAvailable);\n break;\n }\n srcCol += newCols;\n const oldTrimmedLength = getWrappedLineTrimmedLength(wrappedLines, srcLine, oldCols);\n if (srcCol > oldTrimmedLength) {\n srcCol -= oldTrimmedLength;\n srcLine++;\n }\n const endsWithWide = wrappedLines[srcLine].getWidth(srcCol - 1) === 2;\n if (endsWithWide) {\n srcCol--;\n }\n const lineLength = endsWithWide ? newCols - 1 : newCols;\n newLineLengths.push(lineLength);\n cellsAvailable += lineLength;\n }\n\n return newLineLengths;\n}\n\nexport function getWrappedLineTrimmedLength(lines: BufferLine[], i: number, cols: number): number {\n // If this is the last row in the wrapped line, get the actual trimmed length\n if (i === lines.length - 1) {\n return lines[i].getTrimmedLength();\n }\n // Detect whether the following line starts with a wide character and the end of the current line\n // is null, if so then we can be pretty sure the null character should be excluded from the line\n // length]\n const endsInNull = !(lines[i].hasContent(cols - 1)) && lines[i].getWidth(cols - 1) === 1;\n const followingLineStartsWithWide = lines[i + 1].getWidth(0) === 2;\n if (endsInNull && followingLineStartsWithWide) {\n return cols - 1;\n }\n return cols;\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IAttributeData } from 'common/Types';\nimport { Buffer } from 'common/buffer/Buffer';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IOptionsService, IBufferService } from 'common/services/Services';\nimport { Disposable } from 'common/Lifecycle';\n\n/**\n * The BufferSet represents the set of two buffers used by xterm terminals (normal and alt) and\n * provides also utilities for working with them.\n */\nexport class BufferSet extends Disposable implements IBufferSet {\n private _normal!: Buffer;\n private _alt!: Buffer;\n private _activeBuffer!: Buffer;\n\n private readonly _onBufferActivate = this.register(new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>());\n public readonly onBufferActivate = this._onBufferActivate.event;\n\n /**\n * Create a new BufferSet for the given terminal.\n */\n constructor(\n private readonly _optionsService: IOptionsService,\n private readonly _bufferService: IBufferService\n ) {\n super();\n this.reset();\n this.register(this._optionsService.onSpecificOptionChange('scrollback', () => this.resize(this._bufferService.cols, this._bufferService.rows)));\n this.register(this._optionsService.onSpecificOptionChange('tabStopWidth', () => this.setupTabStops()));\n }\n\n public reset(): void {\n this._normal = new Buffer(true, this._optionsService, this._bufferService);\n this._normal.fillViewportRows();\n\n // The alt buffer should never have scrollback.\n // See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer\n this._alt = new Buffer(false, this._optionsService, this._bufferService);\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n\n this.setupTabStops();\n }\n\n /**\n * Returns the alt Buffer of the BufferSet\n */\n public get alt(): Buffer {\n return this._alt;\n }\n\n /**\n * Returns the currently active Buffer of the BufferSet\n */\n public get active(): Buffer {\n return this._activeBuffer;\n }\n\n /**\n * Returns the normal Buffer of the BufferSet\n */\n public get normal(): Buffer {\n return this._normal;\n }\n\n /**\n * Sets the normal Buffer of the BufferSet as its currently active Buffer\n */\n public activateNormalBuffer(): void {\n if (this._activeBuffer === this._normal) {\n return;\n }\n this._normal.x = this._alt.x;\n this._normal.y = this._alt.y;\n // The alt buffer should always be cleared when we switch to the normal\n // buffer. This frees up memory since the alt buffer should always be new\n // when activated.\n this._alt.clearAllMarkers();\n this._alt.clear();\n this._activeBuffer = this._normal;\n this._onBufferActivate.fire({\n activeBuffer: this._normal,\n inactiveBuffer: this._alt\n });\n }\n\n /**\n * Sets the alt Buffer of the BufferSet as its currently active Buffer\n */\n public activateAltBuffer(fillAttr?: IAttributeData): void {\n if (this._activeBuffer === this._alt) {\n return;\n }\n // Since the alt buffer is always cleared when the normal buffer is\n // activated, we want to fill it when switching to it.\n this._alt.fillViewportRows(fillAttr);\n this._alt.x = this._normal.x;\n this._alt.y = this._normal.y;\n this._activeBuffer = this._alt;\n this._onBufferActivate.fire({\n activeBuffer: this._alt,\n inactiveBuffer: this._normal\n });\n }\n\n /**\n * Resizes both normal and alt buffers, adjusting their data accordingly.\n * @param newCols The new number of columns.\n * @param newRows The new number of rows.\n */\n public resize(newCols: number, newRows: number): void {\n this._normal.resize(newCols, newRows);\n this._alt.resize(newCols, newRows);\n this.setupTabStops(newCols);\n }\n\n /**\n * Setup the tab stops.\n * @param i The index to start setting up tab stops from.\n */\n public setupTabStops(i?: number): void {\n this._normal.setupTabStops(i);\n this._alt.setupTabStops(i);\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CharData, ICellData, IExtendedAttrs } from 'common/Types';\nimport { stringFromCodePoint } from 'common/input/TextDecoder';\nimport { CHAR_DATA_CHAR_INDEX, CHAR_DATA_WIDTH_INDEX, CHAR_DATA_ATTR_INDEX, Content } from 'common/buffer/Constants';\nimport { AttributeData, ExtendedAttrs } from 'common/buffer/AttributeData';\n\n/**\n * CellData - represents a single Cell in the terminal buffer.\n */\nexport class CellData extends AttributeData implements ICellData {\n /** Helper to create CellData from CharData. */\n public static fromCharData(value: CharData): CellData {\n const obj = new CellData();\n obj.setFromCharData(value);\n return obj;\n }\n /** Primitives from terminal buffer. */\n public content = 0;\n public fg = 0;\n public bg = 0;\n public extended: IExtendedAttrs = new ExtendedAttrs();\n public combinedData = '';\n /** Whether cell contains a combined string. */\n public isCombined(): number {\n return this.content & Content.IS_COMBINED_MASK;\n }\n /** Width of the cell. */\n public getWidth(): number {\n return this.content >> Content.WIDTH_SHIFT;\n }\n /** JS string of the content. */\n public getChars(): string {\n if (this.content & Content.IS_COMBINED_MASK) {\n return this.combinedData;\n }\n if (this.content & Content.CODEPOINT_MASK) {\n return stringFromCodePoint(this.content & Content.CODEPOINT_MASK);\n }\n return '';\n }\n /**\n * Codepoint of cell\n * Note this returns the UTF32 codepoint of single chars,\n * if content is a combined string it returns the codepoint\n * of the last char in string to be in line with code in CharData.\n */\n public getCode(): number {\n return (this.isCombined())\n ? this.combinedData.charCodeAt(this.combinedData.length - 1)\n : this.content & Content.CODEPOINT_MASK;\n }\n /** Set data from CharData */\n public setFromCharData(value: CharData): void {\n this.fg = value[CHAR_DATA_ATTR_INDEX];\n this.bg = 0;\n let combined = false;\n // surrogates and combined strings need special treatment\n if (value[CHAR_DATA_CHAR_INDEX].length > 2) {\n combined = true;\n }\n else if (value[CHAR_DATA_CHAR_INDEX].length === 2) {\n const code = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0);\n // if the 2-char string is a surrogate create single codepoint\n // everything else is combined\n if (0xD800 <= code && code <= 0xDBFF) {\n const second = value[CHAR_DATA_CHAR_INDEX].charCodeAt(1);\n if (0xDC00 <= second && second <= 0xDFFF) {\n this.content = ((code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n else {\n combined = true;\n }\n }\n else {\n combined = true;\n }\n }\n else {\n this.content = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n if (combined) {\n this.combinedData = value[CHAR_DATA_CHAR_INDEX];\n this.content = Content.IS_COMBINED_MASK | (value[CHAR_DATA_WIDTH_INDEX] << Content.WIDTH_SHIFT);\n }\n }\n /** Get data as CharData. */\n public getAsCharData(): CharData {\n return [this.fg, this.getChars(), this.getWidth(), this.getCode()];\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nexport const DEFAULT_COLOR = 0;\nexport const DEFAULT_ATTR = (0 << 18) | (DEFAULT_COLOR << 9) | (256 << 0);\nexport const DEFAULT_EXT = 0;\n\nexport const CHAR_DATA_ATTR_INDEX = 0;\nexport const CHAR_DATA_CHAR_INDEX = 1;\nexport const CHAR_DATA_WIDTH_INDEX = 2;\nexport const CHAR_DATA_CODE_INDEX = 3;\n\n/**\n * Null cell - a real empty cell (containing nothing).\n * Note that code should always be 0 for a null cell as\n * several test condition of the buffer line rely on this.\n */\nexport const NULL_CELL_CHAR = '';\nexport const NULL_CELL_WIDTH = 1;\nexport const NULL_CELL_CODE = 0;\n\n/**\n * Whitespace cell.\n * This is meant as a replacement for empty cells when needed\n * during rendering lines to preserve correct aligment.\n */\nexport const WHITESPACE_CELL_CHAR = ' ';\nexport const WHITESPACE_CELL_WIDTH = 1;\nexport const WHITESPACE_CELL_CODE = 32;\n\n/**\n * Bitmasks for accessing data in `content`.\n */\nexport const enum Content {\n /**\n * bit 1..21 codepoint, max allowed in UTF32 is 0x10FFFF (21 bits taken)\n * read: `codepoint = content & Content.codepointMask;`\n * write: `content |= codepoint & Content.codepointMask;`\n * shortcut if precondition `codepoint <= 0x10FFFF` is met:\n * `content |= codepoint;`\n */\n CODEPOINT_MASK = 0x1FFFFF,\n\n /**\n * bit 22 flag indication whether a cell contains combined content\n * read: `isCombined = content & Content.isCombined;`\n * set: `content |= Content.isCombined;`\n * clear: `content &= ~Content.isCombined;`\n */\n IS_COMBINED_MASK = 0x200000, // 1 << 21\n\n /**\n * bit 1..22 mask to check whether a cell contains any string data\n * we need to check for codepoint and isCombined bits to see\n * whether a cell contains anything\n * read: `isEmpty = !(content & Content.hasContent)`\n */\n HAS_CONTENT_MASK = 0x3FFFFF,\n\n /**\n * bit 23..24 wcwidth value of cell, takes 2 bits (ranges from 0..2)\n * read: `width = (content & Content.widthMask) >> Content.widthShift;`\n * `hasWidth = content & Content.widthMask;`\n * as long as wcwidth is highest value in `content`:\n * `width = content >> Content.widthShift;`\n * write: `content |= (width << Content.widthShift) & Content.widthMask;`\n * shortcut if precondition `0 <= width <= 3` is met:\n * `content |= width << Content.widthShift;`\n */\n WIDTH_MASK = 0xC00000, // 3 << 22\n WIDTH_SHIFT = 22\n}\n\nexport const enum Attributes {\n /**\n * bit 1..8 blue in RGB, color in P256 and P16\n */\n BLUE_MASK = 0xFF,\n BLUE_SHIFT = 0,\n PCOLOR_MASK = 0xFF,\n PCOLOR_SHIFT = 0,\n\n /**\n * bit 9..16 green in RGB\n */\n GREEN_MASK = 0xFF00,\n GREEN_SHIFT = 8,\n\n /**\n * bit 17..24 red in RGB\n */\n RED_MASK = 0xFF0000,\n RED_SHIFT = 16,\n\n /**\n * bit 25..26 color mode: DEFAULT (0) | P16 (1) | P256 (2) | RGB (3)\n */\n CM_MASK = 0x3000000,\n CM_DEFAULT = 0,\n CM_P16 = 0x1000000,\n CM_P256 = 0x2000000,\n CM_RGB = 0x3000000,\n\n /**\n * bit 1..24 RGB room\n */\n RGB_MASK = 0xFFFFFF\n}\n\nexport const enum FgFlags {\n /**\n * bit 27..32\n */\n INVERSE = 0x4000000,\n BOLD = 0x8000000,\n UNDERLINE = 0x10000000,\n BLINK = 0x20000000,\n INVISIBLE = 0x40000000,\n STRIKETHROUGH = 0x80000000,\n}\n\nexport const enum BgFlags {\n /**\n * bit 27..32 (upper 2 unused)\n */\n ITALIC = 0x4000000,\n DIM = 0x8000000,\n HAS_EXTENDED = 0x10000000,\n PROTECTED = 0x20000000\n}\n\nexport const enum ExtFlags {\n /**\n * bit 27..32 (upper 3 unused)\n */\n UNDERLINE_STYLE = 0x1C000000\n}\n\nexport const enum UnderlineStyle {\n NONE = 0,\n SINGLE = 1,\n DOUBLE = 2,\n CURLY = 3,\n DOTTED = 4,\n DASHED = 5\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter } from 'common/EventEmitter';\nimport { disposeArray } from 'common/Lifecycle';\nimport { IDisposable, IMarker } from 'common/Types';\n\nexport class Marker implements IMarker {\n private static _nextId = 1;\n\n public isDisposed: boolean = false;\n private _disposables: IDisposable[] = [];\n\n private _id: number = Marker._nextId++;\n public get id(): number { return this._id; }\n\n private readonly _onDispose = this.register(new EventEmitter<void>());\n public readonly onDispose = this._onDispose.event;\n\n constructor(\n public line: number\n ) {\n }\n\n public dispose(): void {\n if (this.isDisposed) {\n return;\n }\n this.isDisposed = true;\n this.line = -1;\n // Emit before super.dispose such that dispose listeners get a change to react\n this._onDispose.fire();\n disposeArray(this._disposables);\n this._disposables.length = 0;\n }\n\n public register<T extends IDisposable>(disposable: T): T {\n this._disposables.push(disposable);\n return disposable;\n }\n}\n","/**\n * Copyright (c) 2016 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharset } from 'common/Types';\n\n/**\n * The character sets supported by the terminal. These enable several languages\n * to be represented within the terminal with only 8-bit encoding. See ISO 2022\n * for a discussion on character sets. Only VT100 character sets are supported.\n */\nexport const CHARSETS: { [key: string]: ICharset | undefined } = {};\n\n/**\n * The default character set, US.\n */\nexport const DEFAULT_CHARSET: ICharset | undefined = CHARSETS['B'];\n\n/**\n * DEC Special Character and Line Drawing Set.\n * Reference: http://vt100.net/docs/vt102-ug/table5-13.html\n * A lot of curses apps use this if they see TERM=xterm.\n * testing: echo -e '\\e(0a\\e(B'\n * The xterm output sometimes seems to conflict with the\n * reference above. xterm seems in line with the reference\n * when running vttest however.\n * The table below now uses xterm's output from vttest.\n */\nCHARSETS['0'] = {\n '`': '\\u25c6', // '◆'\n 'a': '\\u2592', // '▒'\n 'b': '\\u2409', // '␉' (HT)\n 'c': '\\u240c', // '␌' (FF)\n 'd': '\\u240d', // '␍' (CR)\n 'e': '\\u240a', // '␊' (LF)\n 'f': '\\u00b0', // '°'\n 'g': '\\u00b1', // '±'\n 'h': '\\u2424', // '␤' (NL)\n 'i': '\\u240b', // '␋' (VT)\n 'j': '\\u2518', // '┘'\n 'k': '\\u2510', // '┐'\n 'l': '\\u250c', // '┌'\n 'm': '\\u2514', // '└'\n 'n': '\\u253c', // '┼'\n 'o': '\\u23ba', // '⎺'\n 'p': '\\u23bb', // '⎻'\n 'q': '\\u2500', // '─'\n 'r': '\\u23bc', // '⎼'\n 's': '\\u23bd', // '⎽'\n 't': '\\u251c', // '├'\n 'u': '\\u2524', // '┤'\n 'v': '\\u2534', // '┴'\n 'w': '\\u252c', // '┬'\n 'x': '\\u2502', // '│'\n 'y': '\\u2264', // '≤'\n 'z': '\\u2265', // '≥'\n '{': '\\u03c0', // 'π'\n '|': '\\u2260', // '≠'\n '}': '\\u00a3', // '£'\n '~': '\\u00b7' // '·'\n};\n\n/**\n * British character set\n * ESC (A\n * Reference: http://vt100.net/docs/vt220-rm/table2-5.html\n */\nCHARSETS['A'] = {\n '#': '£'\n};\n\n/**\n * United States character set\n * ESC (B\n */\nCHARSETS['B'] = undefined;\n\n/**\n * Dutch character set\n * ESC (4\n * Reference: http://vt100.net/docs/vt220-rm/table2-6.html\n */\nCHARSETS['4'] = {\n '#': '£',\n '@': '¾',\n '[': 'ij',\n '\\\\': '½',\n ']': '|',\n '{': '¨',\n '|': 'f',\n '}': '¼',\n '~': '´'\n};\n\n/**\n * Finnish character set\n * ESC (C or ESC (5\n * Reference: http://vt100.net/docs/vt220-rm/table2-7.html\n */\nCHARSETS['C'] =\nCHARSETS['5'] = {\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * French character set\n * ESC (R\n * Reference: http://vt100.net/docs/vt220-rm/table2-8.html\n */\nCHARSETS['R'] = {\n '#': '£',\n '@': 'à',\n '[': '°',\n '\\\\': 'ç',\n ']': '§',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': '¨'\n};\n\n/**\n * French Canadian character set\n * ESC (Q\n * Reference: http://vt100.net/docs/vt220-rm/table2-9.html\n */\nCHARSETS['Q'] = {\n '@': 'à',\n '[': 'â',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n '`': 'ô',\n '{': 'é',\n '|': 'ù',\n '}': 'è',\n '~': 'û'\n};\n\n/**\n * German character set\n * ESC (K\n * Reference: http://vt100.net/docs/vt220-rm/table2-10.html\n */\nCHARSETS['K'] = {\n '@': '§',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Ü',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'ß'\n};\n\n/**\n * Italian character set\n * ESC (Y\n * Reference: http://vt100.net/docs/vt220-rm/table2-11.html\n */\nCHARSETS['Y'] = {\n '#': '£',\n '@': '§',\n '[': '°',\n '\\\\': 'ç',\n ']': 'é',\n '`': 'ù',\n '{': 'à',\n '|': 'ò',\n '}': 'è',\n '~': 'ì'\n};\n\n/**\n * Norwegian/Danish character set\n * ESC (E or ESC (6\n * Reference: http://vt100.net/docs/vt220-rm/table2-12.html\n */\nCHARSETS['E'] =\nCHARSETS['6'] = {\n '@': 'Ä',\n '[': 'Æ',\n '\\\\': 'Ø',\n ']': 'Å',\n '^': 'Ü',\n '`': 'ä',\n '{': 'æ',\n '|': 'ø',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Spanish character set\n * ESC (Z\n * Reference: http://vt100.net/docs/vt220-rm/table2-13.html\n */\nCHARSETS['Z'] = {\n '#': '£',\n '@': '§',\n '[': '¡',\n '\\\\': 'Ñ',\n ']': '¿',\n '{': '°',\n '|': 'ñ',\n '}': 'ç'\n};\n\n/**\n * Swedish character set\n * ESC (H or ESC (7\n * Reference: http://vt100.net/docs/vt220-rm/table2-14.html\n */\nCHARSETS['H'] =\nCHARSETS['7'] = {\n '@': 'É',\n '[': 'Ä',\n '\\\\': 'Ö',\n ']': 'Å',\n '^': 'Ü',\n '`': 'é',\n '{': 'ä',\n '|': 'ö',\n '}': 'å',\n '~': 'ü'\n};\n\n/**\n * Swiss character set\n * ESC (=\n * Reference: http://vt100.net/docs/vt220-rm/table2-15.html\n */\nCHARSETS['='] = {\n '#': 'ù',\n '@': 'à',\n '[': 'é',\n '\\\\': 'ç',\n ']': 'ê',\n '^': 'î',\n // eslint-disable-next-line @typescript-eslint/naming-convention\n '_': 'è',\n '`': 'ô',\n '{': 'ä',\n '|': 'ö',\n '}': 'ü',\n '~': 'û'\n};\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * C0 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C0 {\n /** Null (Caret = ^@, C = \\0) */\n export const NUL = '\\x00';\n /** Start of Heading (Caret = ^A) */\n export const SOH = '\\x01';\n /** Start of Text (Caret = ^B) */\n export const STX = '\\x02';\n /** End of Text (Caret = ^C) */\n export const ETX = '\\x03';\n /** End of Transmission (Caret = ^D) */\n export const EOT = '\\x04';\n /** Enquiry (Caret = ^E) */\n export const ENQ = '\\x05';\n /** Acknowledge (Caret = ^F) */\n export const ACK = '\\x06';\n /** Bell (Caret = ^G, C = \\a) */\n export const BEL = '\\x07';\n /** Backspace (Caret = ^H, C = \\b) */\n export const BS = '\\x08';\n /** Character Tabulation, Horizontal Tabulation (Caret = ^I, C = \\t) */\n export const HT = '\\x09';\n /** Line Feed (Caret = ^J, C = \\n) */\n export const LF = '\\x0a';\n /** Line Tabulation, Vertical Tabulation (Caret = ^K, C = \\v) */\n export const VT = '\\x0b';\n /** Form Feed (Caret = ^L, C = \\f) */\n export const FF = '\\x0c';\n /** Carriage Return (Caret = ^M, C = \\r) */\n export const CR = '\\x0d';\n /** Shift Out (Caret = ^N) */\n export const SO = '\\x0e';\n /** Shift In (Caret = ^O) */\n export const SI = '\\x0f';\n /** Data Link Escape (Caret = ^P) */\n export const DLE = '\\x10';\n /** Device Control One (XON) (Caret = ^Q) */\n export const DC1 = '\\x11';\n /** Device Control Two (Caret = ^R) */\n export const DC2 = '\\x12';\n /** Device Control Three (XOFF) (Caret = ^S) */\n export const DC3 = '\\x13';\n /** Device Control Four (Caret = ^T) */\n export const DC4 = '\\x14';\n /** Negative Acknowledge (Caret = ^U) */\n export const NAK = '\\x15';\n /** Synchronous Idle (Caret = ^V) */\n export const SYN = '\\x16';\n /** End of Transmission Block (Caret = ^W) */\n export const ETB = '\\x17';\n /** Cancel (Caret = ^X) */\n export const CAN = '\\x18';\n /** End of Medium (Caret = ^Y) */\n export const EM = '\\x19';\n /** Substitute (Caret = ^Z) */\n export const SUB = '\\x1a';\n /** Escape (Caret = ^[, C = \\e) */\n export const ESC = '\\x1b';\n /** File Separator (Caret = ^\\) */\n export const FS = '\\x1c';\n /** Group Separator (Caret = ^]) */\n export const GS = '\\x1d';\n /** Record Separator (Caret = ^^) */\n export const RS = '\\x1e';\n /** Unit Separator (Caret = ^_) */\n export const US = '\\x1f';\n /** Space */\n export const SP = '\\x20';\n /** Delete (Caret = ^?) */\n export const DEL = '\\x7f';\n}\n\n/**\n * C1 control codes\n * See = https://en.wikipedia.org/wiki/C0_and_C1_control_codes\n */\nexport namespace C1 {\n /** padding character */\n export const PAD = '\\x80';\n /** High Octet Preset */\n export const HOP = '\\x81';\n /** Break Permitted Here */\n export const BPH = '\\x82';\n /** No Break Here */\n export const NBH = '\\x83';\n /** Index */\n export const IND = '\\x84';\n /** Next Line */\n export const NEL = '\\x85';\n /** Start of Selected Area */\n export const SSA = '\\x86';\n /** End of Selected Area */\n export const ESA = '\\x87';\n /** Horizontal Tabulation Set */\n export const HTS = '\\x88';\n /** Horizontal Tabulation With Justification */\n export const HTJ = '\\x89';\n /** Vertical Tabulation Set */\n export const VTS = '\\x8a';\n /** Partial Line Down */\n export const PLD = '\\x8b';\n /** Partial Line Up */\n export const PLU = '\\x8c';\n /** Reverse Index */\n export const RI = '\\x8d';\n /** Single-Shift 2 */\n export const SS2 = '\\x8e';\n /** Single-Shift 3 */\n export const SS3 = '\\x8f';\n /** Device Control String */\n export const DCS = '\\x90';\n /** Private Use 1 */\n export const PU1 = '\\x91';\n /** Private Use 2 */\n export const PU2 = '\\x92';\n /** Set Transmit State */\n export const STS = '\\x93';\n /** Destructive backspace, intended to eliminate ambiguity about meaning of BS. */\n export const CCH = '\\x94';\n /** Message Waiting */\n export const MW = '\\x95';\n /** Start of Protected Area */\n export const SPA = '\\x96';\n /** End of Protected Area */\n export const EPA = '\\x97';\n /** Start of String */\n export const SOS = '\\x98';\n /** Single Graphic Character Introducer */\n export const SGCI = '\\x99';\n /** Single Character Introducer */\n export const SCI = '\\x9a';\n /** Control Sequence Introducer */\n export const CSI = '\\x9b';\n /** String Terminator */\n export const ST = '\\x9c';\n /** Operating System Command */\n export const OSC = '\\x9d';\n /** Privacy Message */\n export const PM = '\\x9e';\n /** Application Program Command */\n export const APC = '\\x9f';\n}\nexport namespace C1_ESCAPED {\n export const ST = `${C0.ESC}\\\\`;\n}\n","/**\n * Copyright (c) 2014 The xterm.js authors. All rights reserved.\n * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)\n * @license MIT\n */\n\nimport { IKeyboardEvent, IKeyboardResult, KeyboardResultType } from 'common/Types';\nimport { C0 } from 'common/data/EscapeSequences';\n\n// reg + shift key mappings for digits and special chars\nconst KEYCODE_KEY_MAPPINGS: { [key: number]: [string, string]} = {\n // digits 0-9\n 48: ['0', ')'],\n 49: ['1', '!'],\n 50: ['2', '@'],\n 51: ['3', '#'],\n 52: ['4', '$'],\n 53: ['5', '%'],\n 54: ['6', '^'],\n 55: ['7', '&'],\n 56: ['8', '*'],\n 57: ['9', '('],\n\n // special chars\n 186: [';', ':'],\n 187: ['=', '+'],\n 188: [',', '<'],\n 189: ['-', '_'],\n 190: ['.', '>'],\n 191: ['/', '?'],\n 192: ['`', '~'],\n 219: ['[', '{'],\n 220: ['\\\\', '|'],\n 221: [']', '}'],\n 222: ['\\'', '\"']\n};\n\nexport function evaluateKeyboardEvent(\n ev: IKeyboardEvent,\n applicationCursorMode: boolean,\n isMac: boolean,\n macOptionIsMeta: boolean\n): IKeyboardResult {\n const result: IKeyboardResult = {\n type: KeyboardResultType.SEND_KEY,\n // Whether to cancel event propagation (NOTE: this may not be needed since the event is\n // canceled at the end of keyDown\n cancel: false,\n // The new key even to emit\n key: undefined\n };\n const modifiers = (ev.shiftKey ? 1 : 0) | (ev.altKey ? 2 : 0) | (ev.ctrlKey ? 4 : 0) | (ev.metaKey ? 8 : 0);\n switch (ev.keyCode) {\n case 0:\n if (ev.key === 'UIKeyInputUpArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n }\n else if (ev.key === 'UIKeyInputLeftArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n }\n else if (ev.key === 'UIKeyInputRightArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n }\n else if (ev.key === 'UIKeyInputDownArrow') {\n if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n }\n break;\n case 8:\n // backspace\n if (ev.altKey) {\n result.key = C0.ESC + C0.DEL; // \\e ^?\n break;\n }\n result.key = C0.DEL; // ^?\n break;\n case 9:\n // tab\n if (ev.shiftKey) {\n result.key = C0.ESC + '[Z';\n break;\n }\n result.key = C0.HT;\n result.cancel = true;\n break;\n case 13:\n // return/enter\n result.key = ev.altKey ? C0.ESC + C0.CR : C0.CR;\n result.cancel = true;\n break;\n case 27:\n // escape\n result.key = C0.ESC;\n if (ev.altKey) {\n result.key = C0.ESC + C0.ESC;\n }\n result.cancel = true;\n break;\n case 37:\n // left-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'D';\n // HACK: Make Alt + left-arrow behave like Ctrl + left-arrow: move one word backwards\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3D') {\n result.key = C0.ESC + (isMac ? 'b' : '[1;5D');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OD';\n } else {\n result.key = C0.ESC + '[D';\n }\n break;\n case 39:\n // right-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'C';\n // HACK: Make Alt + right-arrow behave like Ctrl + right-arrow: move one word forward\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (result.key === C0.ESC + '[1;3C') {\n result.key = C0.ESC + (isMac ? 'f' : '[1;5C');\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OC';\n } else {\n result.key = C0.ESC + '[C';\n }\n break;\n case 38:\n // up-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'A';\n // HACK: Make Alt + up-arrow behave like Ctrl + up-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3A') {\n result.key = C0.ESC + '[1;5A';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OA';\n } else {\n result.key = C0.ESC + '[A';\n }\n break;\n case 40:\n // down-arrow\n if (ev.metaKey) {\n break;\n }\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'B';\n // HACK: Make Alt + down-arrow behave like Ctrl + down-arrow\n // http://unix.stackexchange.com/a/108106\n // macOS uses different escape sequences than linux\n if (!isMac && result.key === C0.ESC + '[1;3B') {\n result.key = C0.ESC + '[1;5B';\n }\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OB';\n } else {\n result.key = C0.ESC + '[B';\n }\n break;\n case 45:\n // insert\n if (!ev.shiftKey && !ev.ctrlKey) {\n // <Ctrl> or <Shift> + <Insert> are used to\n // copy-paste on some systems.\n result.key = C0.ESC + '[2~';\n }\n break;\n case 46:\n // delete\n if (modifiers) {\n result.key = C0.ESC + '[3;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[3~';\n }\n break;\n case 36:\n // home\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'H';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OH';\n } else {\n result.key = C0.ESC + '[H';\n }\n break;\n case 35:\n // end\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'F';\n } else if (applicationCursorMode) {\n result.key = C0.ESC + 'OF';\n } else {\n result.key = C0.ESC + '[F';\n }\n break;\n case 33:\n // page up\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_UP;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[5;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[5~';\n }\n break;\n case 34:\n // page down\n if (ev.shiftKey) {\n result.type = KeyboardResultType.PAGE_DOWN;\n } else if (ev.ctrlKey) {\n result.key = C0.ESC + '[6;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[6~';\n }\n break;\n case 112:\n // F1-F12\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'P';\n } else {\n result.key = C0.ESC + 'OP';\n }\n break;\n case 113:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'Q';\n } else {\n result.key = C0.ESC + 'OQ';\n }\n break;\n case 114:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'R';\n } else {\n result.key = C0.ESC + 'OR';\n }\n break;\n case 115:\n if (modifiers) {\n result.key = C0.ESC + '[1;' + (modifiers + 1) + 'S';\n } else {\n result.key = C0.ESC + 'OS';\n }\n break;\n case 116:\n if (modifiers) {\n result.key = C0.ESC + '[15;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[15~';\n }\n break;\n case 117:\n if (modifiers) {\n result.key = C0.ESC + '[17;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[17~';\n }\n break;\n case 118:\n if (modifiers) {\n result.key = C0.ESC + '[18;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[18~';\n }\n break;\n case 119:\n if (modifiers) {\n result.key = C0.ESC + '[19;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[19~';\n }\n break;\n case 120:\n if (modifiers) {\n result.key = C0.ESC + '[20;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[20~';\n }\n break;\n case 121:\n if (modifiers) {\n result.key = C0.ESC + '[21;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[21~';\n }\n break;\n case 122:\n if (modifiers) {\n result.key = C0.ESC + '[23;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[23~';\n }\n break;\n case 123:\n if (modifiers) {\n result.key = C0.ESC + '[24;' + (modifiers + 1) + '~';\n } else {\n result.key = C0.ESC + '[24~';\n }\n break;\n default:\n // a-z and space\n if (ev.ctrlKey && !ev.shiftKey && !ev.altKey && !ev.metaKey) {\n if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n result.key = String.fromCharCode(ev.keyCode - 64);\n } else if (ev.keyCode === 32) {\n result.key = C0.NUL;\n } else if (ev.keyCode >= 51 && ev.keyCode <= 55) {\n // escape, file sep, group sep, record sep, unit sep\n result.key = String.fromCharCode(ev.keyCode - 51 + 27);\n } else if (ev.keyCode === 56) {\n result.key = C0.DEL;\n } else if (ev.keyCode === 219) {\n result.key = C0.ESC;\n } else if (ev.keyCode === 220) {\n result.key = C0.FS;\n } else if (ev.keyCode === 221) {\n result.key = C0.GS;\n }\n } else if ((!isMac || macOptionIsMeta) && ev.altKey && !ev.metaKey) {\n // On macOS this is a third level shift when !macOptionIsMeta. Use <Esc> instead.\n const keyMapping = KEYCODE_KEY_MAPPINGS[ev.keyCode];\n const key = keyMapping?.[!ev.shiftKey ? 0 : 1];\n if (key) {\n result.key = C0.ESC + key;\n } else if (ev.keyCode >= 65 && ev.keyCode <= 90) {\n const keyCode = ev.ctrlKey ? ev.keyCode - 64 : ev.keyCode + 32;\n let keyString = String.fromCharCode(keyCode);\n if (ev.shiftKey) {\n keyString = keyString.toUpperCase();\n }\n result.key = C0.ESC + keyString;\n } else if (ev.keyCode === 32) {\n result.key = C0.ESC + (ev.ctrlKey ? C0.NUL : ' ');\n } else if (ev.key === 'Dead' && ev.code.startsWith('Key')) {\n // Reference: https://github.com/xtermjs/xterm.js/issues/3725\n // Alt will produce a \"dead key\" (initate composition) with some\n // of the letters in US layout (e.g. N/E/U).\n // It's safe to match against Key* since no other `code` values begin with \"Key\".\n // https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values#code_values_on_mac\n let keyString = ev.code.slice(3, 4);\n if (!ev.shiftKey) {\n keyString = keyString.toLowerCase();\n }\n result.key = C0.ESC + keyString;\n result.cancel = true;\n }\n } else if (isMac && !ev.altKey && !ev.ctrlKey && !ev.shiftKey && ev.metaKey) {\n if (ev.keyCode === 65) { // cmd + a\n result.type = KeyboardResultType.SELECT_ALL;\n }\n } else if (ev.key && !ev.ctrlKey && !ev.altKey && !ev.metaKey && ev.keyCode >= 48 && ev.key.length === 1) {\n // Include only keys that that result in a _single_ character; don't include num lock, volume up, etc.\n result.key = ev.key;\n } else if (ev.key && ev.ctrlKey) {\n if (ev.key === '_') { // ^_\n result.key = C0.US;\n }\n if (ev.key === '@') { // ^ + shift + 2 = ^ + @\n result.key = C0.NUL;\n }\n }\n break;\n }\n\n return result;\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Polyfill - Convert UTF32 codepoint into JS string.\n * Note: The built-in String.fromCodePoint happens to be much slower\n * due to additional sanity checks. We can avoid them since\n * we always operate on legal UTF32 (granted by the input decoders)\n * and use this faster version instead.\n */\nexport function stringFromCodePoint(codePoint: number): string {\n if (codePoint > 0xFFFF) {\n codePoint -= 0x10000;\n return String.fromCharCode((codePoint >> 10) + 0xD800) + String.fromCharCode((codePoint % 0x400) + 0xDC00);\n }\n return String.fromCharCode(codePoint);\n}\n\n/**\n * Convert UTF32 char codes into JS string.\n * Basically the same as `stringFromCodePoint` but for multiple codepoints\n * in a loop (which is a lot faster).\n */\nexport function utf32ToString(data: Uint32Array, start: number = 0, end: number = data.length): string {\n let result = '';\n for (let i = start; i < end; ++i) {\n let codepoint = data[i];\n if (codepoint > 0xFFFF) {\n // JS strings are encoded as UTF16, thus a non BMP codepoint gets converted into a surrogate pair\n // conversion rules:\n // - subtract 0x10000 from code point, leaving a 20 bit number\n // - add high 10 bits to 0xD800 --> first surrogate\n // - add low 10 bits to 0xDC00 --> second surrogate\n codepoint -= 0x10000;\n result += String.fromCharCode((codepoint >> 10) + 0xD800) + String.fromCharCode((codepoint % 0x400) + 0xDC00);\n } else {\n result += String.fromCharCode(codepoint);\n }\n }\n return result;\n}\n\n/**\n * StringToUtf32 - decodes UTF16 sequences into UTF32 codepoints.\n * To keep the decoder in line with JS strings it handles single surrogates as UCS2.\n */\nexport class StringToUtf32 {\n private _interim: number = 0;\n\n /**\n * Clears interim and resets decoder to clean state.\n */\n public clear(): void {\n this._interim = 0;\n }\n\n /**\n * Decode JS string to UTF32 codepoints.\n * The methods assumes stream input and will store partly transmitted\n * surrogate pairs and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided input data does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: string, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let startPos = 0;\n\n // handle leftover surrogate high\n if (this._interim) {\n const second = input.charCodeAt(startPos++);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (this._interim - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = this._interim;\n target[size++] = second;\n }\n this._interim = 0;\n }\n\n for (let i = startPos; i < length; ++i) {\n const code = input.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n this._interim = code;\n return size;\n }\n const second = input.charCodeAt(i);\n if (0xDC00 <= second && second <= 0xDFFF) {\n target[size++] = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n // illegal codepoint (USC2 handling)\n target[size++] = code;\n target[size++] = second;\n }\n continue;\n }\n if (code === 0xFEFF) {\n // BOM\n continue;\n }\n target[size++] = code;\n }\n return size;\n }\n}\n\n/**\n * Utf8Decoder - decodes UTF8 byte sequences into UTF32 codepoints.\n */\nexport class Utf8ToUtf32 {\n public interim: Uint8Array = new Uint8Array(3);\n\n /**\n * Clears interim bytes and resets decoder to clean state.\n */\n public clear(): void {\n this.interim.fill(0);\n }\n\n /**\n * Decodes UTF8 byte sequences in `input` to UTF32 codepoints in `target`.\n * The methods assumes stream input and will store partly transmitted bytes\n * and decode them with the next data chunk.\n * Note: The method does no bound checks for target, therefore make sure\n * the provided data chunk does not exceed the size of `target`.\n * Returns the number of written codepoints in `target`.\n */\n public decode(input: Uint8Array, target: Uint32Array): number {\n const length = input.length;\n\n if (!length) {\n return 0;\n }\n\n let size = 0;\n let byte1: number;\n let byte2: number;\n let byte3: number;\n let byte4: number;\n let codepoint = 0;\n let startPos = 0;\n\n // handle leftover bytes\n if (this.interim[0]) {\n let discardInterim = false;\n let cp = this.interim[0];\n cp &= ((((cp & 0xE0) === 0xC0)) ? 0x1F : (((cp & 0xF0) === 0xE0)) ? 0x0F : 0x07);\n let pos = 0;\n let tmp: number;\n while ((tmp = this.interim[++pos] & 0x3F) && pos < 4) {\n cp <<= 6;\n cp |= tmp;\n }\n // missing bytes - read ahead from input\n const type = (((this.interim[0] & 0xE0) === 0xC0)) ? 2 : (((this.interim[0] & 0xF0) === 0xE0)) ? 3 : 4;\n const missing = type - pos;\n while (startPos < missing) {\n if (startPos >= length) {\n return 0;\n }\n tmp = input[startPos++];\n if ((tmp & 0xC0) !== 0x80) {\n // wrong continuation, discard interim bytes completely\n startPos--;\n discardInterim = true;\n break;\n } else {\n // need to save so we can continue short inputs in next call\n this.interim[pos++] = tmp;\n cp <<= 6;\n cp |= tmp & 0x3F;\n }\n }\n if (!discardInterim) {\n // final test is type dependent\n if (type === 2) {\n if (cp < 0x80) {\n // wrong starter byte\n startPos--;\n } else {\n target[size++] = cp;\n }\n } else if (type === 3) {\n if (cp < 0x0800 || (cp >= 0xD800 && cp <= 0xDFFF) || cp === 0xFEFF) {\n // illegal codepoint or BOM\n } else {\n target[size++] = cp;\n }\n } else {\n if (cp < 0x010000 || cp > 0x10FFFF) {\n // illegal codepoint\n } else {\n target[size++] = cp;\n }\n }\n }\n this.interim.fill(0);\n }\n\n // loop through input\n const fourStop = length - 4;\n let i = startPos;\n while (i < length) {\n /**\n * ASCII shortcut with loop unrolled to 4 consecutive ASCII chars.\n * This is a compromise between speed gain for ASCII\n * and penalty for non ASCII:\n * For best ASCII performance the char should be stored directly into target,\n * but even a single attempt to write to target and compare afterwards\n * penalizes non ASCII really bad (-50%), thus we load the char into byteX first,\n * which reduces ASCII performance by ~15%.\n * This trial for ASCII reduces non ASCII performance by ~10% which seems acceptible\n * compared to the gains.\n * Note that this optimization only takes place for 4 consecutive ASCII chars,\n * for any shorter it bails out. Worst case - all 4 bytes being read but\n * thrown away due to the last being a non ASCII char (-10% performance).\n */\n while (i < fourStop\n && !((byte1 = input[i]) & 0x80)\n && !((byte2 = input[i + 1]) & 0x80)\n && !((byte3 = input[i + 2]) & 0x80)\n && !((byte4 = input[i + 3]) & 0x80))\n {\n target[size++] = byte1;\n target[size++] = byte2;\n target[size++] = byte3;\n target[size++] = byte4;\n i += 4;\n }\n\n // reread byte1\n byte1 = input[i++];\n\n // 1 byte\n if (byte1 < 0x80) {\n target[size++] = byte1;\n\n // 2 bytes\n } else if ((byte1 & 0xE0) === 0xC0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x1F) << 6 | (byte2 & 0x3F);\n if (codepoint < 0x80) {\n // wrong starter byte\n i--;\n continue;\n }\n target[size++] = codepoint;\n\n // 3 bytes\n } else if ((byte1 & 0xF0) === 0xE0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x0F) << 12 | (byte2 & 0x3F) << 6 | (byte3 & 0x3F);\n if (codepoint < 0x0800 || (codepoint >= 0xD800 && codepoint <= 0xDFFF) || codepoint === 0xFEFF) {\n // illegal codepoint or BOM, no i-- here\n continue;\n }\n target[size++] = codepoint;\n\n // 4 bytes\n } else if ((byte1 & 0xF8) === 0xF0) {\n if (i >= length) {\n this.interim[0] = byte1;\n return size;\n }\n byte2 = input[i++];\n if ((byte2 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n return size;\n }\n byte3 = input[i++];\n if ((byte3 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n if (i >= length) {\n this.interim[0] = byte1;\n this.interim[1] = byte2;\n this.interim[2] = byte3;\n return size;\n }\n byte4 = input[i++];\n if ((byte4 & 0xC0) !== 0x80) {\n // wrong continuation\n i--;\n continue;\n }\n codepoint = (byte1 & 0x07) << 18 | (byte2 & 0x3F) << 12 | (byte3 & 0x3F) << 6 | (byte4 & 0x3F);\n if (codepoint < 0x010000 || codepoint > 0x10FFFF) {\n // illegal codepoint, no i-- here\n continue;\n }\n target[size++] = codepoint;\n } else {\n // illegal byte, just skip\n }\n }\n return size;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeVersionProvider } from 'common/services/Services';\n\ntype CharWidth = 0 | 1 | 2;\n\nconst BMP_COMBINING = [\n [0x0300, 0x036F], [0x0483, 0x0486], [0x0488, 0x0489],\n [0x0591, 0x05BD], [0x05BF, 0x05BF], [0x05C1, 0x05C2],\n [0x05C4, 0x05C5], [0x05C7, 0x05C7], [0x0600, 0x0603],\n [0x0610, 0x0615], [0x064B, 0x065E], [0x0670, 0x0670],\n [0x06D6, 0x06E4], [0x06E7, 0x06E8], [0x06EA, 0x06ED],\n [0x070F, 0x070F], [0x0711, 0x0711], [0x0730, 0x074A],\n [0x07A6, 0x07B0], [0x07EB, 0x07F3], [0x0901, 0x0902],\n [0x093C, 0x093C], [0x0941, 0x0948], [0x094D, 0x094D],\n [0x0951, 0x0954], [0x0962, 0x0963], [0x0981, 0x0981],\n [0x09BC, 0x09BC], [0x09C1, 0x09C4], [0x09CD, 0x09CD],\n [0x09E2, 0x09E3], [0x0A01, 0x0A02], [0x0A3C, 0x0A3C],\n [0x0A41, 0x0A42], [0x0A47, 0x0A48], [0x0A4B, 0x0A4D],\n [0x0A70, 0x0A71], [0x0A81, 0x0A82], [0x0ABC, 0x0ABC],\n [0x0AC1, 0x0AC5], [0x0AC7, 0x0AC8], [0x0ACD, 0x0ACD],\n [0x0AE2, 0x0AE3], [0x0B01, 0x0B01], [0x0B3C, 0x0B3C],\n [0x0B3F, 0x0B3F], [0x0B41, 0x0B43], [0x0B4D, 0x0B4D],\n [0x0B56, 0x0B56], [0x0B82, 0x0B82], [0x0BC0, 0x0BC0],\n [0x0BCD, 0x0BCD], [0x0C3E, 0x0C40], [0x0C46, 0x0C48],\n [0x0C4A, 0x0C4D], [0x0C55, 0x0C56], [0x0CBC, 0x0CBC],\n [0x0CBF, 0x0CBF], [0x0CC6, 0x0CC6], [0x0CCC, 0x0CCD],\n [0x0CE2, 0x0CE3], [0x0D41, 0x0D43], [0x0D4D, 0x0D4D],\n [0x0DCA, 0x0DCA], [0x0DD2, 0x0DD4], [0x0DD6, 0x0DD6],\n [0x0E31, 0x0E31], [0x0E34, 0x0E3A], [0x0E47, 0x0E4E],\n [0x0EB1, 0x0EB1], [0x0EB4, 0x0EB9], [0x0EBB, 0x0EBC],\n [0x0EC8, 0x0ECD], [0x0F18, 0x0F19], [0x0F35, 0x0F35],\n [0x0F37, 0x0F37], [0x0F39, 0x0F39], [0x0F71, 0x0F7E],\n [0x0F80, 0x0F84], [0x0F86, 0x0F87], [0x0F90, 0x0F97],\n [0x0F99, 0x0FBC], [0x0FC6, 0x0FC6], [0x102D, 0x1030],\n [0x1032, 0x1032], [0x1036, 0x1037], [0x1039, 0x1039],\n [0x1058, 0x1059], [0x1160, 0x11FF], [0x135F, 0x135F],\n [0x1712, 0x1714], [0x1732, 0x1734], [0x1752, 0x1753],\n [0x1772, 0x1773], [0x17B4, 0x17B5], [0x17B7, 0x17BD],\n [0x17C6, 0x17C6], [0x17C9, 0x17D3], [0x17DD, 0x17DD],\n [0x180B, 0x180D], [0x18A9, 0x18A9], [0x1920, 0x1922],\n [0x1927, 0x1928], [0x1932, 0x1932], [0x1939, 0x193B],\n [0x1A17, 0x1A18], [0x1B00, 0x1B03], [0x1B34, 0x1B34],\n [0x1B36, 0x1B3A], [0x1B3C, 0x1B3C], [0x1B42, 0x1B42],\n [0x1B6B, 0x1B73], [0x1DC0, 0x1DCA], [0x1DFE, 0x1DFF],\n [0x200B, 0x200F], [0x202A, 0x202E], [0x2060, 0x2063],\n [0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F],\n [0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B],\n [0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F],\n [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB]\n];\nconst HIGH_COMBINING = [\n [0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F],\n [0x10A38, 0x10A3A], [0x10A3F, 0x10A3F], [0x1D167, 0x1D169],\n [0x1D173, 0x1D182], [0x1D185, 0x1D18B], [0x1D1AA, 0x1D1AD],\n [0x1D242, 0x1D244], [0xE0001, 0xE0001], [0xE0020, 0xE007F],\n [0xE0100, 0xE01EF]\n];\n\n// BMP lookup table, lazy initialized during first addon loading\nlet table: Uint8Array;\n\nfunction bisearch(ucs: number, data: number[][]): boolean {\n let min = 0;\n let max = data.length - 1;\n let mid;\n if (ucs < data[0][0] || ucs > data[max][1]) {\n return false;\n }\n while (max >= min) {\n mid = (min + max) >> 1;\n if (ucs > data[mid][1]) {\n min = mid + 1;\n } else if (ucs < data[mid][0]) {\n max = mid - 1;\n } else {\n return true;\n }\n }\n return false;\n}\n\nexport class UnicodeV6 implements IUnicodeVersionProvider {\n public readonly version = '6';\n\n constructor() {\n // init lookup table once\n if (!table) {\n table = new Uint8Array(65536);\n table.fill(1);\n table[0] = 0;\n // control chars\n table.fill(0, 1, 32);\n table.fill(0, 0x7f, 0xa0);\n\n // apply wide char rules first\n // wide chars\n table.fill(2, 0x1100, 0x1160);\n table[0x2329] = 2;\n table[0x232a] = 2;\n table.fill(2, 0x2e80, 0xa4d0);\n table[0x303f] = 1; // wrongly in last line\n\n table.fill(2, 0xac00, 0xd7a4);\n table.fill(2, 0xf900, 0xfb00);\n table.fill(2, 0xfe10, 0xfe1a);\n table.fill(2, 0xfe30, 0xfe70);\n table.fill(2, 0xff00, 0xff61);\n table.fill(2, 0xffe0, 0xffe7);\n\n // apply combining last to ensure we overwrite\n // wrongly wide set chars:\n // the original algo evals combining first and falls\n // through to wide check so we simply do here the opposite\n // combining 0\n for (let r = 0; r < BMP_COMBINING.length; ++r) {\n table.fill(0, BMP_COMBINING[r][0], BMP_COMBINING[r][1] + 1);\n }\n }\n }\n\n public wcwidth(num: number): CharWidth {\n if (num < 32) return 0;\n if (num < 127) return 1;\n if (num < 65536) return table[num] as CharWidth;\n if (bisearch(num, HIGH_COMBINING)) return 0;\n if ((num >= 0x20000 && num <= 0x2fffd) || (num >= 0x30000 && num <= 0x3fffd)) return 2;\n return 1;\n }\n}\n","\n/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\n\ndeclare const setTimeout: (handler: () => void, timeout?: number) => void;\n\n/**\n * Safety watermark to avoid memory exhaustion and browser engine crash on fast data input.\n * Enable flow control to avoid this limit and make sure that your backend correctly\n * propagates this to the underlying pty. (see docs for further instructions)\n * Since this limit is meant as a safety parachute to prevent browser crashs,\n * it is set to a very high number. Typically xterm.js gets unresponsive with\n * a 100 times lower number (>500 kB).\n */\nconst DISCARD_WATERMARK = 50000000; // ~50 MB\n\n/**\n * The max number of ms to spend on writes before allowing the renderer to\n * catch up with a 0ms setTimeout. A value of < 33 to keep us close to\n * 30fps, and a value of < 16 to try to run at 60fps. Of course, the real FPS\n * depends on the time it takes for the renderer to draw the frame.\n */\nconst WRITE_TIMEOUT_MS = 12;\n\n/**\n * Threshold of max held chunks in the write buffer, that were already processed.\n * This is a tradeoff between extensive write buffer shifts (bad runtime) and high\n * memory consumption by data thats not used anymore.\n */\nconst WRITE_BUFFER_LENGTH_THRESHOLD = 50;\n\nexport class WriteBuffer extends Disposable {\n private _writeBuffer: (string | Uint8Array)[] = [];\n private _callbacks: ((() => void) | undefined)[] = [];\n private _pendingData = 0;\n private _bufferOffset = 0;\n private _isSyncWriting = false;\n private _syncCalls = 0;\n private _didUserInput = false;\n\n private readonly _onWriteParsed = this.register(new EventEmitter<void>());\n public readonly onWriteParsed = this._onWriteParsed.event;\n\n constructor(private _action: (data: string | Uint8Array, promiseResult?: boolean) => void | Promise<boolean>) {\n super();\n }\n\n public handleUserInput(): void {\n this._didUserInput = true;\n }\n\n /**\n * @deprecated Unreliable, to be removed soon.\n */\n public writeSync(data: string | Uint8Array, maxSubsequentCalls?: number): void {\n // stop writeSync recursions with maxSubsequentCalls argument\n // This is dangerous to use as it will lose the current data chunk\n // and return immediately.\n if (maxSubsequentCalls !== undefined && this._syncCalls > maxSubsequentCalls) {\n // comment next line if a whole loop block should only contain x `writeSync` calls\n // (total flat vs. deep nested limit)\n this._syncCalls = 0;\n return;\n }\n // append chunk to buffer\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(undefined);\n\n // increase recursion counter\n this._syncCalls++;\n // exit early if another writeSync loop is active\n if (this._isSyncWriting) {\n return;\n }\n this._isSyncWriting = true;\n\n // force sync processing on pending data chunks to avoid in-band data scrambling\n // does the same as innerWrite but without event loop\n // we have to do it here as single loop steps to not corrupt loop subject\n // by another writeSync call triggered from _action\n let chunk: string | Uint8Array | undefined;\n while (chunk = this._writeBuffer.shift()) {\n this._action(chunk);\n const cb = this._callbacks.shift();\n if (cb) cb();\n }\n // reset to avoid reprocessing of chunks with scheduled innerWrite call\n // stopping scheduled innerWrite by offset > length condition\n this._pendingData = 0;\n this._bufferOffset = 0x7FFFFFFF;\n\n // allow another writeSync to loop\n this._isSyncWriting = false;\n this._syncCalls = 0;\n }\n\n public write(data: string | Uint8Array, callback?: () => void): void {\n if (this._pendingData > DISCARD_WATERMARK) {\n throw new Error('write data discarded, use flow control to avoid losing data');\n }\n\n // schedule chunk processing for next event loop run\n if (!this._writeBuffer.length) {\n this._bufferOffset = 0;\n\n // If this is the first write call after the user has done some input,\n // parse it immediately to minimize input latency,\n // otherwise schedule for the next event\n if (this._didUserInput) {\n this._didUserInput = false;\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(callback);\n this._innerWrite();\n return;\n }\n\n setTimeout(() => this._innerWrite());\n }\n\n this._pendingData += data.length;\n this._writeBuffer.push(data);\n this._callbacks.push(callback);\n }\n\n /**\n * Inner write call, that enters the sliced chunk processing by timing.\n *\n * `lastTime` indicates, when the last _innerWrite call had started.\n * It is used to aggregate async handler execution under a timeout constraint\n * effectively lowering the redrawing needs, schematically:\n *\n * macroTask _innerWrite:\n * if (Date.now() - (lastTime | 0) < WRITE_TIMEOUT_MS):\n * schedule microTask _innerWrite(lastTime)\n * else:\n * schedule macroTask _innerWrite(0)\n *\n * overall execution order on task queues:\n *\n * macrotasks: [...] --> _innerWrite(0) --> [...] --> screenUpdate --> [...]\n * m t: |\n * i a: [...]\n * c s: |\n * r k: while < timeout:\n * o s: _innerWrite(timeout)\n *\n * `promiseResult` depicts the promise resolve value of an async handler.\n * This value gets carried forward through all saved stack states of the\n * paused parser for proper continuation.\n *\n * Note, for pure sync code `lastTime` and `promiseResult` have no meaning.\n */\n protected _innerWrite(lastTime: number = 0, promiseResult: boolean = true): void {\n const startTime = lastTime || Date.now();\n while (this._writeBuffer.length > this._bufferOffset) {\n const data = this._writeBuffer[this._bufferOffset];\n const result = this._action(data, promiseResult);\n if (result) {\n /**\n * If we get a promise as return value, we re-schedule the continuation\n * as thenable on the promise and exit right away.\n *\n * The exit here means, that we block input processing at the current active chunk,\n * the exact execution position within the chunk is preserved by the saved\n * stack content in InputHandler and EscapeSequenceParser.\n *\n * Resuming happens automatically from that saved stack state.\n * Also the resolved promise value is passed along the callstack to\n * `EscapeSequenceParser.parse` to correctly resume the stopped handler loop.\n *\n * Exceptions on async handlers will be logged to console async, but do not interrupt\n * the input processing (continues with next handler at the current input position).\n */\n\n /**\n * If a promise takes long to resolve, we should schedule continuation behind setTimeout.\n * This might already be too late, if our .then enters really late (executor + prev thens took very long).\n * This cannot be solved here for the handler itself (it is the handlers responsibility to slice hard work),\n * but we can at least schedule a screen update as we gain control.\n */\n const continuation: (r: boolean) => void = (r: boolean) => Date.now() - startTime >= WRITE_TIMEOUT_MS\n ? setTimeout(() => this._innerWrite(0, r))\n : this._innerWrite(startTime, r);\n\n /**\n * Optimization considerations:\n * The continuation above favors FPS over throughput by eval'ing `startTime` on resolve.\n * This might schedule too many screen updates with bad throughput drops (in case a slow\n * resolving handler sliced its work properly behind setTimeout calls). We cannot spot\n * this condition here, also the renderer has no way to spot nonsense updates either.\n * FIXME: A proper fix for this would track the FPS at the renderer entry level separately.\n *\n * If favoring of FPS shows bad throughtput impact, use the following instead. It favors\n * throughput by eval'ing `startTime` upfront pulling at least one more chunk into the\n * current microtask queue (executed before setTimeout).\n */\n // const continuation: (r: boolean) => void = Date.now() - startTime >= WRITE_TIMEOUT_MS\n // ? r => setTimeout(() => this._innerWrite(0, r))\n // : r => this._innerWrite(startTime, r);\n\n // Handle exceptions synchronously to current band position, idea:\n // 1. spawn a single microtask which we allow to throw hard\n // 2. spawn a promise immediately resolving to `true`\n // (executed on the same queue, thus properly aligned before continuation happens)\n result.catch(err => {\n queueMicrotask(() => {throw err;});\n return Promise.resolve(false);\n }).then(continuation);\n return;\n }\n\n const cb = this._callbacks[this._bufferOffset];\n if (cb) cb();\n this._bufferOffset++;\n this._pendingData -= data.length;\n\n if (Date.now() - startTime >= WRITE_TIMEOUT_MS) {\n break;\n }\n }\n if (this._writeBuffer.length > this._bufferOffset) {\n // Allow renderer to catch up before processing the next batch\n // trim already processed chunks if we are above threshold\n if (this._bufferOffset > WRITE_BUFFER_LENGTH_THRESHOLD) {\n this._writeBuffer = this._writeBuffer.slice(this._bufferOffset);\n this._callbacks = this._callbacks.slice(this._bufferOffset);\n this._bufferOffset = 0;\n }\n setTimeout(() => this._innerWrite());\n } else {\n this._writeBuffer.length = 0;\n this._callbacks.length = 0;\n this._pendingData = 0;\n this._bufferOffset = 0;\n }\n this._onWriteParsed.fire();\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n\n// 'rgb:' rule - matching: r/g/b | rr/gg/bb | rrr/ggg/bbb | rrrr/gggg/bbbb (hex digits)\nconst RGB_REX = /^([\\da-f])\\/([\\da-f])\\/([\\da-f])$|^([\\da-f]{2})\\/([\\da-f]{2})\\/([\\da-f]{2})$|^([\\da-f]{3})\\/([\\da-f]{3})\\/([\\da-f]{3})$|^([\\da-f]{4})\\/([\\da-f]{4})\\/([\\da-f]{4})$/;\n// '#...' rule - matching any hex digits\nconst HASH_REX = /^[\\da-f]+$/;\n\n/**\n * Parse color spec to RGB values (8 bit per channel).\n * See `man xparsecolor` for details about certain format specifications.\n *\n * Supported formats:\n * - rgb:<red>/<green>/<blue> with <red>, <green>, <blue> in h | hh | hhh | hhhh\n * - #RGB, #RRGGBB, #RRRGGGBBB, #RRRRGGGGBBBB\n *\n * All other formats like rgbi: or device-independent string specifications\n * with float numbering are not supported.\n */\nexport function parseColor(data: string): [number, number, number] | undefined {\n if (!data) return;\n // also handle uppercases\n let low = data.toLowerCase();\n if (low.indexOf('rgb:') === 0) {\n // 'rgb:' specifier\n low = low.slice(4);\n const m = RGB_REX.exec(low);\n if (m) {\n const base = m[1] ? 15 : m[4] ? 255 : m[7] ? 4095 : 65535;\n return [\n Math.round(parseInt(m[1] || m[4] || m[7] || m[10], 16) / base * 255),\n Math.round(parseInt(m[2] || m[5] || m[8] || m[11], 16) / base * 255),\n Math.round(parseInt(m[3] || m[6] || m[9] || m[12], 16) / base * 255)\n ];\n }\n } else if (low.indexOf('#') === 0) {\n // '#' specifier\n low = low.slice(1);\n if (HASH_REX.exec(low) && [3, 6, 9, 12].includes(low.length)) {\n const adv = low.length / 3;\n const result: [number, number, number] = [0, 0, 0];\n for (let i = 0; i < 3; ++i) {\n const c = parseInt(low.slice(adv * i, adv * i + adv), 16);\n result[i] = adv === 1 ? c << 4 : adv === 2 ? c : adv === 3 ? c >> 4 : c >> 8;\n }\n return result;\n }\n }\n\n // Named colors are currently not supported due to the large addition to the xterm.js bundle size\n // they would add. In order to support named colors, we would need some way of optionally loading\n // additional payloads so startup/download time is not bloated (see #3530).\n}\n\n// pad hex output to requested bit width\nfunction pad(n: number, bits: number): string {\n const s = n.toString(16);\n const s2 = s.length < 2 ? '0' + s : s;\n switch (bits) {\n case 4:\n return s[0];\n case 8:\n return s2;\n case 12:\n return (s2 + s2).slice(0, 3);\n default:\n return s2 + s2;\n }\n}\n\n/**\n * Convert a given color to rgb:../../.. string of `bits` depth.\n */\nexport function toRgbString(color: [number, number, number], bits: number = 16): string {\n const [r, g, b] = color;\n return `rgb:${pad(r, bits)}/${pad(g, bits)}/${pad(b, bits)}`;\n}\n","/**\n * Copyright (c) 2017 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\n/**\n * Internal states of EscapeSequenceParser.\n */\nexport const enum ParserState {\n GROUND = 0,\n ESCAPE = 1,\n ESCAPE_INTERMEDIATE = 2,\n CSI_ENTRY = 3,\n CSI_PARAM = 4,\n CSI_INTERMEDIATE = 5,\n CSI_IGNORE = 6,\n SOS_PM_APC_STRING = 7,\n OSC_STRING = 8,\n DCS_ENTRY = 9,\n DCS_PARAM = 10,\n DCS_IGNORE = 11,\n DCS_INTERMEDIATE = 12,\n DCS_PASSTHROUGH = 13\n}\n\n/**\n * Internal actions of EscapeSequenceParser.\n */\nexport const enum ParserAction {\n IGNORE = 0,\n ERROR = 1,\n PRINT = 2,\n EXECUTE = 3,\n OSC_START = 4,\n OSC_PUT = 5,\n OSC_END = 6,\n CSI_DISPATCH = 7,\n PARAM = 8,\n COLLECT = 9,\n ESC_DISPATCH = 10,\n CLEAR = 11,\n DCS_HOOK = 12,\n DCS_PUT = 13,\n DCS_UNHOOK = 14\n}\n\n/**\n * Internal states of OscParser.\n */\nexport const enum OscState {\n START = 0,\n ID = 1,\n PAYLOAD = 2,\n ABORT = 3\n}\n\n// payload limit for OSC and DCS\nexport const PAYLOAD_LIMIT = 10000000;\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IDisposable } from 'common/Types';\nimport { IDcsHandler, IParams, IHandlerCollection, IDcsParser, DcsFallbackHandlerType, ISubParserStackState } from 'common/parser/Types';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { Params } from 'common/parser/Params';\nimport { PAYLOAD_LIMIT } from 'common/parser/Constants';\n\nconst EMPTY_HANDLERS: IDcsHandler[] = [];\n\nexport class DcsParser implements IDcsParser {\n private _handlers: IHandlerCollection<IDcsHandler> = Object.create(null);\n private _active: IDcsHandler[] = EMPTY_HANDLERS;\n private _ident: number = 0;\n private _handlerFb: DcsFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public registerHandler(ident: number, handler: IDcsHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n\n public setHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public reset(): void {\n // force cleanup leftover handlers\n if (this._active.length) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].unhook(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n\n public hook(ident: number, params: IParams): void {\n // always reset leftover handlers\n this.reset();\n this._ident = ident;\n this._active = this._handlers[ident] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._ident, 'HOOK', params);\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].hook(params);\n }\n }\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public unhook(success: boolean, promiseResult: boolean = true): void | Promise<boolean> {\n if (!this._active.length) {\n this._handlerFb(this._ident, 'UNHOOK', success);\n } else {\n let handlerResult: boolean | Promise<boolean> = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers (fallThrough for async)\n for (; j >= 0; j--) {\n handlerResult = this._active[j].unhook(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n this._active = EMPTY_HANDLERS;\n this._ident = 0;\n }\n}\n\n// predefine empty params as [0] (ZDM)\nconst EMPTY_PARAMS = new Params();\nEMPTY_PARAMS.addParam(0);\n\n/**\n * Convenient class to create a DCS handler from a single callback function.\n * Note: The payload is currently limited to 50 MB (hardcoded).\n */\nexport class DcsHandler implements IDcsHandler {\n private _data = '';\n private _params: IParams = EMPTY_PARAMS;\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string, params: IParams) => boolean | Promise<boolean>) { }\n\n public hook(params: IParams): void {\n // since we need to preserve params until `unhook`, we have to clone it\n // (only borrowed from parser and spans multiple parser states)\n // perf optimization:\n // clone only, if we have non empty params, otherwise stick with default\n this._params = (params.length > 1 || params.params[0]) ? params.clone() : EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public unhook(success: boolean): boolean | Promise<boolean> {\n let ret: boolean | Promise<boolean> = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data, this._params);\n if (ret instanceof Promise) {\n // need to hold data and params until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._params = EMPTY_PARAMS;\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParsingState, IDcsHandler, IEscapeSequenceParser, IParams, IOscHandler, IHandlerCollection, CsiHandlerType, OscFallbackHandlerType, IOscParser, EscHandlerType, IDcsParser, DcsFallbackHandlerType, IFunctionIdentifier, ExecuteFallbackHandlerType, CsiFallbackHandlerType, EscFallbackHandlerType, PrintHandlerType, PrintFallbackHandlerType, ExecuteHandlerType, IParserStackState, ParserStackType, ResumableHandlersType } from 'common/parser/Types';\nimport { ParserState, ParserAction } from 'common/parser/Constants';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IDisposable } from 'common/Types';\nimport { Params } from 'common/parser/Params';\nimport { OscParser } from 'common/parser/OscParser';\nimport { DcsParser } from 'common/parser/DcsParser';\n\n/**\n * Table values are generated like this:\n * index: currentState << TableValue.INDEX_STATE_SHIFT | charCode\n * value: action << TableValue.TRANSITION_ACTION_SHIFT | nextState\n */\nconst enum TableAccess {\n TRANSITION_ACTION_SHIFT = 4,\n TRANSITION_STATE_MASK = 15,\n INDEX_STATE_SHIFT = 8\n}\n\n/**\n * Transition table for EscapeSequenceParser.\n */\nexport class TransitionTable {\n public table: Uint8Array;\n\n constructor(length: number) {\n this.table = new Uint8Array(length);\n }\n\n /**\n * Set default transition.\n * @param action default action\n * @param next default next state\n */\n public setDefault(action: ParserAction, next: ParserState): void {\n this.table.fill(action << TableAccess.TRANSITION_ACTION_SHIFT | next);\n }\n\n /**\n * Add a transition to the transition table.\n * @param code input character code\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public add(code: number, state: ParserState, action: ParserAction, next: ParserState): void {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | code] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n\n /**\n * Add transitions for multiple input character codes.\n * @param codes input character code array\n * @param state current parser state\n * @param action parser action to be done\n * @param next next parser state\n */\n public addMany(codes: number[], state: ParserState, action: ParserAction, next: ParserState): void {\n for (let i = 0; i < codes.length; i++) {\n this.table[state << TableAccess.INDEX_STATE_SHIFT | codes[i]] = action << TableAccess.TRANSITION_ACTION_SHIFT | next;\n }\n }\n}\n\n\n// Pseudo-character placeholder for printable non-ascii characters (unicode).\nconst NON_ASCII_PRINTABLE = 0xA0;\n\n\n/**\n * VT500 compatible transition table.\n * Taken from https://vt100.net/emu/dec_ansi_parser.\n */\nexport const VT500_TRANSITION_TABLE = (function (): TransitionTable {\n const table: TransitionTable = new TransitionTable(4095);\n\n // range macro for byte\n const BYTE_VALUES = 256;\n const blueprint = Array.apply(null, Array(BYTE_VALUES)).map((unused: any, i: number) => i);\n const r = (start: number, end: number): number[] => blueprint.slice(start, end);\n\n // Default definitions.\n const PRINTABLES = r(0x20, 0x7f); // 0x20 (SP) included, 0x7F (DEL) excluded\n const EXECUTABLES = r(0x00, 0x18);\n EXECUTABLES.push(0x19);\n EXECUTABLES.push.apply(EXECUTABLES, r(0x1c, 0x20));\n\n const states: number[] = r(ParserState.GROUND, ParserState.DCS_PASSTHROUGH + 1);\n let state: any;\n\n // set default transition\n table.setDefault(ParserAction.ERROR, ParserState.GROUND);\n // printables\n table.addMany(PRINTABLES, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n // global anywhere rules\n for (state in states) {\n table.addMany([0x18, 0x1a, 0x99, 0x9a], state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x80, 0x90), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(r(0x90, 0x98), state, ParserAction.EXECUTE, ParserState.GROUND);\n table.add(0x9c, state, ParserAction.IGNORE, ParserState.GROUND); // ST as terminator\n table.add(0x1b, state, ParserAction.CLEAR, ParserState.ESCAPE); // ESC\n table.add(0x9d, state, ParserAction.OSC_START, ParserState.OSC_STRING); // OSC\n table.addMany([0x98, 0x9e, 0x9f], state, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9b, state, ParserAction.CLEAR, ParserState.CSI_ENTRY); // CSI\n table.add(0x90, state, ParserAction.CLEAR, ParserState.DCS_ENTRY); // DCS\n }\n // rules for executables and 7f\n table.addMany(EXECUTABLES, ParserState.GROUND, ParserAction.EXECUTE, ParserState.GROUND);\n table.addMany(EXECUTABLES, ParserState.ESCAPE, ParserAction.EXECUTE, ParserState.ESCAPE);\n table.add(0x7f, ParserState.ESCAPE, ParserAction.IGNORE, ParserState.ESCAPE);\n table.addMany(EXECUTABLES, ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n table.addMany(EXECUTABLES, ParserState.CSI_ENTRY, ParserAction.EXECUTE, ParserState.CSI_ENTRY);\n table.add(0x7f, ParserState.CSI_ENTRY, ParserAction.IGNORE, ParserState.CSI_ENTRY);\n table.addMany(EXECUTABLES, ParserState.CSI_PARAM, ParserAction.EXECUTE, ParserState.CSI_PARAM);\n table.add(0x7f, ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_PARAM);\n table.addMany(EXECUTABLES, ParserState.CSI_IGNORE, ParserAction.EXECUTE, ParserState.CSI_IGNORE);\n table.addMany(EXECUTABLES, ParserState.CSI_INTERMEDIATE, ParserAction.EXECUTE, ParserState.CSI_INTERMEDIATE);\n table.add(0x7f, ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.ESCAPE_INTERMEDIATE, ParserAction.EXECUTE, ParserState.ESCAPE_INTERMEDIATE);\n table.add(0x7f, ParserState.ESCAPE_INTERMEDIATE, ParserAction.IGNORE, ParserState.ESCAPE_INTERMEDIATE);\n // osc\n table.add(0x5d, ParserState.ESCAPE, ParserAction.OSC_START, ParserState.OSC_STRING);\n table.addMany(PRINTABLES, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(0x7f, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.addMany([0x9c, 0x1b, 0x18, 0x1a, 0x07], ParserState.OSC_STRING, ParserAction.OSC_END, ParserState.GROUND);\n table.addMany(r(0x1c, 0x20), ParserState.OSC_STRING, ParserAction.IGNORE, ParserState.OSC_STRING);\n // sos/pm/apc does nothing\n table.addMany([0x58, 0x5e, 0x5f], ParserState.ESCAPE, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(PRINTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.addMany(EXECUTABLES, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n table.add(0x9c, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.GROUND);\n table.add(0x7f, ParserState.SOS_PM_APC_STRING, ParserAction.IGNORE, ParserState.SOS_PM_APC_STRING);\n // csi entries\n table.add(0x5b, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.CSI_ENTRY);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_ENTRY, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_ENTRY, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.CSI_PARAM, ParserAction.PARAM, ParserState.CSI_PARAM);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_PARAM, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.CSI_PARAM, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x20, 0x40), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(0x7f, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_ENTRY, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.CSI_INTERMEDIATE, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.CSI_INTERMEDIATE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.CSI_INTERMEDIATE, ParserAction.CSI_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x20, 0x30), ParserState.CSI_PARAM, ParserAction.COLLECT, ParserState.CSI_INTERMEDIATE);\n // esc_intermediate\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.ESCAPE_INTERMEDIATE, ParserAction.COLLECT, ParserState.ESCAPE_INTERMEDIATE);\n table.addMany(r(0x30, 0x7f), ParserState.ESCAPE_INTERMEDIATE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x30, 0x50), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x51, 0x58), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany([0x59, 0x5a, 0x5c], ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n table.addMany(r(0x60, 0x7f), ParserState.ESCAPE, ParserAction.ESC_DISPATCH, ParserState.GROUND);\n // dcs entry\n table.add(0x50, ParserState.ESCAPE, ParserAction.CLEAR, ParserState.DCS_ENTRY);\n table.addMany(EXECUTABLES, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.add(0x7f, ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_ENTRY, ParserAction.IGNORE, ParserState.DCS_ENTRY);\n table.addMany(r(0x20, 0x30), ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_ENTRY, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_ENTRY, ParserAction.COLLECT, ParserState.DCS_PARAM);\n table.addMany(EXECUTABLES, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x80), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(EXECUTABLES, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.add(0x7f, ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_PARAM);\n table.addMany(r(0x30, 0x3c), ParserState.DCS_PARAM, ParserAction.PARAM, ParserState.DCS_PARAM);\n table.addMany([0x3c, 0x3d, 0x3e, 0x3f], ParserState.DCS_PARAM, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_PARAM, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(EXECUTABLES, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.add(0x7f, ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x1c, 0x20), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x20, 0x30), ParserState.DCS_INTERMEDIATE, ParserAction.COLLECT, ParserState.DCS_INTERMEDIATE);\n table.addMany(r(0x30, 0x40), ParserState.DCS_INTERMEDIATE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_INTERMEDIATE, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_PARAM, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(r(0x40, 0x7f), ParserState.DCS_ENTRY, ParserAction.DCS_HOOK, ParserState.DCS_PASSTHROUGH);\n table.addMany(EXECUTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.addMany(PRINTABLES, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n table.add(0x7f, ParserState.DCS_PASSTHROUGH, ParserAction.IGNORE, ParserState.DCS_PASSTHROUGH);\n table.addMany([0x1b, 0x9c, 0x18, 0x1a], ParserState.DCS_PASSTHROUGH, ParserAction.DCS_UNHOOK, ParserState.GROUND);\n // special handling of unicode chars\n table.add(NON_ASCII_PRINTABLE, ParserState.GROUND, ParserAction.PRINT, ParserState.GROUND);\n table.add(NON_ASCII_PRINTABLE, ParserState.OSC_STRING, ParserAction.OSC_PUT, ParserState.OSC_STRING);\n table.add(NON_ASCII_PRINTABLE, ParserState.CSI_IGNORE, ParserAction.IGNORE, ParserState.CSI_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_IGNORE, ParserAction.IGNORE, ParserState.DCS_IGNORE);\n table.add(NON_ASCII_PRINTABLE, ParserState.DCS_PASSTHROUGH, ParserAction.DCS_PUT, ParserState.DCS_PASSTHROUGH);\n return table;\n})();\n\n\n/**\n * EscapeSequenceParser.\n * This class implements the ANSI/DEC compatible parser described by\n * Paul Williams (https://vt100.net/emu/dec_ansi_parser).\n *\n * To implement custom ANSI compliant escape sequences it is not needed to\n * alter this parser, instead consider registering a custom handler.\n * For non ANSI compliant sequences change the transition table with\n * the optional `transitions` constructor argument and\n * reimplement the `parse` method.\n *\n * This parser is currently hardcoded to operate in ZDM (Zero Default Mode)\n * as suggested by the original parser, thus empty parameters are set to 0.\n * This this is not in line with the latest ECMA-48 specification\n * (ZDM was part of the early specs and got completely removed later on).\n *\n * Other than the original parser from vt100.net this parser supports\n * sub parameters in digital parameters separated by colons. Empty sub parameters\n * are set to -1 (no ZDM for sub parameters).\n *\n * About prefix and intermediate bytes:\n * This parser follows the assumptions of the vt100.net parser with these restrictions:\n * - only one prefix byte is allowed as first parameter byte, byte range 0x3c .. 0x3f\n * - max. two intermediates are respected, byte range 0x20 .. 0x2f\n * Note that this is not in line with ECMA-48 which does not limit either of those.\n * Furthermore ECMA-48 allows the prefix byte range at any param byte position. Currently\n * there are no known sequences that follow the broader definition of the specification.\n *\n * TODO: implement error recovery hook via error handler return values\n */\nexport class EscapeSequenceParser extends Disposable implements IEscapeSequenceParser {\n public initialState: number;\n public currentState: number;\n public precedingCodepoint: number;\n\n // buffers over several parse calls\n protected _params: Params;\n protected _collect: number;\n\n // handler lookup containers\n protected _printHandler: PrintHandlerType;\n protected _executeHandlers: { [flag: number]: ExecuteHandlerType };\n protected _csiHandlers: IHandlerCollection<CsiHandlerType>;\n protected _escHandlers: IHandlerCollection<EscHandlerType>;\n protected readonly _oscParser: IOscParser;\n protected readonly _dcsParser: IDcsParser;\n protected _errorHandler: (state: IParsingState) => IParsingState;\n\n // fallback handlers\n protected _printHandlerFb: PrintFallbackHandlerType;\n protected _executeHandlerFb: ExecuteFallbackHandlerType;\n protected _csiHandlerFb: CsiFallbackHandlerType;\n protected _escHandlerFb: EscFallbackHandlerType;\n protected _errorHandlerFb: (state: IParsingState) => IParsingState;\n\n // parser stack save for async handler support\n protected _parseStack: IParserStackState = {\n state: ParserStackType.NONE,\n handlers: [],\n handlerPos: 0,\n transition: 0,\n chunkPos: 0\n };\n\n constructor(\n protected readonly _transitions: TransitionTable = VT500_TRANSITION_TABLE\n ) {\n super();\n\n this.initialState = ParserState.GROUND;\n this.currentState = this.initialState;\n this._params = new Params(); // defaults to 32 storable params/subparams\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n\n // set default fallback handlers and handler lookup containers\n this._printHandlerFb = (data, start, end): void => { };\n this._executeHandlerFb = (code: number): void => { };\n this._csiHandlerFb = (ident: number, params: IParams): void => { };\n this._escHandlerFb = (ident: number): void => { };\n this._errorHandlerFb = (state: IParsingState): IParsingState => state;\n this._printHandler = this._printHandlerFb;\n this._executeHandlers = Object.create(null);\n this._csiHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n this.register(toDisposable(() => {\n this._csiHandlers = Object.create(null);\n this._executeHandlers = Object.create(null);\n this._escHandlers = Object.create(null);\n }));\n this._oscParser = this.register(new OscParser());\n this._dcsParser = this.register(new DcsParser());\n this._errorHandler = this._errorHandlerFb;\n\n // swallow 7bit ST (ESC+\\)\n this.registerEscHandler({ final: '\\\\' }, () => true);\n }\n\n protected _identifier(id: IFunctionIdentifier, finalRange: number[] = [0x40, 0x7e]): number {\n let res = 0;\n if (id.prefix) {\n if (id.prefix.length > 1) {\n throw new Error('only one byte as prefix supported');\n }\n res = id.prefix.charCodeAt(0);\n if (res && 0x3c > res || res > 0x3f) {\n throw new Error('prefix must be in range 0x3c .. 0x3f');\n }\n }\n if (id.intermediates) {\n if (id.intermediates.length > 2) {\n throw new Error('only two bytes as intermediates are supported');\n }\n for (let i = 0; i < id.intermediates.length; ++i) {\n const intermediate = id.intermediates.charCodeAt(i);\n if (0x20 > intermediate || intermediate > 0x2f) {\n throw new Error('intermediate must be in range 0x20 .. 0x2f');\n }\n res <<= 8;\n res |= intermediate;\n }\n }\n if (id.final.length !== 1) {\n throw new Error('final must be a single byte');\n }\n const finalCode = id.final.charCodeAt(0);\n if (finalRange[0] > finalCode || finalCode > finalRange[1]) {\n throw new Error(`final must be in range ${finalRange[0]} .. ${finalRange[1]}`);\n }\n res <<= 8;\n res |= finalCode;\n\n return res;\n }\n\n public identToString(ident: number): string {\n const res: string[] = [];\n while (ident) {\n res.push(String.fromCharCode(ident & 0xFF));\n ident >>= 8;\n }\n return res.reverse().join('');\n }\n\n public setPrintHandler(handler: PrintHandlerType): void {\n this._printHandler = handler;\n }\n public clearPrintHandler(): void {\n this._printHandler = this._printHandlerFb;\n }\n\n public registerEscHandler(id: IFunctionIdentifier, handler: EscHandlerType): IDisposable {\n const ident = this._identifier(id, [0x30, 0x7e]);\n if (this._escHandlers[ident] === undefined) {\n this._escHandlers[ident] = [];\n }\n const handlerList = this._escHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearEscHandler(id: IFunctionIdentifier): void {\n if (this._escHandlers[this._identifier(id, [0x30, 0x7e])]) delete this._escHandlers[this._identifier(id, [0x30, 0x7e])];\n }\n public setEscHandlerFallback(handler: EscFallbackHandlerType): void {\n this._escHandlerFb = handler;\n }\n\n public setExecuteHandler(flag: string, handler: ExecuteHandlerType): void {\n this._executeHandlers[flag.charCodeAt(0)] = handler;\n }\n public clearExecuteHandler(flag: string): void {\n if (this._executeHandlers[flag.charCodeAt(0)]) delete this._executeHandlers[flag.charCodeAt(0)];\n }\n public setExecuteHandlerFallback(handler: ExecuteFallbackHandlerType): void {\n this._executeHandlerFb = handler;\n }\n\n public registerCsiHandler(id: IFunctionIdentifier, handler: CsiHandlerType): IDisposable {\n const ident = this._identifier(id);\n if (this._csiHandlers[ident] === undefined) {\n this._csiHandlers[ident] = [];\n }\n const handlerList = this._csiHandlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearCsiHandler(id: IFunctionIdentifier): void {\n if (this._csiHandlers[this._identifier(id)]) delete this._csiHandlers[this._identifier(id)];\n }\n public setCsiHandlerFallback(callback: (ident: number, params: IParams) => void): void {\n this._csiHandlerFb = callback;\n }\n\n public registerDcsHandler(id: IFunctionIdentifier, handler: IDcsHandler): IDisposable {\n return this._dcsParser.registerHandler(this._identifier(id), handler);\n }\n public clearDcsHandler(id: IFunctionIdentifier): void {\n this._dcsParser.clearHandler(this._identifier(id));\n }\n public setDcsHandlerFallback(handler: DcsFallbackHandlerType): void {\n this._dcsParser.setHandlerFallback(handler);\n }\n\n public registerOscHandler(ident: number, handler: IOscHandler): IDisposable {\n return this._oscParser.registerHandler(ident, handler);\n }\n public clearOscHandler(ident: number): void {\n this._oscParser.clearHandler(ident);\n }\n public setOscHandlerFallback(handler: OscFallbackHandlerType): void {\n this._oscParser.setHandlerFallback(handler);\n }\n\n public setErrorHandler(callback: (state: IParsingState) => IParsingState): void {\n this._errorHandler = callback;\n }\n public clearErrorHandler(): void {\n this._errorHandler = this._errorHandlerFb;\n }\n\n /**\n * Reset parser to initial values.\n *\n * This can also be used to lift the improper continuation error condition\n * when dealing with async handlers. Use this only as a last resort to silence\n * that error when the terminal has no pending data to be processed. Note that\n * the interrupted async handler might continue its work in the future messing\n * up the terminal state even further.\n */\n public reset(): void {\n this.currentState = this.initialState;\n this._oscParser.reset();\n this._dcsParser.reset();\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n // abort pending continuation from async handler\n // Here the RESET type indicates, that the next parse call will\n // ignore any saved stack, instead continues sync with next codepoint from GROUND\n if (this._parseStack.state !== ParserStackType.NONE) {\n this._parseStack.state = ParserStackType.RESET;\n this._parseStack.handlers = []; // also release handlers ref\n }\n }\n\n /**\n * Async parse support.\n */\n protected _preserveStack(\n state: ParserStackType,\n handlers: ResumableHandlersType,\n handlerPos: number,\n transition: number,\n chunkPos: number\n ): void {\n this._parseStack.state = state;\n this._parseStack.handlers = handlers;\n this._parseStack.handlerPos = handlerPos;\n this._parseStack.transition = transition;\n this._parseStack.chunkPos = chunkPos;\n }\n\n /**\n * Parse UTF32 codepoints in `data` up to `length`.\n *\n * Note: For several actions with high data load the parsing is optimized\n * by using local read ahead loops with hardcoded conditions to\n * avoid costly table lookups. Make sure that any change of table values\n * will be reflected in the loop conditions as well and vice versa.\n * Affected states/actions:\n * - GROUND:PRINT\n * - CSI_PARAM:PARAM\n * - DCS_PARAM:PARAM\n * - OSC_STRING:OSC_PUT\n * - DCS_PASSTHROUGH:DCS_PUT\n *\n * Note on asynchronous handler support:\n * Any handler returning a promise will be treated as asynchronous.\n * To keep the in-band blocking working for async handlers, `parse` pauses execution,\n * creates a stack save and returns the promise to the caller.\n * For proper continuation of the paused state it is important\n * to await the promise resolving. On resolve the parse must be repeated\n * with the same chunk of data and the resolved value in `promiseResult`\n * until no promise is returned.\n *\n * Important: With only sync handlers defined, parsing is completely synchronous as well.\n * As soon as an async handler is involved, synchronous parsing is not possible anymore.\n *\n * Boilerplate for proper parsing of multiple chunks with async handlers:\n *\n * ```typescript\n * async function parseMultipleChunks(chunks: Uint32Array[]): Promise<void> {\n * for (const chunk of chunks) {\n * let result: void | Promise<boolean>;\n * let prev: boolean | undefined;\n * while (result = parser.parse(chunk, chunk.length, prev)) {\n * prev = await result;\n * }\n * }\n * // finished parsing all chunks...\n * }\n * ```\n */\n public parse(data: Uint32Array, length: number, promiseResult?: boolean): void | Promise<boolean> {\n let code = 0;\n let transition = 0;\n let start = 0;\n let handlerResult: void | boolean | Promise<boolean>;\n\n // resume from async handler\n if (this._parseStack.state) {\n // allow sync parser reset even in continuation mode\n // Note: can be used to recover parser from improper continuation error below\n if (this._parseStack.state === ParserStackType.RESET) {\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1; // continue with next codepoint in GROUND\n } else {\n if (promiseResult === undefined || this._parseStack.state === ParserStackType.FAIL) {\n /**\n * Reject further parsing on improper continuation after pausing.\n * This is a really bad condition with screwed up execution order and prolly messed up\n * terminal state, therefore we exit hard with an exception and reject any further parsing.\n *\n * Note: With `Terminal.write` usage this exception should never occur, as the top level\n * calls are guaranteed to handle async conditions properly. If you ever encounter this\n * exception in your terminal integration it indicates, that you injected data chunks to\n * `InputHandler.parse` or `EscapeSequenceParser.parse` synchronously without waiting for\n * continuation of a running async handler.\n *\n * It is possible to get rid of this error by calling `reset`. But dont rely on that,\n * as the pending async handler still might mess up the terminal later. Instead fix the faulty\n * async handling, so this error will not be thrown anymore.\n */\n this._parseStack.state = ParserStackType.FAIL;\n throw new Error('improper continuation due to previous async handler, giving up parsing');\n }\n\n // we have to resume the old handler loop if:\n // - return value of the promise was `false`\n // - handlers are not exhausted yet\n const handlers = this._parseStack.handlers;\n let handlerPos = this._parseStack.handlerPos - 1;\n switch (this._parseStack.state) {\n case ParserStackType.CSI:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as CsiHandlerType[])[handlerPos](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.ESC:\n if (promiseResult === false && handlerPos > -1) {\n for (; handlerPos >= 0; handlerPos--) {\n handlerResult = (handlers as EscHandlerType[])[handlerPos]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._parseStack.handlerPos = handlerPos;\n return handlerResult;\n }\n }\n }\n this._parseStack.handlers = [];\n break;\n case ParserStackType.DCS:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserStackType.OSC:\n code = data[this._parseStack.chunkPos];\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a, promiseResult);\n if (handlerResult) {\n return handlerResult;\n }\n if (code === 0x1b) this._parseStack.transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n }\n // cleanup before continuing with the main sync loop\n this._parseStack.state = ParserStackType.NONE;\n start = this._parseStack.chunkPos + 1;\n this.precedingCodepoint = 0;\n this.currentState = this._parseStack.transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n\n // continue with main sync loop\n\n // process input string\n for (let i = start; i < length; ++i) {\n code = data[i];\n\n // normal transition & action lookup\n transition = this._transitions.table[this.currentState << TableAccess.INDEX_STATE_SHIFT | (code < 0xa0 ? code : NON_ASCII_PRINTABLE)];\n switch (transition >> TableAccess.TRANSITION_ACTION_SHIFT) {\n case ParserAction.PRINT:\n // read ahead with loop unrolling\n // Note: 0x20 (SP) is included, 0x7F (DEL) is excluded\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n if (++j >= length || (code = data[j]) < 0x20 || (code > 0x7e && code < NON_ASCII_PRINTABLE)) {\n this._printHandler(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.EXECUTE:\n if (this._executeHandlers[code]) this._executeHandlers[code]();\n else this._executeHandlerFb(code);\n this.precedingCodepoint = 0;\n break;\n case ParserAction.IGNORE:\n break;\n case ParserAction.ERROR:\n const inject: IParsingState = this._errorHandler(\n {\n position: i,\n code,\n currentState: this.currentState,\n collect: this._collect,\n params: this._params,\n abort: false\n });\n if (inject.abort) return;\n // inject values: currently not implemented\n break;\n case ParserAction.CSI_DISPATCH:\n // Trigger CSI Handler\n const handlers = this._csiHandlers[this._collect << 8 | code];\n let j = handlers ? handlers.length - 1 : -1;\n for (; j >= 0; j--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlers[j](this._params);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.CSI, handlers, j, transition, i);\n return handlerResult;\n }\n }\n if (j < 0) {\n this._csiHandlerFb(this._collect << 8 | code, this._params);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.PARAM:\n // inner loop: digits (0x30 - 0x39) and ; (0x3b) and : (0x3a)\n do {\n switch (code) {\n case 0x3b:\n this._params.addParam(0); // ZDM\n break;\n case 0x3a:\n this._params.addSubParam(-1);\n break;\n default: // 0x30 - 0x39\n this._params.addDigit(code - 48);\n }\n } while (++i < length && (code = data[i]) > 0x2f && code < 0x3c);\n i--;\n break;\n case ParserAction.COLLECT:\n this._collect <<= 8;\n this._collect |= code;\n break;\n case ParserAction.ESC_DISPATCH:\n const handlersEsc = this._escHandlers[this._collect << 8 | code];\n let jj = handlersEsc ? handlersEsc.length - 1 : -1;\n for (; jj >= 0; jj--) {\n // true means success and to stop bubbling\n // a promise indicates an async handler that needs to finish before progressing\n handlerResult = handlersEsc[jj]();\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._preserveStack(ParserStackType.ESC, handlersEsc, jj, transition, i);\n return handlerResult;\n }\n }\n if (jj < 0) {\n this._escHandlerFb(this._collect << 8 | code);\n }\n this.precedingCodepoint = 0;\n break;\n case ParserAction.CLEAR:\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n break;\n case ParserAction.DCS_HOOK:\n this._dcsParser.hook(this._collect << 8 | code, this._params);\n break;\n case ParserAction.DCS_PUT:\n // inner loop - exit DCS_PUT: 0x18, 0x1a, 0x1b, 0x7f, 0x80 - 0x9f\n // unhook triggered by: 0x1b, 0x9c (success) and 0x18, 0x1a (abort)\n for (let j = i + 1; ; ++j) {\n if (j >= length || (code = data[j]) === 0x18 || code === 0x1a || code === 0x1b || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._dcsParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.DCS_UNHOOK:\n handlerResult = this._dcsParser.unhook(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.DCS, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n case ParserAction.OSC_START:\n this._oscParser.start();\n break;\n case ParserAction.OSC_PUT:\n // inner loop: 0x20 (SP) included, 0x7F (DEL) included\n for (let j = i + 1; ; j++) {\n if (j >= length || (code = data[j]) < 0x20 || (code > 0x7f && code < NON_ASCII_PRINTABLE)) {\n this._oscParser.put(data, i, j);\n i = j - 1;\n break;\n }\n }\n break;\n case ParserAction.OSC_END:\n handlerResult = this._oscParser.end(code !== 0x18 && code !== 0x1a);\n if (handlerResult) {\n this._preserveStack(ParserStackType.OSC, [], 0, transition, i);\n return handlerResult;\n }\n if (code === 0x1b) transition |= ParserState.ESCAPE;\n this._params.reset();\n this._params.addParam(0); // ZDM\n this._collect = 0;\n this.precedingCodepoint = 0;\n break;\n }\n this.currentState = transition & TableAccess.TRANSITION_STATE_MASK;\n }\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOscHandler, IHandlerCollection, OscFallbackHandlerType, IOscParser, ISubParserStackState } from 'common/parser/Types';\nimport { OscState, PAYLOAD_LIMIT } from 'common/parser/Constants';\nimport { utf32ToString } from 'common/input/TextDecoder';\nimport { IDisposable } from 'common/Types';\n\nconst EMPTY_HANDLERS: IOscHandler[] = [];\n\nexport class OscParser implements IOscParser {\n private _state = OscState.START;\n private _active = EMPTY_HANDLERS;\n private _id = -1;\n private _handlers: IHandlerCollection<IOscHandler> = Object.create(null);\n private _handlerFb: OscFallbackHandlerType = () => { };\n private _stack: ISubParserStackState = {\n paused: false,\n loopPosition: 0,\n fallThrough: false\n };\n\n public registerHandler(ident: number, handler: IOscHandler): IDisposable {\n if (this._handlers[ident] === undefined) {\n this._handlers[ident] = [];\n }\n const handlerList = this._handlers[ident];\n handlerList.push(handler);\n return {\n dispose: () => {\n const handlerIndex = handlerList.indexOf(handler);\n if (handlerIndex !== -1) {\n handlerList.splice(handlerIndex, 1);\n }\n }\n };\n }\n public clearHandler(ident: number): void {\n if (this._handlers[ident]) delete this._handlers[ident];\n }\n public setHandlerFallback(handler: OscFallbackHandlerType): void {\n this._handlerFb = handler;\n }\n\n public dispose(): void {\n this._handlers = Object.create(null);\n this._handlerFb = () => { };\n this._active = EMPTY_HANDLERS;\n }\n\n public reset(): void {\n // force cleanup handlers if payload was already sent\n if (this._state === OscState.PAYLOAD) {\n for (let j = this._stack.paused ? this._stack.loopPosition - 1 : this._active.length - 1; j >= 0; --j) {\n this._active[j].end(false);\n }\n }\n this._stack.paused = false;\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n\n private _start(): void {\n this._active = this._handlers[this._id] || EMPTY_HANDLERS;\n if (!this._active.length) {\n this._handlerFb(this._id, 'START');\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].start();\n }\n }\n }\n\n private _put(data: Uint32Array, start: number, end: number): void {\n if (!this._active.length) {\n this._handlerFb(this._id, 'PUT', utf32ToString(data, start, end));\n } else {\n for (let j = this._active.length - 1; j >= 0; j--) {\n this._active[j].put(data, start, end);\n }\n }\n }\n\n public start(): void {\n // always reset leftover handlers\n this.reset();\n this._state = OscState.ID;\n }\n\n /**\n * Put data to current OSC command.\n * Expects the identifier of the OSC command in the form\n * OSC id ; payload ST/BEL\n * Payload chunks are not further processed and get\n * directly passed to the handlers.\n */\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._state === OscState.ABORT) {\n return;\n }\n if (this._state === OscState.ID) {\n while (start < end) {\n const code = data[start++];\n if (code === 0x3b) {\n this._state = OscState.PAYLOAD;\n this._start();\n break;\n }\n if (code < 0x30 || 0x39 < code) {\n this._state = OscState.ABORT;\n return;\n }\n if (this._id === -1) {\n this._id = 0;\n }\n this._id = this._id * 10 + code - 48;\n }\n }\n if (this._state === OscState.PAYLOAD && end - start > 0) {\n this._put(data, start, end);\n }\n }\n\n /**\n * Indicates end of an OSC command.\n * Whether the OSC got aborted or finished normally\n * is indicated by `success`.\n */\n public end(success: boolean, promiseResult: boolean = true): void | Promise<boolean> {\n if (this._state === OscState.START) {\n return;\n }\n // do nothing if command was faulty\n if (this._state !== OscState.ABORT) {\n // if we are still in ID state and get an early end\n // means that the command has no payload thus we still have\n // to announce START and send END right after\n if (this._state === OscState.ID) {\n this._start();\n }\n\n if (!this._active.length) {\n this._handlerFb(this._id, 'END', success);\n } else {\n let handlerResult: boolean | Promise<boolean> = false;\n let j = this._active.length - 1;\n let fallThrough = false;\n if (this._stack.paused) {\n j = this._stack.loopPosition - 1;\n handlerResult = promiseResult;\n fallThrough = this._stack.fallThrough;\n this._stack.paused = false;\n }\n if (!fallThrough && handlerResult === false) {\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(success);\n if (handlerResult === true) {\n break;\n } else if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = false;\n return handlerResult;\n }\n }\n j--;\n }\n // cleanup left over handlers\n // we always have to call .end for proper cleanup,\n // here we use `success` to indicate whether a handler should execute\n for (; j >= 0; j--) {\n handlerResult = this._active[j].end(false);\n if (handlerResult instanceof Promise) {\n this._stack.paused = true;\n this._stack.loopPosition = j;\n this._stack.fallThrough = true;\n return handlerResult;\n }\n }\n }\n\n }\n this._active = EMPTY_HANDLERS;\n this._id = -1;\n this._state = OscState.START;\n }\n}\n\n/**\n * Convenient class to allow attaching string based handler functions\n * as OSC handlers.\n */\nexport class OscHandler implements IOscHandler {\n private _data = '';\n private _hitLimit: boolean = false;\n\n constructor(private _handler: (data: string) => boolean | Promise<boolean>) { }\n\n public start(): void {\n this._data = '';\n this._hitLimit = false;\n }\n\n public put(data: Uint32Array, start: number, end: number): void {\n if (this._hitLimit) {\n return;\n }\n this._data += utf32ToString(data, start, end);\n if (this._data.length > PAYLOAD_LIMIT) {\n this._data = '';\n this._hitLimit = true;\n }\n }\n\n public end(success: boolean): boolean | Promise<boolean> {\n let ret: boolean | Promise<boolean> = false;\n if (this._hitLimit) {\n ret = false;\n } else if (success) {\n ret = this._handler(this._data);\n if (ret instanceof Promise) {\n // need to hold data until `ret` got resolved\n // dont care for errors, data will be freed anyway on next start\n return ret.then(res => {\n this._data = '';\n this._hitLimit = false;\n return res;\n });\n }\n }\n this._data = '';\n this._hitLimit = false;\n return ret;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IParams, ParamsArray } from 'common/parser/Types';\n\n// max value supported for a single param/subparam (clamped to positive int32 range)\nconst MAX_VALUE = 0x7FFFFFFF;\n// max allowed subparams for a single sequence (hardcoded limitation)\nconst MAX_SUBPARAMS = 256;\n\n/**\n * Params storage class.\n * This type is used by the parser to accumulate sequence parameters and sub parameters\n * and transmit them to the input handler actions.\n *\n * NOTES:\n * - params object for action handlers is borrowed, use `.toArray` or `.clone` to get a copy\n * - never read beyond `params.length - 1` (likely to contain arbitrary data)\n * - `.getSubParams` returns a borrowed typed array, use `.getSubParamsAll` for cloned sub params\n * - hardcoded limitations:\n * - max. value for a single (sub) param is 2^31 - 1 (greater values are clamped to that)\n * - max. 256 sub params possible\n * - negative values are not allowed beside -1 (placeholder for default value)\n *\n * About ZDM (Zero Default Mode):\n * ZDM is not orchestrated by this class. If the parser is in ZDM,\n * it should add 0 for empty params, otherwise -1. This does not apply\n * to subparams, empty subparams should always be added with -1.\n */\nexport class Params implements IParams {\n // params store and length\n public params: Int32Array;\n public length: number;\n\n // sub params store and length\n protected _subParams: Int32Array;\n protected _subParamsLength: number;\n\n // sub params offsets from param: param idx --> [start, end] offset\n private _subParamsIdx: Uint16Array;\n private _rejectDigits: boolean;\n private _rejectSubDigits: boolean;\n private _digitIsSub: boolean;\n\n /**\n * Create a `Params` type from JS array representation.\n */\n public static fromArray(values: ParamsArray): Params {\n const params = new Params();\n if (!values.length) {\n return params;\n }\n // skip leading sub params\n for (let i = (Array.isArray(values[0])) ? 1 : 0; i < values.length; ++i) {\n const value = values[i];\n if (Array.isArray(value)) {\n for (let k = 0; k < value.length; ++k) {\n params.addSubParam(value[k]);\n }\n } else {\n params.addParam(value);\n }\n }\n return params;\n }\n\n /**\n * @param maxLength max length of storable parameters\n * @param maxSubParamsLength max length of storable sub parameters\n */\n constructor(public maxLength: number = 32, public maxSubParamsLength: number = 32) {\n if (maxSubParamsLength > MAX_SUBPARAMS) {\n throw new Error('maxSubParamsLength must not be greater than 256');\n }\n this.params = new Int32Array(maxLength);\n this.length = 0;\n this._subParams = new Int32Array(maxSubParamsLength);\n this._subParamsLength = 0;\n this._subParamsIdx = new Uint16Array(maxLength);\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Clone object.\n */\n public clone(): Params {\n const newParams = new Params(this.maxLength, this.maxSubParamsLength);\n newParams.params.set(this.params);\n newParams.length = this.length;\n newParams._subParams.set(this._subParams);\n newParams._subParamsLength = this._subParamsLength;\n newParams._subParamsIdx.set(this._subParamsIdx);\n newParams._rejectDigits = this._rejectDigits;\n newParams._rejectSubDigits = this._rejectSubDigits;\n newParams._digitIsSub = this._digitIsSub;\n return newParams;\n }\n\n /**\n * Get a JS array representation of the current parameters and sub parameters.\n * The array is structured as follows:\n * sequence: \"1;2:3:4;5::6\"\n * array : [1, 2, [3, 4], 5, [-1, 6]]\n */\n public toArray(): ParamsArray {\n const res: ParamsArray = [];\n for (let i = 0; i < this.length; ++i) {\n res.push(this.params[i]);\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n res.push(Array.prototype.slice.call(this._subParams, start, end));\n }\n }\n return res;\n }\n\n /**\n * Reset to initial empty state.\n */\n public reset(): void {\n this.length = 0;\n this._subParamsLength = 0;\n this._rejectDigits = false;\n this._rejectSubDigits = false;\n this._digitIsSub = false;\n }\n\n /**\n * Add a parameter value.\n * `Params` only stores up to `maxLength` parameters, any later\n * parameter will be ignored.\n * Note: VT devices only stored up to 16 values, xterm seems to\n * store up to 30.\n */\n public addParam(value: number): void {\n this._digitIsSub = false;\n if (this.length >= this.maxLength) {\n this._rejectDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParamsIdx[this.length] = this._subParamsLength << 8 | this._subParamsLength;\n this.params[this.length++] = value > MAX_VALUE ? MAX_VALUE : value;\n }\n\n /**\n * Add a sub parameter value.\n * The sub parameter is automatically associated with the last parameter value.\n * Thus it is not possible to add a subparameter without any parameter added yet.\n * `Params` only stores up to `subParamsLength` sub parameters, any later\n * sub parameter will be ignored.\n */\n public addSubParam(value: number): void {\n this._digitIsSub = true;\n if (!this.length) {\n return;\n }\n if (this._rejectDigits || this._subParamsLength >= this.maxSubParamsLength) {\n this._rejectSubDigits = true;\n return;\n }\n if (value < -1) {\n throw new Error('values lesser than -1 are not allowed');\n }\n this._subParams[this._subParamsLength++] = value > MAX_VALUE ? MAX_VALUE : value;\n this._subParamsIdx[this.length - 1]++;\n }\n\n /**\n * Whether parameter at index `idx` has sub parameters.\n */\n public hasSubParams(idx: number): boolean {\n return ((this._subParamsIdx[idx] & 0xFF) - (this._subParamsIdx[idx] >> 8) > 0);\n }\n\n /**\n * Return sub parameters for parameter at index `idx`.\n * Note: The values are borrowed, thus you need to copy\n * the values if you need to hold them in nonlocal scope.\n */\n public getSubParams(idx: number): Int32Array | null {\n const start = this._subParamsIdx[idx] >> 8;\n const end = this._subParamsIdx[idx] & 0xFF;\n if (end - start > 0) {\n return this._subParams.subarray(start, end);\n }\n return null;\n }\n\n /**\n * Return all sub parameters as {idx: subparams} mapping.\n * Note: The values are not borrowed.\n */\n public getSubParamsAll(): {[idx: number]: Int32Array} {\n const result: {[idx: number]: Int32Array} = {};\n for (let i = 0; i < this.length; ++i) {\n const start = this._subParamsIdx[i] >> 8;\n const end = this._subParamsIdx[i] & 0xFF;\n if (end - start > 0) {\n result[i] = this._subParams.slice(start, end);\n }\n }\n return result;\n }\n\n /**\n * Add a single digit value to current parameter.\n * This is used by the parser to account digits on a char by char basis.\n */\n public addDigit(value: number): void {\n let length;\n if (this._rejectDigits\n || !(length = this._digitIsSub ? this._subParamsLength : this.length)\n || (this._digitIsSub && this._rejectSubDigits)\n ) {\n return;\n }\n\n const store = this._digitIsSub ? this._subParams : this.params;\n const cur = store[length - 1];\n store[length - 1] = ~cur ? Math.min(cur * 10 + value, MAX_VALUE) : value;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ITerminalAddon, IDisposable, Terminal } from 'xterm';\n\nexport interface ILoadedAddon {\n instance: ITerminalAddon;\n dispose: () => void;\n isDisposed: boolean;\n}\n\nexport class AddonManager implements IDisposable {\n protected _addons: ILoadedAddon[] = [];\n\n constructor() {\n }\n\n public dispose(): void {\n for (let i = this._addons.length - 1; i >= 0; i--) {\n this._addons[i].instance.dispose();\n }\n }\n\n public loadAddon(terminal: Terminal, instance: ITerminalAddon): void {\n const loadedAddon: ILoadedAddon = {\n instance,\n dispose: instance.dispose,\n isDisposed: false\n };\n this._addons.push(loadedAddon);\n instance.dispose = () => this._wrappedAddonDispose(loadedAddon);\n instance.activate(terminal as any);\n }\n\n private _wrappedAddonDispose(loadedAddon: ILoadedAddon): void {\n if (loadedAddon.isDisposed) {\n // Do nothing if already disposed\n return;\n }\n let index = -1;\n for (let i = 0; i < this._addons.length; i++) {\n if (this._addons[i] === loadedAddon) {\n index = i;\n break;\n }\n }\n if (index === -1) {\n throw new Error('Could not dispose an addon that has not been loaded');\n }\n loadedAddon.isDisposed = true;\n loadedAddon.dispose.apply(loadedAddon.instance);\n this._addons.splice(index, 1);\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi } from 'xterm';\nimport { IBuffer } from 'common/buffer/Types';\nimport { BufferLineApiView } from 'common/public/BufferLineApiView';\nimport { CellData } from 'common/buffer/CellData';\n\nexport class BufferApiView implements IBufferApi {\n constructor(\n private _buffer: IBuffer,\n public readonly type: 'normal' | 'alternate'\n ) { }\n\n public init(buffer: IBuffer): BufferApiView {\n this._buffer = buffer;\n return this;\n }\n\n public get cursorY(): number { return this._buffer.y; }\n public get cursorX(): number { return this._buffer.x; }\n public get viewportY(): number { return this._buffer.ydisp; }\n public get baseY(): number { return this._buffer.ybase; }\n public get length(): number { return this._buffer.lines.length; }\n public getLine(y: number): IBufferLineApi | undefined {\n const line = this._buffer.lines.get(y);\n if (!line) {\n return undefined;\n }\n return new BufferLineApiView(line);\n }\n public getNullCell(): IBufferCellApi { return new CellData(); }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { CellData } from 'common/buffer/CellData';\nimport { IBufferLine, ICellData } from 'common/Types';\nimport { IBufferCell as IBufferCellApi, IBufferLine as IBufferLineApi } from 'xterm';\n\nexport class BufferLineApiView implements IBufferLineApi {\n constructor(private _line: IBufferLine) { }\n\n public get isWrapped(): boolean { return this._line.isWrapped; }\n public get length(): number { return this._line.length; }\n public getCell(x: number, cell?: IBufferCellApi): IBufferCellApi | undefined {\n if (x < 0 || x >= this._line.length) {\n return undefined;\n }\n\n if (cell) {\n this._line.loadCell(x, cell as ICellData);\n return cell;\n }\n return this._line.loadCell(x, new CellData());\n }\n public translateToString(trimRight?: boolean, startColumn?: number, endColumn?: number): string {\n return this._line.translateToString(trimRight, startColumn, endColumn);\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi } from 'xterm';\nimport { BufferApiView } from 'common/public/BufferApiView';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class BufferNamespaceApi implements IBufferNamespaceApi {\n private _normal: BufferApiView;\n private _alternate: BufferApiView;\n\n private readonly _onBufferChange = new EventEmitter<IBufferApi>();\n public readonly onBufferChange = this._onBufferChange.event;\n\n constructor(private _core: ICoreTerminal) {\n this._normal = new BufferApiView(this._core.buffers.normal, 'normal');\n this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate');\n this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));\n }\n public get active(): IBufferApi {\n if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; }\n if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; }\n throw new Error('Active buffer is neither normal nor alternate');\n }\n public get normal(): IBufferApi {\n return this._normal.init(this._core.buffers.normal);\n }\n public get alternate(): IBufferApi {\n return this._alternate.init(this._core.buffers.alt);\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IParams } from 'common/parser/Types';\nimport { IDisposable, IFunctionIdentifier, IParser } from 'xterm';\nimport { ICoreTerminal } from 'common/Types';\n\nexport class ParserApi implements IParser {\n constructor(private _core: ICoreTerminal) { }\n\n public registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {\n return this._core.registerCsiHandler(id, (params: IParams) => callback(params.toArray()));\n }\n public addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {\n return this.registerCsiHandler(id, callback);\n }\n public registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {\n return this._core.registerDcsHandler(id, (data: string, params: IParams) => callback(data, params.toArray()));\n }\n public addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean | Promise<boolean>): IDisposable {\n return this.registerDcsHandler(id, callback);\n }\n public registerEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise<boolean>): IDisposable {\n return this._core.registerEscHandler(id, handler);\n }\n public addEscHandler(id: IFunctionIdentifier, handler: () => boolean | Promise<boolean>): IDisposable {\n return this.registerEscHandler(id, handler);\n }\n public registerOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {\n return this._core.registerOscHandler(ident, callback);\n }\n public addOscHandler(ident: number, callback: (data: string) => boolean | Promise<boolean>): IDisposable {\n return this.registerOscHandler(ident, callback);\n }\n}\n","/**\n * Copyright (c) 2021 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreTerminal } from 'common/Types';\nimport { IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';\n\nexport class UnicodeApi implements IUnicodeHandling {\n constructor(private _core: ICoreTerminal) { }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._core.unicodeService.register(provider);\n }\n\n public get versions(): string[] {\n return this._core.unicodeService.versions;\n }\n\n public get activeVersion(): string {\n return this._core.unicodeService.activeVersion;\n }\n\n public set activeVersion(version: string) {\n this._core.unicodeService.activeVersion = version;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IBufferService, IOptionsService } from 'common/services/Services';\nimport { BufferSet } from 'common/buffer/BufferSet';\nimport { IBufferSet, IBuffer } from 'common/buffer/Types';\nimport { EventEmitter, IEventEmitter, IEvent } from 'common/EventEmitter';\nimport { Disposable } from 'common/Lifecycle';\nimport { IAttributeData, IBufferLine, ScrollSource } from 'common/Types';\n\nexport const MINIMUM_COLS = 2; // Less than 2 can mess with wide chars\nexport const MINIMUM_ROWS = 1;\n\nexport class BufferService extends Disposable implements IBufferService {\n public serviceBrand: any;\n\n public cols: number;\n public rows: number;\n public buffers: IBufferSet;\n /** Whether the user is scrolling (locks the scroll position) */\n public isUserScrolling: boolean = false;\n\n private readonly _onResize = this.register(new EventEmitter<{ cols: number, rows: number }>());\n public readonly onResize = this._onResize.event;\n private readonly _onScroll = this.register(new EventEmitter<number>());\n public readonly onScroll = this._onScroll.event;\n\n public get buffer(): IBuffer { return this.buffers.active; }\n\n /** An IBufferline to clone/copy from for new blank lines */\n private _cachedBlankLine: IBufferLine | undefined;\n\n constructor(@IOptionsService optionsService: IOptionsService) {\n super();\n this.cols = Math.max(optionsService.rawOptions.cols || 0, MINIMUM_COLS);\n this.rows = Math.max(optionsService.rawOptions.rows || 0, MINIMUM_ROWS);\n this.buffers = this.register(new BufferSet(optionsService, this));\n }\n\n public resize(cols: number, rows: number): void {\n this.cols = cols;\n this.rows = rows;\n this.buffers.resize(cols, rows);\n // TODO: This doesn't fire when scrollback changes - add a resize event to BufferSet and forward event\n this._onResize.fire({ cols, rows });\n }\n\n public reset(): void {\n this.buffers.reset();\n this.isUserScrolling = false;\n }\n\n /**\n * Scroll the terminal down 1 row, creating a blank line.\n * @param eraseAttr The attribute data to use the for blank line.\n * @param isWrapped Whether the new line is wrapped from the previous line.\n */\n public scroll(eraseAttr: IAttributeData, isWrapped: boolean = false): void {\n const buffer = this.buffer;\n\n let newLine: IBufferLine | undefined;\n newLine = this._cachedBlankLine;\n if (!newLine || newLine.length !== this.cols || newLine.getFg(0) !== eraseAttr.fg || newLine.getBg(0) !== eraseAttr.bg) {\n newLine = buffer.getBlankLine(eraseAttr, isWrapped);\n this._cachedBlankLine = newLine;\n }\n newLine.isWrapped = isWrapped;\n\n const topRow = buffer.ybase + buffer.scrollTop;\n const bottomRow = buffer.ybase + buffer.scrollBottom;\n\n if (buffer.scrollTop === 0) {\n // Determine whether the buffer is going to be trimmed after insertion.\n const willBufferBeTrimmed = buffer.lines.isFull;\n\n // Insert the line using the fastest method\n if (bottomRow === buffer.lines.length - 1) {\n if (willBufferBeTrimmed) {\n buffer.lines.recycle().copyFrom(newLine);\n } else {\n buffer.lines.push(newLine.clone());\n }\n } else {\n buffer.lines.splice(bottomRow + 1, 0, newLine.clone());\n }\n\n // Only adjust ybase and ydisp when the buffer is not trimmed\n if (!willBufferBeTrimmed) {\n buffer.ybase++;\n // Only scroll the ydisp with ybase if the user has not scrolled up\n if (!this.isUserScrolling) {\n buffer.ydisp++;\n }\n } else {\n // When the buffer is full and the user has scrolled up, keep the text\n // stable unless ydisp is right at the top\n if (this.isUserScrolling) {\n buffer.ydisp = Math.max(buffer.ydisp - 1, 0);\n }\n }\n } else {\n // scrollTop is non-zero which means no line will be going to the\n // scrollback, instead we can just shift them in-place.\n const scrollRegionHeight = bottomRow - topRow + 1 /* as it's zero-based */;\n buffer.lines.shiftElements(topRow + 1, scrollRegionHeight - 1, -1);\n buffer.lines.set(bottomRow, newLine.clone());\n }\n\n // Move the viewport to the bottom of the buffer unless the user is\n // scrolling.\n if (!this.isUserScrolling) {\n buffer.ydisp = buffer.ybase;\n }\n\n this._onScroll.fire(buffer.ydisp);\n }\n\n /**\n * Scroll the display of the terminal\n * @param disp The number of lines to scroll down (negative scroll up).\n * @param suppressScrollEvent Don't emit the scroll event as scrollLines. This is used\n * to avoid unwanted events being handled by the viewport when the event was triggered from the\n * viewport originally.\n */\n public scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void {\n const buffer = this.buffer;\n if (disp < 0) {\n if (buffer.ydisp === 0) {\n return;\n }\n this.isUserScrolling = true;\n } else if (disp + buffer.ydisp >= buffer.ybase) {\n this.isUserScrolling = false;\n }\n\n const oldYdisp = buffer.ydisp;\n buffer.ydisp = Math.max(Math.min(buffer.ydisp + disp, buffer.ybase), 0);\n\n // No change occurred, don't trigger scroll/refresh\n if (oldYdisp === buffer.ydisp) {\n return;\n }\n\n if (!suppressScrollEvent) {\n this._onScroll.fire(buffer.ydisp);\n }\n }\n\n /**\n * Scroll the display of the terminal by a number of pages.\n * @param pageCount The number of pages to scroll (negative scrolls up).\n */\n public scrollPages(pageCount: number): void {\n this.scrollLines(pageCount * (this.rows - 1));\n }\n\n /**\n * Scrolls the display of the terminal to the top.\n */\n public scrollToTop(): void {\n this.scrollLines(-this.buffer.ydisp);\n }\n\n /**\n * Scrolls the display of the terminal to the bottom.\n */\n public scrollToBottom(): void {\n this.scrollLines(this.buffer.ybase - this.buffer.ydisp);\n }\n\n public scrollToLine(line: number): void {\n const scrollAmount = line - this.buffer.ydisp;\n if (scrollAmount !== 0) {\n this.scrollLines(scrollAmount);\n }\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICharsetService } from 'common/services/Services';\nimport { ICharset } from 'common/Types';\n\nexport class CharsetService implements ICharsetService {\n public serviceBrand: any;\n\n public charset: ICharset | undefined;\n public glevel: number = 0;\n\n private _charsets: (ICharset | undefined)[] = [];\n\n public reset(): void {\n this.charset = undefined;\n this._charsets = [];\n this.glevel = 0;\n }\n\n public setgLevel(g: number): void {\n this.glevel = g;\n this.charset = this._charsets[g];\n }\n\n public setgCharset(g: number, charset: ICharset | undefined): void {\n this._charsets[g] = charset;\n if (this.glevel === g) {\n this.charset = charset;\n }\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IBufferService, ICoreService, ICoreMouseService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { ICoreMouseProtocol, ICoreMouseEvent, CoreMouseEncoding, CoreMouseEventType, CoreMouseButton, CoreMouseAction } from 'common/Types';\nimport { Disposable } from 'common/Lifecycle';\n\n/**\n * Supported default protocols.\n */\nconst DEFAULT_PROTOCOLS: { [key: string]: ICoreMouseProtocol } = {\n /**\n * NONE\n * Events: none\n * Modifiers: none\n */\n NONE: {\n events: CoreMouseEventType.NONE,\n restrict: () => false\n },\n /**\n * X10\n * Events: mousedown\n * Modifiers: none\n */\n X10: {\n events: CoreMouseEventType.DOWN,\n restrict: (e: ICoreMouseEvent) => {\n // no wheel, no move, no up\n if (e.button === CoreMouseButton.WHEEL || e.action !== CoreMouseAction.DOWN) {\n return false;\n }\n // no modifiers\n e.ctrl = false;\n e.alt = false;\n e.shift = false;\n return true;\n }\n },\n /**\n * VT200\n * Events: mousedown / mouseup / wheel\n * Modifiers: all\n */\n VT200: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL,\n restrict: (e: ICoreMouseEvent) => {\n // no move\n if (e.action === CoreMouseAction.MOVE) {\n return false;\n }\n return true;\n }\n },\n /**\n * DRAG\n * Events: mousedown / mouseup / wheel / mousedrag\n * Modifiers: all\n */\n DRAG: {\n events: CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL | CoreMouseEventType.DRAG,\n restrict: (e: ICoreMouseEvent) => {\n // no move without button\n if (e.action === CoreMouseAction.MOVE && e.button === CoreMouseButton.NONE) {\n return false;\n }\n return true;\n }\n },\n /**\n * ANY\n * Events: all mouse related events\n * Modifiers: all\n */\n ANY: {\n events:\n CoreMouseEventType.DOWN | CoreMouseEventType.UP | CoreMouseEventType.WHEEL\n | CoreMouseEventType.DRAG | CoreMouseEventType.MOVE,\n restrict: (e: ICoreMouseEvent) => true\n }\n};\n\nconst enum Modifiers {\n SHIFT = 4,\n ALT = 8,\n CTRL = 16\n}\n\n// helper for default encoders to generate the event code.\nfunction eventCode(e: ICoreMouseEvent, isSGR: boolean): number {\n let code = (e.ctrl ? Modifiers.CTRL : 0) | (e.shift ? Modifiers.SHIFT : 0) | (e.alt ? Modifiers.ALT : 0);\n if (e.button === CoreMouseButton.WHEEL) {\n code |= 64;\n code |= e.action;\n } else {\n code |= e.button & 3;\n if (e.button & 4) {\n code |= 64;\n }\n if (e.button & 8) {\n code |= 128;\n }\n if (e.action === CoreMouseAction.MOVE) {\n code |= CoreMouseAction.MOVE;\n } else if (e.action === CoreMouseAction.UP && !isSGR) {\n // special case - only SGR can report button on release\n // all others have to go with NONE\n code |= CoreMouseButton.NONE;\n }\n }\n return code;\n}\n\nconst S = String.fromCharCode;\n\n/**\n * Supported default encodings.\n */\nconst DEFAULT_ENCODINGS: { [key: string]: CoreMouseEncoding } = {\n /**\n * DEFAULT - CSI M Pb Px Py\n * Single byte encoding for coords and event code.\n * Can encode values up to 223 (1-based).\n */\n DEFAULT: (e: ICoreMouseEvent) => {\n const params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];\n // supress mouse report if we exceed addressible range\n // Note this is handled differently by emulators\n // - xterm: sends 0;0 coords instead\n // - vte, konsole: no report\n if (params[0] > 255 || params[1] > 255 || params[2] > 255) {\n return '';\n }\n return `\\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;\n },\n /**\n * SGR - CSI < Pb ; Px ; Py M|m\n * No encoding limitation.\n * Can report button on release and works with a well formed sequence.\n */\n SGR: (e: ICoreMouseEvent) => {\n const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';\n return `\\x1b[<${eventCode(e, true)};${e.col};${e.row}${final}`;\n },\n SGR_PIXELS: (e: ICoreMouseEvent) => {\n const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';\n return `\\x1b[<${eventCode(e, true)};${e.x};${e.y}${final}`;\n }\n};\n\n/**\n * CoreMouseService\n *\n * Provides mouse tracking reports with different protocols and encodings.\n * - protocols: NONE (default), X10, VT200, DRAG, ANY\n * - encodings: DEFAULT, SGR (UTF8, URXVT removed in #2507)\n *\n * Custom protocols/encodings can be added by `addProtocol` / `addEncoding`.\n * To activate a protocol/encoding, set `activeProtocol` / `activeEncoding`.\n * Switching a protocol will send a notification event `onProtocolChange`\n * with a list of needed events to track.\n *\n * The service handles the mouse tracking state and decides whether to send\n * a tracking report to the backend based on protocol and encoding limitations.\n * To send a mouse event call `triggerMouseEvent`.\n */\nexport class CoreMouseService extends Disposable implements ICoreMouseService {\n private _protocols: { [name: string]: ICoreMouseProtocol } = {};\n private _encodings: { [name: string]: CoreMouseEncoding } = {};\n private _activeProtocol: string = '';\n private _activeEncoding: string = '';\n private _lastEvent: ICoreMouseEvent | null = null;\n\n private readonly _onProtocolChange = this.register(new EventEmitter<CoreMouseEventType>());\n public readonly onProtocolChange = this._onProtocolChange.event;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService,\n @ICoreService private readonly _coreService: ICoreService\n ) {\n super();\n // register default protocols and encodings\n for (const name of Object.keys(DEFAULT_PROTOCOLS)) this.addProtocol(name, DEFAULT_PROTOCOLS[name]);\n for (const name of Object.keys(DEFAULT_ENCODINGS)) this.addEncoding(name, DEFAULT_ENCODINGS[name]);\n // call reset to set defaults\n this.reset();\n }\n\n public addProtocol(name: string, protocol: ICoreMouseProtocol): void {\n this._protocols[name] = protocol;\n }\n\n public addEncoding(name: string, encoding: CoreMouseEncoding): void {\n this._encodings[name] = encoding;\n }\n\n public get activeProtocol(): string {\n return this._activeProtocol;\n }\n\n public get areMouseEventsActive(): boolean {\n return this._protocols[this._activeProtocol].events !== 0;\n }\n\n public set activeProtocol(name: string) {\n if (!this._protocols[name]) {\n throw new Error(`unknown protocol \"${name}\"`);\n }\n this._activeProtocol = name;\n this._onProtocolChange.fire(this._protocols[name].events);\n }\n\n public get activeEncoding(): string {\n return this._activeEncoding;\n }\n\n public set activeEncoding(name: string) {\n if (!this._encodings[name]) {\n throw new Error(`unknown encoding \"${name}\"`);\n }\n this._activeEncoding = name;\n }\n\n public reset(): void {\n this.activeProtocol = 'NONE';\n this.activeEncoding = 'DEFAULT';\n this._lastEvent = null;\n }\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n public triggerMouseEvent(e: ICoreMouseEvent): boolean {\n // range check for col/row\n if (e.col < 0 || e.col >= this._bufferService.cols\n || e.row < 0 || e.row >= this._bufferService.rows) {\n return false;\n }\n\n // filter nonsense combinations of button + action\n if (e.button === CoreMouseButton.WHEEL && e.action === CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button === CoreMouseButton.NONE && e.action !== CoreMouseAction.MOVE) {\n return false;\n }\n if (e.button !== CoreMouseButton.WHEEL && (e.action === CoreMouseAction.LEFT || e.action === CoreMouseAction.RIGHT)) {\n return false;\n }\n\n // report 1-based coords\n e.col++;\n e.row++;\n\n // debounce move events at grid or pixel level\n if (e.action === CoreMouseAction.MOVE\n && this._lastEvent\n && this._equalEvents(this._lastEvent, e, this._activeEncoding === 'SGR_PIXELS')\n ) {\n return false;\n }\n\n // apply protocol restrictions\n if (!this._protocols[this._activeProtocol].restrict(e)) {\n return false;\n }\n\n // encode report and send\n const report = this._encodings[this._activeEncoding](e);\n if (report) {\n // always send DEFAULT as binary data\n if (this._activeEncoding === 'DEFAULT') {\n this._coreService.triggerBinaryEvent(report);\n } else {\n this._coreService.triggerDataEvent(report, true);\n }\n }\n\n this._lastEvent = e;\n\n return true;\n }\n\n public explainEvents(events: CoreMouseEventType): { [event: string]: boolean } {\n return {\n down: !!(events & CoreMouseEventType.DOWN),\n up: !!(events & CoreMouseEventType.UP),\n drag: !!(events & CoreMouseEventType.DRAG),\n move: !!(events & CoreMouseEventType.MOVE),\n wheel: !!(events & CoreMouseEventType.WHEEL)\n };\n }\n\n private _equalEvents(e1: ICoreMouseEvent, e2: ICoreMouseEvent, pixels: boolean): boolean {\n if (pixels) {\n if (e1.x !== e2.x) return false;\n if (e1.y !== e2.y) return false;\n } else {\n if (e1.col !== e2.col) return false;\n if (e1.row !== e2.row) return false;\n }\n if (e1.button !== e2.button) return false;\n if (e1.action !== e2.action) return false;\n if (e1.ctrl !== e2.ctrl) return false;\n if (e1.alt !== e2.alt) return false;\n if (e1.shift !== e2.shift) return false;\n return true;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { ICoreService, ILogService, IOptionsService, IBufferService } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { IDecPrivateModes, IModes } from 'common/Types';\nimport { clone } from 'common/Clone';\nimport { Disposable } from 'common/Lifecycle';\n\nconst DEFAULT_MODES: IModes = Object.freeze({\n insertMode: false\n});\n\nconst DEFAULT_DEC_PRIVATE_MODES: IDecPrivateModes = Object.freeze({\n applicationCursorKeys: false,\n applicationKeypad: false,\n bracketedPasteMode: false,\n origin: false,\n reverseWraparound: false,\n sendFocus: false,\n wraparound: true // defaults: xterm - true, vt100 - false\n});\n\nexport class CoreService extends Disposable implements ICoreService {\n public serviceBrand: any;\n\n public isCursorInitialized: boolean = false;\n public isCursorHidden: boolean = false;\n public modes: IModes;\n public decPrivateModes: IDecPrivateModes;\n\n private readonly _onData = this.register(new EventEmitter<string>());\n public readonly onData = this._onData.event;\n private readonly _onUserInput = this.register(new EventEmitter<void>());\n public readonly onUserInput = this._onUserInput.event;\n private readonly _onBinary = this.register(new EventEmitter<string>());\n public readonly onBinary = this._onBinary.event;\n private readonly _onRequestScrollToBottom = this.register(new EventEmitter<void>());\n public readonly onRequestScrollToBottom = this._onRequestScrollToBottom.event;\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService,\n @ILogService private readonly _logService: ILogService,\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public reset(): void {\n this.modes = clone(DEFAULT_MODES);\n this.decPrivateModes = clone(DEFAULT_DEC_PRIVATE_MODES);\n }\n\n public triggerDataEvent(data: string, wasUserInput: boolean = false): void {\n // Prevents all events to pty process if stdin is disabled\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n\n // Input is being sent to the terminal, the terminal should focus the prompt.\n const buffer = this._bufferService.buffer;\n if (wasUserInput && this._optionsService.rawOptions.scrollOnUserInput && buffer.ybase !== buffer.ydisp) {\n this._onRequestScrollToBottom.fire();\n }\n\n // Fire onUserInput so listeners can react as well (eg. clear selection)\n if (wasUserInput) {\n this._onUserInput.fire();\n }\n\n // Fire onData API\n this._logService.debug(`sending data \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onData.fire(data);\n }\n\n public triggerBinaryEvent(data: string): void {\n if (this._optionsService.rawOptions.disableStdin) {\n return;\n }\n this._logService.debug(`sending binary \"${data}\"`, () => data.split('').map(e => e.charCodeAt(0)));\n this._onBinary.fire(data);\n }\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { css } from 'common/Color';\nimport { EventEmitter } from 'common/EventEmitter';\nimport { Disposable, toDisposable } from 'common/Lifecycle';\nimport { IDecorationService, IInternalDecoration } from 'common/services/Services';\nimport { SortedList } from 'common/SortedList';\nimport { IColor } from 'common/Types';\nimport { IDecorationOptions, IDecoration, IMarker, IEvent } from 'xterm';\n\n// Work variables to avoid garbage collection\nlet $xmin = 0;\nlet $xmax = 0;\n\nexport class DecorationService extends Disposable implements IDecorationService {\n public serviceBrand: any;\n\n /**\n * A list of all decorations, sorted by the marker's line value. This relies on the fact that\n * while marker line values do change, they should all change by the same amount so this should\n * never become out of order.\n */\n private readonly _decorations: SortedList<IInternalDecoration> = new SortedList(e => e?.marker.line);\n\n private readonly _onDecorationRegistered = this.register(new EventEmitter<IInternalDecoration>());\n public readonly onDecorationRegistered = this._onDecorationRegistered.event;\n private readonly _onDecorationRemoved = this.register(new EventEmitter<IInternalDecoration>());\n public readonly onDecorationRemoved = this._onDecorationRemoved.event;\n\n public get decorations(): IterableIterator<IInternalDecoration> { return this._decorations.values(); }\n\n constructor() {\n super();\n\n this.register(toDisposable(() => {\n for (const d of this._decorations.values()) {\n this._onDecorationRemoved.fire(d);\n }\n this.reset();\n }));\n }\n\n public registerDecoration(options: IDecorationOptions): IDecoration | undefined {\n if (options.marker.isDisposed) {\n return undefined;\n }\n const decoration = new Decoration(options);\n if (decoration) {\n const markerDispose = decoration.marker.onDispose(() => decoration.dispose());\n decoration.onDispose(() => {\n if (decoration) {\n if (this._decorations.delete(decoration)) {\n this._onDecorationRemoved.fire(decoration);\n }\n markerDispose.dispose();\n }\n });\n this._decorations.insert(decoration);\n this._onDecorationRegistered.fire(decoration);\n }\n return decoration;\n }\n\n public reset(): void {\n for (const d of this._decorations.values()) {\n d.dispose();\n }\n this._decorations.clear();\n }\n\n public *getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator<IInternalDecoration> {\n let xmin = 0;\n let xmax = 0;\n for (const d of this._decorations.getKeyIterator(line)) {\n xmin = d.options.x ?? 0;\n xmax = xmin + (d.options.width ?? 1);\n if (x >= xmin && x < xmax && (!layer || (d.options.layer ?? 'bottom') === layer)) {\n yield d;\n }\n }\n }\n\n public forEachDecorationAtCell(x: number, line: number, layer: 'bottom' | 'top' | undefined, callback: (decoration: IInternalDecoration) => void): void {\n this._decorations.forEachByKey(line, d => {\n $xmin = d.options.x ?? 0;\n $xmax = $xmin + (d.options.width ?? 1);\n if (x >= $xmin && x < $xmax && (!layer || (d.options.layer ?? 'bottom') === layer)) {\n callback(d);\n }\n });\n }\n\n public dispose(): void {\n for (const d of this._decorations.values()) {\n this._onDecorationRemoved.fire(d);\n }\n this.reset();\n }\n}\n\nclass Decoration extends Disposable implements IInternalDecoration {\n public readonly marker: IMarker;\n public element: HTMLElement | undefined;\n public isDisposed: boolean = false;\n\n public readonly onRenderEmitter = this.register(new EventEmitter<HTMLElement>());\n public readonly onRender = this.onRenderEmitter.event;\n private readonly _onDispose = this.register(new EventEmitter<void>());\n public readonly onDispose = this._onDispose.event;\n\n private _cachedBg: IColor | undefined | null = null;\n public get backgroundColorRGB(): IColor | undefined {\n if (this._cachedBg === null) {\n if (this.options.backgroundColor) {\n this._cachedBg = css.toColor(this.options.backgroundColor);\n } else {\n this._cachedBg = undefined;\n }\n }\n return this._cachedBg;\n }\n\n private _cachedFg: IColor | undefined | null = null;\n public get foregroundColorRGB(): IColor | undefined {\n if (this._cachedFg === null) {\n if (this.options.foregroundColor) {\n this._cachedFg = css.toColor(this.options.foregroundColor);\n } else {\n this._cachedFg = undefined;\n }\n }\n return this._cachedFg;\n }\n\n constructor(\n public readonly options: IDecorationOptions\n ) {\n super();\n this.marker = options.marker;\n if (this.options.overviewRulerOptions && !this.options.overviewRulerOptions.position) {\n this.options.overviewRulerOptions.position = 'full';\n }\n }\n\n public override dispose(): void {\n this._onDispose.fire();\n super.dispose();\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IInstantiationService, IServiceIdentifier } from 'common/services/Services';\nimport { getServiceDependencies } from 'common/services/ServiceRegistry';\n\nexport class ServiceCollection {\n\n private _entries = new Map<IServiceIdentifier<any>, any>();\n\n constructor(...entries: [IServiceIdentifier<any>, any][]) {\n for (const [id, service] of entries) {\n this.set(id, service);\n }\n }\n\n public set<T>(id: IServiceIdentifier<T>, instance: T): T {\n const result = this._entries.get(id);\n this._entries.set(id, instance);\n return result;\n }\n\n public forEach(callback: (id: IServiceIdentifier<any>, instance: any) => any): void {\n for (const [key, value] of this._entries.entries()) {\n callback(key, value);\n }\n }\n\n public has(id: IServiceIdentifier<any>): boolean {\n return this._entries.has(id);\n }\n\n public get<T>(id: IServiceIdentifier<T>): T | undefined {\n return this._entries.get(id);\n }\n}\n\nexport class InstantiationService implements IInstantiationService {\n public serviceBrand: undefined;\n\n private readonly _services: ServiceCollection = new ServiceCollection();\n\n constructor() {\n this._services.set(IInstantiationService, this);\n }\n\n public setService<T>(id: IServiceIdentifier<T>, instance: T): void {\n this._services.set(id, instance);\n }\n\n public getService<T>(id: IServiceIdentifier<T>): T | undefined {\n return this._services.get(id);\n }\n\n public createInstance<T>(ctor: any, ...args: any[]): T {\n const serviceDependencies = getServiceDependencies(ctor).sort((a, b) => a.index - b.index);\n\n const serviceArgs: any[] = [];\n for (const dependency of serviceDependencies) {\n const service = this._services.get(dependency.id);\n if (!service) {\n throw new Error(`[createInstance] ${ctor.name} depends on UNKNOWN service ${dependency.id}.`);\n }\n serviceArgs.push(service);\n }\n\n const firstServiceArgPos = serviceDependencies.length > 0 ? serviceDependencies[0].index : args.length;\n\n // check for argument mismatches, adjust static args if needed\n if (args.length !== firstServiceArgPos) {\n throw new Error(`[createInstance] First service dependency of ${ctor.name} at position ${firstServiceArgPos + 1} conflicts with ${args.length} static arguments`);\n }\n\n // now create the instance\n return new ctor(...[...args, ...serviceArgs]);\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Disposable } from 'common/Lifecycle';\nimport { ILogService, IOptionsService, LogLevelEnum } from 'common/services/Services';\n\ntype LogType = (message?: any, ...optionalParams: any[]) => void;\n\ninterface IConsole {\n log: LogType;\n error: LogType;\n info: LogType;\n trace: LogType;\n warn: LogType;\n}\n\n// console is available on both node.js and browser contexts but the common\n// module doesn't depend on them so we need to explicitly declare it.\ndeclare const console: IConsole;\n\nconst optionsKeyToLogLevel: { [key: string]: LogLevelEnum } = {\n debug: LogLevelEnum.DEBUG,\n info: LogLevelEnum.INFO,\n warn: LogLevelEnum.WARN,\n error: LogLevelEnum.ERROR,\n off: LogLevelEnum.OFF\n};\n\nconst LOG_PREFIX = 'xterm.js: ';\n\nexport class LogService extends Disposable implements ILogService {\n public serviceBrand: any;\n\n public logLevel: LogLevelEnum = LogLevelEnum.OFF;\n\n constructor(\n @IOptionsService private readonly _optionsService: IOptionsService\n ) {\n super();\n this._updateLogLevel();\n this.register(this._optionsService.onSpecificOptionChange('logLevel', () => this._updateLogLevel()));\n }\n\n private _updateLogLevel(): void {\n this.logLevel = optionsKeyToLogLevel[this._optionsService.rawOptions.logLevel];\n }\n\n private _evalLazyOptionalParams(optionalParams: any[]): void {\n for (let i = 0; i < optionalParams.length; i++) {\n if (typeof optionalParams[i] === 'function') {\n optionalParams[i] = optionalParams[i]();\n }\n }\n }\n\n private _log(type: LogType, message: string, optionalParams: any[]): void {\n this._evalLazyOptionalParams(optionalParams);\n type.call(console, LOG_PREFIX + message, ...optionalParams);\n }\n\n public debug(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.DEBUG) {\n this._log(console.log, message, optionalParams);\n }\n }\n\n public info(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.INFO) {\n this._log(console.info, message, optionalParams);\n }\n }\n\n public warn(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.WARN) {\n this._log(console.warn, message, optionalParams);\n }\n }\n\n public error(message: string, ...optionalParams: any[]): void {\n if (this.logLevel <= LogLevelEnum.ERROR) {\n this._log(console.error, message, optionalParams);\n }\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IOptionsService, ITerminalOptions, FontWeight } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { isMac } from 'common/Platform';\nimport { CursorStyle, IDisposable } from 'common/Types';\nimport { Disposable } from 'common/Lifecycle';\n\nexport const DEFAULT_OPTIONS: Readonly<Required<ITerminalOptions>> = {\n cols: 80,\n rows: 24,\n cursorBlink: false,\n cursorStyle: 'block',\n cursorWidth: 1,\n customGlyphs: true,\n drawBoldTextInBrightColors: true,\n fastScrollModifier: 'alt',\n fastScrollSensitivity: 5,\n fontFamily: 'courier-new, courier, monospace',\n fontSize: 15,\n fontWeight: 'normal',\n fontWeightBold: 'bold',\n lineHeight: 1.0,\n letterSpacing: 0,\n linkHandler: null,\n logLevel: 'info',\n scrollback: 1000,\n scrollOnUserInput: true,\n scrollSensitivity: 1,\n screenReaderMode: false,\n smoothScrollDuration: 0,\n macOptionIsMeta: false,\n macOptionClickForcesSelection: false,\n minimumContrastRatio: 1,\n disableStdin: false,\n allowProposedApi: false,\n allowTransparency: false,\n tabStopWidth: 8,\n theme: {},\n rightClickSelectsWord: isMac,\n windowOptions: {},\n windowsMode: false,\n wordSeparator: ' ()[]{}\\',\"`',\n altClickMovesCursor: true,\n convertEol: false,\n termName: 'xterm',\n cancelEvents: false,\n overviewRulerWidth: 0\n};\n\nconst FONT_WEIGHT_OPTIONS: Extract<FontWeight, string>[] = ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'];\n\nexport class OptionsService extends Disposable implements IOptionsService {\n public serviceBrand: any;\n\n public readonly rawOptions: Required<ITerminalOptions>;\n public options: Required<ITerminalOptions>;\n\n private readonly _onOptionChange = this.register(new EventEmitter<keyof ITerminalOptions>());\n public readonly onOptionChange = this._onOptionChange.event;\n\n constructor(options: Partial<ITerminalOptions>) {\n super();\n // set the default value of each option\n const defaultOptions = { ...DEFAULT_OPTIONS };\n for (const key in options) {\n if (key in defaultOptions) {\n try {\n const newValue = options[key];\n defaultOptions[key] = this._sanitizeAndValidateOption(key, newValue);\n } catch (e) {\n console.error(e);\n }\n }\n }\n\n // set up getters and setters for each option\n this.rawOptions = defaultOptions;\n this.options = { ... defaultOptions };\n this._setupOptions();\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public onSpecificOptionChange<T extends keyof ITerminalOptions>(key: T, listener: (value: ITerminalOptions[T]) => any): IDisposable {\n return this.onOptionChange(eventKey => {\n if (eventKey === key) {\n listener(this.rawOptions[key]);\n }\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public onMultipleOptionChange(keys: (keyof ITerminalOptions)[], listener: () => any): IDisposable {\n return this.onOptionChange(eventKey => {\n if (keys.indexOf(eventKey) !== -1) {\n listener();\n }\n });\n }\n\n private _setupOptions(): void {\n const getter = (propName: string): any => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n return this.rawOptions[propName];\n };\n\n const setter = (propName: string, value: any): void => {\n if (!(propName in DEFAULT_OPTIONS)) {\n throw new Error(`No option with key \"${propName}\"`);\n }\n\n value = this._sanitizeAndValidateOption(propName, value);\n // Don't fire an option change event if they didn't change\n if (this.rawOptions[propName] !== value) {\n this.rawOptions[propName] = value;\n this._onOptionChange.fire(propName);\n }\n };\n\n for (const propName in this.rawOptions) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this.options, propName, desc);\n }\n }\n\n private _sanitizeAndValidateOption(key: string, value: any): any {\n switch (key) {\n case 'cursorStyle':\n if (!value) {\n value = DEFAULT_OPTIONS[key];\n }\n if (!isCursorStyle(value)) {\n throw new Error(`\"${value}\" is not a valid value for ${key}`);\n }\n break;\n case 'wordSeparator':\n if (!value) {\n value = DEFAULT_OPTIONS[key];\n }\n break;\n case 'fontWeight':\n case 'fontWeightBold':\n if (typeof value === 'number' && 1 <= value && value <= 1000) {\n // already valid numeric value\n break;\n }\n value = FONT_WEIGHT_OPTIONS.includes(value) ? value : DEFAULT_OPTIONS[key];\n break;\n case 'cursorWidth':\n value = Math.floor(value);\n // Fall through for bounds check\n case 'lineHeight':\n case 'tabStopWidth':\n if (value < 1) {\n throw new Error(`${key} cannot be less than 1, value: ${value}`);\n }\n break;\n case 'minimumContrastRatio':\n value = Math.max(1, Math.min(21, Math.round(value * 10) / 10));\n break;\n case 'scrollback':\n value = Math.min(value, 4294967295);\n if (value < 0) {\n throw new Error(`${key} cannot be less than 0, value: ${value}`);\n }\n break;\n case 'fastScrollSensitivity':\n case 'scrollSensitivity':\n if (value <= 0) {\n throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);\n }\n case 'rows':\n case 'cols':\n if (!value && value !== 0) {\n throw new Error(`${key} must be numeric, value: ${value}`);\n }\n break;\n }\n return value;\n }\n}\n\nfunction isCursorStyle(value: unknown): value is CursorStyle {\n return value === 'block' || value === 'underline' || value === 'bar';\n}\n","/**\n * Copyright (c) 2022 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IBufferService, IOscLinkService } from 'common/services/Services';\nimport { IMarker, IOscLinkData } from 'common/Types';\n\nexport class OscLinkService implements IOscLinkService {\n public serviceBrand: any;\n\n private _nextId = 1;\n\n /**\n * A map of the link key to link entry. This is used to add additional lines to links with ids.\n */\n private _entriesWithId: Map<string, IOscLinkEntryWithId> = new Map();\n\n /**\n * A map of the link id to the link entry. The \"link id\" (number) which is the numberic\n * representation of a unique link should not be confused with \"id\" (string) which comes in with\n * `id=` in the OSC link's properties.\n */\n private _dataByLinkId: Map<number, IOscLinkEntryNoId | IOscLinkEntryWithId> = new Map();\n\n constructor(\n @IBufferService private readonly _bufferService: IBufferService\n ) {\n }\n\n public registerLink(data: IOscLinkData): number {\n const buffer = this._bufferService.buffer;\n\n // Links with no id will only ever be registered a single time\n if (data.id === undefined) {\n const marker = buffer.addMarker(buffer.ybase + buffer.y);\n const entry: IOscLinkEntryNoId = {\n data,\n id: this._nextId++,\n lines: [marker]\n };\n marker.onDispose(() => this._removeMarkerFromLink(entry, marker));\n this._dataByLinkId.set(entry.id, entry);\n return entry.id;\n }\n\n // Add the line to the link if it already exists\n const castData = data as Required<IOscLinkData>;\n const key = this._getEntryIdKey(castData);\n const match = this._entriesWithId.get(key);\n if (match) {\n this.addLineToLink(match.id, buffer.ybase + buffer.y);\n return match.id;\n }\n\n // Create the link\n const marker = buffer.addMarker(buffer.ybase + buffer.y);\n const entry: IOscLinkEntryWithId = {\n id: this._nextId++,\n key: this._getEntryIdKey(castData),\n data: castData,\n lines: [marker]\n };\n marker.onDispose(() => this._removeMarkerFromLink(entry, marker));\n this._entriesWithId.set(entry.key, entry);\n this._dataByLinkId.set(entry.id, entry);\n return entry.id;\n }\n\n public addLineToLink(linkId: number, y: number): void {\n const entry = this._dataByLinkId.get(linkId);\n if (!entry) {\n return;\n }\n if (entry.lines.every(e => e.line !== y)) {\n const marker = this._bufferService.buffer.addMarker(y);\n entry.lines.push(marker);\n marker.onDispose(() => this._removeMarkerFromLink(entry, marker));\n }\n }\n\n public getLinkData(linkId: number): IOscLinkData | undefined {\n return this._dataByLinkId.get(linkId)?.data;\n }\n\n private _getEntryIdKey(linkData: Required<IOscLinkData>): string {\n return `${linkData.id};;${linkData.uri}`;\n }\n\n private _removeMarkerFromLink(entry: IOscLinkEntryNoId | IOscLinkEntryWithId, marker: IMarker): void {\n const index = entry.lines.indexOf(marker);\n if (index === -1) {\n return;\n }\n entry.lines.splice(index, 1);\n if (entry.lines.length === 0) {\n if (entry.data.id !== undefined) {\n this._entriesWithId.delete((entry as IOscLinkEntryWithId).key);\n }\n this._dataByLinkId.delete(entry.id);\n }\n }\n}\n\ninterface IOscLinkEntry<T extends IOscLinkData> {\n data: T;\n id: number;\n lines: IMarker[];\n}\n\ninterface IOscLinkEntryNoId extends IOscLinkEntry<IOscLinkData> {\n}\n\ninterface IOscLinkEntryWithId extends IOscLinkEntry<Required<IOscLinkData>> {\n key: string;\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n *\n * This was heavily inspired from microsoft/vscode's dependency injection system (MIT).\n */\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport { IServiceIdentifier } from 'common/services/Services';\n\nconst DI_TARGET = 'di$target';\nconst DI_DEPENDENCIES = 'di$dependencies';\n\nexport const serviceRegistry: Map<string, IServiceIdentifier<any>> = new Map();\n\nexport function getServiceDependencies(ctor: any): { id: IServiceIdentifier<any>, index: number, optional: boolean }[] {\n return ctor[DI_DEPENDENCIES] || [];\n}\n\nexport function createDecorator<T>(id: string): IServiceIdentifier<T> {\n if (serviceRegistry.has(id)) {\n return serviceRegistry.get(id)!;\n }\n\n const decorator: any = function (target: Function, key: string, index: number): any {\n if (arguments.length !== 3) {\n throw new Error('@IServiceName-decorator can only be used to decorate a parameter');\n }\n\n storeServiceDependency(decorator, target, index);\n };\n\n decorator.toString = () => id;\n\n serviceRegistry.set(id, decorator);\n return decorator;\n}\n\nfunction storeServiceDependency(id: Function, target: Function, index: number): void {\n if ((target as any)[DI_TARGET] === target) {\n (target as any)[DI_DEPENDENCIES].push({ id, index });\n } else {\n (target as any)[DI_DEPENDENCIES] = [{ id, index }];\n (target as any)[DI_TARGET] = target;\n }\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { IEvent, IEventEmitter } from 'common/EventEmitter';\nimport { IBuffer, IBufferSet } from 'common/buffer/Types';\nimport { IDecPrivateModes, ICoreMouseEvent, CoreMouseEncoding, ICoreMouseProtocol, CoreMouseEventType, ICharset, IWindowOptions, IModes, IAttributeData, ScrollSource, IDisposable, IColor, CursorStyle, IOscLinkData } from 'common/Types';\nimport { createDecorator } from 'common/services/ServiceRegistry';\nimport { IDecorationOptions, IDecoration, ILinkHandler } from 'xterm';\n\nexport const IBufferService = createDecorator<IBufferService>('BufferService');\nexport interface IBufferService {\n serviceBrand: undefined;\n\n readonly cols: number;\n readonly rows: number;\n readonly buffer: IBuffer;\n readonly buffers: IBufferSet;\n isUserScrolling: boolean;\n onResize: IEvent<{ cols: number, rows: number }>;\n onScroll: IEvent<number>;\n scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;\n scrollToBottom(): void;\n scrollToTop(): void;\n scrollToLine(line: number): void;\n scrollLines(disp: number, suppressScrollEvent?: boolean, source?: ScrollSource): void;\n scrollPages(pageCount: number): void;\n resize(cols: number, rows: number): void;\n reset(): void;\n}\n\nexport const ICoreMouseService = createDecorator<ICoreMouseService>('CoreMouseService');\nexport interface ICoreMouseService {\n activeProtocol: string;\n activeEncoding: string;\n areMouseEventsActive: boolean;\n addProtocol(name: string, protocol: ICoreMouseProtocol): void;\n addEncoding(name: string, encoding: CoreMouseEncoding): void;\n reset(): void;\n\n /**\n * Triggers a mouse event to be sent.\n *\n * Returns true if the event passed all protocol restrictions and a report\n * was sent, otherwise false. The return value may be used to decide whether\n * the default event action in the bowser component should be omitted.\n *\n * Note: The method will change values of the given event object\n * to fullfill protocol and encoding restrictions.\n */\n triggerMouseEvent(event: ICoreMouseEvent): boolean;\n\n /**\n * Event to announce changes in mouse tracking.\n */\n onProtocolChange: IEvent<CoreMouseEventType>;\n\n /**\n * Human readable version of mouse events.\n */\n explainEvents(events: CoreMouseEventType): { [event: string]: boolean };\n}\n\nexport const ICoreService = createDecorator<ICoreService>('CoreService');\nexport interface ICoreService {\n serviceBrand: undefined;\n\n /**\n * Initially the cursor will not be visible until the first time the terminal\n * is focused.\n */\n isCursorInitialized: boolean;\n isCursorHidden: boolean;\n\n readonly modes: IModes;\n readonly decPrivateModes: IDecPrivateModes;\n\n readonly onData: IEvent<string>;\n readonly onUserInput: IEvent<void>;\n readonly onBinary: IEvent<string>;\n readonly onRequestScrollToBottom: IEvent<void>;\n\n reset(): void;\n\n /**\n * Triggers the onData event in the public API.\n * @param data The data that is being emitted.\n * @param wasUserInput Whether the data originated from the user (as opposed to\n * resulting from parsing incoming data). When true this will also:\n * - Scroll to the bottom of the buffer if option scrollOnUserInput is true.\n * - Fire the `onUserInput` event (so selection can be cleared).\n */\n triggerDataEvent(data: string, wasUserInput?: boolean): void;\n\n /**\n * Triggers the onBinary event in the public API.\n * @param data The data that is being emitted.\n */\n triggerBinaryEvent(data: string): void;\n}\n\nexport const ICharsetService = createDecorator<ICharsetService>('CharsetService');\nexport interface ICharsetService {\n serviceBrand: undefined;\n\n charset: ICharset | undefined;\n readonly glevel: number;\n\n reset(): void;\n\n /**\n * Set the G level of the terminal.\n * @param g\n */\n setgLevel(g: number): void;\n\n /**\n * Set the charset for the given G level of the terminal.\n * @param g\n * @param charset\n */\n setgCharset(g: number, charset: ICharset | undefined): void;\n}\n\nexport interface IServiceIdentifier<T> {\n (...args: any[]): void;\n type: T;\n}\n\nexport interface IBrandedService {\n serviceBrand: undefined;\n}\n\ntype GetLeadingNonServiceArgs<Args> =\n Args extends [...IBrandedService[]] ? []\n : Args extends [infer A1, ...IBrandedService[]] ? [A1]\n : Args extends [infer A1, infer A2, ...IBrandedService[]] ? [A1, A2]\n : Args extends [infer A1, infer A2, infer A3, ...IBrandedService[]] ? [A1, A2, A3]\n : Args extends [infer A1, infer A2, infer A3, infer A4, ...IBrandedService[]] ? [A1, A2, A3, A4]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, ...IBrandedService[]] ? [A1, A2, A3, A4, A5]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7]\n : Args extends [infer A1, infer A2, infer A3, infer A4, infer A5, infer A6, infer A7, infer A8, ...IBrandedService[]] ? [A1, A2, A3, A4, A5, A6, A7, A8]\n : never;\n\nexport const IInstantiationService = createDecorator<IInstantiationService>('InstantiationService');\nexport interface IInstantiationService {\n serviceBrand: undefined;\n\n setService<T>(id: IServiceIdentifier<T>, instance: T): void;\n getService<T>(id: IServiceIdentifier<T>): T | undefined;\n createInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(t: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;\n}\n\nexport enum LogLevelEnum {\n DEBUG = 0,\n INFO = 1,\n WARN = 2,\n ERROR = 3,\n OFF = 4\n}\n\nexport const ILogService = createDecorator<ILogService>('LogService');\nexport interface ILogService {\n serviceBrand: undefined;\n\n logLevel: LogLevelEnum;\n\n debug(message: any, ...optionalParams: any[]): void;\n info(message: any, ...optionalParams: any[]): void;\n warn(message: any, ...optionalParams: any[]): void;\n error(message: any, ...optionalParams: any[]): void;\n}\n\nexport const IOptionsService = createDecorator<IOptionsService>('OptionsService');\nexport interface IOptionsService {\n serviceBrand: undefined;\n\n /**\n * Read only access to the raw options object, this is an internal-only fast path for accessing\n * single options without any validation as we trust TypeScript to enforce correct usage\n * internally.\n */\n readonly rawOptions: Required<ITerminalOptions>;\n\n /**\n * Options as exposed through the public API, this property uses getters and setters with\n * validation which makes it safer but slower. {@link rawOptions} should be used for pretty much\n * all internal usage for performance reasons.\n */\n readonly options: Required<ITerminalOptions>;\n\n /**\n * Adds an event listener for when any option changes.\n */\n readonly onOptionChange: IEvent<keyof ITerminalOptions>;\n\n /**\n * Adds an event listener for when a specific option changes, this is a convenience method that is\n * preferred over {@link onOptionChange} when only a single option is being listened to.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n onSpecificOptionChange<T extends keyof ITerminalOptions>(key: T, listener: (arg1: Required<ITerminalOptions>[T]) => any): IDisposable;\n\n /**\n * Adds an event listener for when a set of specific options change, this is a convenience method\n * that is preferred over {@link onOptionChange} when multiple options are being listened to and\n * handled the same way.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n onMultipleOptionChange(keys: (keyof ITerminalOptions)[], listener: () => any): IDisposable;\n}\n\nexport type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number;\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\nexport interface ITerminalOptions {\n allowProposedApi?: boolean;\n allowTransparency?: boolean;\n altClickMovesCursor?: boolean;\n cols?: number;\n convertEol?: boolean;\n cursorBlink?: boolean;\n cursorStyle?: CursorStyle;\n cursorWidth?: number;\n customGlyphs?: boolean;\n disableStdin?: boolean;\n drawBoldTextInBrightColors?: boolean;\n fastScrollModifier?: 'none' | 'alt' | 'ctrl' | 'shift';\n fastScrollSensitivity?: number;\n fontSize?: number;\n fontFamily?: string;\n fontWeight?: FontWeight;\n fontWeightBold?: FontWeight;\n letterSpacing?: number;\n lineHeight?: number;\n linkHandler?: ILinkHandler | null;\n logLevel?: LogLevel;\n macOptionIsMeta?: boolean;\n macOptionClickForcesSelection?: boolean;\n minimumContrastRatio?: number;\n rightClickSelectsWord?: boolean;\n rows?: number;\n screenReaderMode?: boolean;\n scrollback?: number;\n scrollOnUserInput?: boolean;\n scrollSensitivity?: number;\n smoothScrollDuration?: number;\n tabStopWidth?: number;\n theme?: ITheme;\n windowsMode?: boolean;\n windowOptions?: IWindowOptions;\n wordSeparator?: string;\n overviewRulerWidth?: number;\n\n [key: string]: any;\n cancelEvents: boolean;\n termName: string;\n}\n\nexport interface ITheme {\n foreground?: string;\n background?: string;\n cursor?: string;\n cursorAccent?: string;\n selectionForeground?: string;\n selectionBackground?: string;\n selectionInactiveBackground?: string;\n black?: string;\n red?: string;\n green?: string;\n yellow?: string;\n blue?: string;\n magenta?: string;\n cyan?: string;\n white?: string;\n brightBlack?: string;\n brightRed?: string;\n brightGreen?: string;\n brightYellow?: string;\n brightBlue?: string;\n brightMagenta?: string;\n brightCyan?: string;\n brightWhite?: string;\n extendedAnsi?: string[];\n}\n\nexport const IOscLinkService = createDecorator<IOscLinkService>('OscLinkService');\nexport interface IOscLinkService {\n serviceBrand: undefined;\n /**\n * Registers a link to the service, returning the link ID. The link data is managed by this\n * service and will be freed when this current cursor position is trimmed off the buffer.\n */\n registerLink(linkData: IOscLinkData): number;\n /**\n * Adds a line to a link if needed.\n */\n addLineToLink(linkId: number, y: number): void;\n /** Get the link data associated with a link ID. */\n getLinkData(linkId: number): IOscLinkData | undefined;\n}\n\nexport const IUnicodeService = createDecorator<IUnicodeService>('UnicodeService');\nexport interface IUnicodeService {\n serviceBrand: undefined;\n /** Register an Unicode version provider. */\n register(provider: IUnicodeVersionProvider): void;\n /** Registered Unicode versions. */\n readonly versions: string[];\n /** Currently active version. */\n activeVersion: string;\n /** Event triggered, when activate version changed. */\n readonly onChange: IEvent<string>;\n\n /**\n * Unicode version dependent\n */\n wcwidth(codepoint: number): number;\n getStringCellWidth(s: string): number;\n}\n\nexport interface IUnicodeVersionProvider {\n readonly version: string;\n wcwidth(ucs: number): 0 | 1 | 2;\n}\n\nexport const IDecorationService = createDecorator<IDecorationService>('DecorationService');\nexport interface IDecorationService extends IDisposable {\n serviceBrand: undefined;\n readonly decorations: IterableIterator<IInternalDecoration>;\n readonly onDecorationRegistered: IEvent<IInternalDecoration>;\n readonly onDecorationRemoved: IEvent<IInternalDecoration>;\n registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined;\n reset(): void;\n /**\n * Trigger a callback over the decoration at a cell (in no particular order). This uses a callback\n * instead of an iterator as it's typically used in hot code paths.\n */\n forEachDecorationAtCell(x: number, line: number, layer: 'bottom' | 'top' | undefined, callback: (decoration: IInternalDecoration) => void): void;\n}\nexport interface IInternalDecoration extends IDecoration {\n readonly options: IDecorationOptions;\n readonly backgroundColorRGB: IColor | undefined;\n readonly foregroundColorRGB: IColor | undefined;\n readonly onRenderEmitter: IEventEmitter<HTMLElement>;\n}\n","/**\n * Copyright (c) 2019 The xterm.js authors. All rights reserved.\n * @license MIT\n */\nimport { IUnicodeService, IUnicodeVersionProvider } from 'common/services/Services';\nimport { EventEmitter, IEvent } from 'common/EventEmitter';\nimport { UnicodeV6 } from 'common/input/UnicodeV6';\n\nexport class UnicodeService implements IUnicodeService {\n public serviceBrand: any;\n\n private _providers: {[key: string]: IUnicodeVersionProvider} = Object.create(null);\n private _active: string = '';\n private _activeProvider: IUnicodeVersionProvider;\n\n private readonly _onChange = new EventEmitter<string>();\n public readonly onChange = this._onChange.event;\n\n constructor() {\n const defaultProvider = new UnicodeV6();\n this.register(defaultProvider);\n this._active = defaultProvider.version;\n this._activeProvider = defaultProvider;\n }\n\n public dispose(): void {\n this._onChange.dispose();\n }\n\n public get versions(): string[] {\n return Object.keys(this._providers);\n }\n\n public get activeVersion(): string {\n return this._active;\n }\n\n public set activeVersion(version: string) {\n if (!this._providers[version]) {\n throw new Error(`unknown Unicode version \"${version}\"`);\n }\n this._active = version;\n this._activeProvider = this._providers[version];\n this._onChange.fire(version);\n }\n\n public register(provider: IUnicodeVersionProvider): void {\n this._providers[provider.version] = provider;\n }\n\n /**\n * Unicode version dependent interface.\n */\n public wcwidth(num: number): number {\n return this._activeProvider.wcwidth(num);\n }\n\n public getStringCellWidth(s: string): number {\n let result = 0;\n const length = s.length;\n for (let i = 0; i < length; ++i) {\n let code = s.charCodeAt(i);\n // surrogate pair first\n if (0xD800 <= code && code <= 0xDBFF) {\n if (++i >= length) {\n // this should not happen with strings retrieved from\n // Buffer.translateToString as it converts from UTF-32\n // and therefore always should contain the second part\n // for any other string we still have to handle it somehow:\n // simply treat the lonely surrogate first as a single char (UCS-2 behavior)\n return result + this.wcwidth(code);\n }\n const second = s.charCodeAt(i);\n // convert surrogate pair to high codepoint only for valid second part (UTF-16)\n // otherwise treat them independently (UCS-2 behavior)\n if (0xDC00 <= second && second <= 0xDFFF) {\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n } else {\n result += this.wcwidth(second);\n }\n }\n result += this.wcwidth(code);\n }\n return result;\n }\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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Copyright (c) 2018 The xterm.js authors. All rights reserved.\n * @license MIT\n */\n\nimport { Terminal as ITerminalApi, IMarker, IDisposable, ILocalizableStrings, ITerminalAddon, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, IModes, IDecorationOptions, IDecoration } from 'xterm';\nimport { IBufferRange, ITerminal } from 'browser/Types';\nimport { Terminal as TerminalCore } from 'browser/Terminal';\nimport * as Strings from 'browser/LocalizableStrings';\nimport { IEvent } from 'common/EventEmitter';\nimport { ParserApi } from 'common/public/ParserApi';\nimport { UnicodeApi } from 'common/public/UnicodeApi';\nimport { AddonManager } from 'common/public/AddonManager';\nimport { BufferNamespaceApi } from 'common/public/BufferNamespaceApi';\nimport { ITerminalOptions } from 'common/Types';\n\n/**\n * The set of options that only have an effect when set in the Terminal constructor.\n */\nconst CONSTRUCTOR_ONLY_OPTIONS = ['cols', 'rows'];\n\nexport class Terminal implements ITerminalApi {\n private _core: ITerminal;\n private _addonManager: AddonManager;\n private _parser: IParser | undefined;\n private _buffer: BufferNamespaceApi | undefined;\n private _publicOptions: Required<ITerminalOptions>;\n\n constructor(options?: ITerminalOptions) {\n this._core = new TerminalCore(options);\n this._addonManager = new AddonManager();\n\n this._publicOptions = { ... this._core.options };\n const getter = (propName: string): any => {\n return this._core.options[propName];\n };\n const setter = (propName: string, value: any): void => {\n this._checkReadonlyOptions(propName);\n this._core.options[propName] = value;\n };\n\n for (const propName in this._core.options) {\n const desc = {\n get: getter.bind(this, propName),\n set: setter.bind(this, propName)\n };\n Object.defineProperty(this._publicOptions, propName, desc);\n }\n }\n\n private _checkReadonlyOptions(propName: string): void {\n // Throw an error if any constructor only option is modified\n // from terminal.options\n // Modifications from anywhere else are allowed\n if (CONSTRUCTOR_ONLY_OPTIONS.includes(propName)) {\n throw new Error(`Option \"${propName}\" can only be set in the constructor`);\n }\n }\n\n private _checkProposedApi(): void {\n if (!this._core.optionsService.rawOptions.allowProposedApi) {\n throw new Error('You must set the allowProposedApi option to true to use proposed API');\n }\n }\n\n public get onBell(): IEvent<void> { return this._core.onBell; }\n public get onBinary(): IEvent<string> { return this._core.onBinary; }\n public get onCursorMove(): IEvent<void> { return this._core.onCursorMove; }\n public get onData(): IEvent<string> { return this._core.onData; }\n public get onKey(): IEvent<{ key: string, domEvent: KeyboardEvent }> { return this._core.onKey; }\n public get onLineFeed(): IEvent<void> { return this._core.onLineFeed; }\n public get onRender(): IEvent<{ start: number, end: number }> { return this._core.onRender; }\n public get onResize(): IEvent<{ cols: number, rows: number }> { return this._core.onResize; }\n public get onScroll(): IEvent<number> { return this._core.onScroll; }\n public get onSelectionChange(): IEvent<void> { return this._core.onSelectionChange; }\n public get onTitleChange(): IEvent<string> { return this._core.onTitleChange; }\n public get onWriteParsed(): IEvent<void> { return this._core.onWriteParsed; }\n\n public get element(): HTMLElement | undefined { return this._core.element; }\n public get parser(): IParser {\n if (!this._parser) {\n this._parser = new ParserApi(this._core);\n }\n return this._parser;\n }\n public get unicode(): IUnicodeHandling {\n this._checkProposedApi();\n return new UnicodeApi(this._core);\n }\n public get textarea(): HTMLTextAreaElement | undefined { return this._core.textarea; }\n public get rows(): number { return this._core.rows; }\n public get cols(): number { return this._core.cols; }\n public get buffer(): IBufferNamespaceApi {\n if (!this._buffer) {\n this._buffer = new BufferNamespaceApi(this._core);\n }\n return this._buffer;\n }\n public get markers(): ReadonlyArray<IMarker> {\n this._checkProposedApi();\n return this._core.markers;\n }\n public get modes(): IModes {\n const m = this._core.coreService.decPrivateModes;\n let mouseTrackingMode: 'none' | 'x10' | 'vt200' | 'drag' | 'any' = 'none';\n switch (this._core.coreMouseService.activeProtocol) {\n case 'X10': mouseTrackingMode = 'x10'; break;\n case 'VT200': mouseTrackingMode = 'vt200'; break;\n case 'DRAG': mouseTrackingMode = 'drag'; break;\n case 'ANY': mouseTrackingMode = 'any'; break;\n }\n return {\n applicationCursorKeysMode: m.applicationCursorKeys,\n applicationKeypadMode: m.applicationKeypad,\n bracketedPasteMode: m.bracketedPasteMode,\n insertMode: this._core.coreService.modes.insertMode,\n mouseTrackingMode: mouseTrackingMode,\n originMode: m.origin,\n reverseWraparoundMode: m.reverseWraparound,\n sendFocusMode: m.sendFocus,\n wraparoundMode: m.wraparound\n };\n }\n public get options(): Required<ITerminalOptions> {\n return this._publicOptions;\n }\n public set options(options: ITerminalOptions) {\n for (const propName in options) {\n this._publicOptions[propName] = options[propName];\n }\n }\n public blur(): void {\n this._core.blur();\n }\n public focus(): void {\n this._core.focus();\n }\n public resize(columns: number, rows: number): void {\n this._verifyIntegers(columns, rows);\n this._core.resize(columns, rows);\n }\n public open(parent: HTMLElement): void {\n this._core.open(parent);\n }\n public attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void {\n this._core.attachCustomKeyEventHandler(customKeyEventHandler);\n }\n public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {\n return this._core.registerLinkProvider(linkProvider);\n }\n public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {\n this._checkProposedApi();\n return this._core.registerCharacterJoiner(handler);\n }\n public deregisterCharacterJoiner(joinerId: number): void {\n this._checkProposedApi();\n this._core.deregisterCharacterJoiner(joinerId);\n }\n public registerMarker(cursorYOffset: number = 0): IMarker | undefined {\n this._verifyIntegers(cursorYOffset);\n return this._core.addMarker(cursorYOffset);\n }\n public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined {\n this._checkProposedApi();\n this._verifyPositiveIntegers(decorationOptions.x ?? 0, decorationOptions.width ?? 0, decorationOptions.height ?? 0);\n return this._core.registerDecoration(decorationOptions);\n }\n public hasSelection(): boolean {\n return this._core.hasSelection();\n }\n public select(column: number, row: number, length: number): void {\n this._verifyIntegers(column, row, length);\n this._core.select(column, row, length);\n }\n public getSelection(): string {\n return this._core.getSelection();\n }\n public getSelectionPosition(): IBufferRange | undefined {\n return this._core.getSelectionPosition();\n }\n public clearSelection(): void {\n this._core.clearSelection();\n }\n public selectAll(): void {\n this._core.selectAll();\n }\n public selectLines(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.selectLines(start, end);\n }\n public dispose(): void {\n this._addonManager.dispose();\n this._core.dispose();\n }\n public scrollLines(amount: number): void {\n this._verifyIntegers(amount);\n this._core.scrollLines(amount);\n }\n public scrollPages(pageCount: number): void {\n this._verifyIntegers(pageCount);\n this._core.scrollPages(pageCount);\n }\n public scrollToTop(): void {\n this._core.scrollToTop();\n }\n public scrollToBottom(): void {\n this._core.scrollToBottom();\n }\n public scrollToLine(line: number): void {\n this._verifyIntegers(line);\n this._core.scrollToLine(line);\n }\n public clear(): void {\n this._core.clear();\n }\n public write(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data, callback);\n }\n public writeln(data: string | Uint8Array, callback?: () => void): void {\n this._core.write(data);\n this._core.write('\\r\\n', callback);\n }\n public paste(data: string): void {\n this._core.paste(data);\n }\n public refresh(start: number, end: number): void {\n this._verifyIntegers(start, end);\n this._core.refresh(start, end);\n }\n public reset(): void {\n this._core.reset();\n }\n public clearTextureAtlas(): void {\n this._core.clearTextureAtlas();\n }\n public loadAddon(addon: ITerminalAddon): void {\n return this._addonManager.loadAddon(this, addon);\n }\n public static get strings(): ILocalizableStrings {\n return Strings;\n }\n\n private _verifyIntegers(...values: number[]): void {\n for (const value of values) {\n if (value === Infinity || isNaN(value) || value % 1 !== 0) {\n throw new Error('This API only accepts integers');\n }\n }\n }\n\n private _verifyPositiveIntegers(...values: number[]): void {\n for (const value of values) {\n if (value && (value === Infinity || isNaN(value) || value % 1 !== 0 || value < 0)) {\n throw new Error('This API only accepts positive integers');\n }\n }\n }\n}\n","function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n return self;\n}\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\nfunction _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n } else {\n module.exports = _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) setPrototypeOf(instance, Class.prototype);\n return instance;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n }\n return _construct.apply(null, arguments);\n}\nmodule.exports = _construct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n var F = function F() {};\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\nmodule.exports = _createForOfIteratorHelper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\nvar isNativeReflectConstruct = require(\"./isNativeReflectConstruct.js\");\nvar possibleConstructorReturn = require(\"./possibleConstructorReturn.js\");\nfunction _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}\nmodule.exports = _createSuper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var superPropBase = require(\"./superPropBase.js\");\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n return desc.value;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n }\n return _get.apply(this, arguments);\n}\nmodule.exports = _get, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}\nmodule.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _iterableToArrayLimit(arr, i) {\n var _i = null == arr ? null : \"undefined\" != typeof Symbol && arr[Symbol.iterator] || arr[\"@@iterator\"];\n if (null != _i) {\n var _s,\n _e,\n _x,\n _r,\n _arr = [],\n _n = !0,\n _d = !1;\n try {\n if (_x = (_i = _i.call(arr)).next, 0 === i) {\n if (Object(_i) !== _i) return;\n _n = !1;\n } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);\n } catch (err) {\n _d = !0, _e = err;\n } finally {\n try {\n if (!_n && null != _i[\"return\"] && (_r = _i[\"return\"](), Object(_r) !== _r)) return;\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n}\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n defineProperty = Object.defineProperty || function (obj, key, desc) {\n obj[key] = desc.value;\n },\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return defineProperty(generator, \"_invoke\", {\n value: makeInvokeMethod(innerFn, self, context)\n }), generator;\n }\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n exports.wrap = wrap;\n var ContinueSentinel = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n reject(record.arg);\n }\n var previousPromise;\n defineProperty(this, \"_invoke\", {\n value: function value(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }\n function maybeInvokeDelegate(delegate, context) {\n var methodName = context.method,\n method = delegate.iterator[methodName];\n if (undefined === method) return context.delegate = null, \"throw\" === methodName && delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method) || \"return\" !== methodName && (context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a '\" + methodName + \"' method\")), ContinueSentinel;\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n return next.value = undefined, next.done = !0, next;\n };\n return next.next = next;\n }\n }\n return {\n next: doneResult\n };\n }\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), defineProperty(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (val) {\n var object = Object(val),\n keys = [];\n for (var key in object) keys.push(key);\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithHoles = require(\"./arrayWithHoles.js\");\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableRest = require(\"./nonIterableRest.js\");\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n return object;\n}\nmodule.exports = _superPropBase, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayWithoutHoles = require(\"./arrayWithoutHoles.js\");\nvar iterableToArray = require(\"./iterableToArray.js\");\nvar unsupportedIterableToArray = require(\"./unsupportedIterableToArray.js\");\nvar nonIterableSpread = require(\"./nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nmodule.exports = _toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nmodule.exports = _toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var arrayLikeToArray = require(\"./arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import './form-control.css';\nexport default {\n \"formControl\": \"pf-c-form-control\",\n \"modifiers\": {\n \"success\": \"pf-m-success\",\n \"plain\": \"pf-m-plain\",\n \"expanded\": \"pf-m-expanded\",\n \"icon\": \"pf-m-icon\",\n \"warning\": \"pf-m-warning\",\n \"search\": \"pf-m-search\",\n \"calendar\": \"pf-m-calendar\",\n \"clock\": \"pf-m-clock\",\n \"iconSprite\": \"pf-m-icon-sprite\",\n \"placeholder\": \"pf-m-placeholder\",\n \"resizeVertical\": \"pf-m-resize-vertical\",\n \"resizeHorizontal\": \"pf-m-resize-horizontal\"\n },\n \"themeDark\": \"pf-theme-dark\"\n};","import './toolbar.css';\nexport default {\n \"button\": \"pf-c-button\",\n \"chipGroup\": \"pf-c-chip-group\",\n \"divider\": \"pf-c-divider\",\n \"modifiers\": {\n \"hidden\": \"pf-m-hidden\",\n \"hiddenOnSm\": \"pf-m-hidden-on-sm\",\n \"visibleOnSm\": \"pf-m-visible-on-sm\",\n \"hiddenOnMd\": \"pf-m-hidden-on-md\",\n \"visibleOnMd\": \"pf-m-visible-on-md\",\n \"hiddenOnLg\": \"pf-m-hidden-on-lg\",\n \"visibleOnLg\": \"pf-m-visible-on-lg\",\n \"hiddenOnXl\": \"pf-m-hidden-on-xl\",\n \"visibleOnXl\": \"pf-m-visible-on-xl\",\n \"hiddenOn_2xl\": \"pf-m-hidden-on-2xl\",\n \"visibleOn_2xl\": \"pf-m-visible-on-2xl\",\n \"pageInsets\": \"pf-m-page-insets\",\n \"sticky\": \"pf-m-sticky\",\n \"fullHeight\": \"pf-m-full-height\",\n \"static\": \"pf-m-static\",\n \"vertical\": \"pf-m-vertical\",\n \"buttonGroup\": \"pf-m-button-group\",\n \"iconButtonGroup\": \"pf-m-icon-button-group\",\n \"filterGroup\": \"pf-m-filter-group\",\n \"toggleGroup\": \"pf-m-toggle-group\",\n \"overflowMenu\": \"pf-m-overflow-menu\",\n \"bulkSelect\": \"pf-m-bulk-select\",\n \"expandAll\": \"pf-m-expand-all\",\n \"expanded\": \"pf-m-expanded\",\n \"searchFilter\": \"pf-m-search-filter\",\n \"chipGroup\": \"pf-m-chip-group\",\n \"label\": \"pf-m-label\",\n \"pagination\": \"pf-m-pagination\",\n \"overflowContainer\": \"pf-m-overflow-container\",\n \"chipContainer\": \"pf-m-chip-container\",\n \"plain\": \"pf-m-plain\",\n \"show\": \"pf-m-show\",\n \"showOnSm\": \"pf-m-show-on-sm\",\n \"showOnMd\": \"pf-m-show-on-md\",\n \"showOnLg\": \"pf-m-show-on-lg\",\n \"showOnXl\": \"pf-m-show-on-xl\",\n \"showOn_2xl\": \"pf-m-show-on-2xl\",\n \"alignRight\": \"pf-m-align-right\",\n \"alignLeft\": \"pf-m-align-left\",\n \"nowrap\": \"pf-m-nowrap\",\n \"wrap\": \"pf-m-wrap\",\n \"alignRightOnSm\": \"pf-m-align-right-on-sm\",\n \"alignLeftOnSm\": \"pf-m-align-left-on-sm\",\n \"nowrapOnSm\": \"pf-m-nowrap-on-sm\",\n \"wrapOnSm\": \"pf-m-wrap-on-sm\",\n \"alignRightOnMd\": \"pf-m-align-right-on-md\",\n \"alignLeftOnMd\": \"pf-m-align-left-on-md\",\n \"nowrapOnMd\": \"pf-m-nowrap-on-md\",\n \"wrapOnMd\": \"pf-m-wrap-on-md\",\n \"alignRightOnLg\": \"pf-m-align-right-on-lg\",\n \"alignLeftOnLg\": \"pf-m-align-left-on-lg\",\n \"nowrapOnLg\": \"pf-m-nowrap-on-lg\",\n \"wrapOnLg\": \"pf-m-wrap-on-lg\",\n \"alignRightOnXl\": \"pf-m-align-right-on-xl\",\n \"alignLeftOnXl\": \"pf-m-align-left-on-xl\",\n \"nowrapOnXl\": \"pf-m-nowrap-on-xl\",\n \"wrapOnXl\": \"pf-m-wrap-on-xl\",\n \"alignRightOn_2xl\": \"pf-m-align-right-on-2xl\",\n \"alignLeftOn_2xl\": \"pf-m-align-left-on-2xl\",\n \"nowrapOn_2xl\": \"pf-m-nowrap-on-2xl\",\n \"wrapOn_2xl\": \"pf-m-wrap-on-2xl\",\n \"spaceItemsNone\": \"pf-m-space-items-none\",\n \"spaceItemsSm\": \"pf-m-space-items-sm\",\n \"spaceItemsMd\": \"pf-m-space-items-md\",\n \"spaceItemsLg\": \"pf-m-space-items-lg\",\n \"spaceItemsNoneOnSm\": \"pf-m-space-items-none-on-sm\",\n \"spaceItemsSmOnSm\": \"pf-m-space-items-sm-on-sm\",\n \"spaceItemsMdOnSm\": \"pf-m-space-items-md-on-sm\",\n \"spaceItemsLgOnSm\": \"pf-m-space-items-lg-on-sm\",\n \"spaceItemsNoneOnMd\": \"pf-m-space-items-none-on-md\",\n \"spaceItemsSmOnMd\": \"pf-m-space-items-sm-on-md\",\n \"spaceItemsMdOnMd\": \"pf-m-space-items-md-on-md\",\n \"spaceItemsLgOnMd\": \"pf-m-space-items-lg-on-md\",\n \"spaceItemsNoneOnLg\": \"pf-m-space-items-none-on-lg\",\n \"spaceItemsSmOnLg\": \"pf-m-space-items-sm-on-lg\",\n \"spaceItemsMdOnLg\": \"pf-m-space-items-md-on-lg\",\n \"spaceItemsLgOnLg\": \"pf-m-space-items-lg-on-lg\",\n \"spaceItemsNoneOnXl\": \"pf-m-space-items-none-on-xl\",\n \"spaceItemsSmOnXl\": \"pf-m-space-items-sm-on-xl\",\n \"spaceItemsMdOnXl\": \"pf-m-space-items-md-on-xl\",\n \"spaceItemsLgOnXl\": \"pf-m-space-items-lg-on-xl\",\n \"spaceItemsNoneOn_2xl\": \"pf-m-space-items-none-on-2xl\",\n \"spaceItemsSmOn_2xl\": \"pf-m-space-items-sm-on-2xl\",\n \"spaceItemsMdOn_2xl\": \"pf-m-space-items-md-on-2xl\",\n \"spaceItemsLgOn_2xl\": \"pf-m-space-items-lg-on-2xl\",\n \"spacerNone\": \"pf-m-spacer-none\",\n \"spacerSm\": \"pf-m-spacer-sm\",\n \"spacerMd\": \"pf-m-spacer-md\",\n \"spacerLg\": \"pf-m-spacer-lg\",\n \"spacerNoneOnSm\": \"pf-m-spacer-none-on-sm\",\n \"spacerSmOnSm\": \"pf-m-spacer-sm-on-sm\",\n \"spacerMdOnSm\": \"pf-m-spacer-md-on-sm\",\n \"spacerLgOnSm\": \"pf-m-spacer-lg-on-sm\",\n \"spacerNoneOnMd\": \"pf-m-spacer-none-on-md\",\n \"spacerSmOnMd\": \"pf-m-spacer-sm-on-md\",\n \"spacerMdOnMd\": \"pf-m-spacer-md-on-md\",\n \"spacerLgOnMd\": \"pf-m-spacer-lg-on-md\",\n \"spacerNoneOnLg\": \"pf-m-spacer-none-on-lg\",\n \"spacerSmOnLg\": \"pf-m-spacer-sm-on-lg\",\n \"spacerMdOnLg\": \"pf-m-spacer-md-on-lg\",\n \"spacerLgOnLg\": \"pf-m-spacer-lg-on-lg\",\n \"spacerNoneOnXl\": \"pf-m-spacer-none-on-xl\",\n \"spacerSmOnXl\": \"pf-m-spacer-sm-on-xl\",\n \"spacerMdOnXl\": \"pf-m-spacer-md-on-xl\",\n \"spacerLgOnXl\": \"pf-m-spacer-lg-on-xl\",\n \"spacerNoneOn_2xl\": \"pf-m-spacer-none-on-2xl\",\n \"spacerSmOn_2xl\": \"pf-m-spacer-sm-on-2xl\",\n \"spacerMdOn_2xl\": \"pf-m-spacer-md-on-2xl\",\n \"spacerLgOn_2xl\": \"pf-m-spacer-lg-on-2xl\",\n \"insetNone\": \"pf-m-inset-none\",\n \"insetSm\": \"pf-m-inset-sm\",\n \"insetMd\": \"pf-m-inset-md\",\n \"insetLg\": \"pf-m-inset-lg\",\n \"insetXl\": \"pf-m-inset-xl\",\n \"inset_2xl\": \"pf-m-inset-2xl\",\n \"insetNoneOnSm\": \"pf-m-inset-none-on-sm\",\n \"insetSmOnSm\": \"pf-m-inset-sm-on-sm\",\n \"insetMdOnSm\": \"pf-m-inset-md-on-sm\",\n \"insetLgOnSm\": \"pf-m-inset-lg-on-sm\",\n \"insetXlOnSm\": \"pf-m-inset-xl-on-sm\",\n \"inset_2xlOnSm\": \"pf-m-inset-2xl-on-sm\",\n \"insetNoneOnMd\": \"pf-m-inset-none-on-md\",\n \"insetSmOnMd\": \"pf-m-inset-sm-on-md\",\n \"insetMdOnMd\": \"pf-m-inset-md-on-md\",\n \"insetLgOnMd\": \"pf-m-inset-lg-on-md\",\n \"insetXlOnMd\": \"pf-m-inset-xl-on-md\",\n \"inset_2xlOnMd\": \"pf-m-inset-2xl-on-md\",\n \"insetNoneOnLg\": \"pf-m-inset-none-on-lg\",\n \"insetSmOnLg\": \"pf-m-inset-sm-on-lg\",\n \"insetMdOnLg\": \"pf-m-inset-md-on-lg\",\n \"insetLgOnLg\": \"pf-m-inset-lg-on-lg\",\n \"insetXlOnLg\": \"pf-m-inset-xl-on-lg\",\n \"inset_2xlOnLg\": \"pf-m-inset-2xl-on-lg\",\n \"insetNoneOnXl\": \"pf-m-inset-none-on-xl\",\n \"insetSmOnXl\": \"pf-m-inset-sm-on-xl\",\n \"insetMdOnXl\": \"pf-m-inset-md-on-xl\",\n \"insetLgOnXl\": \"pf-m-inset-lg-on-xl\",\n \"insetXlOnXl\": \"pf-m-inset-xl-on-xl\",\n \"inset_2xlOnXl\": \"pf-m-inset-2xl-on-xl\",\n \"insetNoneOn_2xl\": \"pf-m-inset-none-on-2xl\",\n \"insetSmOn_2xl\": \"pf-m-inset-sm-on-2xl\",\n \"insetMdOn_2xl\": \"pf-m-inset-md-on-2xl\",\n \"insetLgOn_2xl\": \"pf-m-inset-lg-on-2xl\",\n \"insetXlOn_2xl\": \"pf-m-inset-xl-on-2xl\",\n \"inset_2xlOn_2xl\": \"pf-m-inset-2xl-on-2xl\"\n },\n \"pagination\": \"pf-c-pagination\",\n \"toolbar\": \"pf-c-toolbar\",\n \"toolbarContent\": \"pf-c-toolbar__content\",\n \"toolbarContentSection\": \"pf-c-toolbar__content-section\",\n \"toolbarExpandAllIcon\": \"pf-c-toolbar__expand-all-icon\",\n \"toolbarExpandableContent\": \"pf-c-toolbar__expandable-content\",\n \"toolbarGroup\": \"pf-c-toolbar__group\",\n \"toolbarItem\": \"pf-c-toolbar__item\",\n \"toolbarToggle\": \"pf-c-toolbar__toggle\"\n};"],"names":["spinnerSize","Spinner","_a","className","_a$className","_a$size","size","_a$ariaValuetext","ariaValueText","_a$isSVG","isSVG","diameter","_a$isInline","isInline","ariaLabel","ariaLabelledBy","props","__rest","Component","React","Object","assign","css","styles","spinner","modifiers","inline","role","viewBox","style","spinnerPath","cx","cy","r","fill","spinnerClipper","spinnerLeadBall","spinnerTailBall","displayName","ButtonVariant","ButtonType","Badge","isRead","_a$isRead","_a$children","children","screenReaderText","read","unread","ButtonBase","_a$component","component","_a$isActive","isActive","_a$isBlock","isBlock","_a$isDisabled","isDisabled","_a$isAriaDisabled","isAriaDisabled","_a$isLoading","isLoading","_a$isDanger","isDanger","spinnerAriaValueText","spinnerAriaLabelledBy","spinnerAriaLabel","_a$isSmall","isSmall","_a$isLarge","isLarge","_a$inoperableEvents","inoperableEvents","_a$type","type","button","_a$variant","variant","primary","_a$iconPosition","iconPosition","_a$ariaLabel","_a$icon","icon","ouiaId","_a$ouiaSafe","ouiaSafe","_a$tabIndex","tabIndex","innerRef","countOptions","ouiaProps","useOUIAProps","Button","isButtonElement","isInlineSpan","preventedEvents","reduce","handlers","eventToPrevent","_defineProperty","event","preventDefault","block","disabled","ariaDisabled","active","link","secondary","danger","progress","inProgress","small","displayLg","ref","buttonProgress","md","plain","buttonIcon","start","end","buttonCount","count","FormSelect","_React$Component","_inherits","_super","_createSuper","_this","_classCallCheck","call","handleChange","onChange","currentTarget","value","id","console","error","state","ouiaStateId","getDefaultOUIAId","validated","_createClass","key","this","isRequired","isIconSprite","selectedOption","toArray","find","option","isSelectedPlaceholder","isPlaceholder","formControl","iconSprite","ValidatedOptions","success","warning","placeholder","getOUIAProps","undefined","required","defaultProps","onBlur","onFocus","FormSelectOption","_a$value","label","candidateSelectors","candidateSelector","join","NoElement","Element","matches","prototype","msMatchesSelector","webkitMatchesSelector","getRootNode","element","ownerDocument","getCandidates","el","includeContainer","filter","candidates","Array","slice","apply","querySelectorAll","unshift","getCandidatesIteratively","elements","options","elementsToCheck","from","length","shift","tagName","assigned","assignedElements","nestedCandidates","flatten","push","scope","includes","shadowRoot","getShadowRoot","validShadowRoot","shadowRootFilter","_nestedCandidates","getTabindex","node","isScope","test","isContentEditable","isNaN","parseInt","getAttribute","sortOrderedTabbables","a","b","documentOrder","isInput","isNonTabbableRadio","isRadio","name","radioSet","radioScope","form","queryRadios","window","CSS","escape","err","message","checked","nodes","i","getCheckedRadio","isTabbableRadio","isZeroArea","_node$getBoundingClie","getBoundingClientRect","width","height","isNodeMatchingSelectorFocusable","isHiddenInput","_ref","displayCheck","getComputedStyle","visibility","nodeUnderDetails","parentElement","nodeRootHost","host","nodeIsAttached","contains","originalNode","rootNode","assignedSlot","getClientRects","isHidden","some","child","isDetailsWithSummary","parentNode","item","isDisabledFromFieldset","isNodeMatchingSelectorTabbable","isValidShadowRootTabbable","shadowHostNode","sortByOrder","regularTabbables","orderedTabbables","forEach","candidateTabindex","content","sort","acc","sortable","concat","tabbable","bind","isTabbable","Error","focusableCandidateSelector","isFocusable","activeFocusTraps","trapQueue","activateTrap","trap","activeTrap","pause","trapIndex","indexOf","splice","deactivateTrap","unpause","delay","fn","setTimeout","findIndex","arr","idx","every","valueOrHandler","_len","arguments","params","_key","getActualTarget","target","composedPath","createFocusTrap","userOptions","doc","document","config","_objectSpread2","returnFocusOnDeactivate","escapeDeactivates","delayInitialFocus","containers","containerGroups","tabbableGroups","nodeFocusedBeforeActivation","mostRecentlyFocusedNode","paused","delayInitialFocusTimer","getOption","configOverrideOptions","optionName","configOptionName","findContainerIndex","container","tabbableNodes","getNodeForOption","optionValue","_len2","_key2","querySelector","getInitialFocusNode","activeElement","firstTabbableGroup","firstTabbableNode","updateTabbableNodes","map","tabbableOptions","focusableNodes","lastTabbableNode","nextTabbableNode","forward","nodeIdx","n","reverse","group","tryFocus","focus","preventScroll","toLowerCase","select","isSelectableInput","getReturnFocusNode","previousActiveElement","checkPointerDown","e","clickOutsideDeactivates","deactivate","returnFocus","allowOutsideClick","checkFocusIn","targetContained","Document","stopImmediatePropagation","checkKey","keyCode","isEscapeEvent","isTabEvent","destinationNode","containerIndex","containerGroup","shiftKey","startOfGroupIndex","_ref2","destinationGroupIndex","lastOfGroupIndex","_ref3","_destinationGroupIndex","checkTab","checkClick","addListeners","addEventListener","capture","passive","removeListeners","removeEventListener","activate","activateOptions","onActivate","onPostActivate","checkCanFocusTrap","finishActivation","then","deactivateOptions","onDeactivate","onPostDeactivate","checkCanReturnFocus","clearTimeout","finishDeactivation","updateContainerElements","containerElements","elementsAsArray","Boolean","FocusTrapBase","divRef","previouslyFocusedElement","focusTrap","current","focusTrapOptions","prevProps","preventScrollOnDeactivate","rest","FocusTrap","Backdrop","ModalBoxBody","modalBoxBody","createIcon","svgPath","yOffset","xOffset","ModalBoxCloseButton","_a$onClose","onClose","onClick","TimesIcon","ModalBox","position","positionOffset","ariaLabelledby","ariaDescribedby","topSpacer","modalBox","alignTop","lg","sm","ModalBoxFooter","modalBoxFooter","ModalBoxDescription","_a$id","modalBoxDescription","ModalBoxHeader","_a$help","help","modalBoxHeader","modalBoxHeaderMain","TooltipContent","isLeftAligned","textAlignLeft","TooltipArrow","rect","top","right","bottom","left","x","y","getWindow","toString","defaultView","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","isElement","isHTMLElement","HTMLElement","getNodeName","nodeName","getDocumentElement","documentElement","getWindowScrollBarX","isScrollParent","_getComputedStyle","overflow","overflowX","overflowY","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","scroll","offsets","getNodeScroll","clientLeft","clientTop","getLayoutRect","offsetLeft","offsetTop","offsetWidth","offsetHeight","getParentNode","getScrollParent","body","listScrollParents","list","scrollParent","isBody","visualViewport","updatedList","isTableElement","getTrueOffsetParent","html","getOffsetParent","currentNode","transform","perspective","willChange","getContainingBlock","auto","basePlacements","clippingParents","viewport","popper","reference","variationPlacements","placement","placements","modifierPhases","order","Map","visited","Set","result","modifier","add","_toConsumableArray","requires","requiresIfExists","dep","has","depModifier","get","set","debounce","pending","Promise","resolve","DEFAULT_OPTIONS","strategy","areValidElements","args","popperGenerator","generatorOptions","_generatorOptions$def","defaultModifiers","_generatorOptions$def2","defaultOptions","orderedModifiers","modifiersData","attributes","effectCleanupFns","isDestroyed","instance","setOptions","cleanupModifierEffects","scrollParents","contextElement","phase","orderModifiers","merged","existing","data","keys","mergeByName","m","enabled","_ref3$options","effect","cleanupFn","noopFn","update","forceUpdate","_state$elements","rects","reset","index","_state$orderedModifie","_state$orderedModifie2","destroy","onFirstUpdate","_options$scroll","_options$resize","resize","getBasePlacement","split","getVariation","getMainAxisFromPlacement","computeOffsets","basePlacement","variation","commonX","commonY","mainAxis","len","Math","floor","ceil","unsetSides","mapToStyles","_Object$assign2","popperRect","gpuAcceleration","adaptive","_roundOffsets","dpr","devicePixelRatio","round","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","clientHeight","clientWidth","_Object$assign","commonStyles","_options$offset","offset","invertDistance","_slicedToArray","skidding","distance","distanceAndSkiddingToXY","_data$state$placement","popperOffsets","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","parent","isShadow","next","isSameNode","rectToClientRect","getClientRectFromMixedType","clippingParent","navigator","userAgent","getViewportRect","getInnerBoundingClientRect","winScroll","max","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","min","mergePaddingObject","paddingObject","expandToHashMap","hashMap","detectOverflow","_options$placement","_options$boundary","_options$rootBoundary","_options$elementConte","elementContext","_options$altBoundary","altBoundary","_options$padding","padding","altContext","referenceElement","clippingClientRect","referenceClientRect","popperClientRect","elementClientRect","overflowOffsets","offsetData","multiply","axis","_skip","_options$mainAxis","checkMainAxis","_options$altAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","_options$flipVariatio","flipVariations","allowedAutoPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","_options$allowedAutoP","allPlacements","allowedPlacements","overflows","computeAutoPlacement","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","check","_loop","_i","fittingPlacement","within","_options$tether","tether","_options$tetherOffset","tetherOffset","isBasePlacement","tetherOffsetValue","mainSide","altSide","additive","minLen","maxLen","arrowElement","arrow","arrowRect","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","arrowOffsetParent","clientOffset","offsetModifierValue","tetherMin","tetherMax","preventedOffset","_state$modifiersData$","minProp","maxProp","endDiff","startDiff","clientSize","centerToReference","center","axisProp","_options$element","getSideOffsets","preventedOffsets","isAnySideFullyClipped","side","createPopper","eventListeners","_options$gpuAccelerat","_options$adaptive","removeAttribute","setAttribute","initialStyles","margin","property","attribute","flip","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","useIsomorphicLayoutEffect","canUseDOM","fromEntries","entries","EMPTY_MODIFIERS","usePopper","popperElement","prevOptions","optionsWithDefaults","_React$useState","_React$useState2","setState","updateStateModifier","popperOptions","newOptions","JSON","stringify","popperInstanceRef","popperInstance","defaultCreatePopper","FindRefWrapper","root","ReactDOM","onFoundRef","TooltipPosition","getOpacityTransition","animationDuration","Popper","trigger","_ref$popperMatchesTri","popperMatchesTriggerWidth","_ref$direction","_ref$position","_ref$appendTo","appendTo","_ref$zIndex","zIndex","_ref$isVisible","isVisible","positionModifiers","_ref$distance","onMouseEnter","onMouseLeave","onDocumentClick","onTriggerClick","onTriggerEnter","onPopperClick","onPopperMouseEnter","onPopperMouseLeave","onDocumentKeyDown","_ref$enableFlip","enableFlip","_ref$flipBehavior","flipBehavior","_ref$removeFindDomNod","removeFindDomNode","popperRef","triggerElement","setTriggerElement","_React$useState3","_React$useState4","refElement","setRefElement","_React$useState5","_React$useState6","setPopperElement","_React$useState7","_React$useState8","ready","setReady","refOrTrigger","onDocumentClickCallback","listener","observer","MutationObserver","observe","childList","subtree","disconnect","getPlacement","convertedPlacement","getPlacementMemo","getOppositePlacementMemo","sameWidthMod","_usePopper","startsWith","popperStyles","popperPortal","popperPlacement","modifierFromPopperPosition","menuWithPopper","display","firstElementChild","foundRef","pfTooltipIdCounter","Tooltip","bodyContent","_a$position","_a$trigger","_a$isVisible","_a$isContentLeftAlign","isContentLeftAligned","_a$enableFlip","_a$entryDelay","entryDelay","_a$exitDelay","exitDelay","_a$appendTo","_a$zIndex","_a$maxWidth","maxWidth","tooltipMaxWidth","_a$distance","_a$aria","aria","_a$flipBehavior","_a$animationDuration","_a$ariaLive","ariaLive","_a$removeFindDomNode","isAppLauncher","tippyProps","_a$onTooltipHidden","onTooltipHidden","triggerOnMouseenter","triggerOnFocus","triggerOnClick","triggerManually","visible","setVisible","opacity","setOpacity","transitionTimerRef","showTimerRef","hideTimerRef","prevExitDelayRef","clearTimeouts","timeoutRefs","show","hide","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom","hasCustomMaxWidth","transition","KeyTypes","Escape","Enter","isVariantIcon","ModalBoxTitle","title","titleIconVariant","_a$titleLabel","titleLabel","hasTooltip","setHasTooltip","h1","capitalize","variantIcons","CheckCircleIcon","ExclamationCircleIcon","ExclamationTriangleIcon","info","InfoCircleIcon","default","BellIcon","CustomIcon","modalStyles","modalBoxTitle","modalBoxTitleIcon","accessibleStyles","modalBoxTitleText","ModalVariant","ModalContent","_a$isOpen","isOpen","_a$header","header","_a$description","description","_a$title","_a$titleIconVariant","bodyAriaLabel","bodyAriaRole","_a$showClose","showClose","_a$footer","footer","_a$actions","actions","_a$width","boxId","labelId","descriptorId","_a$disableFocusTrap","disableFocusTrap","_a$hasNoBodyWrapper","hasNoBodyWrapper","defaultModalBodyAriaRole","modalBody","boxStyle","idRefList","ariaLabelledbyFormatted","bullsEyeStyles","Modal","handleEscKeyClick","onEscapePress","_b","getElement","toggleSiblingsFromScreenReaders","bodyChildren","_Array$from","isEmpty","boxIdNum","currentId","labelIdNum","descriptorIdNum","_this$props","createElement","appendChild","classList","remove","removeChild","TextAreResizeOrientation","TextAreaReadOnlyVariant","TextAreaBase","inputRef","setAutoHeight","field","setProperty","heightToken","computed","getPropertyValue","autoResize","isReadOnly","readOnlyVariant","resizeOrientation","orientation","both","defaultValue","readOnly","TextArea","TextInputTypes","TextInputReadOnlyVariant","TextInputBase","handleResize","trimLeft","String","restoreText","isLeftTruncated","_this$props2","sanitizeInputValue","containerRefElement","unobserve","useRequestAnimationFrame","ResizeObserver","resizeObserver","requestAnimationFrame","isArray","getResizeObserver","iconVariant","customIconUrl","customIconDimensions","customIconStyle","backgroundImage","backgroundSize","TextInput","text","InputGroup","formCtrls","comp","idItem","inputGroupRef","NumberInput","widthChars","_a$validated","_a$onMinus","onMinus","_a$onPlus","onPlus","unit","_a$unitPosition","unitPosition","inputName","_a$inputAriaLabel","inputAriaLabel","_a$minusBtnAriaLabel","minusBtnAriaLabel","_a$plusBtnAriaLabel","plusBtnAriaLabel","inputProps","minusBtnProps","plusBtnProps","_a$allowEmptyInput","allowEmptyInput","numberInputUnit","keyDownHandler","onKeyDown","ArrowUp","ArrowDown","status","evt","MinusIcon","Number","PlusIcon","pageContextDefaults","isManagedSidebar","isNavOpen","onNavToggle","getBreakpoint","getVerticalBreakpoint","PageContext","Provider","Consumer","GenerateId","prefix","ToolbarChipGroupContent","isExpanded","chipGroupContentRef","clearAllFilters","showClearFiltersButton","clearFiltersButtonText","collapseListedFiltersBreakpoint","numberOfFilters","numberOfFiltersText","customChipGroupContent","collapseListedFilters","innerWidth","globalBreakpoints","toolbarContent","hidden","ToolbarGroup","ToolbarItem","Toolbar","staticFilterInfo","isManagedToggleExpanded","filterInfo","windowWidth","isToggleManaged","toggleIsExpanded","prevState","closeExpandableContent","updateNumberFilters","categoryName","filterInfoToUpdate","getNumberOfFilters","values","cur","renderToolbar","randomId","isExpandedProp","isFullHeight","isStatic","inset","usePageInsets","isSticky","toolbar","fullHeight","static","pageInsets","sticky","formatBreakpointMods","ToolbarContext","toolbarId","_this2","ToolbarExpandableContent","expandableContentRef","chipContainerRef","_this$context","context","toolbarExpandableContent","chipContainer","contextType","ToolbarContent","visiblity","alignment","warn","clearAllFiltersContext","clearFiltersButtonContext","showClearFiltersButtonContext","toolbarIdContext","expandableContentId","ToolbarContentContext","toolbarContentSection","ToolbarGroupVariant","ToolbarGroupWithRef","spacer","spaceItems","toolbarGroup","toCamel","DividerVariant","Divider","hr","_a$isVertical","divider","vertical","ToolbarItemVariant","widths","isAllExpanded","separator","widthStyles","breakpoint","toolbarItem","expanded","globalBreakpointMd","globalBreakpointLg","xl","globalBreakpointXl","globalBreakpoint2xl","uid","ouiaPrefix","ouiaIdByRoute","componentType","useOUIAId","defaultOUIAId","useMemo","location","href","exception","Tab","Space","ArrowLeft","ArrowRight","globalWidthBreakpoints","globalBreakpointSm","globalHeightBreakpoints","globalHeightBreakpointSm","globalHeightBreakpointMd","globalHeightBreakpointLg","globalHeightBreakpointXl","globalHeightBreakpoint2xl","input","toUpperCase","substring","mods","stylePrefix","breakpointsOrder","_ref4","mod","_res","modifierKey","camelize","s","getTextWidth","computedStyle","getContext","font","fontStretch","fontStretchLookupTable","fontStyle","fontVariant","fontWeight","fontSize","lineHeight","fontFamily","getFontFromComputedStyle","measureText","availableWidth","parseFloat","paddingTop","paddingBottom","paddingLeft","paddingRight","innerDimensions","newValue","innerText","IconSize","getSize","_ref$xOffset","_ref$yOffset","SVGIcon","color","noVerticalAlign","hasTitle","heightWidth","baseAlign","verticalAlign","d","classes","hasOwn","arg","argType","inner","self","module","exports","o","h","c","l","_","u","g","_d$Disposable","t","_terminal","_container","_alpha","_themeService","_bufferService","_optionsService","_decorationService","_coreBrowserService","_deviceCharWidth","_deviceCharHeight","_deviceCellWidth","_deviceCellHeight","_deviceCharLeft","_deviceCharTop","_selectionModel","createSelectionRenderModel","_bitmapGenerator","_onAddTextureAtlasCanvas","register","EventEmitter","onAddTextureAtlasCanvas","_cellColorResolver","CellColorResolver","_canvas","_initCanvas","_refreshCharAtlas","colors","onChangeColors","toDisposable","removeElementFromParent","_charAtlas","dispose","pages","canvas","_ctx","throwIfFalsy","alpha","_clearAll","cloneNode","replaceChild","handleGridChanged","rows","_charAtlasDisposable","acquireTextureAtlas","rawOptions","forwardEvent","warmUp","f","device","cell","char","clearTexture","fillRect","save","beginPath","strokeStyle","fillStyle","lineWidth","moveTo","bezierCurveTo","stroke","restore","setLineDash","lineTo","closePath","strokeRect","clearRect","background","_getFont","textBaseline","TEXT_BASELINE","_clipRow","customGlyphs","tryDrawCustomChar","getChars","fillText","buffer","ydisp","getRasterizedGlyphCombinedChar","bg","fg","ext","getRasterizedGlyph","getCode","WHITESPACE_CELL_CODE","texturePage","version","refresh","drawImage","bitmap","texturePosition","cols","clip","fontWeightBold","Disposable","BaseRenderLayer","_state","_commitTimeout","_bitmap","isSafari","_generate","_this3","createImageBitmap","_a$Disposable","_super2","v","C","p","_this4","_screenElement","_charSizeService","_onRequestRedraw","onRequestRedraw","_onChangeTextureAtlas","onChangeTextureAtlas","allowTransparency","_renderLayers","TextRenderLayer","SelectionRenderLayer","LinkRenderLayer","CursorRenderLayer","_step","_iterator","_createForOfIteratorHelper","done","dimensions","createRenderDimensions","_devicePixelRatio","_updateDimensions","observeDevicePixelDimensions","_setCanvasDevicePixelDimensions","_step2","_iterator2","removeTerminalFromCache","cacheCanvas","_step3","_iterator3","_runOperation","handleBlur","handleFocus","handleSelectionChanged","selectionForeground","fire","handleCursorMove","_step4","_iterator4","_step5","_iterator5","_step6","_iterator6","clearTextureAtlas","hasValidSize","letterSpacing","_step7","_iterator7","_requestRedrawViewport","CanvasRenderer","_s$BaseRenderLayer","_super3","_this5","_coreService","_cell","CellData","isFocused","_cursorRenderers","bar","_renderBarCursor","_assertThisInitialized","_renderBlockCursor","underline","_renderUnderlineCursor","onOptionChange","_handleOptionsChanged","_cursorBlinkStateManager","_get","_getPrototypeOf","_clearCursor","restartBlinkAnimation","resume","_this6","cursorBlink","_render","isPaused","isCursorInitialized","isCursorHidden","ybase","lines","loadCell","cursor","cursorStyle","_renderBlurCursor","getWidth","isCursorVisible","_clearCells","_fillLeftLineAtCell","cursorWidth","_fillCells","cursorAccent","_fillCharTrueColor","_fillBottomLineAtCells","_strokeRectAtCell","_renderCallback","_restartInterval","_blinkStartTimeout","_blinkInterval","clearInterval","_animationFrame","cancelAnimationFrame","_this7","_animationTimeRestarted","Date","now","_this8","setInterval","GridCache","_class","cache","_s$BaseRenderLayer2","_super4","_this9","onShowLinkUnderline","_handleShowLinkUnderline","onHideLinkUnderline","_handleHideLinkUnderline","_clearCurrentLink","x1","y1","y2","x2","INVERTED_DEFAULT_COLOR","is256Color","ansi","foreground","_s$BaseRenderLayer3","_super5","_this10","_clearState","columnSelectMode","selectionStart","selectionEnd","_redrawSelection","_didStateChange","selectionBackgroundTransparent","selectionInactiveBackgroundTransparent","_areCoordinatesEqual","_r$BaseRenderLayer","_super6","_this11","_characterJoinerService","_characterWidth","_characterFont","_characterOverlapCache","_workCell","onSpecificOptionChange","_setTransparency","clear","getJoinedCharacters","JoinedCellData","translateToString","_isOverlapping","getCodePoint","NULL_CELL_CODE","_this12","_forEachCell","isInverse","isFgDefault","isFgRGB","AttributeData","toColorRGB","getFgColor","isBgRGB","getBgColor","isBgPalette","isDim","multiplyOpacity","toColor","forEachDecorationAtCell","layer","backgroundColorRGB","_this13","_drawChars","beginFrame","_drawBackground","_drawForeground","_i6","_e17","_class2","_selectionRenderModel","extended","rgba","foregroundColorRGB","isCellSelected","selectionBackgroundOpaque","selectionInactiveBackgroundOpaque","generateConfig","ownedBy","configEquals","atlas","_core","TextureAtlas","unicodeService","NULL_COLOR","contrastCache","deviceCellWidth","deviceCellHeight","deviceCharWidth","deviceCharHeight","drawBoldTextInBrightColors","minimumContrastRatio","DIM_OPACITY","isFirefox","isLegacyEdge","blockElementDefinitions","w","boxDrawingDefinitions","powerlineDefinitions","rightPadding","leftPadding","ImageData","_c$substring$split$ma","_c$substring$split$ma2","putImageData","createPattern","_i13","_Object$entries","_Object$entries$_i","_step8","_iterator8","Path2D","_step9","_iterator9","L","M","devicePixelContentBoxSize","inlineSize","blockSize","box","isPowerlineGlyph","isRestrictedPowerlineGlyph","excludeFromContrastRatioDemands","hasSelection","viewportStartRow","viewportEndRow","viewportCappedStartRow","viewportCappedEndRow","startCol","endCol","viewportY","texturePositionClipSpace","sizeClipSpace","_document","_config","_unicodeService","_didWarmUp","_cacheMap","FourKeyMap","_cacheMapCombined","_pages","_activePages","_workBoundingBox","_workAttributeData","_textureSize","_onRemoveTextureAtlasCanvas","onRemoveTextureAtlasCanvas","_requestClearModel","_createNewPage","_tmpCanvas","_tmpCtx","willReadFrequently","_step10","_iterator10","_doWarmUp","_this14","IdleTaskQueue","_t11","enqueue","DEFAULT_COLOR","DEFAULT_EXT","_drawToCache","currentRow","_step11","_iterator11","_this15","maxAtlasPages","queueMicrotask","maxTextureSize","percentageUsed","glyphs","_mergePages","_deletePage","_step12","_iterator12","_step12$value","ctx","_step13","_iterator13","_step14","_iterator14","_getFromCacheMap","_getColorFromAnsiIndex","blend","_getMinimumContrastColor","opaque","getColor","_resolveBackgroundRgba","_resolveForegroundRgba","ensureContrastRatio","setColor","fromCharCode","isInvisible","isBold","isItalic","isUnderline","isStrikethrough","getFgColorMode","getBgColorMode","_getBackgroundColor","globalCompositeOperation","S","charCodeAt","R","A","_getForegroundColor","D","T","k","$","wcwidth","getStringCellWidth","isUnderlineColorDefault","isUnderlineColorRGB","getUnderlineColor","underlineStyle","actualBoundingBoxDescent","strokeText","getImageData","E","B","I","O","P","_findGlyphBoundingBox","_step15","_iterator15","_step16","_iterator16","fixedRows","_step17","_iterator17","addGlyph","_usedPixels","_glyphs","_step18","_iterator18","_this$_glyphs","abs","_o$AttributeData","_super7","_this16","combinedData","_width","_characterJoiners","_nextCharacterJoinerId","handler","getFg","getBg","getTrimmedLength","_getJoinedRanges","WHITESPACE_CELL_CHAR","_mergeRanges","_stringRangesToCellRanges","getString","IBufferService","CharacterJoinerService","toCss","toRgba","channels","_l$toChannels","_l$toChannels2","toChannels","isOpaque","_l$toChannels3","_l$toChannels4","isNode","createLinearGradient","_t$getImageData$data","match","repeat","pow","relativeLuminance","relativeLuminance2","rgb","reduceLuminance","increaseLuminance","toPaddedHex","contrastRatio","_class3","_listeners","_disposed","_this17","_event","_step19","_iterator19","_class4","_disposables","_isDisposed","_step20","_iterator20","disposeArray","getDisposeArrayDisposable","_data","TwoKeyMap","_class5","platform","getSafariVersion","isMac","isIpad","isIphone","isWindows","isLinux","isChromeOS","_tasks","_start","_idleCallback","_cancelCallback","_requestCallback","_process","timeRemaining","_r15","_super8","_this18","_createDeadline","PriorityTaskQueue","_r16","_class6","_super9","requestIdleCallback","cancelIdleCallback","DebouncedIdleTask","_class7","_queue","flush","clone","hasExtendedAttrs","underlineColor","isFgPalette","_ext","_urlId","ExtendedAttrs","_o$AttributeData2","_super10","_this19","stringFromCodePoint","isCombined","CHAR_DATA_ATTR_INDEX","CHAR_DATA_CHAR_INDEX","CHAR_DATA_WIDTH_INDEX","setFromCharData","DEFAULT_ATTR","CHAR_DATA_CODE_INDEX","NULL_CELL_CHAR","NULL_CELL_WIDTH","WHITESPACE_CELL_WIDTH","utf32ToString","StringToUtf32","_class8","_interim","Utf8ToUtf32","_class9","interim","Uint8Array","di$target","di$dependencies","serviceRegistry","getServiceDependencies","createDecorator","ICoreMouseService","ICoreService","ICharsetService","IInstantiationService","LogLevelEnum","DEBUG","INFO","WARN","ERROR","OFF","ILogService","IOptionsService","IOscLinkService","IUnicodeService","IDecorationService","_o$Disposable","_super11","_this20","_renderer","textureAtlas","_this21","coreService","optionsService","screenElement","linkifier2","_renderService","setRenderer","_createRenderer","onWillOpen","CanvasAddon","_liveRegionLineCount","_charsToConsume","_charsToAnnounce","_accessibilityTreeRoot","_rowContainer","_rowElements","_createAccessibilityTreeNode","_topBoundaryFocusListener","_handleBoundaryFocus","_bottomBoundaryFocusListener","_refreshRowsDimensions","_renderRowsDebouncer","TimeBasedDebouncer","_renderRows","_refreshRows","_liveRegion","insertAdjacentElement","onResize","_handleResize","onRender","onScroll","onA11yChar","_handleChar","onLineFeed","onA11yTab","_handleTab","onKey","_handleKey","_clearLiveRegion","onDimensionsChange","_screenDprMonitor","ScreenDprMonitor","setListener","addDisposableDomListener","relatedTarget","pop","scrollLines","_refreshRowDimensions","textContent","tooMuchOutput","translateBufferLineToString","_announceCharacters","AccessibilityManager","decPrivateModes","bracketedPasteMode","triggerDataEvent","clientX","clientY","prepareTextForTerminal","bracketTextForPaste","copyHandler","clipboardData","setData","selectionText","handlePasteEvent","stopPropagation","getData","paste","moveTextAreaUnderMouseCursor","rightClickHandler","rightClickSelect","ColorContrastCache","_color","_css","_e7","_a$Disposable2","_linkProviders","_linkCacheDisposables","_isMouseOut","_activeLine","_onShowLinkUnderline","_onHideLinkUnderline","_lastMouseEvent","_currentLink","_element","_mouseService","_handleMouseMove","_handleMouseDown","_handleMouseUp","_positionFromMouseEvent","_lastBufferCell","_handleHover","_askForLink","_linkAtPosition","_activeProviderReplies","_step$value","_checkLinkProviderResult","provideLinks","_removeIntersectingLinks","range","_handleNewLink","_mouseDownLink","_linkLeave","decorations","pointerCursor","isHovered","_linkHover","defineProperties","toggle","_fireUnderlineEvent","onRenderedViewportChange","hover","_createLinkUnderlineEvent","leave","getCoords","Linkifier2","promptLabel","_oscLinkService","linkHandler","hasContent","urlId","getLinkData","uri","allowNonHttpProtocols","URL","protocol","confirm","open","opener","OscLinkProvider","RenderDebouncer","_parentWindow","_refreshCallbacks","_innerRefresh","_rowCount","_rowStart","_rowEnd","_runRefreshCallbacks","_s$Disposable","_currentDevicePixelRatio","clearListener","_listener","_outerListener","_updateDpr","_resolutionMediaMatchList","removeListener","matchMedia","addListener","_w$CoreTerminal","browser","_keyDownHandled","_keyDownSeen","_keyPressHandled","_unprocessedDeadKey","_onCursorMove","onCursorMove","_onKey","_onRender","_onSelectionChange","onSelectionChange","_onTitleChange","onTitleChange","_onBell","onBell","_onFocus","_onBlur","_onA11yCharEmitter","_onA11yTabEmitter","_onWillOpen","_setup","_instantiationService","createInstance","registerLinkProvider","DecorationService","setService","_inputHandler","onRequestBell","onRequestRefreshRows","onRequestSendFocus","_reportFocus","onRequestReset","onRequestWindowsOptionsReport","_reportWindowsOptions","onColor","_handleColorEvent","_afterResize","_customKeyEventHandler","_loop2","C0","ESC","toRgbString","C1_ESCAPED","ST","modifyColors","_E$rgba","_E$rgba2","restoreColor","buffers","textarea","_accessibilityManager","sendFocus","updateCursorStyle","_showCursor","blur","isCursorInViewport","_compositionHelper","isComposing","_bindKeys","_selectionService","rightClickSelectsWord","_keyUp","_keyDown","_keyPress","compositionstart","compositionupdate","compositionend","_inputEvent","updateCompositionElements","isConnected","_logService","debug","dir","createDocumentFragment","_viewportElement","_viewportScrollArea","_helperContainer","CoreBrowserService","ICoreBrowserService","_handleTextAreaFocus","_handleTextAreaBlur","CharSizeService","ICharSizeService","ThemeService","IThemeService","ICharacterJoinerService","RenderService","IRenderService","_compositionView","CompositionHelper","hasRenderer","MouseService","IMouseService","Viewport","onRequestSyncScrollBar","syncScrollArea","_syncTextArea","SelectionService","ISelectionService","onRequestScrollLines","amount","suppressScrollEvent","onLinuxMouseSelection","_onScroll","attachToDom","BufferDecorationRenderer","handleMouseDown","coreMouseService","areMouseEventsActive","disable","enable","screenReaderMode","_handleScreenReaderModeOptionChange","overviewRulerWidth","_overviewRulerRenderer","OverviewRulerRenderer","measure","_initGlobal","bindMouse","DomRenderer","getMouseReportCoords","overrideType","buttons","getLinesScrolled","deltaY","triggerMouseEvent","col","row","action","ctrl","ctrlKey","alt","altKey","mouseup","wheel","mousedrag","mousemove","cancel","onProtocolChange","logLevel","explainEvents","activeProtocol","shouldForceSelection","hasScrollback","applicationCursorKeys","handleWheel","handleTouchStart","handleTouchMove","refreshRows","shouldColumnSelect","deregister","markers","addMarker","registerDecoration","setSelection","clearSelection","selectAll","selectLines","macOptionIsMeta","keydown","scrollOnUserInput","scrollToBottom","evaluateKeyboardEvent","_isThirdLevelShift","metaKey","ETX","CR","domEvent","getModifierState","charCode","which","inputType","composed","clearAllMarkers","getBlankLine","DEFAULT_ATTR_DATA","source","WindowsOptionsReportType","GET_WIN_SIZE_PIXELS","toFixed","GET_CELL_SIZE_PIXELS","cancelEvents","CoreTerminal","Terminal","_debounceThresholdMS","_lastRefreshMs","_additionalRefreshRequested","_refreshTimeoutID","_n$Disposable","_scrollLines","_scrollArea","scrollBarWidth","_currentRowHeight","_currentDeviceCellHeight","_lastRecordedBufferLength","_lastRecordedViewportHeight","_lastRecordedBufferHeight","_lastTouchY","_lastScrollTop","_wheelPartialScroll","_refreshAnimationFrame","_ignoreNextScrollEvent","_smoothScrollState","startTime","origin","_handleScroll","_activeBuffer","onBufferActivate","activeBuffer","_renderDimensions","_handleThemeChange","backgroundColor","_refresh","_this22","_smoothScrollPercent","_smoothScroll","_clearSmoothScrollState","smoothScrollDuration","cancelable","_getPixelsScrolled","_bubbleScroll","_applyScrollModifier","deltaMode","WheelEvent","DOM_DELTA_LINE","DOM_DELTA_PAGE","DOM_DELTA_PIXEL","fastScrollModifier","fastScrollSensitivity","scrollSensitivity","touches","pageY","_a$Disposable3","_this23","_decorationElements","_altBufferIsActive","_dimensionsChanged","_doRefreshDecorations","_queueRefresh","onDecorationRegistered","onDecorationRemoved","_removeDecoration","_this24","addRefreshCallback","_renderDecoration","_refreshStyle","_refreshXPosition","marker","line","onRenderEmitter","_createElement","anchor","delete","ColorZoneStore","_zones","_zonePool","_zonePoolIndex","_linePadding","full","overviewRulerOptions","_lineIntersectsZone","_lineAdjacentToZone","_addLineToZone","startBufferLine","endBufferLine","_h$Disposable","_this25","_coreBrowseService","_colorZoneStore","_shouldUpdateDimensions","_shouldUpdateAnchor","_lastKnownBufferLength","_refreshCanvasDimensions","insertBefore","_registerDecorationListeners","_registerBufferChangeListeners","_registerDimensionChangeListeners","_this26","_this27","normal","_refreshDrawHeightConstants","_refreshColorZonePadding","_this28","_containerHeight","setPadding","_refreshDrawConstants","addDecoration","zones","_renderColorZone","_this29","_refreshDecorations","_textarea","_isComposing","_isSendingComposition","_compositionPosition","_dataAlreadySent","_this30","_finalizeComposition","_handleAnyTextareaChanges","_this31","_this32","DEL","_this33","getCoordsRelativeToElement","isWrapped","moveToCellSequence","_$Disposable","_this34","_linkifier2","_terminalClass","_cellToRowElements","_refreshRowElements","_selectionContainer","_injectCss","_rowFactory","DomRendererRowFactory","_handleLinkHover","_handleLinkLeave","_themeStyleElement","_dimensionsStyleElement","_terminalSelector","BOLD_CLASS","ITALIC_CLASS","CURSOR_CLASS","CURSOR_STYLE_BLOCK_CLASS","CURSOR_BLINK_CLASS","CURSOR_STYLE_BAR_CLASS","CURSOR_STYLE_UNDERLINE_CLASS","_step10$value","renderRows","_createSelectionElement","replaceChildren","Int16Array","createRow","_setCellUnderline","textDecoration","DIM_CLASS","UNDERLINE_CLASS","STRIKETHROUGH_CLASS","_columnSelectMode","_selectionStart","_selectionEnd","_this35","_loop3","textDecorationColor","_isCellInSelection","_addStyle","_applyMinimumContrast","subarray","SelectionModel","isSelectAllActive","selectionStartLength","areSelectionValuesReversed","_a$Disposable4","_this36","_onCharSizeChange","onCharSizeChange","_measureStrategy","onMultipleOptionChange","_parentElement","_result","_measureElement","_n$AttributeData","_this37","_this38","_isFocused","_cachedIsFocused","_this39","hasFocus","_a$Disposable5","_this40","_pausedResizeTask","_isPaused","_needsFullRefresh","_isNextRenderRedrawOnly","_needsSelectionRefresh","_canvasWidth","_canvasHeight","_selectionState","_onDimensionsChange","_onRenderedViewportChange","_onRefreshRequest","onRefreshRequest","_renderDebouncer","handleDevicePixelRatioChange","_fullRefresh","handleCharSizeChanged","IntersectionObserver","_handleIntersectionChange","threshold","_possibleConstructorReturn","isIntersecting","intersectionRatio","_fireOnCanvasResize","_this41","_this42","RegExp","_u$Disposable","_super12","_this43","_linkifier","_dragScrollAmount","_enabled","_mouseDownTimeStamp","_oldHasSelection","_oldSelectionStart","_oldSelectionEnd","_onLinuxMouseSelection","_onRedrawRequest","_onRequestScrollLines","_mouseMoveListener","_mouseUpListener","onUserInput","_trimListener","onTrim","_handleTrim","_handleBufferActivate","_model","_activeSelectionMode","_removeMouseDownListeners","finalSelectionStart","finalSelectionEnd","_this44","_getMouseBufferCoords","_areCoordsInSelection","currentLink","getRangeLength","_selectWordAt","handleTrim","macOptionClickForcesSelection","timeStamp","_handleIncrementalClick","detail","_handleSingleClick","_handleDoubleClick","_handleTripleClick","_addMouseDownListeners","_this45","_dragScrollIntervalTimer","_dragScroll","hasWidth","_selectWordAtCursor","_selectLineAt","_selectToWordAt","_getMouseEventScrollAmount","altClickMovesCursor","_fireEventIfSelectionChanged","_fireOnSelectionChange","_this46","_isClickInSelection","_convertViewportColToCharacterIndex","charAt","_isCharWordSeparator","trim","_getWordAt","wordSeparator","getWrappedRangeForLine","first","last","DEFAULT_ANSI_COLORS","freeze","_h$Disposable2","_super13","_this47","_onChangeColors","_contrastCache","_colors","_updateRestoreColors","_setTheme","theme","selectionBackground","selectionInactiveBackground","black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite","extendedAnsi","_restoreColor","_restoreColors","_r$Disposable","_super14","_this48","_maxLength","onDeleteEmitter","onDelete","onInsertEmitter","onInsert","onTrimEmitter","_array","_startIndex","_length","_getCyclicIndex","CircularList","_s$Disposable2","_super15","_this49","_onBinary","onBinary","_onData","onData","_onLineFeed","_onResize","_onWriteParsed","onWriteParsed","InstantiationService","OptionsService","BufferService","LogService","CoreService","CoreMouseService","UnicodeService","_charsetService","CharsetService","OscLinkService","InputHandler","onRequestScrollToBottom","_writeBuffer","handleUserInput","_handleWindowsModeOptionChange","markRangeDirty","scrollBottom","WriteBuffer","parse","_windowsMode","_this50","_onScrollApi","write","writeSync","MINIMUM_COLS","MINIMUM_ROWS","scrollPages","scrollToTop","scrollToLine","registerEscHandler","registerDcsHandler","registerCsiHandler","registerOscHandler","windowsMode","_enableWindowsMode","_this51","updateWindowsModeWrappedState","final","_i22","_e66","_this52","setWinLines","restoreWin","minimizeWin","setWinPosition","setWinSizePixels","raiseWin","lowerWin","refreshWin","setWinSizeChars","maximizeWin","fullscreenWin","getWinState","getWinPosition","getWinSizePixels","getScreenSizePixels","getCellSizePixels","getWinSizeChars","getScreenSizeChars","getIconTitle","getWinTitle","pushTitle","popTitle","_h$Disposable3","_super16","_this53","EscapeSequenceParser","_coreMouseService","_parser","_parseBuffer","Uint32Array","_stringDecoder","_utf8Decoder","_windowTitle","_iconName","_windowTitleStack","_iconNameStack","_curAttrData","_eraseAttrDataInternal","_onRequestBell","_onRequestRefreshRows","_onRequestReset","_onRequestSendFocus","_onRequestSyncScrollBar","_onRequestWindowsOptionsReport","_onA11yChar","_onA11yTab","_onColor","_parseStack","cursorStartX","cursorStartY","decodedLength","_specialColors","_dirtyRowTracker","setCsiHandlerFallback","identifier","identToString","setEscHandlerFallback","setExecuteHandlerFallback","code","setOscHandlerFallback","setDcsHandlerFallback","payload","setPrintHandler","print","insertChars","intermediates","cursorUp","scrollRight","cursorDown","cursorForward","cursorBackward","cursorNextLine","cursorPrecedingLine","cursorCharAbsolute","cursorPosition","cursorForwardTab","eraseInDisplay","eraseInLine","insertLines","deleteLines","deleteChars","scrollUp","scrollDown","eraseChars","cursorBackwardTab","charPosAbsolute","hPositionRelative","repeatPrecedingCharacter","sendDeviceAttributesPrimary","sendDeviceAttributesSecondary","linePosAbsolute","vPositionRelative","hVPosition","tabClear","setMode","setModePrivate","resetMode","resetModePrivate","charAttributes","deviceStatus","deviceStatusPrivate","softReset","setCursorStyle","setScrollRegion","saveCursor","windowOptions","restoreCursor","insertColumns","deleteColumns","selectProtected","requestMode","setExecuteHandler","BEL","bell","LF","lineFeed","VT","FF","carriageReturn","BS","backspace","HT","tab","SO","shiftOut","SI","shiftIn","C1","IND","NEL","nextLine","HTS","tabSet","OscHandler","setTitle","setIconName","setOrReportIndexedColor","setHyperlink","setOrReportFgColor","setOrReportBgColor","setOrReportCursorColor","restoreIndexedColor","restoreFgColor","restoreBgColor","restoreCursorColor","reverseIndex","keypadApplicationMode","keypadNumericMode","fullReset","setgLevel","selectDefaultCharset","_loop4","_e68","selectCharset","CHARSETS","screenAlignmentPattern","setErrorHandler","DcsHandler","requestStatusString","race","catch","_logSlowResolvingAsync","clearRange","decode","_preserveStack","charset","wraparound","modes","insertMode","markDirty","setCellFromCodePoint","_getCurrentLinkId","addLineToLink","_eraseAttrData","insertCells","getNullCell","addCodepointToCell","precedingCodepoint","_this54","convertEol","reverseWraparound","_restrictCursor","nextStop","_setCursor","_moveCursor","tabs","prevStop","replaceCells","clearMarkers","_eraseInBufferLine","_resetBufferLine","trimStart","deleteCells","_is","termName","setgCharset","DEFAULT_CHARSET","applicationKeypad","activeEncoding","activateAltBuffer","activateNormalBuffer","_this$_coreMouseServi","_this$_bufferService","fromColorRGB","hasSubParams","getSubParams","_updateAttrColor","updateExtended","_processSGR0","_processUnderline","_extractColor","savedX","savedY","savedCurAttrData","savedCharset","_savedCharset","exec","parseColor","_createHyperlink","_finishHyperlink","registerLink","_setOrReportSpecialColor","shiftElements","markAllDirty","_this55","isProtected","SortedList","_class10","_getKey","_search","_regeneratorRuntime","mark","getKeyIterator","wrap","_context","prev","stop","_super17","_this56","_class11","_super18","_class12","MAX_BUFFER_SIZE","Buffer","_class13","_hasScrollback","_nullCell","fromCharData","_whitespaceCell","_isClearing","_memoryCleanupQueue","_memoryCleanupPosition","_cols","_rows","_getCorrectBufferLength","setupTabStops","BufferLine","maxLength","scrollback","_this57","_isReflowEnabled","_reflow","_batchedMemoryCleanup","cleanupMemory","_reflowLarger","_reflowSmaller","reflowLargerGetLinesToRemove","reflowLargerCreateNewLayout","reflowLargerApplyNewLayout","layout","_reflowLargerAdjustViewport","countRemoved","reflowSmallerGetNewLineLengths","newLines","copyCellsFrom","getWrappedLineTrimmedLength","setCell","tabStopWidth","_this58","Marker","onDispose","_removeMarker","_buffer","_trimRight","_endIndex","_startOverscan","_endOverscan","_current","BufferStringIterator","_combined","_extendedAttrs","byteLength","_n$Disposable2","_super19","_this59","_onBufferActivate","_normal","fillViewportRows","_alt","inactiveBuffer","BufferSet","_n$AttributeData2","_super20","_this60","isDisposed","_id","_nextId","_onDispose","j","q","z","Q","K","Y","Z","H","NUL","SOH","STX","EOT","ENQ","ACK","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","FS","GS","RS","US","SP","PAD","HOP","BPH","NBH","SSA","ESA","HTJ","VTS","PLD","PLU","RI","SS2","SS3","DCS","PU1","PU2","STS","CCH","MW","SPA","EPA","SOS","SGCI","SCI","CSI","OSC","PM","APC","_class14","_class15","UnicodeV6","_class16","_r$Disposable2","_super21","_this61","_action","_callbacks","_pendingData","_bufferOffset","_isSyncWriting","_syncCalls","_didUserInput","_this62","_innerWrite","_this63","_e111","PAYLOAD_LIMIT","DcsParser","_class17","_handlers","create","_active","_ident","_handlerFb","_stack","loopPosition","fallThrough","unhook","hook","put","Params","addParam","_class18","_handler","_params","_hitLimit","_this64","table","TransitionTable","VT500_TRANSITION_TABLE","setDefault","addMany","_s$Disposable3","_super22","_this65","_transitions","handlerPos","chunkPos","initialState","currentState","_collect","_printHandlerFb","_executeHandlerFb","_csiHandlerFb","_escHandlerFb","_errorHandlerFb","_printHandler","_executeHandlers","_csiHandlers","_escHandlers","_oscParser","OscParser","_dcsParser","_errorHandler","_identifier","registerHandler","clearHandler","setHandlerFallback","collect","abort","addSubParam","addDigit","_class19","_put","_class20","_this66","maxSubParamsLength","Int32Array","_subParams","_subParamsLength","_subParamsIdx","Uint16Array","_rejectDigits","_rejectSubDigits","_digitIsSub","AddonManager","_class21","_addons","_this67","_wrappedAddonDispose","BufferApiView","_class22","BufferLineApiView","_class23","_line","BufferNamespaceApi","_class24","_this68","_onBufferChange","onBufferChange","_alternate","alternate","init","ParserApi","_class25","UnicodeApi","_class26","versions","activeVersion","_h$Disposable4","_super23","_this69","isUserScrolling","_cachedBlankLine","isFull","recycle","copyFrom","_class27","glevel","_charsets","NONE","events","restrict","X10","VT200","DRAG","ANY","DEFAULT","SGR","SGR_PIXELS","_a$Disposable6","_super24","_this70","_protocols","_encodings","_activeProtocol","_activeEncoding","_lastEvent","_onProtocolChange","_i55","_Object$keys","addProtocol","_i56","_Object$keys2","addEncoding","_equalEvents","triggerBinaryEvent","down","up","drag","move","_h$Disposable5","_super25","_this71","_onUserInput","_onRequestScrollToBottom","disableStdin","_n$Disposable3","_super26","_this72","_decorations","_onDecorationRegistered","_onDecorationRemoved","_this73","insert","getDecorationsAtCell","_h8","_context2","t0","t1","finish","forEachByKey","_n$Disposable4","_super27","_this74","_cachedBg","_cachedFg","foregroundColor","_entries","_i57","_e126","_e126$_i","_step18$value","ServiceCollection","_class28","_services","_len3","_key3","_construct","off","_n$Disposable5","_super28","_this75","_updateLogLevel","_evalLazyOptionalParams","_len4","_key4","_log","log","_len5","_key5","_len6","_key6","_len7","_key7","allowProposedApi","_n$Disposable6","_super29","_this76","_onOptionChange","_sanitizeAndValidateOption","_setupOptions","_this77","_this78","defineProperty","_entriesWithId","_dataByLinkId","_this79","_removeMarkerFromLink","_getEntryIdKey","_this80","_class29","_providers","_onChange","_activeProvider","_class30","_this81","_addonManager","_publicOptions","_checkReadonlyOptions","_checkProposedApi","applicationCursorKeysMode","applicationKeypadMode","mouseTrackingMode","originMode","reverseWraparoundMode","sendFocusMode","wraparoundMode","_verifyIntegers","attachCustomKeyEventHandler","registerCharacterJoiner","deregisterCharacterJoiner","_verifyPositiveIntegers","getSelection","getSelectionPosition","loadAddon","_len8","_key8","_i63","_e130","_len9","_key9","_i64","_e131","arr2","__esModule","arrayLikeToArray","ReferenceError","Constructor","TypeError","setPrototypeOf","isNativeReflectConstruct","Parent","Class","Reflect","construct","Function","toPropertyKey","_defineProperties","descriptor","enumerable","configurable","writable","protoProps","staticProps","unsupportedIterableToArray","allowArrayLike","it","Symbol","iterator","F","_e","normalCompletion","didErr","step","_e2","getPrototypeOf","possibleConstructorReturn","Derived","hasNativeReflectConstruct","Super","NewTarget","constructor","superPropBase","receiver","base","desc","getOwnPropertyDescriptor","__proto__","subClass","superClass","sham","Proxy","valueOf","iter","_s","_x","_r","_arr","_n","_d","_typeof","assertThisInitialized","Op","obj","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","innerFn","outerFn","tryLocsList","protoGenerator","Generator","generator","Context","makeInvokeMethod","tryCatch","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","NativeIteratorPrototype","Gp","defineIteratorMethods","method","_invoke","AsyncIterator","PromiseImpl","invoke","reject","record","__await","unwrapped","previousPromise","callInvokeWithMethodAndArg","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","resultName","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","iterable","iteratorMethod","isGeneratorFunction","genFun","ctor","awrap","async","val","object","skipTempReset","rootRecord","rval","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","thrown","delegateYield","_setPrototypeOf","arrayWithHoles","iterableToArrayLimit","nonIterableRest","arrayWithoutHoles","iterableToArray","nonIterableSpread","hint","prim","toPrimitive","res"],"sourceRoot":""}