import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{o as openWormhole}from"./consumer.js";import{a as groupBundleLineItems}from"./index6.js";import{d as defineCustomElement$8}from"./sc-button2.js";import{d as defineCustomElement$7}from"./sc-icon2.js";import{d as defineCustomElement$6}from"./sc-line-item2.js";import{d as defineCustomElement$5}from"./sc-product-line-item2.js";import{d as defineCustomElement$4}from"./sc-product-line-item-note2.js";import{d as defineCustomElement$3}from"./sc-quantity-select2.js";import{d as defineCustomElement$2}from"./sc-skeleton2.js";import{d as defineCustomElement$1}from"./sc-spinner2.js";const scOrderConfirmationLineItemsCss=":host{display:block}.line-items{display:grid;gap:var(--sc-spacing-small)}.line-item{display:grid;gap:var(--sc-spacing-small)}.fee__description{opacity:0.75}",ScOrderConfirmationLineItemsStyle0=scOrderConfirmationLineItemsCss,ScOrderConfirmationLineItems=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.order=void 0,this.loading=void 0}render(){var e,t;if(this.loading)return h("sc-line-item",null,h("sc-skeleton",{style:{width:"50px",height:"50px","--border-radius":"0"},slot:"image"}),h("sc-skeleton",{slot:"title",style:{width:"120px",display:"inline-block"}}),h("sc-skeleton",{slot:"description",style:{width:"60px",display:"inline-block"}}),h("sc-skeleton",{style:{width:"120px",display:"inline-block"},slot:"price"}),h("sc-skeleton",{style:{width:"60px",display:"inline-block"},slot:"price-description"}));const i=(null===(t=null===(e=this.order)||void 0===e?void 0:e.line_items)||void 0===t?void 0:t.data)||[],{regular:s,bundleParents:n,componentsByParent:o}=groupBundleLineItems(i),l=[...n,...s];return h("div",{class:{"confirmation-summary":!0}},h("div",{class:"line-items",part:"line-items"},l.map((e=>{var t,i,s,n,l,m;const r=null===(t=null==e?void 0:e.price)||void 0===t?void 0:t.product,d=!!(null==r?void 0:r.bundle);return h("div",{class:"line-item",key:e.id},h("sc-product-line-item",{image:null==r?void 0:r.line_item_image,name:null==r?void 0:r.name,price:null===(i=null==e?void 0:e.price)||void 0===i?void 0:i.name,variant:null==e?void 0:e.variant_display_options,editable:!1,removable:!1,quantity:e.quantity,fees:null===(s=null==e?void 0:e.fees)||void 0===s?void 0:s.data,note:null==e?void 0:e.display_note,amount:e.ad_hoc_display_amount?e.ad_hoc_display_amount:e.subtotal_display_amount,scratch:!e.ad_hoc_display_amount&&(null==e?void 0:e.scratch_display_amount),trial:null===(n=null==e?void 0:e.price)||void 0===n?void 0:n.trial_text,interval:`${null===(l=null==e?void 0:e.price)||void 0===l?void 0:l.short_interval_text} ${null===(m=null==e?void 0:e.price)||void 0===m?void 0:m.short_interval_count_text}`,purchasableStatus:null==e?void 0:e.purchasable_status_display,sku:null==e?void 0:e.sku,bundleComponents:d&&o[e.id]||[]}))}))))}static get style(){return ScOrderConfirmationLineItemsStyle0}},[1,"sc-order-confirmation-line-items",{order:[16],loading:[4]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-order-confirmation-line-items","sc-button","sc-icon","sc-line-item","sc-product-line-item","sc-product-line-item-note","sc-quantity-select","sc-skeleton","sc-spinner"].forEach((e=>{switch(e){case"sc-order-confirmation-line-items":customElements.get(e)||customElements.define(e,ScOrderConfirmationLineItems);break;case"sc-button":customElements.get(e)||defineCustomElement$8();break;case"sc-icon":customElements.get(e)||defineCustomElement$7();break;case"sc-line-item":customElements.get(e)||defineCustomElement$6();break;case"sc-product-line-item":customElements.get(e)||defineCustomElement$5();break;case"sc-product-line-item-note":customElements.get(e)||defineCustomElement$4();break;case"sc-quantity-select":customElements.get(e)||defineCustomElement$3();break;case"sc-skeleton":customElements.get(e)||defineCustomElement$2();break;case"sc-spinner":customElements.get(e)||defineCustomElement$1()}}))}openWormhole(ScOrderConfirmationLineItems,["order","busy","loading","empty"],!1);export{ScOrderConfirmationLineItems as S,defineCustomElement as d};