import{r as t,h as e,a as s}from"./p-e97fde0a.js";import{a as i}from"./p-dd3464cd.js";import{o as r}from"./p-b719a497.js";import{a}from"./p-401e165e.js";import"./p-d3366af3.js";const o=":host{display:block;position:relative}.customer-details{display:grid;gap:0.75em}";const n=o;const d=class{constructor(e){t(this,e);this.customerId=undefined;this.heading=undefined;this.customer=undefined;this.loading=undefined;this.error=undefined}componentWillLoad(){r(this.el,(()=>{this.fetch()}))}async fetch(){if(""===this.customerId){return}try{this.loading=true;this.customer=await await i({path:a(`surecart/v1/customers/${this.customerId}`,{expand:["shipping_address","billing_address","tax_identifier"]})})}catch(t){if(t===null||t===void 0?void 0:t.message){this.error=t.message}else{this.error=wp.i18n.__("Something went wrong","surecart")}console.error(this.error)}finally{this.loading=false}}render(){return e("sc-customer-details",{key:"2b634a85254137e276c91bb03439247b219ca7fc",exportparts:"base, heading, heading-text, heading-title, heading-description, error__base, error__icon, error__text, error__title, error__message, test-tag__base, test-tag__content, button__base, button__label, button__prefix",customer:this.customer,loading:this.loading,error:this.error,heading:this.heading,"edit-link":a(window.location.href,{action:"edit",model:"customer",id:this.customerId})})}get el(){return s(this)}};d.style=n;export{d as sc_dashboard_customer_details};
//# sourceMappingURL=p-e1ed459e.entry.js.map