File: /home/zeusxp5/tour.kamille.us/wp-content/plugins/surecart/dist/2529.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[2529],{4805:function(t,e,n){n.d(e,{a:function(){return h},b:function(){return u},g:function(){return d}});var r=n(4467),i=n(3453);function o(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){(0,r.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},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,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function u(t){for(var e,n="",r=Object.entries(t);e=r.shift();){var o=e,s=(0,i.A)(o,2),a=s[0],u=s[1];if(Array.isArray(u)||u&&u.constructor===Object){var c,d=l(Object.entries(u).reverse());try{for(d.s();!(c=d.n()).done;){var h=(0,i.A)(c.value,2),v=h[0],p=h[1];r.unshift(["".concat(a,"[").concat(v,"]"),p])}}catch(t){d.e(t)}finally{d.f()}}else void 0!==u&&(null===u&&(u=""),n+="&"+[a,u].map(encodeURIComponent).join("="))}return n.substr(1)}function c(t){try{return decodeURIComponent(t)}catch(e){return t}}function d(t){return(function(t){var e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}(t)||"").replace(/\+/g,"%20").split("&").reduce((function(t,e){var n=e.split("=").filter(Boolean).map(c),r=(0,i.A)(n,2),o=r[0],l=r[1],a=void 0===l?"":l;return o&&function(t,e,n){for(var r=e.length,i=r-1,o=0;o<r;o++){var l=e[o];!l&&Array.isArray(t)&&(l=t.length.toString()),l=["__proto__","constructor","prototype"].includes(l)?l.toUpperCase():l;var a=!isNaN(Number(e[o+1]));t[l]=o===i?n:t[l]||(a?[]:{}),Array.isArray(t[l])&&!a&&(t[l]=s({},t[l])),t=t[l]}}(t,o.replace(/\]/g,"").split("["),a),t}),Object.create(null))}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if(!e||!Object.keys(e).length)return t;var n=t,r=t.indexOf("?");return-1!==r&&(e=Object.assign(d(t),e),n=n.substr(0,r)),n+"?"+u(e)}},7215:function(t,e,n){n.d(e,{c:function(){return h},g:function(){return v},i:function(){return p}});var r,i=n(467),o=n(9280),s=n.n(o),l=n(4805),a=["AU","BR","CA","CH","ES","HK","IE","IN","IT","JP","MY","MX","US"],u=["HK"],c=["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 t=(0,i.A)(s().mark((function t(){var e,n,r,i,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=(0,l.a)("https://api.surecart.com/v1/public/atlas",{locale:d}),t.next=3,fetch(r);case 3:return i=t.sent,t.next=6,i.json();case 6:return o=t.sent,t.abrupt("return",null!==(n=null===(e=(null==o?void 0:o.data)||[])||void 0===e?void 0:e.map((function(t){return{value:t.code,label:t.name}})))&&void 0!==n?n:[]);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),v=function(){var t=(0,i.A)(s().mark((function t(e){var n,r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(0,l.a)("https://api.surecart.com/v1/public/atlas/".concat(e),{locale:d}),t.next=3,fetch(n);case 3:return r=t.sent,t.next=6,r.json();case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(_x){return t.apply(this,arguments)}}(),p=function(t){return(null==t?void 0:t.country)&&(null==t?void 0:t.line_1)&&(e=t.country,!!u.includes(e)||(null==t?void 0:t.postal_code))&&(!function(t){return!c.includes(t)}(t.country)||(null==t?void 0:t.city))&&(!function(t){return a.includes(t)}(t.country)||(null==t?void 0:t.state));var e}},2529:function(t,e,n){n.r(e),n.d(e,{sc_customer_details:function(){return d}});var r=n(467),i=n(3029),o=n(2901),s=n(9280),l=n.n(s),a=n(1346),u=n(7215),c=n(8674),d=function(){return(0,o.A)((function t(e){(0,i.A)(this,t),(0,a.r)(this,e),this.heading=void 0,this.editLink=void 0,this.customer=void 0,this.loading=void 0,this.error=void 0,this.countryChoices=void 0}),[{key:"componentWillLoad",value:function(){this.initCountryChoices()}},{key:"initCountryChoices",value:(t=(0,r.A)(l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,u.c)();case 2:this.countryChoices=t.sent;case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"renderContent",value:function(){var t,e,n,r,i,o,s,l,u=this;return this.loading?this.renderLoading():this.customer?(0,a.h)("sc-card",{"no-padding":!0},(0,a.h)("sc-stacked-list",null,!!(null===(t=null==this?void 0:this.customer)||void 0===t?void 0:t.name)&&(0,a.h)("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},(0,a.h)("div",null,(0,a.h)("strong",null,wp.i18n.__("Billing Name","surecart"))),(0,a.h)("div",null,null===(e=this.customer)||void 0===e?void 0:e.name),(0,a.h)("div",null)),!!(null===(n=null==this?void 0:this.customer)||void 0===n?void 0:n.email)&&(0,a.h)("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},(0,a.h)("div",null,(0,a.h)("strong",null,wp.i18n.__("Billing Email","surecart"))),(0,a.h)("div",null,null===(r=this.customer)||void 0===r?void 0:r.email),(0,a.h)("div",null)),!!Object.keys((null===(i=null==this?void 0:this.customer)||void 0===i?void 0:i.shipping_address_display)||{}).length&&this.renderAddress(wp.i18n.__("Shipping Address","surecart"),this.customer.shipping_address_display),!!Object.keys((null===(o=this.customer)||void 0===o?void 0:o.billing_address_display)||{}).length&&this.renderAddress(wp.i18n.__("Billing Address","surecart"),this.customer.billing_address_display),!!(null===(s=null==this?void 0:this.customer)||void 0===s?void 0:s.phone)&&(0,a.h)("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},(0,a.h)("div",null,(0,a.h)("strong",null,wp.i18n.__("Phone","surecart"))),(0,a.h)("div",null,null===(l=this.customer)||void 0===l?void 0:l.phone),(0,a.h)("div",null)),function(){var t,e,n,r,i=(null===(t=u.customer)||void 0===t?void 0:t.tax_identifier)||{},o=i.number_type,s=i.number;if(s&&o){var l=(null===(e=null===c.z||void 0===c.z?void 0:c.z[o])||void 0===e?void 0:e.label)||wp.i18n.__("Tax Id","surecart"),d=!1===(null===(r=null===(n=u.customer)||void 0===n?void 0:n.tax_identifier)||void 0===r?void 0:r["valid_".concat(o)]);return(0,a.h)("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},(0,a.h)("div",null,(0,a.h)("strong",null,l)),(0,a.h)("div",null,s," ",d&&(0,a.h)("sc-tag",{type:"warning"},wp.i18n.__("Invalid","surecart"))),(0,a.h)("div",null))}}())):this.renderEmpty()}},{key:"renderAddress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Address",e=arguments.length>1?arguments[1]:void 0;return(0,a.h)("sc-stacked-list-row",{style:{"--columns":"3"},mobileSize:480},(0,a.h)("div",null,(0,a.h)("strong",null,t)),(0,a.h)("div",{style:{whiteSpace:"pre-line"}},e),(0,a.h)("div",null))}},{key:"renderEmpty",value:function(){return(0,a.h)("div",null,(0,a.h)("sc-divider",{style:{"--spacing":"0"}}),(0,a.h)("slot",{name:"empty"},(0,a.h)("sc-empty",{icon:"user"},wp.i18n.__("You don't have any billing information.","surecart"))))}},{key:"renderLoading",value:function(){return(0,a.h)("sc-card",{"no-padding":!0},(0,a.h)("sc-stacked-list",null,(0,a.h)("sc-stacked-list-row",{style:{"--columns":"2"},"mobile-size":0},(0,a.h)("div",{style:{padding:"0.5em"}},(0,a.h)("sc-skeleton",{style:{width:"30%",marginBottom:"0.75em"}}),(0,a.h)("sc-skeleton",{style:{width:"20%",marginBottom:"0.75em"}}),(0,a.h)("sc-skeleton",{style:{width:"40%"}})))))}},{key:"render",value:function(){var t,e,n;return(0,a.h)("sc-dashboard-module",{key:"02e68517b43466ff5843b30f2a701507ac30f764",exportparts:"base, heading, heading-text, heading-title, heading-description",class:"customer-details",error:this.error},(0,a.h)("span",{key:"063195a49328d8c8804e0263a35b540baf8c1e08",slot:"heading"},this.heading||wp.i18n.__("Billing Details","surecart")," ",!!(null===(t=null==this?void 0:this.customer)||void 0===t?void 0:t.id)&&!(null===(e=null==this?void 0:this.customer)||void 0===e?void 0:e.live_mode)&&(0,a.h)("sc-tag",{key:"9306f1fa20c6fb186d99313864fecb8c7d416355",exportparts:"base:test-tag__base, content:test-tag__content",type:"warning",size:"small"},wp.i18n.__("Test","surecart"))),!!this.editLink&&!!(null===(n=this.customer)||void 0===n?void 0:n.id)&&(0,a.h)("sc-button",{key:"6e6c4f3dfa8a860b161c5bd22931a0ac8497a7b9",exportparts:"base:button__base, label:button__label, prefix:button__prefix",type:"link",href:this.editLink,slot:"end"},(0,a.h)("sc-icon",{key:"4f158a11ddcd2d0660ca4f2418973cc5101e45b9",name:"edit-3",slot:"prefix"}),wp.i18n.__("Update","surecart")),this.renderContent())}},{key:"el",get:function(){return(0,a.a)(this)}}]);var t}();d.style=""},8674:function(t,e,n){n.d(e,{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(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?wp.i18n.__("Estimated Tax","surecart"):wp.i18n.__("Tax","surecart");return t?"".concat(e,": ").concat(t):e}}}]);