import{r as t,h as e,a as s}from"./p-9add63ef.js";import"./p-8dccb656.js";import{o as i}from"./p-b719a497.js";import{a as r}from"./p-401e165e.js";import{a}from"./p-259c3935.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(){i(this.el,(()=>{this.fetch()}))}async fetch(){if(""===this.customerId){return}try{this.loading=true;this.customer=await await a({path:r(`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:"e79ff11c856a35e0b86429338178ecbfdccc59fc",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":r(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-625c5102.entry.js.map