import{Fragment,h}from"@stencil/core";import{__}from"@wordpress/i18n";import{addQueryArgs}from"@wordpress/url";export class ScWordPressUser{constructor(){this.heading=void 0,this.user=void 0}renderContent(){var e,s,r,t,i,l,d,n;return this.user?h(Fragment,null,!!(null===(e=null==this?void 0:this.user)||void 0===e?void 0:e.display_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Display Name","surecart"))),h("div",null,null===(s=this.user)||void 0===s?void 0:s.display_name),h("div",null)),!!(null===(r=null==this?void 0:this.user)||void 0===r?void 0:r.email)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Account Email","surecart"))),h("div",null,null===(t=this.user)||void 0===t?void 0:t.email),h("div",null)),!!(null===(i=null==this?void 0:this.user)||void 0===i?void 0:i.first_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("First Name","surecart"))),h("div",null,null===(l=this.user)||void 0===l?void 0:l.first_name),h("div",null)),!!(null===(d=null==this?void 0:this.user)||void 0===d?void 0:d.last_name)&&h("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},h("div",null,h("strong",null,__("Last Name","surecart"))),h("div",null,null===(n=this.user)||void 0===n?void 0:n.last_name),h("div",null))):this.renderEmpty()}renderEmpty(){return h("slot",{name:"empty"},__("User not found.","surecart"))}render(){return h("sc-dashboard-module",{key:"b6c4379470ae52c4480a608670d43ee30ad5d97f",class:"customer-details"},h("span",{key:"ebeefa6dc968529dabd1be1a34ef300ceefba735",slot:"heading"},this.heading||__("Account Details","surecart")," "),h("sc-button",{key:"005905e56d18ff178e5b638c16af6bce8f2d0951",type:"link",href:addQueryArgs(window.location.href,{action:"edit",model:"user"}),slot:"end"},h("sc-icon",{key:"f75fdf8f61c08648c29597b96a2f0a9ef1c0e38c",name:"edit-3",slot:"prefix"}),__("Update","surecart")),h("sc-card",{key:"d70ccb9d63fccc976913ee9cd3eb5d23286e9b31","no-padding":!0},h("sc-stacked-list",{key:"83228a6d738a6d46fdbeac88d9f2dc6c1adda99d"},this.renderContent())))}static get is(){return"sc-wordpress-user"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-wordpress-user.css"]}}static get styleUrls(){return{$:["sc-wordpress-user.css"]}}static get properties(){return{heading:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"heading",reflect:!1},user:{type:"unknown",mutable:!1,complexType:{original:"WordPressUser",resolved:"WordPressUser",references:{WordPressUser:{location:"import",path:"../../../../types",id:"src/types.ts::WordPressUser"}}},required:!1,optional:!1,docs:{tags:[],text:""}}}}}