1import{s as N,u as R,c as U,a as W,_ as te,b as me,t as fe,d as ve,e as re,f as he}from"./entry.2ehg4ZD6.js";import{_ as oe}from"./sprite.MSAEivaF.js";import{G as o,L as n,_ as t,a8 as y,u as e,M as i,ac as Oe,a as g,c as K,Q as p,a0 as J,$ as ue,H as V,aa as pe,ab as be,ad as $e,X as ce,V as L,C as we,a1 as ge,P as k,T as O,Y as q,Z as Q,a9 as de,N as Y,w as _e,q as Z,S as Ve}from"./swiper-vue.iPC35nDh.js";import{u as ye,_ as De,a as Me}from"./products.B9NnDm_y.js";import{_ as Ie}from"./OrderItem.vue.Mwv4YnmI.js";import{_ as Le}from"./Globe.vue.Du-cvUfs.js";import{_ as Ne,a as Te,u as je,b as Ue}from"./Trigger.CzJ2a4iC.js";import{l as ae}from"./log.BJl5G_4Q.js";import{u as ke}from"./app.C61p9UAB.js";import{_ as Ce}from"./EntireLink.Brkj9KUL.js";import{_ as Re}from"./Input.B0zO46lR.js";import{_ as Je}from"./Radiobutton.Dzhp2L1L.js";import{_ as He}from"./BouncingDots.CQJZ1P1-.js";import"./EntireMedia.C7G8GjGR.js";import"./client-only.CdBPenLZ.js";import"./EntireResize.x4YkSxw8.js";import"./dimensions.DOnGCwxX.js";import"./v4.LUkOAzCQ.js";import"./view-height.CZaf9OBr.js";import"./cart.ecZ5euuP.js";import"./nuxt-link.Dmp1iV9N.js";const ze=oe+"#icon-triangle",Ge={class:"account-banner"},qe={class:"account-banner__topbar"},Qe={class:"account-banner-col account-banner-col--left"},Ye={class:"el-label account-role"},Xe=t("svg",{class:"icon"},[t("use",{"xlink:href":ze})],-1),Ze={key:0,class:"account-banner-col account-banner-col--right"},Ke={class:"h-color--secondary"},We={class:"account-banner__body"},Be={class:"el-heading el-heading--h1 h-word-break"},et={class:"account-banner__bottombar"},tt={key:0,class:"account-banner-col account-banner-col--left"},ot=t("span",{class:"h-b"},"Supporter",-1),st=[ot],nt={key:1,class:"account-banner-col account-banner-col--right"},at={class:"h-color--secondary h-word-break"},lt={__name:"Banner",setup(a){const{user:d,hasSubscription:s,hasCommunityProfile:l}=N(R()),{$prettifyDateFormat:f}=W();return(u,r)=>(o(),n("section",Ge,[t("div",qe,[t("div",Qe,[t("div",Ye,[Xe,t("span",null,y(e(l)?e(d).community_member_details.community_member_type:e(U).default_community_member_type),1)])]),(e(d)||{}).createdAt?(o(),n("div",Ze,[t("span",Ke,"since "+y(e(f)(e(d).createdAt)),1)])):i("",!0)]),t("div",We,[t("span",Be,y((e(d)||{}).name??"Profile"),1)]),t("div",et,[e(s)?(o(),n("div",tt,st)):i("",!0),(e(d)||{}).company?(o(),n("div",nt,[t("span",at,y(e(d).company),1)])):i("",!0)])]))}},it=lt,ct=a=>(pe("data-v-8c2be62d"),a=a(),be(),a),rt={class:"configurations-list"},ut={class:"configurations-lis__header"},dt={class:"configurations-list__body"},_t={key:1,class:"configuration-list-dummy"},mt=ct(()=>t("div",{class:"el-heading el-heading--h3 h-center h-color--secondary"},"No configurations found.",-1)),pt=[mt],bt={key:0,class:"configurations-list__footer"},yt={__name:"List",async setup(a){let d,s;const l=me(),{categories:f}=N(ye()),{userOrders:u}=N(R()),{saveCategoriesToStore:r}=ye();if(!f.value.length){const{data:m,error:x}=([d,s]=Oe(()=>l.fetchCategories()),d=await d,s(),d);x.value||r(m.value)}const h=g([{label:"Newest First",value:"all"}].concat(f.value.map(m=>({label:m.title,value:m.id})))),C=g([]),v=g("all"),E=()=>{C.value=[...h.value].sort(m=>m.value===v.value?-1:1)},c=m=>{if(v.value==="all")return!0;{const x=f.value.find(F=>F.id===v.value),M=JSON.parse(JSON.stringify(m.cart));return m.cart=M.filter(F=>{var j;return F.product?x.products.some(I=>I.id===F.product.id)||delete F.product:(j=F.printed_part)!=null&&j.product&&(x.products.some(I=>{var B;return I.id===((B=F.printed_part)==null?void 0:B.product.id)})||delete F.printed_part),F.product||F.printed_part}),m.cart.length}},A=K(()=>u.value.map(m=>JSON.parse(JSON.stringify(m))).filter(m=>v.value?c(m):!0).sort((m,x)=>new Date(x.createdAt)<=new Date(m.createdAt)?-1:1)),w=g([]),S=g(A.value.length>=3?3:A.value.length),$=g(!1),H=K(()=>S.value<A.value.length||$.value),D=()=>{w.value=A.value.filter((m,x)=>x<S.value)};E(),D();const X=()=>{S.value<A.value.length&&($.value=!0,setTimeout(()=>{const m=A.value.length-S.value;S.value+=m>=3?3:m,D(),$.value=!1},300))},T=m=>{v.value=m,S.value=3,setTimeout(()=>{D()},0)};return(m,x)=>{const M=De,F=Ie,j=Me;return o(),n("div",rt,[t("div",ut,[p(M,{"model-value":e(v),color:"light",size:"small",class:"el-sorting-select--no-border",label:!1,"chevron-icon":"arrow-desc",placement:"top",options:e(C),onFocus:E,onChange:T}
1,null,8,["model-value","options"])]),t("div",dt,[e(w).length?(o(!0),n(J,{key:0},ue(e(w),z=>(o(),n("div",{class:"configuration-order",key:z.id},[(o(!0),n(J,null,ue(z.cart,(I,B)=>(o(),V(F,{key:`${z.id}-${B}`,order:z,"cart-item":I,generate:!1,class:"configuration-item"},null,8,["order","cart-item"]))),128))]))),128)):(o(),n("div",_t,pt))]),e(H)?(o(),n("div",bt,[p(j,{class:"el-button--thirdly",loading:e($),onClick:X},null,8,["loading"])])):i("",!0)])}}},ft=te(yt,[["__scopeId","data-v-8c2be62d"]]),vt={class:"account-configurations-count"},ht={key:0,class:"h-color--secondary"},$t={__name:"Counter",props:{subscription:{type:Object,default:null}},setup(a){return(d,s)=>(o(),n("div",vt,[t("span",null,y(4-a.subscription.download_count)+" of 4 included downloads used.",1),a.subscription.renewal_date?(o(),n("span",ht," Downloads renew on "+y(new Date(a.subscription.renewal_date).toLocaleString("en-GB",{year:"numeric",month:"long",day:"numeric"}))+". ",1)):i("",!0)]))}},wt=te($t,[["__scopeId","data-v-388d7588"]]),gt=a=>(pe("data-v-b8ab9791"),a=a(),be(),a),kt={key:0,class:"account-section account-section--configurations"},Ct=gt(()=>t("div",{class:"account-section__header"},[t("span",{class:"el-heading"},"Configurations")],-1)),St={key:0,class:"account-section__body"},Et={key:1,class:"account-section__footer"},Pt={__name:"Index",setup(a){const{hasSubscription:d,subscriptionDetails:s,ordersCount:l}=N(R());return(f,u)=>{const r=ft,h=wt;return e(d)||e(l)?(o(),n("section",kt,[Ct,e(l)?(o(),n("div",St,[p(r)])):i("",!0),e(d)&&f.$isObject(e(s))?(o(),n("div",Et,[p(h,{subscription:e(s)},null,8,["subscription"])])):i("",!0)])):i("",!0)}}},At=te(Pt,[["__scopeId","data-v-b8ab9791"]]),xt={key:0,class:"el-heading"},Ft={class:"el-link__label"},Ot={__name:"Board",props:{color:{type:String,default:null,validator:a=>["grey","dark-grey"].includes(a)},title:{type:String,default:null},centered:{type:Boolean,default:!1},actionTitle:{type:String,default:null},actionIcon:{type:String,default:null},actionClass:{type:String,default:"el-link el-link--secondary"}},emits:["action"],setup(a,{expose:d}){const s=g(null),l=g(null),f=g(null),u=g(null);return d({rootEl:s,headerEl:l,actionsEl:f,bodyEl:u}),(r,h)=>{const C=$e("SvgSprite");return o(),n("div",{ref_key:"rootEl",ref:s,class:L(["c-board",[a.color?`c-board--${a.color}`:""]])},[r.$slots.title||a.title||r.$slots.actions||a.actionTitle||a.actionIcon?(o(),n("div",{key:0,ref_key:"headerEl",ref:l,class:"c-board__header"},[r.$slots.title?i("",!0):(o(),n("span",xt,y(a.title),1)),ce(r.$slots,"title"),r.$slots.actions||a.actionTitle||a.actionIcon?(o(),n("div",{key:1,ref_key:"actionsEl",ref:f,class:"c-board__actions"},[ce(r.$slots,"actions"),a.actionTitle||a.actionIcon?(o(),n("button",{key:0,type:"button",class:L(["c-board__cta",a.actionClass]),onClick:h[0]||(h[0]=v=>r.$emit("action"))},[t("span",Ft,y(a.actionTitle),1),a.actionIcon?(o(),V(C,{key:0,symbol:`icon-${a.actionIcon}`,class:"icon"},null,8,["symbol"])):i("",!0)],2)):i("",!0)],512)):i("",!0)],512)):i("",!0),t("div",{ref_key:"bodyEl",ref:u,class:L(["c-board__body",{"c-board__body--centered":a.centered}])},[ce(r.$slots,"default")],2)],2)}}},Se=Ot,Vt=oe+"#icon-cross",Dt=oe+"#icon-plus",Mt={key:0,class:"el-heading"},It={key:0,class:"el-label el-label--small h-b h-sup"},Lt={class:"el-link__label"},Nt={key:0,class:"icon"},Tt=t("use",{"xlink:href":Vt},null,-1),jt=[Tt],Ut={key:1,class:"icon"},Rt=t("use",{"xlink:href":Dt},null,-1),Jt=[Rt],Ht=["id"],zt={key:0,class:"community-profile-overview__body"},Gt={class:"el-label"},qt={class:"el-label el-label--small h-b h-sup"},Qt={key:0,class:"community-profile-overview__body"},Yt={class:"el-label"},Xt={class:"h-word-break-all"},Zt={key:0,class:"el-label el-label--small h-b h-sup"},Kt={key:0,class:"community-profile-overview__body"},Wt={class:"el-label"},Bt={key:0,class:"community-profile-overview__body"},eo={class:"el-label"},to={key:0,class:"community-profile-overview__body"},oo={class:"el-label"},so={key:0,class:"community-profile-overview__body"},no={class:"el-label"},ao={__name:"ProfileDetailsOverview",props:{transition:{type:Object,default:()=>fe.fade}},emits:["component-changed"],setup(a){const{user:d,community_profile:s}=N(R()),{setCommunityProfile:l,setUser:f}=R(),{fetchUser:u}=ve(),r=me(),{$debounce:h}=W(),C=a,v=g(null),E=g(!1),c=g(!1),A=g(null),w=g(null),S=T=>{E.value=!0,w.value=T,h(C.transition.duration,()=>v.value&&v.value.rootEl&&v.value.rootEl.classList.add("community-profile-overview--flow-open"))()},$=()=>{E.value=!1,w.value=null,c.value=!1,l(d.value.community_member_details),v.value&&v.value.rootEl&&v.value.rootEl.classList.remove("community-profile-overview--flow-open")},H=()=>{E.value=!1,w.value=null,v.value.rootEl.classList.remove("community-profile-overview--flow-open")},D=()=>{c.value=!0,w.value=null},X=async()=>{const T=Object.assign(d.value,{community_member_details:Object.assign(d.value.community_member_details,{profile_visibility:!d.value.community_member_details.profile_visibility})});try{const m=await r.updateMe(T);ae("[CommunityFlow:ProfileDetailOverview] PUT response:",m);const x=await u();ae("[CommunityFlow:ProfileDetailOverview] updated user:",x.value),f(x.value)}catch{}};return we(()=>{A.value=`teleport-${Math.floor(Math.random()*1e6)}`,v.value&&v.value.rootEl&&v.value.rootEl.style.setProperty("--fade-transition-duration",`${C.transition.duration}ms`)}),(T,m)=>{const x=Ne,M=Se;return o(),V(M,{ref_key:"rootEl",ref:v,color:"grey",class:L(["community-profile-overview",{"community-profile-overview--hidden":e(s)&&e(s).hasOwnProperty("profile_visibility")&&!e(s).profile_visibility}])},ge({title:k(()=>[p(O,q(Q(a.transition)),{default:k(()=>[e(E)?i("",!0):(o(),n("span",Mt,[de(" Public Profile "),e(s)&&e(s).hasOwnProperty("profile_visibility")&&!e(s).profile_visibility?(o(),n("span",It," Hidden ")):i("",!0)]))]),_:1},16)]),default:k(()=>[e(s)?(o(),n(J,{key:0},[t("div",{id:e(A),class:"community-profile-overview__flow"},[p(x,{"teleport-to":`#${e(A)}`,transition:a.transition,class:"community-profile-overview__trigger","trigger-class":"el-link el-link--light",label:"Edit","trigger-icon":"edit",trigger:"edit-profile-details",onFlowOpen:S,onFlowClose:$,onFlowSuccess:D,onFlowFinish:H,onComponentChanged:m[0]||(m[0]=F=>T.$emit("component-changed"))},null,8,["teleport-to","transition"])],8,Ht),p(O,q(Q(a.transition)),{default:k(()=>[e(s).name&&!e(E)?(o(),n("div",zt,[t("span",Gt,[de(y(e(s).name)+" ",1),t("span",qt,y(e(s).community_member_type),1)])])):i("",!0)]),_:1},16),p(O,q(Q(a.transition)),{default:k(()=>[e(E)?i("",!0):(o(),n("div",Qt,[t("span",Yt,[t("span",Xt,y(e(s).contact_email??"No contact email"),1),e(s).name?i("",!0):(o(),n("span",Zt,y(e(s).community_member_type),1))])]))]),_:1},16),p(O,q(Q(a.transition)),{default:k(()=>
1[e(s).company&&!e(E)?(o(),n("div",Kt,[t("span",Wt,y(e(s).company),1)])):i("",!0)]),_:1},16),p(O,q(Q(a.transition)),{default:k(()=>[e(s).phone_number&&!e(E)?(o(),n("div",Bt,[t("span",eo,y(e(s).phone_number),1)])):i("",!0)]),_:1},16),p(O,q(Q(a.transition)),{default:k(()=>[e(s).website&&!e(E)?(o(),n("div",to,[t("span",oo,y(e(s).website),1)])):i("",!0)]),_:1},16),p(O,q(Q(a.transition)),{default:k(()=>[e(s).printer_setup&&!e(E)?(o(),n("div",so,[t("span",no,y(e(s).printer_setup),1)])):i("",!0)]),_:1},16)],64)):i("",!0)]),_:2},[e(s)&&e(s).hasOwnProperty("profile_visibility")?{name:"actions",fn:k(()=>[p(O,q(Q(a.transition)),{default:k(()=>[e(E)?i("",!0):(o(),n("button",{key:0,type:"button",class:"el-link el-link--light community-profile-overview__trigger",onClick:X},[t("span",Lt,y(e(s).profile_visibility?"Hide Profile":"Show Profile"),1),e(s).profile_visibility?(o(),n("svg",Nt,jt)):(o(),n("svg",Ut,Jt))]))]),_:1},16)]),key:"0"}:void 0]),1032,["class"])}}},lo=ao,io=a=>(pe("data-v-1a394749"),a=a(),be(),a),co=io(()=>t("div",{class:"account-section__header"},[t("span",{class:"el-heading"},"Community")],-1)),ro={key:0,class:"my-community-profile community-globe-wrapper"},uo={__name:"CommunityProfile",props:{transition:{type:Object,default:()=>fe.fade}},setup(a){const d=a,{hasCommunityProfile:s,community_profile:l}=N(R()),{uiElements:f}=N(ke()),{$scrollTo:u}=W(),r=g(null),h=g(null),C=g(!s.value),v=K(()=>s.value?{lat:l.value.lat,long:l.value.long}:null),E=K(()=>{var w;return(w=l.value)!=null&&w.profile_visibility?l.value:null}),c=()=>{C.value=!1},A=()=>{var w,S;u(h.value,-1*((S=(w=f.value)==null?void 0:w.header)==null?void 0:S.offsetHeight))};return we(()=>{r.value.style.setProperty("--fade-transition-duration",`${d.transition.duration}ms`)}),(w,S)=>{const $=Le,H=lo,D=Te;return o(),n("section",{ref_key:"rootEl",ref:r,class:"account-section account-section--community"},[co,t("div",{ref_key:"communityFlowEl",ref:h,class:"account-section__body"},[p(O,Y(a.transition,{mode:"out-in"}),{default:k(()=>[e(s)&&!e(C)?(o(),n("div",ro,[p($,{"compact-ui":"","initial-location":e(v),"initial-member":e(E),"initially-interactive":""},null,8,["initial-location","initial-member"]),p(H,{transition:a.transition,onComponentChanged:A},null,8,["transition"])])):!e(s)||e(C)?(o(),V(D,{key:1,class:"all-community-profiles",transition:a.transition,onFlowClose:c,onFlowFinish:c,onComponentChanged:A},null,8,["transition"])):i("",!0)]),_:1},16)],512)],512)}}},_o=te(uo,[["__scopeId","data-v-1a394749"]]),mo={key:0,class:"follow-boards"},po={key:1,class:"el-button-label"},bo={key:0,class:"el-heading el-heading--h2"},yo={key:1,class:"el-button-label"},fo={__name:"Boards",props:{collapsable:{type:Boolean,default:!0},collapsed:{type:Boolean,default:!1},arena:{type:[Boolean,Object],default:!0},discord:{type:[Boolean,Object],default:!0}},setup(a){const{$omit:d}=W(),s=a,l=g({type:"arena",collapsed:!1,title:"Follow us on Are.na to find references and ideas that can help you with your project.",color:null,url:"https://www.are.na/1x1-systems/",buttonExpandedLabel:"Follow us on Are.na",buttonCollapsedLabel:"are.na",buttonIcon:"arena"}),f=g({type:"discord",collapsed:!1,title:"Join our marketplace on Discord to exchange knowledge, trade parts, and offer services.",color:null,url:"https://discord.gg/MdatAQtP",buttonIcon:"discord",buttonExpandedLabel:"Join our Discord Server",buttonCollapsedLabel:"Discord"});(s.arena??null)!==null&&(l.value=s.arena?{...l.value,...typeof s.arena=="object"&&!Array.isArray(s.arena)&&Object.keys(s.arena).length?d(s.arena,"type","collapsed"):{},...s.collapsed?{collapsed:!0}:{}}:null),(s.discord??null)!==null&&(f.value=s.discord?{...f.value,...typeof s.discord=="object"&&!Array.isArray(s.discord)&&Object.keys(s.discord).length?d(s.discord,"type","collapsed"):{},...s.collapsed?{collapsed:!0}:{}}:null);const u=r=>{switch(r){case"arena":l.value.collapsed=!l.value.collapsed;break;case"discord":f.value.collapsed=!f.value.collapsed;break}};return(r,h)=>{const C=$e("SvgSprite"),v=Ce,E=Se;return[e(f),e(l)].filter(c=>c).length?(o(),n("div",mo,[(o(!0),n(J,null,ue([e(l),e(f)].filter(c=>c),c=>
1(o(),V(O,{key:c.type,name:"fade",mode:"out-in"},{default:k(()=>[c.collapsed?(o(),V(v,{key:0,class:L(["el-button el-button--collapsed",[`${c.type}-button`,c.buttonClass?c.buttonClass:null]]),to:c.url?c.url:null},{default:k(()=>[c.buttonIcon?(o(),V(C,{key:0,symbol:`icon-${c.buttonIcon}`,class:"icon"},null,8,["symbol"])):i("",!0),c.buttonCollapsedLabel?(o(),n("span",po,y(("useState"in r?r.useState:e(re))("isMobile").value?c.buttonCollapsedLabel:c.buttonExpandedLabel),1)):i("",!0)]),_:2},1032,["class","to"])):(o(),V(E,{key:1,color:c.color,centered:"",class:L(["follow-board",`follow-board--${c.type}`]),"action-title":a.collapsable?"Close":null,"action-icon":a.collapsable?"cross":null,"action-class":`${c.type==="discord"?"el-link--light":"el-link--secondary"}${("useState"in r?r.useState:e(re))("isMobile").value?" el-link el-link--small":" el-link"}`,onAction:A=>u(c.type)},{default:k(()=>[c.title?(o(),n("span",bo,y(c.title),1)):i("",!0),c.buttonExpandedLabel||c.url||c.buttonIcon?(o(),V(v,{key:1,class:L(["el-button",[`${c.type}-button`,c.buttonClass?c.buttonClass:null]]),to:c.url},{default:k(()=>[c.buttonIcon?(o(),V(C,{key:0,symbol:`icon-${c.buttonIcon}`,class:"icon"},null,8,["symbol"])):i("",!0),c.buttonExpandedLabel?(o(),n("span",yo,y(c.buttonExpandedLabel),1)):i("",!0)]),_:2},1032,["class","to"])):i("",!0)]),_:2},1032,["color","class","action-title","action-icon","action-class","onAction"]))]),_:2},1024))),128))])):i("",!0)}}},vo=fo,ho={class:"account-details account-details--editor"},$o={class:"account-details-section"},wo=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Information")],-1),go={class:"account-details-section__body"},ko={class:"c-form-row c-form-row--inputs"},Co={class:"c-form-col"},So={class:"c-form-field"},Eo={class:"c-form-col"},Po={class:"c-form-field"},Ao=t("span",null,[de("Company"),t("span",{class:"el-label el-label--medium el-label--optional"},"optional")],-1),xo={class:"c-form-col"},Fo={class:"c-form-field"},Oo={class:"c-form-col"},Vo={class:"c-form-field"},Do={key:0,class:"account-details-section"},Mo=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Membership")],-1),Io={class:"account-details-section__body"},Lo={key:0,class:"c-form-row c-form-row--inputs"},No={class:"c-form-col"},To={class:"c-form-field"},jo={class:"c-form-col"},Uo={class:"c-form-field"},Ro={key:1,class:"c-form-row"},Jo={class:"c-form-field-error-message"},Ho={class:"account-details-section"},zo=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Subscription")],-1),Go={class:"account-details-section__body"},qo={class:"c-form-row d-flex flex-wrap"},Qo={class:"c-form-col account-subscription-info"},Yo={class:"el-label"},Xo={key:0,class:"el-label"},Zo={class:"c-form-col c-form-col--fullwidth"},Ko={class:"c-form-field c-form-field--no-label"},Wo={class:"c-form-col account-subscription-action"},Bo=t("span",{class:"el-link__label"},"Cancel subscription",-1),es=[Bo],ts=t("div",{class:"c-form-col c-form-col--fullwidth account-subscription-action"},null,-1),os={key:1,class:"c-form-col c-form-col--fullwidth account-subscription-action"},ss=t("span",{class:"el-button__label"},"Subscribe Now",-1),ns={class:"c-form__footer"},as={class:"c-form-row"},ls={class:"c-form-col c-form-col--fullwidth"},is={class:"c-form-field c-form-field--action"},cs=["allow-pointer-events","disabled"],rs=t("span",{class:"el-button__label"},"Save Changes",-1),us={__name:"DetailsEditor",emits:["saved"],setup(a,{emit:d}){const s=he,{$validateEmail:l}=W(),f=me(),{user:u,isRegistredViaThirdPartyService:r,hasCommunityProfile:h,hasSubscription:C}=N(R()),{setUser:v,cancelSubscription:E}=R(),{fetchUser:c}=ve(),A=d;K(()=>!!(h.value&&ee.value===U.member_type.member)),K(()=>!!(h.value&&ee.value===U.member_type.maker)),K(()=>!!(h.value&&ee.value===U.member_type.makerspace));const w=g(!1),{register:S,errors:$,handleSubmit:H,validateField:D}=je({initialValues:{name:(u.value||{}).name??"",email:(u.value||{}).email??"",confirmEmail:"",password:"",confirmPassword:"",company:(u.value||{}).company??"",newsletter_status:(u.value||{}).newsletter_status===s.newsletter_status.subscribed,community_member_type:h.value?u.value.community_member_details.community_member_type:U.default_community_member_type},validate(_){const b={};return _.password&&_.password!==_.confirmPassword&&(b.confirmPassword="Password does not match"),_.email&&_.email!==u.value.email&&_.email!==_.confirmEmail&&(b.confirmEmail="Emails do not match"),b},onInvalid:_=>{},onSubmit:async _=>{w.value=!0;const b={};
1if(_.name&&_.name!==u.value.name&&(b.name=_.name),_.company!==u.value.company&&(b.company=_.company),!r.value&&_.email&&_.email!==u.value.email&&(b.email=_.email,b.username=_.email),_.password&&(b.password=_.password),_.newsletter_status!==(u.value.newsletter_status===s.newsletter_status.subscribed)&&(b.newsletter_status=u.value.newsletter_status===s.newsletter_status.subscribed?s.newsletter_status.unsubscribed:s.newsletter_status.subscribed),h.value&&_.community_member_type!==u.value.community_member_details.community_member_type&&(b.community_member_details=Object.assign(u.value.community_member_details,{community_member_type:_.community_member_type})),Object.keys(b).length){const G=Object.assign(u.value,b);try{const se=await f.updateMe(G);ae("[EditAccountFlow:DetailsEditorForm] PUT response:",se);const ne=await c();ae("[EditAccountFlow:DetailsEditorForm] updated user:",ne),v(ne),A("saved"),w.value=!1}catch{w.value=!1}}else A("saved"),w.value=!1}}),{value:X,attrs:T}=S("name"),{value:m,attrs:x}=S("email",{validate(_){if(_&&!l(_))return"Please enter a valid email address"}}),{value:M,attrs:F}=S("confirmEmail"),{value:j,attrs:z}=S("password",{validate(_){if(_&&`${_}`.length<8)return"Your password should have at least 8 digits"}}),{value:I,attrs:B}=S("confirmPassword"),{value:le,attrs:Ee}=S("company"),{value:ie,attrs:Pe}=S("newsletter_status"),{value:ee,attrs:dn}=S("community_member_type",{validate(_){if(!_)return"Community role is required"}}),Ae=_=>{ee.value=_};return _e([I,j],()=>{D("confirmPassword")}),_e([M,m],()=>{D("confirmEmail")}),(_,b)=>{const G=Re,se=Ue,ne=Je,xe=Ce,Fe=He;return o(),n("div",ho,[t("form",{class:"c-form c-form--account c-form--dark",onSubmit:b[8]||(b[8]=Ve((...P)=>e(H)&&e(H)(...P),["prevent"]))},[t("div",$o,[wo,t("div",go,[t("div",ko,[t("div",Co,[t("div",So,[p(G,Y({modelValue:e(X),"onUpdate:modelValue":b[0]||(b[0]=P=>Z(X)?X.value=P:null),label:"Name",error:"name"in e($)?e($).name:""},e(T)),null,16,["modelValue","error"])])]),t("div",Eo,[t("div",Po,[p(G,Y({modelValue:e(le),"onUpdate:modelValue":b[1]||(b[1]=P=>Z(le)?le.value=P:null),error:"accountCompany"in e($)?e($).company:""},e(Ee)),{label:k(()=>[Ao]),_:1},16,["modelValue","error"])])]),e(r)?i("",!0):(o(),n(J,{key:0},[t("div",xo,[t("div",Fo,[p(G,Y({modelValue:e(m),"onUpdate:modelValue":b[2]||(b[2]=P=>Z(m)?m.value=P:null),label:"Email Address",type:"email",error:"email"in e($)?e($).email:""},e(x)),null,16,["modelValue","error"])])]),t("div",Oo,[t("div",Vo,[p(G,Y({modelValue:e(M),"onUpdate:modelValue":b[3]||(b[3]=P=>Z(M)?M.value=P:null),label:"Confirm Email Address",type:"email",error:"confirmEmail"in e($)?e($).confirmEmail:""},e(F)),null,16,["modelValue","error"])])])],64))])])]),!e(r)||e(h)?(o(),n("div",Do,[Mo,t("div",Io,[e(r)?i("",!0):(o(),n("div",Lo,[t("div",No,[t("div",To,[p(G,Y({modelValue:e(j),"onUpdate:modelValue":b[4]||(b[4]=P=>Z(j)?j.value=P:null),label:"Password",type:"password",error:"password"in e($)?e($).password:""},e(z),{autocomplete:"new-password"}),null,16,["modelValue","error"])])]),t("div",jo,[t("div",Uo,[p(G,Y({modelValue:e(I),"onUpdate:modelValue":b[5]||(b[5]=P=>Z(I)?I.value=P:null),label:"Confirm password",type:"password",error:"confirmPassword"in e($)?e($).confirmPassword:""},e(B),{autocomplete:"new-password"}),null,16,["modelValue","error"])])])])),e(h)?(o(),n("div",Ro,[p(se,{"model-value":e(ee),items:[e(U).member_type.member,e(U).member_type.maker,e(U).member_type.makerspace].map(P=>({label:P,value:P})),name:"communityRole",class:L(["c-form-col c-form-col--fullwidth c-form-col--horizontal flex-wrap",{"c-form-col--error":"community_member_type"in e($)}]),type:"checkbox","item-wrapper":"div","item-wrapper-class":"c-form-field c-form-field--no-label","onUpdate:modelValue":Ae},ge({_:2},["community_member_type"in e($)?{name:"group-start",fn:k(()=>[t("div",Jo,[t("span",null,y(e($).community_member_type),1)])]),key:"0"}:void 0]),1032,["model-value","items","class"])])):i("",!0)])])):i("",!0),t("div",Ho,[zo,t("div",Go,[t("div",qo,[t("div",Qo,[t("span",Yo," Subscription: "+y(e(C)?(e(u).subscription_details||{}).subscription_type||e(s).subscription_type.subscribed:e(s).subscription_type.none),1),e(C)&&(e(u).subscription_details||{}).renewal_date?(o(),n("span",Xo," Renews on: "+y(_.$prettifyDateFormat(e(u).subscription_details.renewal_date)),1)):i("",!0)]),t("div",Zo,[t("div",Ko,[p(ne,Y({modelValue:e(ie),"onUpdate:modelValue":b[6]||(b[6]=P=>Z(ie)?ie.value=P:null),error:"newsletter_status"in e($)?e($).newsletter_status:""},e(Pe),{label:"Subscribe to newsletter"}),null,16,["modelValue","error"])])]),e(C)?(o(),n(J,{key:0},[t("div",Wo,[t("button",{type:"button",class:"el-link el-link--secondary",onClick:b[7]||(b[7]=P=>
1e(E)(e(u).subscription_details.stripe_id))},es)]),ts],64)):(o(),n("div",os,[p(xe,{type:"button",class:"el-button",to:"/#subscription"},{default:k(()=>[ss]),_:1})]))])])]),t("div",ns,[t("div",as,[t("div",ls,[t("div",is,[t("button",{ref:"submitEl",type:"submit",class:L(["el-button el-button--is-gradient",{"is-disabled":e(w)}]),"allow-pointer-events":!e(w),disabled:e(w)},[rs,p(O,{name:"fade"},{default:k(()=>[e(w)?(o(),V(Fe,{key:0,class:"icon"})):i("",!0)]),_:1})],10,cs)])])])])],32)])}}},ds=us,_s={class:"account-details account-details--overview"},ms={class:"account-details-section"},ps=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Information")],-1),bs={class:"account-details-section__body"},ys={class:"el-label h-word-break"},fs={key:0,class:"account-details-section__body"},vs={key:0,class:"el-label h-word-break"},hs={key:1,class:"el-label h-word-break-all"},$s={key:1,class:"account-details-section__body"},ws=t("span",{class:"el-label el-label--medium h-secondary"},"No information available about this user",-1),gs=[ws],ks={class:"account-details-section"},Cs=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Membership")],-1),Ss={key:0,class:"account-details-section__body"},Es=t("span",{class:"el-label"},"Password: ***********",-1),Ps=[Es],As={key:1,class:"account-details-section__body"},xs={key:0,class:"el-label"},Fs={class:"account-details-section__body"},Os={class:"el-label"},Vs={key:1,class:"account-details-section__body"},Ds=t("span",{class:"el-label el-label--medium h-secondary"},"No membership information available about this user",-1),Ms=[Ds],Is={class:"account-details-section"},Ls=t("div",{class:"account-details-section__header"},[t("span",{class:"el-label el-label--medium"},"Subscription")],-1),Ns={class:"account-details-section__body"},Ts={class:"el-label"},js={class:"account-details-section__body"},Us={key:0,class:"el-label"},Rs={class:"el-label"},Js={key:1,class:"account-details-section__body"},Hs=t("span",{class:"el-label el-label--medium h-secondary"},"No subscription information available about this user",-1),zs=[Hs],Gs={__name:"DetailsOverview",setup(a){const d=he,{$prettifyDateFormat:s}=W(),{user:l,isRegistredViaThirdPartyService:f,hasSubscription:u,hasCommunityProfile:r}=N(R());return(h,C)=>(o(),n("div",_s,[t("div",ms,[ps,t("div",bs,[t("span",ys,y((e(l)||{}).name||"Profile"),1)]),e(l)&&["company","email"].some(v=>Object.keys(e(l)).includes(v))?(o(),n("div",fs,[e(l).company?(o(),n("span",vs,y(e(l).company),1)):i("",!0),e(l).email?(o(),n("span",hs,y(e(l).email),1)):i("",!0)])):(o(),n("div",$s,gs))]),t("div",ks,[Cs,e(l)?(o(),n(J,{key:0},[e(f)?i("",!0):(o(),n("div",Ss,Ps)),e(l).createdAt?(o(),n("div",As,[e(l).createdAt?(o(),n("span",xs,"Member since: "+y(e(s)(e(l).createdAt)),1)):i("",!0)])):i("",!0),t("div",Fs,[t("span",Os," Member type: "+y(e(r)?e(l).community_member_details.community_member_type:("community"in h?h.community:e(U)).default_community_member_type),1)])],64)):(o(),n("div",Vs,Ms))]),t("div",Is,[Ls,e(l)?(o(),n(J,{key:0},[t("div",Ns,[t("span",Ts," Subscription: "+y(e(u)?(e(l).subscription_details||{}).subscription_type||e(d).subscription_type.subscribed:e(d).subscription_type.not_subscribed),1)]),t("div",js,[(e(l).subscription_details||{}).renewal_date?(o(),n("span",Us," Renews on: "+y(e(s)(e(l).subscription_details.renewal_date)),1)):i("",!0),t("span",Rs,"Newsletter status: "+y(e(l).newsletter_status===e(d).newsletter_status.subscribed?"Active":"Not subscribed"),1)])],64)):(o(),n("div",Js,zs))])]))}},qs=Gs,Qs=oe+"#icon-cross",Ys=oe+"#icon-edit",Xs={class:"el-heading"},Zs={key:0,class:"icon"},Ks=t("use",{"xlink:href":Qs},null,-1),Ws=[Ks],Bs=t("span",{class:"el-button__label"},"Edit",-1),en=t("svg",{class:"icon edit"},[t("use",{"xlink:href":Ys})],-1),tn={class:"account-section__body"},on={__name:"Details",setup(a){const{uiElements:d}=N(ke()),{$scrollTo:s}=W(),l=g(!1),f=g(null),u=()=>{l.value=!l.value};return _e(l,()=>{var r,h;return s(f.value,-1*((h=(r=d.value)==null?void 0:r.header)==null?void 0:h.offsetHeight))}),(r,h)=>{const C=ds,v=qs;return o(),n("section",{ref_key:"accountDetailsEl",ref:f,class:"account-section account-section--detail
1s"},[p(O,{name:"fade",mode:"out-in"},{default:k(()=>[(o(),n("div",{key:e(l),class:"account-section__header"},[t("span",Xs,y(e(l)?"Edit account details":"Account details"),1),t("button",{type:"button",class:L(["el-button el-button--secondary el-button--is-borderless account-section__toggle",{"is-hover":e(l),"el-button--medium":("useState"in r?r.useState:e(re))("isMobile").value&&!e(l)}]),onClick:u},[e(l)?(o(),n("svg",Zs,Ws)):(o(),n(J,{key:1},[Bs,en],64))],2)]))]),_:1}),t("div",tn,[p(O,{name:"fade",mode:"out-in"},{default:k(()=>[e(l)?(o(),V(C,{key:0,onSaved:u})):(o(),V(v,{key:1}))]),_:1})])],512)}}},sn=on,nn={},an={class:"account-page"},ln={class:"g-container"},cn={class:"g-row"},rn={class:"g-col g-col-xs-6"};function un(a,d){const s=it,l=At,f=_o,u=vo,r=sn;return o(),n("main",an,[t("div",ln,[t("div",cn,[t("div",rn,[p(s),p(l),p(f),p(u,{class:"account-section"}),p(r)])])])])}const Dn=te(nn,[["render",un]]);export{Dn as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.