File: /home/zeusxp5/tour.kamille.us/wp-content/plugins/surecart/dist/7578.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[7578],{4805:function(e,t,n){n.d(t,{a:function(){return h},b:function(){return c},g:function(){return d}});var r=n(4467),i=n(3453);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){for(var t,n="",r=Object.entries(e);t=r.shift();){var a=t,o=(0,i.A)(a,2),l=o[0],c=o[1];if(Array.isArray(c)||c&&c.constructor===Object){var u,d=s(Object.entries(c).reverse());try{for(d.s();!(u=d.n()).done;){var h=(0,i.A)(u.value,2),p=h[0],b=h[1];r.unshift(["".concat(l,"[").concat(p,"]"),b])}}catch(e){d.e(e)}finally{d.f()}}else void 0!==c&&(null===c&&(c=""),n+="&"+[l,c].map(encodeURIComponent).join("="))}return n.substr(1)}function u(e){try{return decodeURIComponent(e)}catch(t){return e}}function d(e){return(function(e){var t;try{t=new URL(e,"http://example.com").search.substring(1)}catch(e){}if(t)return t}(e)||"").replace(/\+/g,"%20").split("&").reduce((function(e,t){var n=t.split("=").filter(Boolean).map(u),r=(0,i.A)(n,2),a=r[0],s=r[1],l=void 0===s?"":s;return a&&function(e,t,n){for(var r=t.length,i=r-1,a=0;a<r;a++){var s=t[a];!s&&Array.isArray(e)&&(s=e.length.toString()),s=["__proto__","constructor","prototype"].includes(s)?s.toUpperCase():s;var l=!isNaN(Number(t[a+1]));e[s]=a===i?n:e[s]||(l?[]:{}),Array.isArray(e[s])&&!l&&(e[s]=o({},e[s])),e=e[s]}}(e,a.replace(/\]/g,"").split("["),l),e}),Object.create(null))}function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var n=e,r=e.indexOf("?");return-1!==r&&(t=Object.assign(d(e),t),n=n.substr(0,r)),n+"?"+c(t)}},7215:function(e,t,n){n.d(t,{c:function(){return h},g:function(){return p},i:function(){return b}});var r,i=n(467),a=n(9280),o=n.n(a),s=n(4805),l=["AU","BR","CA","CH","ES","HK","IE","IN","IT","JP","MY","MX","US"],c=["HK"],u=["SG"],d=(null===(r=window.scData)||void 0===r?void 0:r.locale)||navigator.language||(null===navigator||void 0===navigator?void 0:navigator.browserLanguage)||(navigator.languages||["en"])[0],h=function(){var e=(0,i.A)(o().mark((function e(){var t,n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,s.a)("https://api.surecart.com/v1/public/atlas",{locale:d}),e.next=3,fetch(r);case 3:return i=e.sent,e.next=6,i.json();case 6:return a=e.sent,e.abrupt("return",null!==(n=null===(t=(null==a?void 0:a.data)||[])||void 0===t?void 0:t.map((function(e){return{value:e.code,label:e.name}})))&&void 0!==n?n:[]);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),p=function(){var e=(0,i.A)(o().mark((function e(t){var n,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(0,s.a)("https://api.surecart.com/v1/public/atlas/".concat(t),{locale:d}),e.next=3,fetch(n);case 3:return r=e.sent,e.next=6,r.json();case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),b=function(e){return(null==e?void 0:e.country)&&(null==e?void 0:e.line_1)&&(t=e.country,!!c.includes(t)||(null==e?void 0:e.postal_code))&&(!function(e){return!u.includes(e)}(e.country)||(null==e?void 0:e.city))&&(!function(e){return l.includes(e)}(e.country)||(null==e?void 0:e.state));var t}},6418:function(e,t,n){n.d(t,{F:function(){return f},p:function(){return m},r:function(){return y}});var r=n(9394),i=n(467),a=n(45),o=n(4467),s=n(3029),l=n(2901),c=n(9280),u=n.n(c),d=["email","name","first_name","last_name","phone","password","shipping_city","shipping_country","shipping_line_1","shipping_line_2","shipping_postal_code","shipping_state","billing_city","billing_country","billing_line_1","billing_line_2","billing_postal_code","billing_state","tax_identifier.number_type","tax_identifier.number"];function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return p(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw i}}}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){(0,o.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var f=function(){return(0,l.A)((function e(t,n){var r=this;(0,s.A)(this,e),this.form=null,this.input=t,this.options=v({form:function(e){var t,n;return(null===(n=null===(t=r.closestElement("sc-form",e))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("form"))||r.closestElement("form",e)},name:function(e){return e.name},value:function(e){return e.value},disabled:function(e){return e.disabled}},n),this.form=this.options.form(this.input),this.handleFormData=this.handleFormData.bind(this)}),[{key:"closestElement",value:function(e,t){return t?t&&t!=document&&t!=window&&t.closest(e)||this.closestElement(e,t.getRootNode().host):null}},{key:"addFormData",value:function(){this.form&&this.form.addEventListener("formdata",this.handleFormData)}},{key:"removeFormData",value:function(){this.form&&this.form.removeEventListener("formdata",this.handleFormData)}},{key:"handleFormData",value:function(e){var t=this.options.name(this.input),n=this.options.value(this.input);"string"==typeof t&&void 0!==n&&(Array.isArray(n)?n.forEach((function(n){n&&e.formData.append(t,n.toString())})):n&&e.formData.append(t,n.toString()))}}])}(),m=function(e){var t,n=e.email,r=e.name,i=e.first_name,o=e.last_name,s=e.phone,l=e.password,c=e.shipping_city,u=e.shipping_country,h=e.shipping_line_1,p=e.shipping_line_2,b=e.shipping_postal_code,f=e.shipping_state,m=e.billing_city,y=e.billing_country,_=e.billing_line_1,g=e.billing_line_2,k=e.billing_postal_code,x=e.billing_state,w=e["tax_identifier.number_type"],A=e["tax_identifier.number"],C=(0,a.A)(e,d),O=v(v(v(v(v(v({},c?{city:c}:{}),u?{country:u}:{}),h?{line_1:h}:{}),p?{line_2:p}:{}),b?{postal_code:b}:{}),f?{state:f}:{}),I=v(v(v(v(v(v({},m?{city:m}:{}),y?{country:y}:{}),_?{line_1:_}:{}),g?{line_2:g}:{}),k?{postal_code:k}:{}),x?{state:x}:{});return v(v(v(v(v(v(v(v(v(v({},r?{name:r}:{}),n?{email:n}:{}),i?{first_name:i}:{}),o?{last_name:o}:{}),s?{phone:s}:{}),l?{password:l}:{}),Object.keys(O||{}).length?{shipping_address:O}:{}),Object.keys(I||{}).length?{billing_address:I}:{}),w&&A?{tax_identifier:{number:A,number_type:w}}:{}),(null===(t=Object.keys(C))||void 0===t?void 0:t.length)?{metadata:C}:{})},y=function(){var e=(0,i.A)(u().mark((function e(t){var n,i,a,o;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(0,r.A)(t.shadowRoot.querySelectorAll("*")).filter((function(e){return"function"==typeof e.reportValidity})),i=h(n),e.prev=2,i.s();case 4:if((a=i.n()).done){e.next=13;break}return o=a.value,e.next=8,o.reportValidity();case 8:if(e.sent){e.next=11;break}return e.abrupt("return",!1);case 11:e.next=4;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(2),i.e(e.t0);case 18:return e.prev=18,i.f(),e.finish(18);case 21:return e.abrupt("return",!0);case 22:case"end":return e.stop()}}),e,null,[[2,15,18,21]])})));return function(_x){return e.apply(this,arguments)}}()},6402:function(e,t,n){function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",t=document.createElement("div");t.id="a11y-speak-".concat(e),t.className="a11y-speak-region",t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("aria-live",e),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");var n=document.body;return n&&n.appendChild(t),t}n.d(t,{s:function(){return o}});var i,a="";function o(e,t){!function(){for(var e=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text"),n=0;n<e.length;n++)e[n].textContent="";t&&t.setAttribute("hidden","hidden")}(),e=function(e){return e=e.replace(/<[^<>]+>/g," "),a===e&&(e+=" "),a=e,e}(e);var n=document.getElementById("a11y-speak-intro-text"),r=document.getElementById("a11y-speak-assertive"),i=document.getElementById("a11y-speak-polite");r&&"assertive"===t?r.textContent=e:i&&(i.textContent=e),n&&n.removeAttribute("hidden")}i=function(){var e=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===e&&function(){var e=document.createElement("p");e.id="a11y-speak-intro-text",e.className="a11y-speak-intro-text",e.textContent=wp.i18n.__("Notifications"),e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("hidden","hidden");var t=document.body;t&&t.appendChild(e)}(),null===t&&r("assertive"),null===n&&r("polite")},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",i):i())},4493:function(e,t,n){function r(){return"rtl"===document.dir}n.d(t,{i:function(){return r}})},7578:function(e,t,n){n.r(t),n.d(t,{sc_address:function(){return y},sc_checkbox:function(){return g},sc_tax_id_input:function(){return k}});var r=n(4467),i=n(467),a=n(3029),o=n(2901),s=n(9280),l=n.n(s),c=n(1346),u=n(7215),d=n(6418),h=n(4493),p=n(6402),b=n(8674);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach((function(t){(0,r.A)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=[{name:"country",priority:30,label:wp.i18n.__("Country","surecart")},{name:"name",priority:40,label:wp.i18n.__("Name or Company Name","surecart")},{name:"line_1",priority:50,label:wp.i18n.__("Address","surecart")},{name:"line_2",priority:60,label:wp.i18n.__("Line 2","surecart")},{name:"city",priority:70,label:wp.i18n.__("City","surecart")},{name:"state",priority:80,label:wp.i18n.__("State / County","surecart")},{name:"postal_code",priority:90,label:wp.i18n.__("Postal Code","surecart")}],y=function(){return(0,o.A)((function e(t){(0,a.A)(this,e),(0,c.r)(this,t),this.scChangeAddress=(0,c.c)(this,"scChangeAddress",7),this.scInputAddress=(0,c.c)(this,"scInputAddress",7),this.address={country:null,city:null,line_1:null,line_2:null,postal_code:null,state:null},this.names={name:"shipping_name",country:"shipping_country",city:"shipping_city",line_1:"shipping_line_1",line_2:"shipping_line_2",postal_code:"shipping_postal_code",state:"shipping_state"},this.loading=!1,this.disabled=void 0,this.label=void 0,this.showName=void 0,this.showLine2=void 0,this.required=!1,this.requireName=!1,this.showCity=!0,this.showPostal=!0,this.countryDetails=null,this.countryChoices=void 0}),[{key:"handleAddressChange",value:(n=(0,i.A)(l().mark((function e(){var t,n;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=this.address)||void 0===t?void 0:t.country){e.next=2;break}return e.abrupt("return");case 2:if(this.countryDetails&&(null===(n=this.countryDetails)||void 0===n?void 0:n.code)===this.address.country){e.next=6;break}return e.next=5,(0,u.g)(this.address.country);case 5:this.countryDetails=e.sent;case 6:this.scChangeAddress.emit(this.address),this.scInputAddress.emit(this.address);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"handleNameChange",value:function(){this.requireName&&(this.showName=!0)}},{key:"decodeHtmlEntities",value:function(e){var t;return(null===(t=(new DOMParser).parseFromString(e,"text/html"))||void 0===t?void 0:t.body.textContent)||e}},{key:"updateAddress",value:function(e){this.address=f(f({},this.address),e)}},{key:"handleAddressInput",value:function(e){this.scInputAddress.emit(f(f({},this.address),e))}},{key:"clearAddress",value:function(){var e;this.address={name:null===(e=this.address)||void 0===e?void 0:e.name,country:null,city:null,line_1:null,line_2:null,postal_code:null,state:null}}},{key:"componentWillLoad",value:function(){this.initCountryChoices(),this.handleAddressChange(),this.handleNameChange()}},{key:"initCountryChoices",value:(t=(0,i.A)(l().mark((function e(){var t,n,r,i=this;return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,u.c)();case 2:this.countryChoices=e.sent,r=(null===(n=null===(t=this.countryChoices)||void 0===t?void 0:t.find((function(e){var t;return e.value===(null===(t=i.address)||void 0===t?void 0:t.country)})))||void 0===n?void 0:n.value)||null,this.updateAddress({country:r});case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"reportValidity",value:(e=(0,i.A)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,d.r)(this.el));case 1:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"sortedFields",value:function(){var e,t,n,r,i=this;return this.countryDetails&&(null===(e=null==this?void 0:this.address)||void 0===e?void 0:e.country)?(null===(r=null===(n=null===(t=null==this?void 0:this.countryDetails)||void 0===t?void 0:t.address_formats)||void 0===n?void 0:n.edit)||void 0===r?void 0:r.match(/{{([^}]+)}}/g).map((function(e){return e.slice(2,-2)})).map((function(e){var t,n,r;return{name:e,label:(null===(n=null===(t=null==i?void 0:i.countryDetails)||void 0===t?void 0:t.address_labels)||void 0===n?void 0:n[e])||(null===(r=null==m?void 0:m.find((function(t){return(null==t?void 0:t.name)===e})))||void 0===r?void 0:r.label)}})))||[]:m}},{key:"regions",value:function(){var e,t,n,r,i,a=(null===(t=null===(e=null==this?void 0:this.countryDetails)||void 0===e?void 0:e.states)||void 0===t?void 0:t.map((function(e){return{value:null==e?void 0:e.code,label:null==e?void 0:e.name}})))||[];return(null===(r=null===(n=null===window||void 0===window?void 0:window.wp)||void 0===n?void 0:n.hooks)||void 0===r?void 0:r.applyFilters)&&(a=window.wp.hooks.applyFilters("surecart_address_regions",a,null===(i=null==this?void 0:this.address)||void 0===i?void 0:i.country)),a}},{key:"getRoundedProps",value:function(e,t){var n=0===e,r=e===t-1;return{squaredTop:r,squaredBottom:n,squared:!r&&!n}}},{key:"render",value:function(){var e,t,n=this,r=null===(t=null!==(e=this.sortedFields())&&void 0!==e?e:[])||void 0===t?void 0:t.filter((function(e){var t,r,i,a;switch(e.name){case"name":return n.showName;case"line_2":return n.showLine2||!!(null===(r=null===(t=null==n?void 0:n.address)||void 0===t?void 0:t.line_2)||void 0===r?void 0:r.length);case"city":return n.showCity;case"state":return!!(null===(i=null==n?void 0:n.regions())||void 0===i?void 0:i.length)&&!!(null===(a=null==n?void 0:n.address)||void 0===a?void 0:a.country);case"postal_code":return n.showPostal;default:return!0}}));return(0,c.h)("div",{class:"sc-address",part:"base"},(0,c.h)("sc-form-control",{label:this.label,exportparts:"label, help-text, form-control",class:"sc-address__control",required:this.required},r.map((function(e,t){var i,a,o,s,l,u,d,h,p,b,v,m,y,_,g,k=n.getRoundedProps(t,r.length);switch(e.name){case"country":return(0,c.h)("sc-select",f({exportparts:"base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty",part:"name__input",value:null===(i=n.address)||void 0===i?void 0:i.country,onScChange:function(e){var t;e.target.value!==(null===(t=n.address)||void 0===t?void 0:t.country)&&(n.clearAddress(),n.updateAddress({country:e.target.value}))},choices:n.countryChoices,autocomplete:"country-name",placeholder:e.label,name:null===(a=n.names)||void 0===a?void 0:a.country,search:!0,unselect:!1,disabled:n.disabled,required:n.required,"aria-label":e.label},k));case"name":return(0,c.h)("sc-input",f({exportparts:"base:input__base, input, form-control, label, help-text",value:null===(o=null==n?void 0:n.address)||void 0===o?void 0:o.name,onScChange:function(e){return n.updateAddress({name:e.target.value||null})},onScInput:function(e){return n.handleAddressInput({name:e.target.value||null})},autocomplete:"street-address",placeholder:e.label,name:null===(s=n.names)||void 0===s?void 0:s.name,disabled:n.disabled,required:n.requireName,"aria-label":e.label},k));case"line_1":return(0,c.h)("sc-input",f({exportparts:"base:input__base, input, form-control, label, help-text",value:null===(l=null==n?void 0:n.address)||void 0===l?void 0:l.line_1,onScChange:function(e){return n.updateAddress({line_1:e.target.value||null})},onScInput:function(e){return n.handleAddressInput({line_1:e.target.value||null})},autocomplete:"street-address",placeholder:e.label,name:null===(u=n.names)||void 0===u?void 0:u.line_1,disabled:n.disabled,required:n.required,"aria-label":e.label},k));case"line_2":return(0,c.h)("sc-input",f({exportparts:"base:input__base, input, form-control, label, help-text",value:null===(d=null==n?void 0:n.address)||void 0===d?void 0:d.line_2,onScChange:function(e){return n.updateAddress({line_2:e.target.value||null})},onScInput:function(e){return n.handleAddressInput({line_2:e.target.value||null})},autocomplete:"street-address",placeholder:e.label,name:null===(h=n.names)||void 0===h?void 0:h.line_2,disabled:n.disabled,"aria-label":e.label},k));case"city":return(0,c.h)("sc-input",f({exportparts:"base:input__base, input, form-control, label, help-text",placeholder:e.label,name:null===(p=n.names)||void 0===p?void 0:p.city,value:null===(b=null==n?void 0:n.address)||void 0===b?void 0:b.city,onScChange:function(e){return n.updateAddress({city:e.target.value||null})},onScInput:function(e){return n.handleAddressInput({city:e.target.value||null})},required:n.required,disabled:n.disabled,"aria-label":e.label},k));case"state":return(0,c.h)("sc-select",f({exportparts:"base:select__base, input, form-control, label, help-text, trigger, panel, caret, search__base, search__input, search__form-control, menu__base, spinner__base, empty",placeholder:e.label,name:null===(v=n.names)||void 0===v?void 0:v.state,autocomplete:"address-level1",value:null===(m=null==n?void 0:n.address)||void 0===m?void 0:m.state,onScChange:function(e){var t;return n.updateAddress({state:e.target.value||(null===(t=e.detail)||void 0===t?void 0:t.value)||null})},choices:n.regions(),required:n.required,disabled:n.disabled,search:!0,"aria-label":e.label},k));case"postal_code":return(0,c.h)("sc-input",f({exportparts:"base:input__base, input, form-control, label, help-text",placeholder:e.label,name:null===(y=n.names)||void 0===y?void 0:y.postal_code,onScChange:function(e){return n.updateAddress({postal_code:e.target.value||null})},onScInput:function(e){return n.handleAddressInput({postal_code:e.target.value||null})},autocomplete:"postal-code",required:n.required,value:null===(_=null==n?void 0:n.address)||void 0===_?void 0:_.postal_code,disabled:n.disabled,maxlength:"US"===(null===(g=n.address)||void 0===g?void 0:g.country)?5:null,"aria-label":e.label},k));default:return null}}))),this.loading&&(0,c.h)("sc-block-ui",{exportparts:"base:block-ui, content:block-ui__content"}))}},{key:"el",get:function(){return(0,c.a)(this)}}],[{key:"watchers",get:function(){return{address:["handleAddressChange"],requireName:["handleNameChange"]}}}]);var e,t,n}();y.style=":host{display:block}.sc-address{display:block;position:relative}.sc-address [hidden]{display:none}.sc-address--loading{min-height:230px}.sc-address sc-skeleton{display:block;margin-bottom:1em}.sc-address__control{display:block}.sc-address__control>*{margin-bottom:var(--sc-address-column-spacing, -1px)}.sc-address__columns{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;justify-content:space-between}.sc-address__columns>*{flex:1;width:50%;margin-right:var(--sc-address-column-spacing, -1px)}.sc-address__columns>*:last-child{margin-right:0}";var _=0,g=function(){return(0,o.A)((function e(t){(0,a.A)(this,e),(0,c.r)(this,t),this.scBlur=(0,c.c)(this,"scBlur",7),this.scChange=(0,c.c)(this,"scChange",7),this.scFocus=(0,c.c)(this,"scFocus",7),this.inputId="checkbox-".concat(++_),this.labelId="checkbox-label-".concat(_),this.hasFocus=!1,this.name=void 0,this.value=void 0,this.disabled=!1,this.edit=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.invalid=!1}),[{key:"firstUpdated",value:function(){this.input.indeterminate=this.indeterminate}},{key:"triggerClick",value:(r=(0,i.A)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.input.click());case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"triggerFocus",value:(n=(0,i.A)(l().mark((function e(t){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.input.focus(t));case 1:case"end":return e.stop()}}),e,this)}))),function(_x){return n.apply(this,arguments)})},{key:"triggerBlur",value:(t=(0,i.A)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.input.blur());case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"reportValidity",value:(e=(0,i.A)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.invalid=!this.input.checkValidity(),e.abrupt("return",this.input.reportValidity());case 2:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"setCustomValidity",value:function(e){this.input.setCustomValidity(e),this.invalid=!this.input.checkValidity()}},{key:"handleClick",value:function(){this.checked=!this.checked,this.indeterminate=!1}},{key:"handleBlur",value:function(){this.hasFocus=!1,this.scBlur.emit()}},{key:"handleFocus",value:function(){this.hasFocus=!0,this.scFocus.emit()}},{key:"handleLabelMouseDown",value:function(){this.input.focus()}},{key:"handleStateChange",value:function(){this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.scChange.emit()}},{key:"componentDidLoad",value:function(){this.formController=new d.F(this.el,{value:function(e){return e.checked?e.value:void 0}}).addFormData()}},{key:"disconnectedCallback",value:function(){var e;null===(e=this.formController)||void 0===e||e.removeFormData()}},{key:"render",value:function(){var e=this,t=this.edit?"div":"label";return(0,c.h)(t,{key:"3ac07eb97439442d837d0a8cda4136edc3616f2a",part:"base",class:{checkbox:!0,"checkbox--is-required":this.required,"checkbox--checked":this.checked,"checkbox--disabled":this.disabled,"checkbox--focused":this.hasFocus,"checkbox--indeterminate":this.indeterminate,"checkbox--is-rtl":(0,h.i)()},htmlFor:this.inputId,onMouseDown:function(){return e.handleLabelMouseDown()}},(0,c.h)("span",{key:"ecd9c8541f7ee252d1a2e3224b109632680d3a15",part:"control",class:"checkbox__control"},this.checked?(0,c.h)("span",{part:"checked-icon",class:"checkbox__icon"},(0,c.h)("svg",{viewBox:"0 0 16 16"},(0,c.h)("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"round"},(0,c.h)("g",{stroke:"currentColor","stroke-width":"2"},(0,c.h)("g",{transform:"translate(3.428571, 3.428571)"},(0,c.h)("path",{d:"M0,5.71428571 L3.42857143,9.14285714"}),(0,c.h)("path",{d:"M9.14285714,0 L3.42857143,9.14285714"})))))):"",!this.checked&&this.indeterminate?(0,c.h)("span",{part:"indeterminate-icon",class:"checkbox__icon"},(0,c.h)("svg",{viewBox:"0 0 16 16"},(0,c.h)("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd","stroke-linecap":"round"},(0,c.h)("g",{stroke:"currentColor","stroke-width":"2"},(0,c.h)("g",{transform:"translate(2.285714, 6.857143)"},(0,c.h)("path",{d:"M10.2857143,1.14285714 L1.14285714,1.14285714"})))))):"",(0,c.h)("input",{key:"8bf943beb6241b829eea924acb3d9e6edef0f7c4",id:this.inputId,ref:function(t){return e.input=t},type:"checkbox",name:this.name,value:this.value,checked:this.checked,disabled:this.disabled,required:this.required,role:"checkbox","aria-checked":this.checked?"true":"false","aria-labelledby":this.labelId,onClick:function(){return e.handleClick()},onBlur:function(){return e.handleBlur()},onFocus:function(){return e.handleFocus()}})),(0,c.h)("span",{key:"c6dc0936a6c90ca0d416cf701ee8277a3045a1a2",part:"label",id:this.labelId,class:"checkbox__label"},(0,c.h)("slot",{key:"78426ec19722b27768b493aba35ec99a82679d27"})))}},{key:"el",get:function(){return(0,c.a)(this)}}],[{key:"watchers",get:function(){return{checked:["handleStateChange"],indeterminate:["handleStateChange"]}}}]);var e,t,n,r}();g.style=':host{display:block}.checkbox{display:flex;font-family:var(--sc-input-font-family);font-size:var(--sc-input-font-size-medium);font-weight:var(--sc-input-font-weight);color:var(--sc-input-color);vertical-align:middle;cursor:pointer}.checkbox__control{flex:0 0 auto;position:relative;display:inline-flex;align-items:center;justify-content:center;width:var(--sc-checkbox-size);height:var(--sc-checkbox-size);border:solid var(--sc-input-border-width) var(--sc-input-border-color);border-radius:2px;background-color:var(--sc-input-background-color);color:var(--sc-color-white);transition:var(--sc-input-transition, var(--sc-transition-medium)) border-color, var(--sc-input-transition, var(--sc-transition-medium)) opacity, var(--sc-input-transition, var(--sc-transition-medium)) background-color, var(--sc-input-transition, var(--sc-transition-medium)) color, var(--sc-input-transition, var(--sc-transition-medium)) box-shadow}.checkbox__control input[type=checkbox]{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}.checkbox__control .checkbox__icon{display:inline-flex;width:var(--sc-checkbox-size);height:var(--sc-checkbox-size)}.checkbox__control .checkbox__icon svg{width:100%;height:100%}.checkbox:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control:hover{border-color:var(--sc-input-border-color-hover);background-color:var(--sc-input-background-color-hover)}.checkbox.checkbox--focused:not(.checkbox--checked):not(.checkbox--disabled) .checkbox__control{border-color:var(--sc-input-border-color-focus);background-color:var(--sc-input-background-color-focus);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.checkbox--checked .checkbox__control,.checkbox--indeterminate .checkbox__control{border-color:var(--sc-color-primary-500);background-color:var(--sc-color-primary-500)}.checkbox.checkbox--checked:not(.checkbox--disabled) .checkbox__control:hover,.checkbox.checkbox--indeterminate:not(.checkbox--disabled) .checkbox__control:hover{opacity:0.8}.checkbox.checkbox--checked:not(.checkbox--disabled).checkbox--focused .checkbox__control,.checkbox.checkbox--indeterminate:not(.checkbox--disabled).checkbox--focused .checkbox__control{border-color:var(--sc-color-white);background-color:var(--sc-color-primary-500);box-shadow:0 0 0 var(--sc-focus-ring-width) var(--sc-focus-ring-color-primary)}.checkbox--disabled{opacity:0.5;cursor:not-allowed}.checkbox__label{line-height:var(--sc-checkbox-size);margin-top:var(--sc-input-border-width);margin-left:0.5em;flex:1}.checkbox--is-required .checkbox__label:after{content:" *";color:var(--sc-color-danger-500)}::slotted(*){display:inline-block}.checkbox--is-rtl .checkbox__label{margin-left:0;margin-right:0.5em}';var k=function(){return(0,o.A)((function e(t){(0,a.A)(this,e),(0,c.r)(this,t),this.scChange=(0,c.c)(this,"scChange",7),this.scInput=(0,c.c)(this,"scInput",7),this.scInputType=(0,c.c)(this,"scInputType",7),this.scSetState=(0,c.c)(this,"scSetState",7),this.country=void 0,this.show=!1,this.type="other",this.number=null,this.status="unknown",this.loading=void 0,this.help=void 0,this.otherLabel=wp.i18n.__("Tax ID","surecart"),this.caGstLabel=wp.i18n.__("GST Number","surecart"),this.auAbnLabel=wp.i18n.__("ABN Number","surecart"),this.gbVatLabel=wp.i18n.__("UK VAT","surecart"),this.euVatLabel=wp.i18n.__("EU VAT","surecart"),this.taxIdTypes=[],this.required=!1}),[{key:"reportValidity",value:(e=(0,i.A)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.input.reportValidity());case 1:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"onLabelChange",value:function(){b.z.ca_gst.label=this.caGstLabel||b.z.ca_gst.label,b.z.au_abn.label=this.auAbnLabel||b.z.au_abn.label,b.z.gb_vat.label=this.gbVatLabel||b.z.gb_vat.label,b.z.eu_vat.label=this.euVatLabel||b.z.eu_vat.label,b.z.other.label=this.otherLabel||b.z.other.label}},{key:"componentWillLoad",value:function(){this.onLabelChange()}},{key:"renderStatus",value:function(){return"valid"===this.status?(0,c.h)("sc-icon",{name:"check",slot:"prefix",style:{color:"var(--sc-color-success-500)"}}):"invalid"===this.status?(0,c.h)("sc-icon",{name:"x",slot:"prefix",style:{color:"var(--sc-color-danger-500)"}}):void 0}},{key:"filteredZones",value:function(){var e=this;return this.taxIdTypes.length?Object.keys(b.z).filter((function(t){return e.taxIdTypes.includes(t)})).reduce((function(e,t){return e[t]=b.z[t],e}),{}):b.z}},{key:"onTaxIdTypesChange",value:function(){this.taxIdTypes.length&&(this.type=this.taxIdTypes.includes("other")?"other":this.taxIdTypes[0])}},{key:"getZoneLabel",value:function(){var e,t,n=this.filteredZones()||{};return(null===(e=null==n?void 0:n[(null==this?void 0:this.type)||"other"])||void 0===e?void 0:e.label)||(null===(t=null==n?void 0:n[Object.keys(n)[0]])||void 0===t?void 0:t.label)}},{key:"render",value:function(){var e,t,n,r,i,a=this;return(0,c.h)(c.F,{key:"43a7cad8450579f6d5060c612c82f4c72893cbbf"},(0,c.h)("sc-input",{key:"00ad99ba8390326c977bd3ea55c8cd0c396d827f",name:"tax_identifier.number_type",required:this.required,value:this.type,style:{display:"none"}}),(0,c.h)("sc-input",{key:"cc9bb4148eae72267fc0f649980ddbef95f43a98",ref:function(e){return a.input=e},label:this.getZoneLabel(),"aria-label":wp.i18n.__("Tax ID","surecart"),placeholder:wp.i18n.__("Enter Tax ID","surecart"),name:"tax_identifier.number",value:this.number,onScInput:function(e){e.stopImmediatePropagation(),a.scInput.emit({number:e.target.value,number_type:a.type||"other"})},onScChange:function(e){e.stopImmediatePropagation(),a.scChange.emit({number:e.target.value,number_type:a.type||"other"})},help:this.help,required:this.required},this.loading&&"eu_vat"===this.type?(0,c.h)("sc-spinner",{slot:"prefix",style:{"--spinner-size":"10px"}}):this.renderStatus(),1===(null===(e=Object.keys(this.filteredZones()||{}))||void 0===e?void 0:e.length)?(0,c.h)("span",{slot:"suffix"},null===(n=null===(t=Object.values(this.filteredZones()||{}))||void 0===t?void 0:t[0])||void 0===n?void 0:n.label_small):(0,c.h)("sc-dropdown",{slot:"suffix",position:"bottom-right",role:"select","aria-multiselectable":"false","aria-label":wp.i18n.__("Select number type","surecart")},(0,c.h)("sc-button",{type:"text",slot:"trigger",caret:!0,loading:!1,style:{color:"var(--sc-input-label-color)"},tabindex:"0"},null===(i=null===(r=this.filteredZones())||void 0===r?void 0:r[(null==this?void 0:this.type)||"other"])||void 0===i?void 0:i.label_small),(0,c.h)("sc-menu",null,Object.keys(this.filteredZones()||{}).map((function(e){return(0,c.h)("sc-menu-item",{role:"option",onClick:function(){a.scInput.emit({number:a.number,number_type:e}),a.scChange.emit({number:a.number,number_type:e}),a.type=e},onKeyDown:function(t){var n;"Enter"===t.key&&(a.scInput.emit({number:a.number,number_type:e}),a.scChange.emit({number:a.number,number_type:e}),a.type=e,null===(n=a.input)||void 0===n||n.triggerFocus(),(0,p.s)(wp.i18n.sprintf(wp.i18n.__("%s selected","surecart"),b.z[e].label_small,"assertive")))},checked:a.type===e,"aria-selected":a.type===e?"true":"false","aria-label":b.z[e].label_small},b.z[e].label_small)}))))))}}],[{key:"watchers",get:function(){return{otherLabel:["onLabelChange"],caGstLabel:["onLabelChange"],auAbnLabel:["onLabelChange"],gbVatLabel:["onLabelChange"],euVatLabel:["onLabelChange"],taxIdTypes:["onTaxIdTypesChange"]}}}]);var e}();k.style=":host{display:block;z-index:3;position:relative}"},8674:function(e,t,n){n.d(t,{f:function(){return i},z:function(){return r}});var r={ca_gst:{label:wp.i18n.__("GST Number","surecart"),label_small:wp.i18n.__("CA GST","surecart")},au_abn:{label:wp.i18n.__("ABN Number","surecart"),label_small:wp.i18n.__("AU ABN","surecart")},gb_vat:{label:wp.i18n.__("VAT Number","surecart"),label_small:wp.i18n.__("UK VAT","surecart")},eu_vat:{label:wp.i18n.__("VAT Number","surecart"),label_small:wp.i18n.__("EU VAT","surecart")},other:{label:wp.i18n.__("Tax ID","surecart"),label_small:wp.i18n.__("Other","surecart")}},i=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?wp.i18n.__("Estimated Tax","surecart"):wp.i18n.__("Tax","surecart");return e?"".concat(t,": ").concat(e):t}},45:function(e,t,n){n.d(t,{A:function(){return i}});var r=n(8587);function i(e,t){if(null==e)return{};var n,i,a=(0,r.A)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}},8587:function(e,t,n){function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}n.d(t,{A:function(){return r}})}}]);