{"version":3,"names":["contextMenuCss","EonUiContextMenuStyle0","ContextMenu","this","schemeConfig","CONTEXT_MENU_SCHEME_CONFIG","schemeMap","CONTEXT_MENU_SCHEME_MAP","selectLabels","CONTEXT_MENU_SIZE_NORMAL","componentWillLoad","applyScheme","collectMenuItems","onWindowResize","componentDidLoad","detectSlotChanges","menuElementSelectionHandler","hostElement","setCssVariables","applySchemeDelegate","setCssVariablesDelegate","onDocumentClick","event","closeContextMenu","initContextMenu","isTouchDevice","initTouchContextMenu","eventFiredElement","parentElement","containerWidth","getBoundingClientRect","width","containerHeight","height","tempSelectItems","label","tempSelectLabelItem","value","selectedItem","selectedMenuItem","innerText","disabled","push","menuItems","forEach","item","optionElement","href","selectItems","leftPos","left","menuExpandPosition","window","innerWidth","iconAlignment","offsetTop","_a","menuContainerHead","setCssVariable","menuOffsetX","Array","from","getNestedChildrenOf","contextMenuFocus","emit","OpenContextMenu","visible","e","srcElement","tagName","contains","stopImmediatePropagation","toggleMenuList","collapseMenu","menuItem","focusedItem","prevSelectedMenuItem","size","focusOnMenuItems","onclick","target","handleMenuKeyDown","focusedMenuItemIndex","key","KeyIds","SPACE","preventDefault","focusedMenuItem","selectionOfMenuItems","DOWN","indexOf","length","UP","handleNewSelectedMenuItem","contextMenuItemOnSelect","handleSelectionChange","newSelectedOption","filter","option","select","location","render","styleProp","style","h","Host","class","pfx","role","tabIndex","onKeyDown","iconWithLabel","ref","el","innerHTML","iconName","noSpace","name","divider","onChange","onFocus","onBlur","contextMenuBlur","map","selected"],"sources":["src/components/context-menu/context-menu.scss?tag=eon-ui-context-menu&encapsulation=shadow","src/components/context-menu/context-menu.tsx"],"sourcesContent":["/**\n * THEME JSON CONFIG CSS VARS\n * The following default component scss variables can be overwritten via theme configuration per brand.\n * If you need to add new one, please make sure to set a default value.\n * JSON Definition for Component with name \"Example\": testCssVar: \"20px\"\n * Resulting CSS var: $example-test-css-var: 20px;\n */\n\n$context-menu-box-shadow: 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12) !default;\n$context-menu-border-radius: 3px !default;\n$context-menu-normal-padding: 12px !default;\n$context-menu-max-width: 270px !default;\n$context-menu-inset-box-shadow: inset 0px -1px 0px #e5e5e5 !default;\n$context-menu-max-icon-height: 32px !default;\n$context-menu-max-icon-width: 32px !default;\n$context-menu-font-size: 18px !default;\n$context-menu-border-color: transparent !default;\n$context-menu-border-width: 0px !default;\n$context-menu-border-style: none !default;\n$context-menu-divider-border-color: transparent !default;\n$context-menu-divider-border-width: 0px !default;\n$context-menu-divider-border-style: none !default;\n/* END THEME JSON CONFIG CSS VARS ******************************************************* */\n\n:host {\n position: absolute;\n top: 0;\n left: 0;\n display: block;\n font-family: $font-family-base;\n z-index: 100;\n margin: 0 !important; // For proper positioning of Menu on component which fired the click event, \"important!\" is necessary\n padding: 0 !important;\n\n * {\n box-sizing: border-box;\n outline: none;\n }\n}\n\n:host(.#{$prefix}position-left) {\n left: 0;\n right: unset;\n}\n\n:host(.#{$prefix}position-right) {\n left: unset;\n right: 0;\n}\n\n.#{$prefix}context-menu-container {\n display: inline-block;\n position: absolute;\n top: -2px;\n width: $context-menu-max-width;\n box-shadow: $context-menu-box-shadow;\n border-radius: $context-menu-border-radius;\n border: $context-menu-border-width $context-menu-border-style $context-menu-border-color;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.25s cubic-bezier(0.33, 0, 0.35, 1) 0.5s, visibility 0.25s cubic-bezier(0.33, 0, 0.35, 1) 0.5s,\n transform 0.25s ease-in-out 0.5s;\n\n &.#{$prefix}visible {\n overflow: hidden;\n opacity: 1;\n visibility: visible;\n transition: opacity 0.25s cubic-bezier(0.33, 0, 0.35, 1) 0s, visibility 0.25s cubic-bezier(0.33, 0, 0.35, 1) 0s,\n transform 0.25s ease-in-out 0s;\n }\n\n &.#{$prefix}position-left {\n transform: translate3d(var(--offsetLeft), var(--offsetTop), 0px);\n left: 0;\n }\n\n &.#{$prefix}position-right {\n transform: translate3d(calc(var(--offsetLeft) * -1), var(--offsetTop), 0px);\n right: -2px;\n }\n\n .#{$prefix}context-menu-wrapper {\n width: 100%;\n display: flex;\n flex-direction: column;\n background-color: v(backgroundColor);\n overflow: hidden;\n border-radius: $context-menu-border-radius;\n\n .#{$prefix}context-menu-title {\n display: flex;\n align-items: center;\n width: 100%;\n padding: $context-menu-normal-padding;\n height: 48px;\n box-shadow: $context-menu-inset-box-shadow;\n background-color: v(menuTitleBackgroundColor);\n\n .#{$prefix}context-menu-label {\n width: 100%;\n cursor: initial;\n }\n\n .#{$prefix}context-menu-label {\n font-weight: normal;\n font-size: 18px;\n line-height: 24px;\n color: v(labelColor);\n @include noneUserSelect();\n }\n\n .#{$prefix}context-menu-icon {\n fill: v(iconColor);\n width: auto;\n }\n\n &.#{$prefix}icon-with-label {\n &.#{$prefix}icon-right {\n flex-direction: row-reverse;\n justify-content: flex-start;\n\n .#{$prefix}context-menu-label {\n justify-content: flex-end;\n text-align: right;\n padding-left: 10px;\n }\n\n .#{$prefix}context-menu-icon {\n justify-content: flex-end;\n }\n }\n\n &.#{$prefix}icon-left {\n flex-direction: row-reverse;\n justify-content: flex-end;\n\n .#{$prefix}context-menu-label {\n justify-content: flex-start;\n text-align: left;\n }\n\n .#{$prefix}context-menu-icon {\n justify-content: flex-start;\n padding-right: 10px;\n }\n }\n\n .#{$prefix}context-menu-label,\n .#{$prefix}context-menu-icon {\n width: auto;\n }\n }\n\n &.#{$prefix}icon-right {\n flex-direction: row;\n\n .#{$prefix}context-menu-label {\n justify-content: flex-start;\n text-align: left;\n }\n\n .#{$prefix}context-menu-icon {\n justify-content: flex-end;\n }\n\n &:not(.#{$prefix}icon-with-label) {\n margin-left: -2px;\n }\n }\n\n &.#{$prefix}icon-left {\n flex-direction: row-reverse;\n\n .#{$prefix}context-menu-label {\n justify-content: flex-end;\n text-align: left;\n }\n\n .#{$prefix}context-menu-icon {\n justify-content: flex-start;\n padding-right: $context-menu-normal-padding;\n }\n }\n }\n }\n\n &.#{$prefix}small {\n .#{$prefix}context-menu-title {\n height: 33px;\n padding: 10px;\n\n .#{$prefix}context-menu-label {\n font-weight: normal;\n font-size: 16px;\n line-height: 22px;\n }\n }\n }\n\n &.#{$prefix}touch-device {\n width: #{$context-menu-max-icon-width};\n height: #{$context-menu-max-icon-height};\n opacity: 0 !important;\n\n &.#{$prefix}visible {\n opacity: 0 !important;\n\n select {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n z-index: 100;\n font-size: $context-menu-font-size;\n }\n }\n\n select {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n z-index: 100;\n font-size: $context-menu-font-size;\n }\n\n &.#{$prefix}small {\n select {\n font-size: 16px;\n }\n }\n }\n\n .#{$prefix}divider-wrapper {\n position: absolute;\n padding: 0px 12px;\n top: 48px;\n width: 100%;\n\n .#{$prefix}divider {\n border: $context-menu-divider-border-width $context-menu-divider-border-style $context-menu-divider-border-color;\n }\n }\n\n &.#{$prefix}small {\n .#{$prefix}divider-wrapper {\n top: 33px;\n }\n }\n}\n","import { h, Component, Host, State, Element, Prop, Watch, Listen, Event, EventEmitter } from \"@stencil/core\";\nimport { ColorableComponent, applySchemeDelegate, setCssVariablesDelegate } from \"../../common/colorable-component\";\nimport { ContextMenuSchemeDefinition, ContextMenuSchemeName, ContextMenuSize } from \"./constants/context-menu-types\";\nimport {\n CONTEXT_MENU_SCHEME_CONFIG,\n CONTEXT_MENU_SCHEME_MAP,\n CONTEXT_MENU_SIZE_NORMAL\n} from \"./constants/context-menu-constants\";\nimport { ContextMenuSchemeConfiguration } from \"../../constants/colors\";\nimport pfx from \"../../utils/style-class-prefix-helper\";\nimport { getNestedChildrenOf } from \"../../utils/dom-helper\";\nimport { detectSlotChanges } from \"../../utils/slot-helper\";\nimport { KeyIds } from \"../../constants/keys\";\nimport { isTouchDevice } from \"../../utils/touch-helper\";\nimport { setCssVariable } from \"../../utils/css-variables\";\n// import { InitLogging } from \"../../decorators/init-logging\";\n\n/**\n * @slot [unnamed] - holds any number of HTML elements.\n */\n@Component({\n tag: \"eon-ui-context-menu\",\n styleUrl: \"context-menu.scss\",\n shadow: true\n})\nexport class ContextMenu implements ColorableComponent> {\n // @InitLogging() sentryTransaction;\n schemeConfig: ContextMenuSchemeConfiguration = CONTEXT_MENU_SCHEME_CONFIG;\n schemeMap = CONTEXT_MENU_SCHEME_MAP;\n\n private menuContainerHead: HTMLElement;\n selectLabels: string[] = [];\n select: HTMLSelectElement;\n\n @State() selectItems: any[] = [];\n\n @State() containerHeight: any;\n\n @State() containerWidth: any;\n\n /**\n * The components active scheme. If {@link scheme} is set, it will be set to the corresponding scheme.\n * If not set, the component will try to calculate it based on the nearest enclosing background information given by inner-background attribute or eon-ui-background component.\n */\n @State() activeScheme: ContextMenuSchemeDefinition;\n\n /**\n * Collection of all the menu items\n */\n @State() menuItems: HTMLEonUiContextMenuItemElement[] = [];\n\n /**\n * Newly Selected menu item\n */\n @State() selectedMenuItem: HTMLEonUiContextMenuItemElement;\n\n /**\n * Decides the side where the menu should be opened\n * @example \"left\" | \"right\"\n */\n @State() menuExpandPosition: string;\n\n /**\n * Newly Focused menu item\n */\n @State() focusedMenuItem: HTMLEonUiContextMenuItemElement;\n\n /**\n * Previously selected menu item\n */\n @State() prevSelectedMenuItem: HTMLEonUiContextMenuItemElement;\n\n /**\n * When Context Menu collapses\n */\n @State() collapseMenu: boolean;\n\n @Element() hostElement: HTMLEonUiContextMenuElement;\n\n /**\n * Raised when the input is focused.\n */\n @Event() contextMenuFocus: EventEmitter;\n\n /**\n * Raised when the input is losing focus.\n */\n @Event() contextMenuBlur: EventEmitter;\n\n /**\n * Raised when item has been selected from Context Menu.\n */\n @Event() contextMenuItemOnSelect: EventEmitter;\n\n /**\n * The name of the color scheme of the component.\n * If not set, the component will try to calculate it based on the nearest enclosing background information given by inner-background attribute or eon-ui-background component.\n */\n @Prop({ reflect: true }) scheme: ContextMenuSchemeName;\n\n /**\n * if this property is true, the context menu will be displayed\n */\n @Prop({ mutable: true, reflect: true }) visible: boolean = false;\n\n /**\n * Label Headline for Menu\n */\n @Prop({ reflect: true }) label: string;\n\n /**\n * Icon in aligned with label headline\n */\n @Prop({ reflect: true }) iconName: string;\n\n /**\n * Alignment on Icon on Menu title\n * @example \"left\", \"right\"\n */\n @Prop({ reflect: true, mutable: true }) iconAlignment: string = \"right\";\n\n /**\n * Allows to define an offset for exact positioning of context menu on x-axis\n */\n @Prop() menuOffsetX: number = 0;\n\n /**\n * Selected Value from context menun item component\n */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n /**\n * Set the size of the component\n */\n @Prop() size: ContextMenuSize = CONTEXT_MENU_SIZE_NORMAL;\n\n /**\n * Icon and label are placed together\n */\n @Prop({ reflect: true, mutable: true }) iconWithLabel: boolean = false;\n\n componentWillLoad() {\n this.applyScheme();\n this.collectMenuItems();\n this.onWindowResize();\n }\n\n componentDidLoad() {\n detectSlotChanges(() => {\n this.collectMenuItems();\n this.menuElementSelectionHandler();\n this.onWindowResize();\n }, this.hostElement);\n\n this.setCssVariables();\n this.collectMenuItems();\n this.menuElementSelectionHandler();\n this.onWindowResize();\n }\n\n @Watch(\"scheme\")\n applyScheme() {\n applySchemeDelegate(this);\n }\n\n @Watch(\"activeScheme\")\n setCssVariables(): void {\n setCssVariablesDelegate(this);\n }\n\n @Listen(\"click\", { target: \"document\" })\n onDocumentClick(event) {\n this.closeContextMenu(event);\n }\n\n @Listen(\"resize\", { target: \"window\" })\n onWindowResize() {\n this.initContextMenu();\n if (isTouchDevice()) this.initTouchContextMenu();\n }\n\n private initTouchContextMenu() {\n const eventFiredElement = this.hostElement.parentElement;\n this.containerWidth = eventFiredElement.getBoundingClientRect().width;\n this.containerHeight = eventFiredElement.getBoundingClientRect().height;\n let tempSelectItems: any[] = [];\n\n if (this.label) {\n let tempSelectLabelItem = {\n value: \"\",\n label: this.label,\n selectedItem: !this.selectedMenuItem ? true : false,\n innerText: this.label,\n disabled: true\n };\n\n tempSelectItems.push(tempSelectLabelItem);\n }\n\n this.menuItems.forEach((item: HTMLEonUiContextMenuItemElement) => {\n let optionElement = {\n value: item.value,\n label: item.label,\n href: item.href,\n selectedItem: this.selectedMenuItem && this.selectedMenuItem.value === item.value ? true : false,\n innerText: item.label\n };\n\n tempSelectItems.push(optionElement);\n });\n\n this.selectItems = tempSelectItems;\n }\n\n private initContextMenu() {\n const eventFiredElement = this.hostElement.parentElement;\n this.containerWidth = eventFiredElement.getBoundingClientRect().width;\n\n // Detects the position of parent from where the click event is fired\n // and on basis of that the menu should open on right or left\n let leftPos = eventFiredElement.getBoundingClientRect().left;\n this.menuExpandPosition = window.innerWidth / 2 < leftPos ? \"right\" : \"left\";\n\n if (this.menuExpandPosition === \"left\") {\n this.iconAlignment = \"left\";\n } else if (this.menuExpandPosition === \"right\") {\n this.iconAlignment = \"right\";\n }\n\n let offsetTop =\n this.hostElement.parentElement.getBoundingClientRect().height * 0.5 -\n this.menuContainerHead?.getBoundingClientRect().height * 0.5;\n\n setCssVariable(this.hostElement, `--offsetLeft`, `${this.menuOffsetX}px`);\n setCssVariable(this.hostElement, `--offsetTop`, `${offsetTop}px`);\n }\n\n @Watch(\"visible\")\n private collectMenuItems() {\n this.menuItems = Array.from(\n getNestedChildrenOf(\n this.hostElement,\n \"eon-ui-context-menu-item\"\n ) as HTMLCollectionOf\n );\n\n isTouchDevice() && this.contextMenuFocus.emit();\n }\n\n /* @Watch(\"visible\")\n setFocus() {\n console.log(\"setFocus\");\n if (this.visible) {\n console.log(\"visible\");\n this.menuContainer.focus();\n } else {\n this.hostElement.parentElement.focus();\n }\n } */\n\n @Listen(\"contextMenuFocus\")\n OpenContextMenu() {\n this.visible = true;\n }\n\n private closeContextMenu(e) {\n const srcElement = e.srcElement as HTMLElement;\n\n if (\n srcElement?.tagName != \"EON-UI-CONTEXT-MENU\" &&\n !this.hostElement.contains(srcElement) &&\n this.hostElement.parentElement !== srcElement\n ) {\n isTouchDevice() && e.stopImmediatePropagation();\n this.visible = false;\n this.toggleMenuList();\n }\n\n if (this.collapseMenu) {\n this.menuItems.forEach((menuItem: HTMLEonUiContextMenuItemElement) => {\n menuItem.focusedItem = null;\n });\n }\n }\n\n private menuElementSelectionHandler() {\n let prevSelectedMenuItem: HTMLEonUiContextMenuItemElement;\n\n this.menuItems.forEach((menuItem: HTMLEonUiContextMenuItemElement) => {\n menuItem.size = this.size;\n if (menuItem.selectedItem) {\n this.selectedMenuItem = menuItem;\n this.focusOnMenuItems(this.selectedMenuItem);\n }\n menuItem.onclick = (event) => {\n prevSelectedMenuItem = this.selectedMenuItem;\n this.selectedMenuItem = event.target as HTMLEonUiContextMenuItemElement;\n\n if (prevSelectedMenuItem?.label !== this.selectedMenuItem.label) {\n prevSelectedMenuItem && (prevSelectedMenuItem.selectedItem = null);\n this.selectedMenuItem.selectedItem = true;\n this.focusOnMenuItems(this.selectedMenuItem);\n }\n\n this.visible = false;\n this.toggleMenuList();\n this.value = this.selectedMenuItem?.value;\n };\n });\n }\n\n private toggleMenuList() {\n this.collapseMenu = !this.collapseMenu;\n }\n\n private handleMenuKeyDown(e: KeyboardEvent) {\n let focusedMenuItemIndex: number;\n\n switch (e.key) {\n case KeyIds.SPACE:\n e.preventDefault();\n if (this.collapseMenu) {\n if (this.selectedMenuItem) {\n this.focusedMenuItem = this.selectedMenuItem;\n }\n this.toggleMenuList();\n } else {\n if (this.focusedMenuItem) {\n this.selectionOfMenuItems(this.focusedMenuItem);\n }\n this.closeContextMenu(e);\n }\n break;\n case KeyIds.DOWN:\n e.preventDefault();\n if (this.collapseMenu) {\n if (this.selectedMenuItem) {\n this.focusedMenuItem = this.selectedMenuItem;\n this.focusOnMenuItems(this.focusedMenuItem);\n }\n this.toggleMenuList();\n } else {\n focusedMenuItemIndex = this.menuItems.indexOf(this.focusedMenuItem);\n if (focusedMenuItemIndex === -1) {\n this.focusOnMenuItems(this.menuItems[0]);\n } else if (focusedMenuItemIndex < this.menuItems.length - 1) {\n this.focusOnMenuItems(this.menuItems[focusedMenuItemIndex + 1]);\n } else if (focusedMenuItemIndex === this.menuItems.length - 1) {\n this.focusOnMenuItems(this.menuItems[0]);\n }\n }\n break;\n case KeyIds.UP:\n e.preventDefault();\n if (this.collapseMenu) {\n if (this.selectedMenuItem) {\n this.focusedMenuItem = this.selectedMenuItem;\n this.focusOnMenuItems(this.focusedMenuItem);\n }\n this.toggleMenuList();\n } else {\n focusedMenuItemIndex = this.menuItems.indexOf(this.focusedMenuItem);\n if (focusedMenuItemIndex === -1) {\n this.focusOnMenuItems(this.menuItems[0]);\n } else if (focusedMenuItemIndex > 0) {\n this.focusOnMenuItems(this.menuItems[focusedMenuItemIndex - 1]);\n } else if (focusedMenuItemIndex === 0) {\n this.focusOnMenuItems(this.menuItems[this.menuItems.length - 1]);\n }\n }\n break;\n }\n }\n\n private focusOnMenuItems(item: HTMLEonUiContextMenuItemElement) {\n this.focusedMenuItem = item;\n this.menuItems.forEach((menuItem: HTMLEonUiContextMenuItemElement) => {\n menuItem.focusedItem = null;\n });\n this.focusedMenuItem.focusedItem = true;\n }\n\n private selectionOfMenuItems(item: HTMLEonUiContextMenuItemElement) {\n this.selectedMenuItem = item;\n this.menuItems.forEach((menuItem: HTMLEonUiContextMenuItemElement) => {\n menuItem.selectedItem = null;\n this.value = this.selectedMenuItem?.value;\n });\n this.selectedMenuItem.selectedItem = true;\n }\n\n @Watch(\"selectedMenuItem\")\n handleNewSelectedMenuItem() {\n this.contextMenuItemOnSelect.emit(this.selectedMenuItem);\n }\n\n private handleSelectionChange() {\n const newSelectedOption: HTMLEonUiContextMenuItemElement = this.menuItems.filter(\n (option) => option.value === this.select.value\n )[0];\n if (newSelectedOption) {\n this.menuItems.forEach((menuItem) => {\n menuItem.selectedItem = null;\n });\n newSelectedOption.selectedItem = true;\n this.selectedMenuItem = newSelectedOption;\n this.value = newSelectedOption.value;\n }\n if (this.selectedMenuItem.href) {\n window.location.href = this.selectedMenuItem.href;\n }\n }\n\n render() {\n const styleProp = this.containerHeight &&\n this.containerWidth && {\n style: {\n height: `${this.containerHeight}px`,\n width: `${this.containerWidth}px`\n }\n };\n return (\n \n {!isTouchDevice() && (\n this.handleMenuKeyDown(event)}\n >\n
\n (this.menuContainerHead = el as HTMLElement)}\n >\n {\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n \n }\n {this.iconName && (\n \n )}\n
\n
\n \n
\n \n
\n
\n
\n \n )}\n {isTouchDevice() && (\n \n (this.select = el as HTMLSelectElement)}\n onChange={() => this.handleSelectionChange()}\n onFocus={(event) => this.contextMenuFocus.emit(event)}\n onBlur={(event) => this.contextMenuBlur.emit(event)}\n name={this.value}\n >\n {this.selectItems.map((option) => (\n \n {option.innerText}\n \n ))}\n \n \n )}\n \n );\n }\n}\n"],"mappings":"qdAAA,MAAMA,EAAiB,gvqDACvB,MAAAC,EAAeD,E,MCwBFE,EAAW,M,8LAEtBC,KAAAC,aAA4EC,EAC5EF,KAAAG,UAAYC,EAGZJ,KAAAK,aAAyB,G,iBAGK,G,wGAe0B,G,oMAsDG,M,gEAgBK,Q,iBAKlC,E,+BAUEC,E,mBAKiC,K,CAEjE,iBAAAC,GACEP,KAAKQ,cACLR,KAAKS,mBACLT,KAAKU,gB,CAGP,gBAAAC,GACEC,GAAkB,KAChBZ,KAAKS,mBACLT,KAAKa,8BACLb,KAAKU,gBAAgB,GACpBV,KAAKc,aAERd,KAAKe,kBACLf,KAAKS,mBACLT,KAAKa,8BACLb,KAAKU,gB,CAIP,WAAAF,GACEQ,EAAoBhB,K,CAItB,eAAAe,GACEE,EAAwBjB,K,CAI1B,eAAAkB,CAAgBC,GACdnB,KAAKoB,iBAAiBD,E,CAIxB,cAAAT,GACEV,KAAKqB,kBACL,GAAIC,IAAiBtB,KAAKuB,sB,CAGpB,oBAAAA,GACN,MAAMC,EAAoBxB,KAAKc,YAAYW,cAC3CzB,KAAK0B,eAAiBF,EAAkBG,wBAAwBC,MAChE5B,KAAK6B,gBAAkBL,EAAkB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