PageSourceSearch

https://www.hapabox.com/assets/EditAddressView-_vEnoIdY.js

js hapabox.com collected 2026-09-25 03:17:29 UTC 9,061 bytes, 1 lines download raw bytes

1import{_ as e}from"./BaseSelect-DApz7IFc.js";import{d as t,ai as a,a as l,r,y as s,e as d,c as i,i as u,q as o,w as n,al as c,p,am as v,t as x,C as m,o as y,L as b,M as g,_ as h}from"./vendor-CSbCDvZF.js";import{_ as f}from"./PageTitle.vue_vue_type_script_setup_true_lang-BbiOS8cM.js";import{a as k,Q as w,L as _,R as q,e as V,s as F,S as N}from"./index-BLvwiHhB.js";import{g as T}from"./index-B1e76CFQ.js";const S=e=>(b("data-v-95608e34"),e=e(),g(),e),U={class:"py-4"},z={class:"grid grid-cols-1 lg:grid-cols-2 lg:gap-[18px] mt-4"},j=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," First Name ",-1)),A={class:"relative"},C={class:"error absolute text-right text-[75%]"},P=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Last Name ",-1)),E={class:"relative"},D={class:"error absolute text-right text-[75%]"},L=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Country/Region ",-1)),R={class:"relative rounded bg-white dark:bg-[#333] border border-[#333333] dark:border-[#666]"},O={class:"error absolute text-right text-[75%]"},$=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Street Address ",-1)),B={class:"relative"},G={class:"error absolute text-right text-[75%]"},I=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," City ",-1)),M={class:"relative"},Q={class:"error absolute text-right text-[75%]"},W=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," State/Provice ",-1)),Z={class:"relative"},H={class:"error absolute text-right text-[75%]"},J=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Postal/Zip Code ",-1)),K={class:"relative"},X={class:"error absolute text-right text-[75%]"},Y=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Phone Number ",-1)),ee={class:"relative"},te={class:"error absolute text-right text-[75%]"},ae=S(()=>u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}," Email ",-1)),le={class:"relative"},re={class:"error absolute text-right text-[75%]"},se=S(()=>u("div",{class:"flex justify-center my-[23px] lg:my-[46px]"},[u("div",{class:"text-sm lg:text-[26px] text-[#333333] my-2 lg:my-4 dark:text-white"}),u("button",{class:"capitalize text-white bg-black dark:bg-white dark:text-black w-[188px] h-[28px] text-[14px] rounded lg:w-[450px] lg:h-[68px] lg:text-[34px] lg:rounded-xl"}," SAVE ADDRESS ")],-1)),de=h(t({__name:"EditAddressView",setup(t){const b=k(),{proxy:g}=a();l(()=>b.getGuideDownloadStatus);const h=r(),S=r(""),de=r(""),ie=r({initialValues:{firstName:"",lastName:"",country:"",address:"",city:"",province:"",postal:"",phone:"",email:""},validationSchema:{firstName:w.yup.string().required("This field is required"),lastName:w.yup.string().required("This field is required"),country:w.yup.string().required("This field is required"),address:w.yup.string().required("This field is required"),city:w.yup.string().required("This field is required"),province:w.yup.string().required("This field is required"),postal:w.yup.string().required("This field is required"),phone:w.yup.string().required("This field is required"),email:w.yup.string().required("This field is required")}}),{handleSubmit:ue,errors:oe}=w.vee.useForm(ie.value),{value:ne}=w.vee.useField("firstName",{}),{value:ce}=w.vee.useField("lastName",{}),{value:pe}=w.vee.useField("country",{}),{value:ve}=w.vee.useField("address",{}),{value:xe}=w.vee.useField("city",{}),{value:me}=w.vee.useField("province",{}),{value:ye}=w.vee.useField("postal",{}),{value:be}=w.vee.useField("phone",{}),{value:ge}=w.vee.useField("email",{}),he=r([]),fe=s("history"),ke=l(()=>"true"===fe.isFromCheckOrderPage),we=ue(async(e,{resetForm:t})=>{if("Turkey"===e.country){if(!S.value)return void(de.value="This field is required");await _e()}else await _e();_.replace({path:"address",query:{isFromCheckOrderPage:`${ke.value}`}})});async function _e(){"Turkey"===pe.value?await q({id:h.value,first_name:ne.value,last_name:ce.value,country:pe.value,detail_addr:ve.value,city:xe.value,province:me.value,postal:ye.value,phone:be.value,email:ge.value,turkish_id:S.value}):await q({id:h.value,first_name:ne.value,last_name:ce.value,country:pe.value,detail_addr:ve.value,city:xe.value,province:me.value,postal:ye.value,phone:be.value,email:ge.value}),g?.$notify({message:"Address has been edited",type:"success"})}return d(async()=>{V("hp_addaddress-view"),F(),he.value=await T(),await async function(){const e=s("history").id,t=(await N()).find(t=>
1t.id===Number(e));h.value=t?.id,ne.value=t?.first_name,ce.value=t?.last_name,pe.value=t?.country,ve.value=t?.detail_addr,xe.value=t?.city,me.value=t?.province,ye.value=t?.postal,be.value=t?.phone,ge.value=t?.email}()}),(t,a)=>{const l=e;return y(),i("div",U,[u("div",null,[o(f,{title:"Edit Address"})]),u("form",{onSubmit:a[10]||(a[10]=m((...e)=>p(we)&&p(we)(...e),["prevent"]))},[u("div",z,[u("div",null,[j,u("div",A,[n(u("input",{"onUpdate:modelValue":a[0]||(a[0]=e=>v(ne)?ne.value=e:null),type:"text",autocomplete:"given-name",name:"firstName",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(ne)]]),u("div",C,x(p(oe).firstName||""),1)])]),u("div",null,[P,u("div",E,[n(u("input",{"onUpdate:modelValue":a[1]||(a[1]=e=>v(ce)?ce.value=e:null),type:"text",autocomplete:"family-name",name:"lastName",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(ce)]]),u("div",D,x(p(oe).lastName||""),1)])]),u("div",null,[L,u("div",R,[o(l,{modelValue:p(pe),"onUpdate:modelValue":a[2]||(a[2]=e=>v(pe)?pe.value=e:null),class:"address-select rounded h-[32px] lg:h-[56px]",list:he.value},null,8,["modelValue","list"]),n(u("input",{"onUpdate:modelValue":a[3]||(a[3]=e=>v(pe)?pe.value=e:null),class:"hidden",name:"country",autocomplete:"country-name"},null,512),[[c,p(pe)]]),u("div",O,x(p(oe).country||""),1)])]),u("div",null,[$,u("div",B,[n(u("input",{"onUpdate:modelValue":a[4]||(a[4]=e=>v(ve)?ve.value=e:null),type:"text",autocomplete:"street-address",name:"address",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(ve)]]),u("div",G,x(p(oe).address||""),1)])]),u("div",null,[I,u("div",M,[n(u("input",{"onUpdate:modelValue":a[5]||(a[5]=e=>v(xe)?xe.value=e:null),type:"text",autocomplete:"address-level2",name:"city",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(xe)]]),u("div",Q,x(p(oe).city||""),1)])]),u("div",null,[W,u("div",Z,[n(u("input",{"onUpdate:modelValue":a[6]||(a[6]=e=>v(me)?me.value=e:null),type:"text",autocomplete:"address-level1",name:"province",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(me)]]),u("div",H,x(p(oe).province||""),1)])]),u("div",null,[J,u("div",K,[n(u("input",{"onUpdate:modelValue":a[7]||(a[7]=e=>v(ye)?ye.value=e:null),type:"text",autocomplete:"postal-code",name:"postal",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(ye)]]),u("div",X,x(p(oe).postal||""),1)])]),u("div",null,[Y,u("div",ee,[n(u("input",{"onUpdate:modelValue":a[8]||(a[8]=e=>v(be)?be.value=e:null),type:"text",inputmode:"tel",autocomplete:"tel",name:"tel",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focus:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(be)]]),u("div",te,x(p(oe).phone||""),1)])]),u("div",null,[ae,u("div",le,[n(u("input",{"onUpdate:modelValue":a[9]||(a[9]=e=>v(ge)?ge.value=e:null),type:"text",inputmode:"email",autocomplete:"email",name:"email",class:"rounded w-full h-[32px] lg:h-[56px] px-3 py-2 text-black dark:text-white border border-[#333333] dark:border-[#666] focu
1s:outline-none focus:border-[#333333] dark:focus:border-[#666] focus:z-10 dark:bg-[#333]"},null,512),[[c,p(ge)]]),u("div",re,x(p(oe).email||""),1)])])]),se],32)])}}}),[["__scopeId","data-v-95608e34"]]);export{de 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.