import{h}from"@stencil/core";import{openWormhole}from"stencil-wormhole";import{groupBundleLineItems}from"../../../../functions/line-items";export class ScOrderConfirmationLineItems{constructor(){this.order=void 0,this.loading=void 0}render(){var e,i;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 t=(null===(i=null===(e=this.order)||void 0===e?void 0:e.line_items)||void 0===i?void 0:i.data)||[],{regular:o,bundleParents:l,componentsByParent:n}=groupBundleLineItems(t),s=[...l,...o];return h("div",{class:{"confirmation-summary":!0}},h("div",{class:"line-items",part:"line-items"},s.map((e=>{var i,t,o,l,s,r;const a=null===(i=null==e?void 0:e.price)||void 0===i?void 0:i.product,d=!!(null==a?void 0:a.bundle);return h("div",{class:"line-item",key:e.id},h("sc-product-line-item",{image:null==a?void 0:a.line_item_image,name:null==a?void 0:a.name,price:null===(t=null==e?void 0:e.price)||void 0===t?void 0:t.name,variant:null==e?void 0:e.variant_display_options,editable:!1,removable:!1,quantity:e.quantity,fees:null===(o=null==e?void 0:e.fees)||void 0===o?void 0:o.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===(l=null==e?void 0:e.price)||void 0===l?void 0:l.trial_text,interval:`${null===(s=null==e?void 0:e.price)||void 0===s?void 0:s.short_interval_text} ${null===(r=null==e?void 0:e.price)||void 0===r?void 0:r.short_interval_count_text}`,purchasableStatus:null==e?void 0:e.purchasable_status_display,sku:null==e?void 0:e.sku,bundleComponents:d&&n[e.id]||[]}))}))))}static get is(){return"sc-order-confirmation-line-items"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-order-confirmation-line-items.scss"]}}static get styleUrls(){return{$:["sc-order-confirmation-line-items.css"]}}static get properties(){return{order:{type:"unknown",mutable:!1,complexType:{original:"Checkout",resolved:"Checkout",references:{Checkout:{location:"import",path:"../../../../types",id:"src/types.ts::Checkout"}}},required:!1,optional:!1,docs:{tags:[],text:""}},loading:{type:"boolean",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"loading",reflect:!1}}}}openWormhole(ScOrderConfirmationLineItems,["order","busy","loading","empty"],!1);