1import{d as N,u as S,r as _,K as L,N as T,z as V,o as B,c as n,a as i,b as h,e as c,m as r,w as b,f as F,t as p,L as P,h as m,F as j,i as H,M as O,q as M,_ as $}from"./CBb99Q15.js";import{D as q,u as z}from"./CenJt9tC.js";import{M as I}from"./dFIXalo2.js";import{b as K}from"./Jd6aBPtE.js";import{h as R}from"./CbGaPIAM.js";import"./DkvjyNul.js";import"./ChYhb54x.js";import"./CmJn3jzX.js";import"./GWMrmONc.js";import"./DoeV4jsm.js";import"./HJwVSgq5.js";import"./BDr1m4Qv.js";const G={class:"delivery-addresses"},J={key:0},Q={key:0},U={class:"delivery-addresses-error"},W={class:"delivery-addresses-error-title"},X={class:"delivery-addresses-error-message"},w=N({__name:"new",setup(v){const{$accountApi:s,$errorHandler:A}=S(),a=_(!0),l=_(),f=_(),x=()=>{f.value.open()},C=L(),{t:d,locale:y}=T({useScope:"local"}),E=V(()=>{const t=l.value??void 0;return t?Object.entries(t).reduce((o,[e,u])=>[...o,...u.message],[]):[]}),D=async t=>{var u;a.value=!1,l.value=void 0;const o=z();o.value={...t};const{error:e}=await s().createDeliveryAddress(t);if((e==null?void 0:e.value)!=null){const g=e.value.statusCode;if(g===400){l.value=e.value.data.errors,x(),window.scrollTo(0,0),a.value=!0;return}else if(g===403){M(e.value.data.errors.blacklist.redirect_url,{external:!0});return}A().handle((u=e.value)==null?void 0:u.statusCode)}else o.value={honorific_title:"",first_name:"",first_name_kana:"",last_name:"",last_name_kana:"",postal_code:"",country:"",state:"",prefecture_cd:"",city:"",address_line_1:"",address_line_2:"",company_name:"",tel:"",lang:y.value},M(C("/mypage/setting/delivery-address/"));a.value=!0};return B(()=>{R.set({title:d("title"),useShortSiteTitle:!0,isEn:y.value==="en"}),K.set([{name:"mypage",translation:!0,path:"/mypage/"},{name:"deliveryAddressList",translation:!0,path:"/mypage/setting/delivery-address/"},{name:d("title"),path:"/mypage/setting/delivery-address/new/"}])}),(t,o)=>(i(),n("div",G,[r(a)?(i(),n("div",J,[c(I,null,{default:b(()=>[F(p(r(d)("title")),1)]),_:1}),c(q,{onSave:D})])):h("",!0),c(P,{loading:!r(a)},null,8,["loading"]),c(O,{ref_key:"errorModal",ref:f},{default:b(()=>[r(l)?(i(),n("div",Q,[m("div",U,[m("div",W,p(r(d)("inputError")),1),(i(!0),n(j,null,H(r(E),e=>(i(),n("ul",{key:e},[m("li",X,p(e),1)]))),128))])])):h("",!0)]),_:1},512)]))}});function k(v){const s=v;s.__i18n=s.__i18n||[],s.__i18n.push({locale:"",resource:{ja:{title:{t:0,b:{t:2,i:[{t:3}],s:"éä»å
ç»é²"}},inputError:{t:0,b:{t:2,i:[{t:3}],s:"å
¥åå
容ã«èª¤ããããã¾ã"}}},en:{title:{t:0,b:{t:2,i:[{t:3}],s:"Delivery Address Registration"}},inputError:{t:0,b:{t:2,i:[{t:3}],s:"There is an error in the input content"}}}}})}typeof k=="function"&&k(w);const ue=$(w,[["__scopeId","data-v-39f41c39"]]);export{ue 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.