@ecomplus/storefront-app
Version:
Vue.js ecommerce app with cart, checkout and account pages
1 lines • 183 kB
JavaScript
(this["webpackJsonp_storefront_app"]=this["webpackJsonp_storefront_app"]||[]).push([["app-account"],{"033e":function(t,e,r){var i=r("a918");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=r("0ed3").default;a("6f6be835",i,!0,{sourceMap:!1,shadowMode:!1})},"04ba":function(t,e,r){"use strict";r("5026")},1125:function(t,e,r){"use strict";var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"login"},[r("form",{on:{submit:function(e){return e.preventDefault(),t.submitLogin.apply(null,arguments)}}},[r("label",{staticClass:"h4",attrs:{for:"login-email"}},[t._v(" "+t._s(t.i19enterYourEmailMsg)+" ")]),r("div",{staticClass:"login__email input-group input-group-lg"},[r("input",{directives:[{name:"model",rawName:"v-model.trim",value:t.email,expression:"email",modifiers:{trim:!0}}],ref:"inputEmail",staticClass:"form-control",attrs:{type:"email",id:"login-email",placeholder:"email@mail.com",readonly:t.isWaitingLogin,required:""},domProps:{value:t.email},on:{input:function(e){e.target.composing||(t.email=e.target.value.trim())},blur:function(e){return t.$forceUpdate()}}}),r("div",{staticClass:"input-group-append"},[r("button",{staticClass:"login__email-btn btn btn-primary",attrs:{type:"submit",disabled:t.isWaitingLogin}},[t.isWaitingLogin?r("span",{key:"loading",staticClass:"spinner-border spinner-border-sm mb-1 mr-1",attrs:{role:"status"}},[r("span",{staticClass:"sr-only"},[t._v("Loading...")])]):r("span",{key:"login"},[r("i",{staticClass:"i-arrow-right"}),r("span",{staticClass:"d-none d-md-inline ml-1"},[t._v(" "+t._s(t.i19continue)+" ")])])])])]),r("transition",{attrs:{"enter-active-class":"animated fadeInDown","leave-active-class":"animated position-absolute fadeOutUp"}},[t.confirmAccount()?r("div",{staticClass:"login__confirm"},[r("div",{staticClass:"login__hello"},[t._v(" "+t._s(t.i19helloAgain)+" "),r("strong",[t._v(t._s(t.ecomPassport.getCustomerName()))])]),r("label",{staticClass:"lead",attrs:{for:"login-doc"}},[t._v(" "+t._s(t.i19enterYourDocNumberMsg)+" ")]),r("div",{staticClass:"input-group input-group-lg"},[r("input-doc-number",{ref:"InputDoc",attrs:{id:"login-doc",isCompany:t.isCompany,readonly:t.isWaitingLogin,required:""},model:{value:t.docNumber,callback:function(e){t.docNumber=e},expression:"docNumber"}}),r("div",{staticClass:"input-group-append"},[r("button",{staticClass:"btn btn-primary",attrs:{type:"submit",disabled:t.isWaitingLogin,"aria-label":t.i19continue}},[r("i",{staticClass:"i-check"})])])],1)]):t._e()]),r("a-alert",{staticClass:"mt-3",attrs:{"can-show":Boolean(t.failAlertText)}},[t._v(" "+t._s(t.failAlertText)+" ")]),t._t("login-methods",(function(){return[r("transition",{attrs:{"enter-active-class":"animated fadeInUp"}},[t.oauthProviders.length?r("div",{staticClass:"login__oauth"},[r("p",{staticClass:"lead"},[t._v(" "+t._s(t.i19orProceedWith)+": ")]),t._l(t.oauthProviders,(function(e){var i=e.link,a=e.faIcon,n=e.providerName,s=e.provider;return r("button",{key:s,staticClass:"btn login__btn",class:"login__btn--"+s,attrs:{type:"button"},on:{click:function(){return t.oauthPopup(i)}}},[r("small",[t._v(t._s(t.i19signInWith))]),r("i",{staticClass:"fab mr-2",class:a}),t._v(" "+t._s(n)+" ")])}))],2):t._e()])]}),null,{isWaitingLogin:t.isWaitingLogin,email:t.email,confirmAccount:t.confirmAccount})],2),r("div",{staticClass:"login__info"},[r("div",{staticClass:"login__info-title"},[r("i",{staticClass:"i-lock"}),t._v(" "+t._s(t.i19weUseYourDataToMsg)+": ")]),t._l([t.i19identifyYourAccount,t.i19notifyAboutOrders,t.i19manageYourPurchaseHistory],(function(e){return r("div",{staticClass:"login__info-row"},[r("i",{staticClass:"i-check"}),t._v(" "+t._s(e)+" ")])}))],2),r("transition",{attrs:{"enter-active-class":"animated fadeIn slow","leave-active-class":"animated fadeOut"}},[t.isWaitingPopup?r("div",{staticClass:"login__popup-overlay"},[r("div",[r("div",{staticClass:"spinner-border mb-3",attrs:{role:"status"}},[r("span",{staticClass:"sr-only"},[t._v("Popup...")])]),r("h5",[t._v(t._s(t.i19oauthOnPopup))])])]):t._e()])],1)},a=[],n=r("6d50"),s=r("736b"),o=r("498e"),c=r("568f"),l=r("9361"),u={name:"LoginBlock",components:{AAlert:c["a"],InputDocNumber:l["a"]},props:{customerEmail:String,canAcceptGuest:{type:Boolean,default:!0},canFetchOauth:{type:Boolean,default:!0},ecomPassport:{type:Object,default(){return o["a"]}}},data(){return{email:this.customerEmail,docNumber:"",isCompany:!1,oauthProviders:[],isWaitingPopup:!1,isWaitingLogin:!1,failAlertText:null}},computed:{i19continue:()=>Object(s["a"])(n["T"]),i19enterYourDocNumberMsg:()=>Object(s["a"])(n["mb"]),i19enterYourEmailMsg:()=>Object(s["a"])(n["nb"]),i19helloAgain:()=>Object(s["a"])(n["Db"]),i19identifyYourAccount:()=>Object(s["a"])(n["Gb"]),i19manageYourPurchaseHistory:()=>Object(s["a"])(n["Xb"]),i19notifyAboutOrders:()=>Object(s["a"])(n["kc"]),i19oauthOnPopup:()=>Object(s["a"])(n["mc"]),i19orProceedWith:()=>Object(s["a"])(n["uc"]),i19signInWith:()=>Object(s["a"])(n["md"]),i19weUseYourDataToMsg:()=>Object(s["a"])(n["Jd"])},methods:{confirmAccount(){const{checkLogin:t,checkAuthorization:e,getCustomer:r}=this.ecomPassport,i=t()&&!e()&&r().main_email===this.email;return i&&this.$nextTick(()=>{this.$refs.InputDoc&&this.$refs.InputDoc.$el.focus()}),i},submitLogin(){if(!this.isWaitingLogin){this.isWaitingLogin=!0,this.failAlertText=null;const{docNumber:t}=this,e=this.email&&this.email.toLowerCase(),r=this.confirmAccount(),i=()=>this.$emit("update",{email:e,docNumber:t});this.ecomPassport.fetchLogin(e,r?t:null).then(()=>{r&&i()}).catch(t=>{const{response:a}=t;a&&403===a.status?!r&&this.canAcceptGuest?(this.$emit("update:customer-email",e),i()):this.failAlertText=Object(s["a"])(n["Nb"]):(console.error(t),this.failAlertText=Object(s["a"])(n["Sb"]))}).finally(()=>{this.isWaitingLogin=!1})}},oauthPopup(t){"function"===typeof t?t():this.ecomPassport.popupOauthLink(t),this.isWaitingPopup=!0,setTimeout(()=>{this.isWaitingPopup=!1},7500)}},watch:{email(){this.failAlertText=null},docNumber(){this.failAlertText=null}},created(){Array.isArray(window.OAUTH_PROVIDERS)&&(this.oauthProviders=[],window.OAUTH_PROVIDERS.includes("google")&&window.signInWithGoogle&&this.oauthProviders.push({link:window.signInWithGoogle,faIcon:"fa-google",provider:"google",providerName:"Google"}),window.OAUTH_PROVIDERS.includes("facebook")&&window.signInWithFacebook&&this.oauthProviders.push({link:window.signInWithFacebook,faIcon:"fa-facebook-f",provider:"facebook",providerName:"Facebook"}),this.oauthProviders.length)||this.canFetchOauth&&this.ecomPassport.fetchOauthProviders().then(({host:t,baseUri:e,oauthPath:r,providers:i})=>{const a=[];for(const n in i)if(i[n]&&"facebook"!==n){const{faIcon:s,providerName:o}=i[n];let c=t+e+n+r;const l="object"===typeof window&&window.sessionStorage.getItem("ecomReferral");l&&(c+="?referral="+l),a.push({link:c,faIcon:s,provider:n,providerName:o})}this.oauthProviders=a}).catch(t=>{console.error(t)})},mounted(){this.$refs.inputEmail.focus();const{checkLogin:t,checkAuthorization:e,getCustomer:r}=this.ecomPassport,i=()=>{if(e())this.$emit("login",this.ecomPassport);else if(t()){const t=r();this.email=t.main_email,this.isCompany="j"===t.registry_type,t._id&&t.doc_number&&this.$emit("login",this.ecomPassport)}};o["a"].on("login",()=>{this.isWaitingPopup=!1,i()}),i()}},d=u,p=(r("a554"),r("2be6")),m=Object(p["a"])(d,i,a,!1,null,null,null);e["a"]=m.exports},"1c46":function(t,e,r){"use strict";var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"account-addresses"},[r("transition-group",{attrs:{"enter-active-class":"animated fadeIn"}},[t.isForm&&t.canShowForm?r("address-form",{key:"form",attrs:{address:t.localAddress,"btn-text":t.formBtnText},on:{"update:address":function(e){t.localAddress=e}}}):t.addresses.length?r("div",{key:"list"},[t._l(t.addresses,(function(e,i){return r("div",{key:e._id,staticClass:"account-addresses__card card"},[r("div",{staticClass:"card-body"},[r("div",{staticClass:"custom-control custom-radio"},[r("input",{staticClass:"custom-control-input",attrs:{type:"radio",id:"account-address-"+i,name:"account-address-selected"},domProps:{checked:e.default},on:{change:function(r){return t.selectAddress(e)}}}),r("label",{staticClass:"custom-control-label",attrs:{for:"account-address-"+i}},[r("address",{staticClass:"account-addresses__address"},[r("span",{staticClass:"account-addresses__line"},[t._v(" "+t._s(t.getLineAddress(e))+" ")]),e.city?r("span",{staticClass:"account-addresses__city"},[t._v(" "+t._s(e.city+" / "+(e.province_code||e.province))+" ")]):t._e(),r("span",{staticClass:"account-addresses__zip"},[t._v(" "+t._s(e.zip)+" ")])])])]),r("div",{staticClass:"account-addresses__actions"},[r("button",{staticClass:"btn btn-sm btn-light",attrs:{type:"button","aria-label":t.i19edit},on:{click:function(e){t.editAddressIndex=i}}},[r("i",{staticClass:"i-pencil"})]),r("button",{staticClass:"btn btn-sm btn-danger",attrs:{type:"button","aria-label":t.i19remove},on:{click:function(e){return t.removeAddress(i)}}},[r("i",{staticClass:"i-trash"})])])]),e.name&&!e.name.endsWith("*")?r("div",{staticClass:"account-addresses__recipient card-footer"},[t._v(" "+t._s(e.name)+" ")]):t._e()])})),r("button",{staticClass:"btn btn-sm btn-outline-secondary",attrs:{type:"button"},on:{click:function(e){t.isNewAddress=!0}}},[r("i",{staticClass:"i-plus mr-1"}),t._v(" "+t._s(t.i19newAddress)+" ")])],2):t._e()],1)],1)},a=[],n=r("6d50"),s=r("736b"),o=r("fa5f"),c=r("2c61"),l=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("form",{staticClass:"address-form needs-validation",attrs:{novalidate:""},on:{submit:function(e){return e.preventDefault(),t.submit.apply(null,arguments)}}},[r("div",{staticClass:"form-group address-form__name"},[r("label",{attrs:{for:"address-form-name"}},[t._v(" "+t._s(t.i19recipient)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.name,expression:"localAddress.name"}],staticClass:"form-control",attrs:{type:"text",pattern:"[^\\d\\s]{2,}.*",id:"address-form-name",placeholder:t.i19name,required:""},domProps:{value:t.localAddress.name},on:{input:function(e){e.target.composing||t.$set(t.localAddress,"name",e.target.value)}}})]),r("div",{staticClass:"form-group address-form__zip"},[r("div",{staticClass:"input-group"},[r("input-zip-code",{attrs:{id:"address-form-zip","aria-label":t.i19zipCode,required:""},model:{value:t.localAddress.zip,callback:function(e){t.$set(t.localAddress,"zip",e)},expression:"localAddress.zip"}}),t.zipLoading||t.zipInfoLink?r("div",{staticClass:"input-group-append"},[r("span",{staticClass:"input-group-text"},[t.zipLoading?r("div",{staticClass:"spinner-grow spinner-grow-sm",attrs:{role:"status"}},[r("span",{staticClass:"sr-only"},[t._v("Loading...")])]):r("a",{attrs:{href:t.zipInfoLink,target:"_blank"}},[r("i",{staticClass:"i-question-circle"})])])]):t._e()],1)]),r("transition",{attrs:{"enter-active-class":"animated fadeIn","leave-active-class":"animated fadeOut fast"}},[r("div",{directives:[{name:"show",rawName:"v-show",value:t.isZipReady,expression:"isZipReady"}]},[r("div",{staticClass:"form-group"},[r("label",{attrs:{for:"address-form-number"}},[t._v(" "+t._s(t.i19number)+" ")]),r("div",{staticClass:"row address-form__number"},[r("div",{staticClass:"col-5 col-lg-4"},[r("input",{directives:[{name:"model",rawName:"v-model.number",value:t.localAddress.number,expression:"localAddress.number",modifiers:{number:!0}}],ref:"inputNumber",staticClass:"form-control",attrs:{type:"number",id:"address-form-number",required:!t.isNoNumber,readonly:t.isNoNumber},domProps:{value:t.localAddress.number},on:{input:function(e){e.target.composing||t.$set(t.localAddress,"number",t._n(e.target.value))},blur:function(e){return t.$forceUpdate()}}})]),r("div",{staticClass:"col"},[r("div",{staticClass:"custom-control custom-checkbox"},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.isNoNumber,expression:"isNoNumber"}],staticClass:"custom-control-input",attrs:{type:"checkbox",id:"address-form-no-number"},domProps:{checked:Array.isArray(t.isNoNumber)?t._i(t.isNoNumber,null)>-1:t.isNoNumber},on:{change:function(e){var r=t.isNoNumber,i=e.target,a=!!i.checked;if(Array.isArray(r)){var n=null,s=t._i(r,n);i.checked?s<0&&(t.isNoNumber=r.concat([n])):s>-1&&(t.isNoNumber=r.slice(0,s).concat(r.slice(s+1)))}else t.isNoNumber=a}}}),r("label",{staticClass:"custom-control-label",attrs:{for:"address-form-no-number"}},[t._v(" "+t._s(t.i19noNumber)+" ")])])])])]),r("div",{staticClass:"form-row"},[r("div",{staticClass:"form-group col-lg-6"},[r("label",{attrs:{for:"address-form-compl"}},[t._v(" "+t._s(t.i19complement)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.complement,expression:"localAddress.complement"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-compl",maxlength:"100"},domProps:{value:t.localAddress.complement},on:{input:function(e){e.target.composing||t.$set(t.localAddress,"complement",e.target.value)}}})]),r("div",{staticClass:"form-group col-lg-6"},[r("label",{attrs:{for:"address-form-ref"}},[t._v(" "+t._s(t.i19reference)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.near_to,expression:"localAddress.near_to"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-ref",maxlength:"100"},domProps:{value:t.localAddress.near_to},on:{input:function(e){e.target.composing||t.$set(t.localAddress,"near_to",e.target.value)}}})])]),r("div",{staticClass:"form-row"},[r("div",{staticClass:"form-group col-lg-6"},[r("label",{attrs:{for:"address-form-street"}},[t._v(" "+t._s(t.i19street)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.street,expression:"localAddress.street"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-street",readonly:t.addressFromZip.street,required:""},domProps:{value:t.localAddress.street},on:{click:function(t){var e=t.target;return e.select()},input:function(e){e.target.composing||t.$set(t.localAddress,"street",e.target.value)}}})]),r("div",{staticClass:"form-group col-lg-6"},[r("label",{attrs:{for:"address-form-borough"}},[t._v(" "+t._s(t.i19borough)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.borough,expression:"localAddress.borough"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-borough",readonly:t.addressFromZip.borough},domProps:{value:t.localAddress.borough},on:{click:function(t){var e=t.target;return e.select()},input:function(e){e.target.composing||t.$set(t.localAddress,"borough",e.target.value)}}})])]),r("div",{staticClass:"form-row"},[r("div",{staticClass:"form-group col-lg-6 col-7"},[r("label",{attrs:{for:"address-form-city"}},[t._v(" "+t._s(t.i19city)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.localAddress.city,expression:"localAddress.city"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-city",readonly:t.addressFromZip.city,required:""},domProps:{value:t.localAddress.city},on:{click:function(t){var e=t.target;return e.select()},input:function(e){e.target.composing||t.$set(t.localAddress,"city",e.target.value)}}})]),r("div",{staticClass:"form-group col-lg-4 col"},[r("label",{attrs:{for:"address-form-pc"}},[t._v(" "+t._s(t.i19provinceCode)+" ")]),r("input",{directives:[{name:"model",rawName:"v-model",value:t.provinceCode,expression:"provinceCode"}],staticClass:"form-control",attrs:{type:"text",id:"address-form-pc",pattern:"[A-Z]{2}",maxlength:"2",placeholder:"AA",readonly:t.addressFromZip.province_code,required:""},domProps:{value:t.provinceCode},on:{click:function(t){var e=t.target;return e.select()},input:function(e){e.target.composing||(t.provinceCode=e.target.value)}}})])]),r("button",{staticClass:"btn btn-lg btn-primary",attrs:{type:"submit"}},[r("i",{staticClass:"i-check mr-1"}),t._v(" "+t._s(t.btnText)+" ")])])])],1)},u=[],d=r("87b7"),p=r("f1d8"),m=r("1d2b"),f=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("cleave-input",{staticClass:"form-control",attrs:{type:"tel",pattern:t.pattern,options:t.cleaveOptions,placeholder:t.placeholder},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}})},h=[],g=r("d0df"),_=r.n(g);const b=d["$ecomConfig"].get("country_code");var v={name:"InputZipCode",components:{CleaveInput:_.a},props:{value:{type:[String,Number],required:!0}},computed:{placeholder(){return Object(s["a"])(n["Md"])},pattern(){return"BR"===b?"[\\d]{5}-[\\d]{3}":null},localValue:{get(){return this.value},set(t){this.$emit("input",t)}},cleaveOptions(){return"BR"===b?{blocks:[5,3],delimiter:"-"}:{blocks:[30]}}}},y=v,C=r("2be6"),w=Object(C["a"])(y,f,h,!1,null,null,null),x=w.exports;const O=d["$ecomConfig"].get("country_code");var k={name:"AddressForm",components:{InputZipCode:x},props:{address:{type:Object,default(){return{}}},zipCode:String,btnText:{type:String,default(){return Object(s["a"])(n["ad"])}}},data(){const t={_id:Object(o["a"])(),zip:"",province_code:"",...this.address};return t.name&&t.name.endsWith("*")&&delete t.name,t.line_address&&t.line_address.endsWith("*")&&delete t.line_address,{localAddress:t,isZipReady:"BR"!==O,zipLoading:null,addressFromZip:{},isNoNumber:!1}},computed:{i19borough:()=>Object(s["a"])(n["w"]),i19city:()=>Object(s["a"])(n["K"]),i19complement:()=>Object(s["a"])(n["P"]),i19name:()=>Object(s["a"])(n["cc"]),i19noNumber:()=>Object(s["a"])(n["hc"]),i19number:()=>Object(s["a"])(n["lc"]),i19provinceCode:()=>Object(s["a"])(n["Nc"]),i19recipient:()=>Object(s["a"])(n["Qc"]),i19reference:()=>Object(s["a"])(n["Tc"]),i19street:()=>Object(s["a"])(n["nd"]),i19zipCode:()=>Object(s["a"])(n["Md"]),provinceCode:{get(){return this.localAddress.province_code},set(t){this.localAddress.province_code=t.toUpperCase().slice(0,2)}},zipInfoLink(){return"BR"===O?"https://buscacepinter.correios.com.br/app/endereco/index.php":null}},methods:{updateZipState(){"BR"===O&&this.localAddress.zip.length>=8?this.zipLoading!==this.localAddress.zip&&(this.addressFromZip={},setTimeout(()=>{this.fetchAddressInfo(this.localAddress.zip)},this.zipLoading?150:50)):this.zipLoading=null},setAddressFields(t,e){t===this.localAddress.zip&&(e.forEach(([t,e])=>{this.$set(this.localAddress,t,e||""),this.$set(this.addressFromZip,t,Boolean(e))}),this.$nextTick(()=>{setTimeout(()=>{this.$refs.inputNumber&&this.$refs.inputNumber.select()},300)}))},fetchAddressInfo(t){t===this.localAddress.zip&&(this.zipLoading=t,p["a"].get("https://brasilapi.com.br/api/cep/v2/"+t,{timeout:4e3}).then(({data:e})=>{this.setAddressFields(t,[["province_code",e.state],["city",e.city],["borough",e.neighborhood],["street",e.street]])}).catch(e=>{console.error(e),setTimeout(()=>{p["a"].get(`https://viacep.com.br/ws/${t}/json/`,{timeout:4e3}).then(({data:e})=>{e.erro||this.setAddressFields(t,[["province_code",e.uf],["city",e.localidade],["borough",e.bairro],["street",e.logradouro]])}).catch(t=>console.error(t)).finally(()=>{t===this.zipLoading&&(this.zipLoading=null)})},300)}).finally(()=>{t===this.zipLoading&&(this.zipLoading=null)}))},submit(t){const e=this.$el;Object(m["a"])(e)&&this.$emit("update:address",this.localAddress),e.classList.add("was-validated")}},watch:{zipCode(t){this.localAddress.zip=t},"localAddress.zip"(t){this.updateZipState(),this.$emit("update:zip-code",t)},zipLoading(t){t?(this.isZipReady=!1,setTimeout(()=>{this.isZipReady=!0},1500)):this.isZipReady=!0},isNoNumber(t){t&&delete this.localAddress.number}},mounted(){this.updateZipState();const t=this.$el.querySelectorAll("input");for(let e=0;e<t.length;e++)if(!t[e].value){t[e].focus();break}}},j=k,A=(r("60c5"),Object(C["a"])(j,l,u,!1,null,null,null)),S=A.exports;const{sessionStorage:P}=window,I="ecomCustomerAddress";var $={name:"AccountAddresses",components:{AddressForm:S},props:{customer:{type:Object,default(){return{}}},zipCode:String,formBtnText:String,canShowForm:{type:Boolean,default:!0}},data(){return{isForm:!1,isNewAddress:!1,editAddressIndex:-1}},computed:{i19edit:()=>Object(s["a"])(n["gb"]),i19newAddress:()=>Object(s["a"])(n["ec"]),i19remove:()=>Object(s["a"])(n["Wc"]),i19noNumber:()=>Object(s["a"])(n["hc"]),addresses(){return this.customer.addresses?this.customer.addresses.map(t=>(t._id||(t._id=Object(o["a"])()),t)):[]},localAddress:{get(){let t=this.addresses[this.editAddressIndex];return t||(t={},this.zipCode&&(t.zip=this.zipCode),this.customer.name&&(t.name=Object(c["a"])(this.customer).substr(0,70))),t},set(t){const e=[].concat(this.addresses);e[this.editAddressIndex]=t,this.$emit("update:customer",{...this.customer,addresses:e}),t.zip&&(this.isNewAddress=!1,this.selectAddress(t)),this.isForm=!1}}},methods:{getLineAddress(t){if(t.line_address)return t.line_address;{let e=`${t.street} ${t.number||this.i19noNumber}`;return t.complement&&(e+=" - "+t.complement),t.borough&&(e+=", "+t.borough),e}},selectAddress(t){this.$emit("select-address",t._id),P.setItem(I,JSON.stringify(t))},removeAddress(t){const e=[].concat(this.addresses);e.splice(t,1),this.$emit("update:customer",{...this.customer,addresses:e})}},watch:{addresses(t,e){e.length?t.length||(this.isForm=this.isNewAddress=!0):t.length&&this.isNewAddress&&(this.isForm=this.isNewAddress=!1)},isNewAddress(t){t&&(this.editAddressIndex=this.addresses.length,this.isForm=!0)},editAddressIndex(t){if(t>-1){const e=this.addresses[t];e&&this.selectAddress(e),this.isForm=!0}},isForm(t){this.$emit("show-form",t),t||(this.editAddressIndex=-1)}},created(){if(this.addresses.length){let t;this.zipCode&&(t=this.addresses.findIndex(t=>t.zip===this.zipCode)),t>=0||(t=this.addresses.findIndex(t=>t.default),-1===t&&(t=0));const e=this.addresses[t];e.name&&(e.street&&e.city||e.name.endsWith("*"))?this.selectAddress(e):this.editAddressIndex=t}else{this.isNewAddress=!0;const t=JSON.parse(P.getItem(I));if(t){const e={};for(const r in t)t[r]&&(e[r]=t[r]);e._id&&e.zip&&e.street&&(this.editAddressIndex=0,this.$nextTick(()=>{this.localAddress=e}))}}}},L=$,N=(r("3426"),Object(C["a"])(L,i,a,!1,null,null,null));e["a"]=N.exports},"1d2b":function(t,e,r){"use strict";e["a"]=t=>"function"===typeof t.reportValidity?t.reportValidity():t.checkValidity()},"221f":function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return n}));var i=r("498e");const a=(t,e=i["a"])=>{const r=e.getCustomer(),a=r.favorites||[],s=n(t,e);if(s){const e=a.indexOf(t);a.splice(e,1)}else a.push(t);return e.requestApi("/me.json","patch",{favorites:a}),!s},n=(t,e)=>{const{favorites:r}=e.getCustomer();return r&&r.includes(t)}},2392:function(t,e,r){var i=r("3c10");e=i(!1),e.push([t.i,".shipping-line>strong{display:inline-block;min-width:120px}.shipping-line>span{display:inline-block}.shipping-line>small{display:block;display:-webkit-box;line-height:var(--line-height-sm);-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:var(--text-muted)}.active .shipping-line>small{color:inherit}",""]),t.exports=e},2498:function(t,e,r){"use strict";r("33fd")},"273f":function(t,e,r){"use strict";var i=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"prices",class:{"prices--literal":t.isLiteral,"prices--big":t.isBig}},[t.comparePrice?r("span",{staticClass:"prices__compare"},[t.isLiteral?[r("small",[t._v(" "+t._s(t.i19from)+" ")]),r("s",[t._v(t._s(t.formatMoney(t.comparePrice)))]),r("small",[t._v(" "+t._s(t.i19to)+" ")])]:r("s",[t._v(t._s(t.formatMoney(t.comparePrice)))])],2):t._e(),r("strong",{staticClass:"prices__value"},[t.hasVariedPrices?r("small",[t._v(" "+t._s(t.i19asOf)+" ")]):t._e(),t._v(" "+t._s(t.formatMoney(t.price))+" ")]),r("transition-group",{attrs:{"enter-active-class":"animated slideInDown"}},[t.earnPointsFactor>0&&!(t.pointsMinPrice>t.price)?r("div",{key:"points",staticClass:"prices__points"},[r("i",{staticClass:"i-check-circle"}),t._v(" "+t._s(t.i19youEarn)+" "),r("span",[t._v(" +"+t._s((t.earnPointsFactor*t.price).toFixed(1))+" ")]),r("em",[t._v(t._s(t.pointsProgramName))])]):t._e(),t.installmentsNumber>1&&t.installmentValue?r("div",{key:"installments",staticClass:"prices__installments"},[t.isLiteral?r("small",[t._v(" "+t._s(t.i19upTo)+" ")]):t._e(),t._v(" "+t._s(t.installmentsNumber)+"x "),t.isLiteral?r("small",[t._v(" "+t._s(t.i19of)+" ")]):t._e(),r("span",[t._v(" "+t._s(t.formatMoney(t.installmentValue))+" ")]),!t.monthlyInterest&&t.isLiteral?r("small",[t._v(" "+t._s(t.i19interestFree)+" ")]):t._e()]):t._e(),"number"===typeof t.priceWithDiscount&&t.priceWithDiscount<t.price?r("div",{key:"discount",staticClass:"prices__discount"},["string"===typeof t.discountLabel&&t.discountLabel?[r("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")]),r("small",{staticClass:"prices__discount-label"},[t._v(" "+t._s(t.discountLabel)+" ")])]:[r("small",[t._v(" "+t._s(t.i19asOf)+" ")]),r("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")])]],2):t._e()])],1)},a=[],n=r("6d50"),s=r("736b"),o=r("066e"),c=r("04f2"),l=r("f1d7"),u=r("fde6");const d=(t,e)=>{const{type:r,value:i}=e;let a;if(i)return a="percentage"===r?t*(100-i)/100:t-i,a>0?a:0};var p={name:"APrices",props:{product:{type:Object,required:!0},isLiteral:Boolean,isBig:Boolean,isAmountTotal:Boolean,installmentsOption:Object,discountOption:Object,discountText:{type:[String,Boolean],default:""},canShowPriceOptions:{type:Boolean,default:!0}},data(){return{installmentsNumber:0,monthlyInterest:0,discount:{type:null,value:0},extraDiscount:{type:null,value:0,min_amount:0},discountLabel:this.discountText,pointsProgramName:null,pointsMinPrice:0,earnPointsFactor:0}},computed:{i19asOf:()=>Object(s["a"])(n["q"]),i19from:()=>Object(s["a"])(n["xb"]),i19interestFree:()=>Object(s["a"])(n["Jb"]),i19of:()=>Object(s["a"])(n["nc"]),i19to:()=>Object(s["a"])(n["td"]),i19upTo:()=>Object(s["a"])(n["Ed"]),i19youEarn:()=>Object(s["a"])(n["Ld"]),price(){const t=Object(o["a"])(this.product);return this.extraDiscount.value&&(!this.extraDiscount.min_amount||t>this.extraDiscount.min_amount)?d(t,this.extraDiscount):t},comparePrice(){return Object(c["a"])(this.product)?this.product.base_price:this.extraDiscount.value?Object(o["a"])(this.product):void 0},hasVariedPrices(){const{variations:t}=this.product;if(t){const e=Object(o["a"])(this.product);for(let r=0;r<t.length;r++){const i=Object(o["a"])({...this.product,...t[r]});if(i>e)return!0}}return!1},priceWithDiscount(){return this.canShowPriceOptions&&d(this.price,this.discount)},installmentValue(){if(this.canShowPriceOptions&&this.installmentsNumber>=2){if(this.monthlyInterest){const t=this.monthlyInterest/100;return this.price*t/(1-Math.pow(1+t,-this.installmentsNumber))}return this.price/this.installmentsNumber}return 0}},methods:{formatMoney:l["a"],updateInstallments(t){if(t){this.monthlyInterest=t.monthly_interest;const e=t.min_installment||5,r=parseInt(this.price/e,10);this.installmentsNumber=Math.min(r,t.max_number)}},updateDiscount(t){!t||t.min_amount&&!(t.min_amount<=this.price)||this.isAmountTotal&&"total"!==t.apply_at||(this.discount=t,!this.discountText&&!1!==this.discountText&&t.label&&(this.discountLabel="via "+t.label))}},watch:{price:{handler(t){this.$emit("fix-price",t)},immediate:!0}},created(){this.canShowPriceOptions&&(this.discountOption?this.updateDiscount(this.discountOption):Object(u["a"])("apply_discount").then(t=>{t.available_extra_discount&&(this.extraDiscount=t.available_extra_discount)}),this.installmentsOption?this.updateInstallments(this.installmentsOption):Object(u["a"])("list_payments").then(t=>{this.updateInstallments(t.installments_option),this.updateDiscount(t.discount_option);const e=t.loyalty_points_programs;this.isLiteral&&e&&this.$nextTick(()=>{for(const t in e){const r=e[t];if(r&&r.earn_percentage>0){this.pointsMinPrice=r.min_subtotal_to_earn,this.pointsProgramName=r.name,this.earnPointsFactor=r.earn_percentage/100;break}}})}))}},m=p,f=(r("7e95"),r("2be6")),h=Object(f["a"])(m,i,a,!1,null,null,null);e["a"]=h.exports},"2a6c":function(t,e,r){(function(t,r){var i=200,a="__lodash_hash_undefined__",n=800,s=16,o=9007199254740991,c="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",p="[object Date]",m="[object Error]",f="[object Function]",h="[object GeneratorFunction]",g="[object Map]",_="[object Number]",b="[object Null]",v="[object Object]",y="[object Proxy]",C="[object RegExp]",w="[object Set]",x="[object String]",O="[object Undefined]",k="[object WeakMap]",j="[object ArrayBuffer]",A="[object DataView]",S="[object Float32Array]",P="[object Float64Array]",I="[object Int8Array]",$="[object Int16Array]",L="[object Int32Array]",N="[object Uint8Array]",T="[object Uint8ClampedArray]",F="[object Uint16Array]",D="[object Uint32Array]",M=/[\\^$.*+?()[\]{}|]/g,z=/^\[object .+?Constructor\]$/,E=/^(?:0|[1-9]\d*)$/,B={};B[S]=B[P]=B[I]=B[$]=B[L]=B[N]=B[T]=B[F]=B[D]=!0,B[c]=B[l]=B[j]=B[d]=B[A]=B[p]=B[m]=B[f]=B[g]=B[_]=B[v]=B[C]=B[w]=B[x]=B[k]=!1;var R="object"==typeof t&&t&&t.Object===Object&&t,V="object"==typeof self&&self&&self.Object===Object&&self,q=R||V||Function("return this")(),U=e&&!e.nodeType&&e,W=U&&"object"==typeof r&&r&&!r.nodeType&&r,H=W&&W.exports===U,Z=H&&R.process,Y=function(){try{var t=W&&W.require&&W.require("util").types;return t||Z&&Z.binding&&Z.binding("util")}catch(e){}}(),G=Y&&Y.isTypedArray;function J(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function K(t,e){var r=-1,i=Array(t);while(++r<t)i[r]=e(r);return i}function X(t){return function(e){return t(e)}}function Q(t,e){return null==t?void 0:t[e]}function tt(t,e){return function(r){return t(e(r))}}var et=Array.prototype,rt=Function.prototype,it=Object.prototype,at=q["__core-js_shared__"],nt=rt.toString,st=it.hasOwnProperty,ot=function(){var t=/[^.]+$/.exec(at&&at.keys&&at.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),ct=it.toString,lt=nt.call(Object),ut=RegExp("^"+nt.call(st).replace(M,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),dt=H?q.Buffer:void 0,pt=q.Symbol,mt=q.Uint8Array,ft=dt?dt.allocUnsafe:void 0,ht=tt(Object.getPrototypeOf,Object),gt=Object.create,_t=it.propertyIsEnumerable,bt=et.splice,vt=pt?pt.toStringTag:void 0,yt=function(){try{var t=ye(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),Ct=dt?dt.isBuffer:void 0,wt=Math.max,xt=Date.now,Ot=ye(q,"Map"),kt=ye(Object,"create"),jt=function(){function t(){}return function(e){if(!qe(e))return{};if(gt)return gt(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function At(t){var e=-1,r=null==t?0:t.length;this.clear();while(++e<r){var i=t[e];this.set(i[0],i[1])}}function St(){this.__data__=kt?kt(null):{},this.size=0}function Pt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function It(t){var e=this.__data__;if(kt){var r=e[t];return r===a?void 0:r}return st.call(e,t)?e[t]:void 0}function $t(t){var e=this.__data__;return kt?void 0!==e[t]:st.call(e,t)}function Lt(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kt&&void 0===e?a:e,this}function Nt(t){var e=-1,r=null==t?0:t.length;this.clear();while(++e<r){var i=t[e];this.set(i[0],i[1])}}function Tt(){this.__data__=[],this.size=0}function Ft(t){var e=this.__data__,r=te(e,t);if(r<0)return!1;var i=e.length-1;return r==i?e.pop():bt.call(e,r,1),--this.size,!0}function Dt(t){var e=this.__data__,r=te(e,t);return r<0?void 0:e[r][1]}function Mt(t){return te(this.__data__,t)>-1}function zt(t,e){var r=this.__data__,i=te(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}function Et(t){var e=-1,r=null==t?0:t.length;this.clear();while(++e<r){var i=t[e];this.set(i[0],i[1])}}function Bt(){this.size=0,this.__data__={hash:new At,map:new(Ot||Nt),string:new At}}function Rt(t){var e=ve(this,t)["delete"](t);return this.size-=e?1:0,e}function Vt(t){return ve(this,t).get(t)}function qt(t){return ve(this,t).has(t)}function Ut(t,e){var r=ve(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}function Wt(t){var e=this.__data__=new Nt(t);this.size=e.size}function Ht(){this.__data__=new Nt,this.size=0}function Zt(t){var e=this.__data__,r=e["delete"](t);return this.size=e.size,r}function Yt(t){return this.__data__.get(t)}function Gt(t){return this.__data__.has(t)}function Jt(t,e){var r=this.__data__;if(r instanceof Nt){var a=r.__data__;if(!Ot||a.length<i-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new Et(a)}return r.set(t,e),this.size=r.size,this}function Kt(t,e){var r=Me(t),i=!r&&De(t),a=!r&&!i&&Be(t),n=!r&&!i&&!a&&He(t),s=r||i||a||n,o=s?K(t.length,String):[],c=o.length;for(var l in t)!e&&!st.call(t,l)||s&&("length"==l||a&&("offset"==l||"parent"==l)||n&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||xe(l,c))||o.push(l);return o}function Xt(t,e,r){(void 0!==r&&!Fe(t[e],r)||void 0===r&&!(e in t))&&ee(t,e,r)}function Qt(t,e,r){var i=t[e];st.call(t,e)&&Fe(i,r)&&(void 0!==r||e in t)||ee(t,e,r)}function te(t,e){var r=t.length;while(r--)if(Fe(t[r][0],e))return r;return-1}function ee(t,e,r){"__proto__"==e&&yt?yt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}At.prototype.clear=St,At.prototype["delete"]=Pt,At.prototype.get=It,At.prototype.has=$t,At.prototype.set=Lt,Nt.prototype.clear=Tt,Nt.prototype["delete"]=Ft,Nt.prototype.get=Dt,Nt.prototype.has=Mt,Nt.prototype.set=zt,Et.prototype.clear=Bt,Et.prototype["delete"]=Rt,Et.prototype.get=Vt,Et.prototype.has=qt,Et.prototype.set=Ut,Wt.prototype.clear=Ht,Wt.prototype["delete"]=Zt,Wt.prototype.get=Yt,Wt.prototype.has=Gt,Wt.prototype.set=Jt;var re=be();function ie(t){return null==t?void 0===t?O:b:vt&&vt in Object(t)?Ce(t):Pe(t)}function ae(t){return Ue(t)&&ie(t)==c}function ne(t){if(!qe(t)||je(t))return!1;var e=Re(t)?ut:z;return e.test(Te(t))}function se(t){return Ue(t)&&Ve(t.length)&&!!B[ie(t)]}function oe(t){if(!qe(t))return Se(t);var e=Ae(t),r=[];for(var i in t)("constructor"!=i||!e&&st.call(t,i))&&r.push(i);return r}function ce(t,e,r,i,a){t!==e&&re(e,(function(n,s){if(a||(a=new Wt),qe(n))le(t,e,s,r,ce,i,a);else{var o=i?i($e(t,s),n,s+"",t,e,a):void 0;void 0===o&&(o=n),Xt(t,s,o)}}),Ye)}function le(t,e,r,i,a,n,s){var o=$e(t,r),c=$e(e,r),l=s.get(c);if(l)Xt(t,r,l);else{var u=n?n(o,c,r+"",t,e,s):void 0,d=void 0===u;if(d){var p=Me(c),m=!p&&Be(c),f=!p&&!m&&He(c);u=c,p||m||f?Me(o)?u=o:Ee(o)?u=he(o):m?(d=!1,u=pe(c,!0)):f?(d=!1,u=fe(c,!0)):u=[]:We(c)||De(c)?(u=o,De(o)?u=Ze(o):qe(o)&&!Re(o)||(u=we(c))):d=!1}d&&(s.set(c,u),a(u,c,i,n,s),s["delete"](c)),Xt(t,r,u)}}function ue(t,e){return Le(Ie(t,e,Ke),t+"")}var de=yt?function(t,e){return yt(t,"toString",{configurable:!0,enumerable:!1,value:Je(e),writable:!0})}:Ke;function pe(t,e){if(e)return t.slice();var r=t.length,i=ft?ft(r):new t.constructor(r);return t.copy(i),i}function me(t){var e=new t.constructor(t.byteLength);return new mt(e).set(new mt(t)),e}function fe(t,e){var r=e?me(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function he(t,e){var r=-1,i=t.length;e||(e=Array(i));while(++r<i)e[r]=t[r];return e}function ge(t,e,r,i){var a=!r;r||(r={});var n=-1,s=e.length;while(++n<s){var o=e[n],c=i?i(r[o],t[o],o,r,t):void 0;void 0===c&&(c=t[o]),a?ee(r,o,c):Qt(r,o,c)}return r}function _e(t){return ue((function(e,r){var i=-1,a=r.length,n=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;n=t.length>3&&"function"==typeof n?(a--,n):void 0,s&&Oe(r[0],r[1],s)&&(n=a<3?void 0:n,a=1),e=Object(e);while(++i<a){var o=r[i];o&&t(e,o,i,n)}return e}))}function be(t){return function(e,r,i){var a=-1,n=Object(e),s=i(e),o=s.length;while(o--){var c=s[t?o:++a];if(!1===r(n[c],c,n))break}return e}}function ve(t,e){var r=t.__data__;return ke(e)?r["string"==typeof e?"string":"hash"]:r.map}function ye(t,e){var r=Q(t,e);return ne(r)?r:void 0}function Ce(t){var e=st.call(t,vt),r=t[vt];try{t[vt]=void 0;var i=!0}catch(n){}var a=ct.call(t);return i&&(e?t[vt]=r:delete t[vt]),a}function we(t){return"function"!=typeof t.constructor||Ae(t)?{}:jt(ht(t))}function xe(t,e){var r=typeof t;return e=null==e?o:e,!!e&&("number"==r||"symbol"!=r&&E.test(t))&&t>-1&&t%1==0&&t<e}function Oe(t,e,r){if(!qe(r))return!1;var i=typeof e;return!!("number"==i?ze(r)&&xe(e,r.length):"string"==i&&e in r)&&Fe(r[e],t)}function ke(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function je(t){return!!ot&&ot in t}function Ae(t){var e=t&&t.constructor,r="function"==typeof e&&e.prototype||it;return t===r}function Se(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}function Pe(t){return ct.call(t)}function Ie(t,e,r){return e=wt(void 0===e?t.length-1:e,0),function(){var i=arguments,a=-1,n=wt(i.length-e,0),s=Array(n);while(++a<n)s[a]=i[e+a];a=-1;var o=Array(e+1);while(++a<e)o[a]=i[a];return o[e]=r(s),J(t,this,o)}}function $e(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var Le=Ne(de);function Ne(t){var e=0,r=0;return function(){var i=xt(),a=s-(i-r);if(r=i,a>0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Te(t){if(null!=t){try{return nt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function Fe(t,e){return t===e||t!==t&&e!==e}var De=ae(function(){return arguments}())?ae:function(t){return Ue(t)&&st.call(t,"callee")&&!_t.call(t,"callee")},Me=Array.isArray;function ze(t){return null!=t&&Ve(t.length)&&!Re(t)}function Ee(t){return Ue(t)&&ze(t)}var Be=Ct||Xe;function Re(t){if(!qe(t))return!1;var e=ie(t);return e==f||e==h||e==u||e==y}function Ve(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function qe(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ue(t){return null!=t&&"object"==typeof t}function We(t){if(!Ue(t)||ie(t)!=v)return!1;var e=ht(t);if(null===e)return!0;var r=st.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&nt.call(r)==lt}var He=G?X(G):se;function Ze(t){return ge(t,Ye(t))}function Ye(t){return ze(t)?Kt(t,!0):oe(t)}var Ge=_e((function(t,e,r){ce(t,e,r)}));function Je(t){return function(){return t}}function Ke(t){return t}function Xe(){return!1}r.exports=Ge}).call(this,r("7d15"),r("6984")(t))},"2bab":function(t,e,r){(function(t){(function(){function t(t,e){var r,i=t.split("."),a=V;i[0]in a||!a.execScript||a.execScript("var "+i[0]);for(;i.length&&(r=i.shift());)i.length||void 0===e?a=a[r]?a[r]:a[r]={}:a[r]=e}function e(t,e){function r(){}r.prototype=e.prototype,t.M=e.prototype,t.prototype=new r,t.prototype.constructor=t,t.N=function(t,r,i){for(var a=Array(arguments.length-2),n=2;n<arguments.length;n++)a[n-2]=arguments[n];return e.prototype[r].apply(t,a)}}function r(t,e){null!=t&&this.a.apply(this,arguments)}function i(t){t.b=""}function a(t,e){t.sort(e||n)}function n(t,e){return t>e?1:t<e?-1:0}function s(t){var e,r=[],i=0;for(e in t)r[i++]=t[e];return r}function o(t,e){this.b=t,this.a={};for(var r=0;r<e.length;r++){var i=e[r];this.a[i.b]=i}}function c(t){return t=s(t.a),a(t,(function(t,e){return t.b-e.b})),t}function l(t,e){switch(this.b=t,this.g=!!e.v,this.a=e.c,this.i=e.type,this.h=!1,this.a){case W:case H:case Z:case Y:case G:case U:case q:this.h=!0}this.f=e.defaultValue}function u(){this.a={},this.f=this.j().a,this.b=this.g=null}function d(t,e){for(var r=c(t.j()),i=0;i<r.length;i++){var a=r[i],n=a.b;if(null!=e.a[n]){t.b&&delete t.b[a.b];var s=11==a.a||10==a.a;if(a.g){a=p(e,n)||[];for(var o=0;o<a.length;o++){var l=t,u=n,m=s?a[o].clone():a[o];l.a[u]||(l.a[u]=[]),l.a[u].push(m),l.b&&delete l.b[u]}}else a=p(e,n),s?(s=p(t,n))?d(s,a):g(t,n,a.clone()):g(t,n,a)}}}function p(t,e){var r=t.a[e];if(null==r)return null;if(t.g){if(!(e in t.b)){var i=t.g,a=t.f[e];if(null!=r)if(a.g){for(var n=[],s=0;s<r.length;s++)n[s]=i.b(a,r[s]);r=n}else r=i.b(a,r);return t.b[e]=r}return t.b[e]}return r}function m(t,e,r){var i=p(t,e);return t.f[e].g?i[r||0]:i}function f(t,e){var r;if(null!=t.a[e])r=m(t,e,void 0);else t:{if(r=t.f[e],void 0===r.f){var i=r.i;if(i===Boolean)r.f=!1;else if(i===Number)r.f=0;else{if(i!==String){r=new i;break t}r.f=r.h?"0":""}}r=r.f}return r}function h(t,e){return t.f[e].g?null!=t.a[e]?t.a[e].length:0:null!=t.a[e]?1:0}function g(t,e,r){t.a[e]=r,t.b&&(t.b[e]=r)}function _(t,e){var r,i=[];for(r in e)0!=r&&i.push(new l(r,e[r]));return new o(t,i)}function b(){u.call(this)}function v(){u.call(this)}function y(){u.call(this)}function C(){}function w(){}function x(){}function O(){this.a={}}function k(t){return 0==t.length||nt.test(t)}function j(t,e){if(null==e)return null;e=e.toUpperCase();var r=t.a[e];if(null==r){if(r=et[e],null==r)return null;r=(new x).a(y.j(),r),t.a[e]=r}return r}function A(t){return t=tt[t],null==t?"ZZ":t[0]}function S(t){this.H=RegExp(" "),this.C="",this.m=new r,this.w="",this.i=new r,this.u=new r,this.l=!0,this.A=this.o=this.F=!1,this.G=O.b(),this.s=0,this.b=new r,this.B=!1,this.h="",this.a=new r,this.f=[],this.D=t,this.J=this.g=P(this,this.D)}function P(t,e){var r;if(null!=e&&isNaN(e)&&e.toUpperCase()in et){if(r=j(t.G,e),null==r)throw Error("Invalid region code: "+e);r=f(r,10)}else r=0;return r=j(t.G,A(r)),null!=r?r:st}function I(t){for(var e=t.f.length,r=0;r<e;++r){var a,n=t.f[r],s=f(n,1);if(t.w==s)return!1;a=t;var o=n,c=f(o,1);if(-1!=c.indexOf("|"))a=!1;else{var l;c=c.replace(ot,"\\d"),c=c.replace(ct,"\\d"),i(a.m),l=a;o=f(o,2);var u="999999999999999".match(c)[0];u.length<l.a.b.length?l="":(l=u.replace(new RegExp(c,"g"),o),l=l.replace(RegExp("9","g")," ")),0<l.length?(a.m.a(l),a=!0):a=!1}if(a)return t.w=s,t.B=ut.test(m(n,4)),t.s=0,!0}return t.l=!1}function $(t,e){for(var r=[],i=e.length-3,a=t.f.length,n=0;n<a;++n){var s=t.f[n];0==h(s,3)?r.push(t.f[n]):(s=m(s,3,Math.min(i,h(s,3)-1)),0==e.search(s)&&r.push(t.f[n]))}t.f=r}function L(t,e){t.i.a(e);var r=e;if(at.test(r)||1==t.i.b.length&&it.test(r)){var a;r=e;"+"==r?(a=r,t.u.a(r)):(a=rt[r],t.u.a(a),t.a.a(a)),e=a}else t.l=!1,t.F=!0;if(!t.l){if(!t.F)if(E(t)){if(B(t))return N(t)}else if(0<t.h.length&&(r=t.a.toString(),i(t.a),t.a.a(t.h),t.a.a(r),r=t.b.toString(),a=r.lastIndexOf(t.h),i(t.b),t.b.a(r.substring(0,a))),t.h!=z(t))return t.b.a(" "),N(t);return t.i.toString()}switch(t.u.b.length){case 0:case 1:case 2:return t.i.toString();case 3:if(!E(t))return t.h=z(t),D(t);t.A=!0;default:return t.A?(B(t)&&(t.A=!1),t.b.toString()+t.a.toString()):0<t.f.length?(r=R(t,e),a=T(t),0<a.length?a:($(t,t.a.toString()),I(t)?M(t):t.l?F(t,r):t.i.toString())):D(t)}}function N(t){return t.l=!0,t.A=!1,t.f=[],t.s=0,i(t.m),t.w="",D(t)}function T(t){for(var e=t.a.toString(),r=t.f.length,i=0;i<r;++i){var a=t.f[i],n=f(a,1);if(new RegExp("^(?:"+n+")$").test(e))return t.B=ut.test(m(a,4)),e=e.replace(new RegExp(n,"g"),m(a,2)),F(t,e)}return""}function F(t,e){var r=t.b.b.length;return t.B&&0<r&&" "!=t.b.toString().charAt(r-1)?t.b+" "+e:t.b+e}function D(t){var e=t.a.toString();if(3<=e.length){for(var r=t.o&&0==t.h.length&&0<h(t.g,20)?p(t.g,20)||[]:p(t.g,19)||[],i=r.length,a=0;a<i;++a){var n=r[a];0<t.h.length&&k(f(n,4))&&!m(n,6)&&null==n.a[5]||(0!=t.h.length||t.o||k(f(n,4))||m(n,6))&<.test(f(n,2))&&t.f.push(n)}return $(t,e),e=T(t),0<e.length?e:I(t)?M(t):t.i.toString()}return F(t,e)}function M(t){var e=t.a.toString(),r=e.length;if(0<r){for(var i="",a=0;a<r;a++)i=R(t,e.charAt(a));return t.l?F(t,i):t.i.toString()}return t.b.toString()}function z(t){var e,r=t.a.toString(),a=0;return 1!=m(t.g,10)?e=!1:(e=t.a.toString(),e="1"==e.charAt(0)&&"0"!=e.charAt(1)&&"1"!=e.charAt(1)),e?(a=1,t.b.a("1").a(" "),t.o=!0):null!=t.g.a[15]&&(e=new RegExp("^(?:"+m(t.g,15)+")"),e=r.match(e),null!=e&&null!=e[0]&&0<e[0].length&&(t.o=!0,a=e[0].length,t.b.a(r.substring(0,a)))),i(t.a),t.a.a(r.substring(a)),r.substring(0,a)}function E(t){var e=t.u.toString(),r=new RegExp("^(?:\\+|"+m(t.g,11)+")");r=e.match(r);return null!=r&&null!=r[0]&&0<r[0].length&&(t.o=!0,r=r[0].length,i(t.a),t.a.a(e.substring(r)),i(t.b),t.b.a(e.substring(0,r)),"+"!=e.charAt(0)&&t.b.a(" "),!0)}function B(t){if(0==t.a.b.length)return!1;var e,a=new r;t:{if(e=t.a.toString(),0!=e.length&&"0"!=e.charAt(0))for(var n,s=e.length,o=1;3>=o&&o<=s;++o)if(n=parseInt(e.substring(0,o),10),n in tt){a.a(e.substring(o)),e=n;break t}e=0}return 0!=e&&(i(t.a),t.a.a(a.toString()),a=A(e),"001"==a?t.g=j(t.G,""+e):a!=t.D&&(t.g=P(t,a)),t.b.a(""+e).a(" "),t.h="",!0)}function R(t,e){var r=t.m.toString();if(0<=r.substring(t.s).search(t.H)){var a=r.search(t.H);r=r.replace(t.H,e);return i(t.m),t.m.a(r),t.s=a,r.substring(0,t.s+1)}return 1==t.f.length&&(t.l=!1),t.w="",t.i.toString()}var V=this;r.prototype.b="",r.prototype.set=function(t){this.b=""+t},r.prototype.a=function(t,e,r){if(this.b+=String(t),null!=e)for(var i=1;i<arguments.length;i++)this.b+=arguments[i];return this},r.prototype.toString=function(){return this.b};var q=1,U=2,W=3,H=4,Z=6,Y=16,G=18;u.prototype.set=function(t,e){g(this,t.b,e)},u.prototype.clone=function(){var t=new this.constructor;return t!=this&&(t.a={},t.b&&(t.b={}),d(t,this)),t},e(b,u);var J=null;e(v,u);var K=null;e(y,u);var X=null;b.prototype.j=function(){var t=J;return t||(J=t=_(b,{0:{name:"NumberFormat",I:"i18n.phonenumbers.NumberFormat"},1:{name:"pattern",required:!0,c:9,type:String},2:{name:"format",required:!0,c:9,type:String},3:{name:"leading_digits_pattern",v:!0,c:9,type:String},4:{name:"national_prefix_formatting_rule",c:9,type:String},6:{name:"national_prefix_optional_when_formatting",c:8,defaultValue:!1,type:Boolean},5:{name:"domestic_carrier_code_formatting_rule",c:9,type:String}})),t},b.j=b.prototype.j,v.prototype.j=function(){var t=K;return t||(K=t=_(v,{0:{name:"PhoneNumberDesc",I:"i18n.phonenumbers.PhoneNumberDesc"},2:{name:"national_number_pattern",c:9,type:String},9:{name:"possible_length",v:!0,c:5,type:Number},10:{name:"possible_length_local_only",v:!0,c:5,type:Number},6:{name:"example_number",c:9,type:String}})),t},v.j=v.prototype.j,y.prototype.j=function(){var t=X;return t||(X=t=_(y,{0:{name:"PhoneMetadata",I:"i18n.phonenumbers.PhoneMetadata"},1:{name:"general_desc",c:11,type:v},2:{name:"fixed_line",c:11,type:v},3:{name:"mobile",c:11,type:v},4:{name:"toll_free",c:11,type:v},5:{name:"premium_rate",c:11,type:v},6:{name:"shared_cost",c:11,type:v},7:{name:"personal_number",c:11,type:v},8:{name:"voip",c:11,type:v},21:{name:"pager",c:11,type:v},25:{name:"uan",c:11,type:v},27:{name:"emergency",c:11,type:v},28:{name:"voicemail",c:11,type:v},29:{name:"short_code",c:11,type:v},30:{name:"standard_rate",c:11,type:v},31:{name:"carrier_specific",c:11,type:v},33:{name:"sms_services",c:11,type:v},24:{name:"no_international_dialling",c:11,type:v},9:{name:"id",required:!0,c:9,type:String},10:{name:"country_code",c:5,type:Number},11:{name:"international_prefix",c:9,type:String},17:{name:"preferred_international_prefix",c:9,type:String},12:{name:"national_prefix",c:9,type:String},13:{name:"preferred_extn_prefix",c:9,type:String},15:{name:"national_prefix_for_parsing",c:9,type:String},16:{name:"national_prefix_transform_rule",c:9,type:String},18:{name:"same_mobile_and_fixed_line_pattern",c:8,defaultValue:!1,type:Boolean},19:{name:"number_format",v:!0,c:11,type:b},20:{name:"intl_number_format",v:!0,c:11,type:b},22:{name:"main_country_for_code",c:8,defaultValue:!1,type:Boolean},23:{name:"leading_digits",c:9,type:String},26:{name:"leading_zero_possible",c:8,defaultValue:!1,type:Boolean}})),t},y.j=y.prototype.j,C.prototype.a=function(t){throw new t.b,Error("Unimplemented")},C.prototype.b=function(t,e){if(11==t.a||10==t.a)return e instanceof u?e:this.a(t.i.prototype.j(),e);if(14==t.a){if("string"==typeof e&&Q.test(e)){var r=Number(e);if(0<r)return r}return e}if(!t.h)return e;if(r=t.i,r===String){if("number"==typeof e)return String(e)}else if(r===Number&&"string"==typeof e&&("Infinity"===e||"-Infinity"===e||"NaN"===e||Q.test(e)))return Number(e);return e};var Q=/^-?[0-9]+$/;e(w,C),w.prototype.a=function(t,e){var r=new t.b;return r.g=this,r.a=e,r.b={},r},e(x,w),x.prototype.b=function(t,e){return 8==t.a?!!e:C.prototype.b.apply(this,arguments)},x.prototype.a=function(t,e){return x.M.a.call(this,t,e)};var tt={55:["BR"]},et={BR:[null,[null,null,"(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-24679]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",null,null,null,null,null,null,[8,9,10,11]],[null,null,"(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-5]\\d{7}",null,null,null,"1123456789",null,null,[10],[8]],[null,null,"(?:[189][1-9]|2[12478])(?:7|9\\d)\\d{7}|(?:3[1-578]|[46][1-9]|5[13-5]|7[13-579])(?:[6-9]|9\\d)\\d{7}",null,null,null,"11961234567",null,null,[10,11],[8]],[null,null,"800\\d{6,7}",null,null,null,"800123456",null,null,[9,10]],[null,null,"(?:300|[59]00\\d?)\\d{6}",null,null,null,"300123456",null,null,[9,10]],[null,null,"(?:300\\d(?:\\d{2})?|4(?:0(?:0\\d|20)|370))\\d{4}",null,null,null,"40041234",null,null,[8,10]],[null,null,null,null,null,null,null,null,null,[-1]],[null,null,null,null,null,null,null,null,null,[-1]],"BR",55,"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","0",null,null,"0(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2",null,null,[[null,"(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","300|4(?:0(?:0|20)|370)"]],[null,"(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"],[null,"(\\d{3,5})","$1",["1[125689]"]],[null,"(\\d{4})(\\d{4})","$1-$2",["[2-9](?:0[1-9]|[1-9])"]],[null,"(\\d{5})(\\d{4})","$1-$2",["9(?:0[1-9]|[1-9])"]],[null,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[null,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[1-9][1-9]9"],"($1)","0 $CC ($1)"]],[[null,"(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","300|4(?:0(?:0|20)|370)"]],[null,"(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["[3589]00"],"0$1"],[null,"(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["[1-9][1-9]"],"($1)","0 $CC ($1)"],[null,"(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[1-9][1-9]9"],"($1)","0 $CC ($1)"]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,"(?:300\\d|40(?:0\\d|20))\\d{4}",null,null,null,null,null,null,[8]],[null,null,null,null,null,null,null,null,null,[-1]],null,null,[null,null,null,null,null,null,null,null,null,[-1]]]};O.b=function(){return O.a?O.a:O.a=new O};var rt={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1"