{"version":3,"file":"content.mjs","sources":["../../../../src/content/content.ts"],"sourcesContent":["import { html, LitElement, unsafeCSS, CSSResult} from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { appendStylesheet, warnOnDeprecatedSlot } from '../core/utils';\nimport styles from './content.scss?inline';\nimport slotStyles from './content.slot.scss?inline';\n\n@customElement('pips-v1-content')\nexport class Content extends LitElement {\n  static override styles: CSSResult = unsafeCSS(styles);\n\n  @property({ type: String })\n  fullWidth: boolean = false;\n\n  @property({ type: String })\n  iconPosition: string = '';\n\n  override connectedCallback(): void {\n    super.connectedCallback();\n\n    // Only required if you need to apply styles to slotted elements\n    appendStylesheet({\n      target: this,\n      styles: slotStyles,\n      name: `${this.tagName.toLowerCase()}-slot`\n    });\n  }\n\n  private onDeprecatedDefaultSlot(e: Event) {\n    warnOnDeprecatedSlot(e, '[pips-v1-content] Default slot is deprecated. Use slot=\"body\" instead.');\n  }\n\n  private getTemplate() {\n        if (this.iconPosition === 'left') {\n          return html`\n          <slot name=\"image\" class=\"iconImage\"></slot>\n          <div class=\"content-wrap\">\n            <slot name=\"heading\"></slot>\n            <slot name=\"sub-heading\"></slot>\n            <!-- Body content goes into the default slot -->\n            <slot @slotchange=\"${this.onDeprecatedDefaultSlot}\"></slot>\n            <slot name=\"body\"></slot>\n            <slot name=\"call-to-action\"></slot>\n          </div>\n        `;\n        } else {\n        return html`\n          <slot name=\"image\"></slot>\n          <slot name=\"heading\"></slot>\n          <slot name=\"sub-heading\"></slot>\n          <!-- Body content goes into the default slot -->\n          <slot @slotchange=\"${this.onDeprecatedDefaultSlot}\"></slot>\n          <slot name=\"body\"></slot>\n          <slot name=\"call-to-action\"></slot>\n        `;\n    }\n  }\n  override render() {\n    return html`\n      <div class=\"layout\">\n        <div class=\"teaser-container\">\n          ${this.getTemplate()}\n        </div>\n      </div>\n    `;\n  }\n}"],"names":["Content","LitElement","constructor","super","arguments","this","fullWidth","iconPosition","connectedCallback","appendStylesheet","target","styles","name","tagName","toLowerCase","e","warnOnDeprecatedSlot","getTemplate","html","onDeprecatedDefaultSlot","render","unsafeCSS","__decorateClass","property","type","String","prototype","customElement"],"mappings":"upCAOO,IAAMA,EAAN,cAAsBC,CAAAA,CAAtB,aAAAC,CAAAC,MAAAA,GAAAC,SAAAA,EAILC,KAAAC,UAAAA,GAGAD,KAAAE,aAAuB,EAAA,CAEd,mBAAAC,CACPL,MAAMK,kBAAAA,EAGNC,EAAiB,CACfC,OAAQL,KACRM,gvEACAC,KAAM,GAAGP,KAAKQ,QAAQC,YAAAA,CAAAA,OAAAA,CAAAA,CAE1B,CAEQ,wBAAwBC,EAAAA,CAC9BC,EAAqBD,EAAG,wEAAA,CAC1B,CAEQ,aAAAE,CACF,OAAIZ,KAAKE,eAAiB,OACjBW;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,iCAMgBb,KAAKc,uBAAAA;AAAAA;AAAAA;AAAAA;AAAAA,UAMvBD;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,+BAKgBb,KAAKc,uBAAAA;AAAAA;AAAAA;AAAAA,SAKlC,CACS,QAAAC,CACP,OAAOF;AAAAA;AAAAA;AAAAA,YAGCb,KAAKY,YAAAA,CAAAA;AAAAA;AAAAA;AAAAA,KAIf,CAAA,EAzDWjB,EACKW,OAAoBU,01BAGpCC,EAAA,CADCC,EAAS,CAAEC,KAAMC,MAAAA,CAAAA,CAAAA,EAHPzB,EAIX0B,UAAA,YAAA,CAAA,EAGAJ,EAAA,CADCC,EAAS,CAAEC,KAAMC,MAAAA,CAAAA,CAAAA,EANPzB,EAOX0B,UAAA,eAAA,CAAA,EAPW1B,EAANsB,EAAA,CADNK,EAAc,oBACF3B,CAAAA"}