{"version":3,"file":"compare-at-price-info-section-xxxxxxxxxxxxxxxxxxxx.min.js","mappings":"yBAOA,MAAMA,2BAA2BC,YAYxBC,WAAAA,GACLC,QAAQ,KAHFC,cAAgBC,KAAKC,gBAAgBC,KAAKF,MAIhDA,KAAKG,aAAa,CAAEC,KAAM,SAC1BJ,KAAKK,WAAWC,UAAY,UAAHC,OCtB7B,qWDsBgD,YAAAA,OErBrC,6kBFsBT,CAEOC,iBAAAA,GACLR,KAAKS,QACP,CAEOC,oBAAAA,GACUV,KAAKK,WAAWM,cAAc,UACtCC,oBAAoB,QAASZ,KAAKD,cAC3C,CAEQU,MAAAA,GACST,KAAKK,WAAWM,cAAc,UACtCE,iBAAiB,QAASb,KAAKD,cACxC,CAEQE,eAAAA,CAAgBa,GAEtB,MAAMC,EAAiB,IAAIC,YAAoB,mCAAoC,CACjFC,OAAQ,CAAEC,QAASlB,KAAKmB,QAAQD,WAElCE,cAAcL,EAChB,EASGM,eAAeC,IAAI,0BACtBD,eAAeE,OAAO,wBAAyB5B,mB","sources":["webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.ts","webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.scss","webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.html"],"sourcesContent":["import { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders a button which, when clicked, requests showing the compare at price modal.\n */\nclass CompareAtPriceInfo extends HTMLElement implements CustomElement {\n  readonly dataset!: {\n    /**\n     * Content to be displayed in the compare at price modal for a particular variant\n     */\n    content: string;\n  };\n\n  public shadowRoot!: ShadowRoot;\n\n  private onButtonBound = this.onButtonClicked.bind(this);\n\n  public constructor() {\n    super();\n    this.attachShadow({ mode: 'open' });\n    this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n  }\n\n  public connectedCallback() {\n    this.render();\n  }\n\n  public disconnectedCallback() {\n    const anchor = this.shadowRoot.querySelector('button');\n    anchor.removeEventListener('click', this.onButtonBound);\n  }\n\n  private render() {\n    const anchor = this.shadowRoot.querySelector('button');\n    anchor.addEventListener('click', this.onButtonBound);\n  }\n\n  private onButtonClicked(_event: Event) {\n    type Detail = WindowEventMap['compare-at-price-modal-requested']['detail'];\n    const modalShowEvent = new CustomEvent<Detail>('compare-at-price-modal-requested', {\n      detail: { content: this.dataset.content }\n    });\n    dispatchEvent(modalShowEvent);\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'compare-at-price-info': CompareAtPriceInfo;\n  }\n}\n\nif (!customElements.get('compare-at-price-info')) {\n  customElements.define('compare-at-price-info', CompareAtPriceInfo);\n}\n","export default \":host{display:inline-block}button{appearance:none;background-color:#0000;border:none;color:inherit;cursor:pointer;display:block;padding:0;position:relative}button:after{content:\\\"\\\";height:200%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:200%}svg{color:inherit;display:block;height:14px;width:14px;stroke:currentcolor}\";","// Module\nvar code = \"<button aria-label=\\\"See details about the compare at price\\\"><svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"24\\\" height=\\\"24\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\"><path d=\\\"M9.09 9C9.3251 8.33167 9.78915 7.76811 10.4 7.40913C11.0108 7.05016 11.7289 6.91894 12.4272 7.03871C13.1255 7.15849 13.7588 7.52152 14.2151 8.06353C14.6713 8.60553 14.9211 9.29152 14.92 10C14.92 12 11.92 13 11.92 13M12 17H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/></svg></button>\";\n// Exports\nexport default code;"],"names":["CompareAtPriceInfo","HTMLElement","constructor","super","onButtonBound","this","onButtonClicked","bind","attachShadow","mode","shadowRoot","innerHTML","concat","connectedCallback","render","disconnectedCallback","querySelector","removeEventListener","addEventListener","_event","modalShowEvent","CustomEvent","detail","content","dataset","dispatchEvent","customElements","get","define"],"sourceRoot":""}