index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/3328.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[3328],{488:function(t,n,e){e.d(n,{i:function(){return a},m:function(){return i},z:function(){return r}});var r=["bif","byr","clp","djf","gnf","isk","jpy","kmf","krw","pyg","rwf","ugx","vnd","vuv","xaf","xag","xau","xba","xbb","xbc","xbd","xdr","xof","xpd","xpf","xpt","xts"],i=function(t,n){return a(n)?t:t/100},a=function(t){var n;return r.includes(null===(n=null==t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t))}},6418:function(t,n,e){e.d(n,{F:function(){return m},p:function(){return y},r:function(){return _}});var r=e(9394),i=e(467),a=e(45),o=e(4467),u=e(3029),s=e(2901),c=e(9280),l=e.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 p(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return h(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?h(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);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,a=!0,o=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){o=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(o)throw i}}}}function h(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function f(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function v(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?f(Object(e),!0).forEach((function(n){(0,o.A)(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):f(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var m=function(){return(0,s.A)((function t(n,e){var r=this;(0,u.A)(this,t),this.form=null,this.input=n,this.options=v({form:function(t){var n,e;return(null===(e=null===(n=r.closestElement("sc-form",t))||void 0===n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector("form"))||r.closestElement("form",t)},name:function(t){return t.name},value:function(t){return t.value},disabled:function(t){return t.disabled}},e),this.form=this.options.form(this.input),this.handleFormData=this.handleFormData.bind(this)}),[{key:"closestElement",value:function(t,n){return n?n&&n!=document&&n!=window&&n.closest(t)||this.closestElement(t,n.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(t){var n=this.options.name(this.input),e=this.options.value(this.input);"string"==typeof n&&void 0!==e&&(Array.isArray(e)?e.forEach((function(e){e&&t.formData.append(n,e.toString())})):e&&t.formData.append(n,e.toString()))}}])}(),y=function(t){var n,e=t.email,r=t.name,i=t.first_name,o=t.last_name,u=t.phone,s=t.password,c=t.shipping_city,l=t.shipping_country,p=t.shipping_line_1,h=t.shipping_line_2,f=t.shipping_postal_code,m=t.shipping_state,y=t.billing_city,_=t.billing_country,b=t.billing_line_1,g=t.billing_line_2,w=t.billing_postal_code,x=t.billing_state,k=t["tax_identifier.number_type"],F=t["tax_identifier.number"],C=(0,a.A)(t,d),O=v(v(v(v(v(v({},c?{city:c}:{}),l?{country:l}:{}),p?{line_1:p}:{}),h?{line_2:h}:{}),f?{postal_code:f}:{}),m?{state:m}:{}),A=v(v(v(v(v(v({},y?{city:y}:{}),_?{country:_}:{}),b?{line_1:b}:{}),g?{line_2:g}:{}),w?{postal_code:w}:{}),x?{state:x}:{});return v(v(v(v(v(v(v(v(v(v({},r?{name:r}:{}),e?{email:e}:{}),i?{first_name:i}:{}),o?{last_name:o}:{}),u?{phone:u}:{}),s?{password:s}:{}),Object.keys(O||{}).length?{shipping_address:O}:{}),Object.keys(A||{}).length?{billing_address:A}:{}),k&&F?{tax_identifier:{number:F,number_type:k}}:{}),(null===(n=Object.keys(C))||void 0===n?void 0:n.length)?{metadata:C}:{})},_=function(){var t=(0,i.A)(l().mark((function t(n){var e,i,a,o;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=(0,r.A)(n.shadowRoot.querySelectorAll("*")).filter((function(t){return"function"==typeof t.reportValidity})),i=p(e),t.prev=2,i.s();case 4:if((a=i.n()).done){t.next=13;break}return o=a.value,t.next=8,o.reportValidity();case 8:if(t.sent){t.next=11;break}return t.abrupt("return",!1);case 11:t.next=4;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(2),i.e(t.t0);case 18:return t.prev=18,i.f(),t.finish(18);case 21:return t.abrupt("return",!0);case 22:case"end":return t.stop()}}),t,null,[[2,15,18,21]])})));return function(_x){return t.apply(this,arguments)}}()},1517:function(t,n,e){e.d(n,{a:function(){return i},b:function(){return d},c:function(){return h},d:function(){return o},g:function(){return a},i:function(){return s},p:function(){return p},t:function(){return u}});var r=e(488),i=function(t){return(null==t?void 0:t.amount_off)&&(null==t?void 0:t.currency)?a({amount:t.amount_off,currency:t.currency}):(null==t?void 0:t.percent_off)?wp.i18n.sprintf(wp.i18n.__("%1d%% off","surecart"),0|t.percent_off):""},a=function(t){var n=t.amount,e=t.currency,i=function(t,n){return r.z.includes(n)?t:t/100}(n,e);return"".concat(new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(parseFloat(i.toFixed(2))))},o=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"usd";return null===(t=new Intl.NumberFormat(void 0,{style:"currency",currency:n}).formatToParts().find((function(t){return"currency"===t.type})))||void 0===t?void 0:t.value},u=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wp.i18n.__("every","surecart"),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wp.i18n.__("once","surecart"),i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];switch(n){case"day":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d day","%d days",t,"surecart"):wp.i18n._n("day","%d days",t,"surecart"),t));case"week":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d week","%d weeks",t,"surecart"):wp.i18n._n("week","%d weeks",t,"surecart"),t));case"month":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d month","%d months",t,"surecart"):wp.i18n._n("month","%d months",t,"surecart"),t));case"year":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d year","%d years",t,"surecart"):wp.i18n._n("year","%d years",t,"surecart"),t));default:return r}},s=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return"";var e=n.showOnce,r=n.labels,i=n.abbreviate,a=(r||{}).interval,o=void 0===a?wp.i18n.__("every","surecart"):a;return"".concat(c(t,o,e?wp.i18n.__("once","surecart"):"",i)," ").concat(l(t,i))},c=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wp.i18n.__("once","surecart"),r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.recurring_interval_count&&t.recurring_interval&&1!==(null==t?void 0:t.recurring_period_count)?r?function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wp.i18n.__("once","surecart"),r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];switch(n){case"day":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d day","%d days",t,"surecart"):wp.i18n._n("day","%d days",t,"surecart"),t));case"week":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d wk","%d wks",t,"surecart"):wp.i18n._n("wk","%d wks",t,"surecart"),t));case"month":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d mo","%d months",t,"surecart"):wp.i18n._n("mo","%d mos",t,"surecart"),t));case"year":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d yr","%d yrs",t,"surecart"):wp.i18n._n("yr","%d yrs",t,"surecart"),t));default:return e}}(t.recurring_interval_count,t.recurring_interval,e):u(t.recurring_interval_count,t.recurring_interval," ".concat(n),e):""},l=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(null==t?void 0:t.recurring_period_count)&&1!==(null==t?void 0:t.recurring_period_count)?n?"x ".concat(t.recurring_period_count):" (".concat(wp.i18n.sprintf(wp.i18n._n("%d payment","%d payments",t.recurring_period_count,"surecart"),t.recurring_period_count),")"):""},d=function(t){return wp.i18n.sprintf(wp.i18n._n("%d payment remaining","%d payments remaining",t,"surecart"),t)},p=function(t){var n;return t?"".concat(null===(n=null==t?void 0:t.product)||void 0===n?void 0:n.name," ").concat((null==t?void 0:t.name)?"— ".concat(t.name):""):""},h=function(t){switch(t){case"invalid":return wp.i18n.__("Not valid","surecart");case"expired":return wp.i18n.__("Expired","surecart");case"gone":return wp.i18n.__("Not available","surecart");case"less_than_min_subtotal_amount":return wp.i18n.__("Minimum not met","surecart");case"greater_than_max_subtotal_amount":return wp.i18n.__("Order too large","surecart");case"not_applicable":return wp.i18n.__("Product(s) not eligible","surecart");case"not_applicable_to_customer":return wp.i18n.__("Not eligible","surecart");case"":return"";default:return wp.i18n.__("Not redeemable","surecart")}}},3328:function(t,n,e){e.r(n),e.d(n,{sc_price_input:function(){return p}});var r=e(467),i=e(3029),a=e(2901),o=e(9280),u=e.n(o),s=e(1346),c=e(1517),l=e(6418),d=e(488),p=function(){return(0,a.A)((function t(n){(0,i.A)(this,t),(0,s.r)(this,n),this.scChange=(0,s.c)(this,"scChange",7),this.scInput=(0,s.c)(this,"scInput",7),this.scFocus=(0,s.c)(this,"scFocus",7),this.scBlur=(0,s.c)(this,"scBlur",7),this.size="medium",this.name=void 0,this.value="",this.pill=!1,this.label=void 0,this.showLabel=!0,this.help="",this.clearable=!1,this.placeholder=void 0,this.disabled=!1,this.readonly=!1,this.minlength=void 0,this.maxlength=void 0,this.max=void 0,this.min=void 0,this.required=!1,this.invalid=!1,this.autofocus=void 0,this.hasFocus=void 0,this.currencyCode=void 0,this.showCode=void 0}),[{key:"reportValidity",value:(o=(0,r.A)(u().mark((function t(){var n;return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(n=this.input.shadowRoot.querySelector("input")).setCustomValidity(""),this.min&&this.value&&parseFloat(this.value)<this.min&&(this.invalid=!0,n.setCustomValidity(wp.i18n.sprintf(wp.i18n.__("Must be %d or more.","surecart"),(0,d.m)(this.min,this.currencyCode).toString()))),this.max&&this.value&&parseFloat(this.value)>this.max&&(this.invalid=!0,n.setCustomValidity(wp.i18n.sprintf(wp.i18n.__("Must be %d or less.","surecart"),(0,d.m)(this.max,this.currencyCode).toString()))),t.abrupt("return",n.reportValidity());case 5:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"triggerFocus",value:(e=(0,r.A)(u().mark((function t(n){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.input.triggerFocus(n));case 1:case"end":return t.stop()}}),t,this)}))),function(_x){return e.apply(this,arguments)})},{key:"setCustomValidity",value:(n=(0,r.A)(u().mark((function t(n){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.input.setCustomValidity(n);case 1:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"triggerBlur",value:(t=(0,r.A)(u().mark((function t(){return u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.input.blur());case 1:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})},{key:"handleFocusChange",value:function(){var t,n,e,r;this.hasFocus?null===(n=null===(t=this.input)||void 0===t?void 0:t.focus)||void 0===n||n.call(t):null===(r=null===(e=this.input)||void 0===e?void 0:e.blur)||void 0===r||r.call(e)}},{key:"handleChange",value:function(){this.updateValue(),this.scChange.emit()}},{key:"handleInput",value:function(){this.updateValue(),this.scInput.emit()}},{key:"updateValue",value:function(){var t=parseFloat(this.input.value);if(isNaN(t))this.value="";else{var n=(0,d.i)(this.currencyCode)?t:(100*t).toFixed(2);this.value=n.toString(),this.setCustomValidity("")}}},{key:"componentDidLoad",value:function(){var t=this;this.handleFocusChange(),this.formController=new l.F(this.el).addFormData(),document.addEventListener("wheel",(function(){t.input.triggerBlur()}))}},{key:"disconnectedCallback",value:function(){var t;null===(t=this.formController)||void 0===t||t.removeFormData()}},{key:"getFormattedValue",value:function(){if(!this.value)return"";var t=parseFloat(this.value);return isNaN(t)?"":(0,d.m)(t,this.currencyCode).toString()}},{key:"render",value:function(){var t=this;return(0,s.h)("sc-input",{key:"6acd20c52b5a3305cf8e3ee0d633fa111e0bea4f",exportparts:"base, input, form-control, label, help-text, prefix, suffix",size:this.size,label:this.label,showLabel:this.showLabel,help:this.help,ref:function(n){return t.input=n},type:"text",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,placeholder:this.placeholder,minlength:this.minlength,maxlength:this.maxlength,min:this.min?this.min/100:0,step:.01,max:this.max?this.max/100:null,autofocus:this.autofocus,inputmode:"decimal",onScChange:function(){return t.handleChange()},onScInput:function(){return t.handleInput()},onScBlur:function(){return t.scBlur.emit()},onScFocus:function(){return t.scFocus.emit()},pattern:"^\\d*(\\.\\d{0,2})?$",value:this.getFormattedValue()},(0,s.h)("span",{key:"ad3e6746f8063b9b1f55da885211e8cb25bf159d",style:{opacity:"0.5"},slot:"prefix"},(0,c.d)(this.currencyCode)),(0,s.h)("span",{key:"5a3f492667b004b979346d380541c7ca3cc458e9",slot:"suffix"},(0,s.h)("slot",{key:"e5bfb4decf20e7693716b80e51d2b744249dd731",name:"suffix"},this.showCode&&(null==this?void 0:this.currencyCode)&&(0,s.h)("span",{key:"94de71f635c3f49f0bfe19fc043ddec585132e4d",style:{opacity:"0.5"}},this.currencyCode.toUpperCase()))))}},{key:"el",get:function(){return(0,s.a)(this)}}],[{key:"watchers",get:function(){return{hasFocus:["handleFocusChange"]}}}]);var t,n,e,o}();p.style=":host{display:block}"},45:function(t,n,e){e.d(n,{A:function(){return i}});var r=e(8587);function i(t,n){if(null==t)return{};var e,i,a=(0,r.A)(t,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)e=o[i],n.indexOf(e)>=0||{}.propertyIsEnumerable.call(t,e)&&(a[e]=t[e])}return a}},8587:function(t,n,e){function r(t,n){if(null==t)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(n.indexOf(r)>=0)continue;e[r]=t[r]}return e}e.d(n,{A:function(){return r}})}}]);