index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/3684.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[3684],{4805:function(e,t,r){r.d(t,{a:function(){return d},b:function(){return c},g:function(){return p}});var n=r(4467),o=r(296);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var _n=0,n=function(){};return{s:n,n:function(){return _n>=e.length?{done:!0}:{done:!1,value:e[_n++]}},e:function(e){throw e},f:n}}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 o,i=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e){for(var t,r="",n=Object.entries(e);t=n.shift();){var i=t,a=(0,o.A)(i,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var l,p=s(Object.entries(c).reverse());try{for(p.s();!(l=p.n()).done;){var d=(0,o.A)(l.value,2),f=d[0],h=d[1];n.unshift(["".concat(u,"[").concat(f,"]"),h])}}catch(e){p.e(e)}finally{p.f()}}else void 0!==c&&(null===c&&(c=""),r+="&"+[u,c].map(encodeURIComponent).join("="))}return r.substr(1)}function l(e){try{return decodeURIComponent(e)}catch(t){return e}}function p(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 r=t.split("=").filter(Boolean).map(l),n=(0,o.A)(r,2),i=n[0],s=n[1],u=void 0===s?"":s;return i&&function(e,t,r){for(var n=t.length,o=n-1,i=0;i<n;i++){var s=t[i];!s&&Array.isArray(e)&&(s=e.length.toString()),s=["__proto__","constructor","prototype"].includes(s)?s.toUpperCase():s;var u=!isNaN(Number(t[i+1]));e[s]=i===o?r:e[s]||(u?[]:{}),Array.isArray(e[s])&&!u&&(e[s]=a({},e[s])),e=e[s]}}(e,i.replace(/\]/g,"").split("["),u),e}),Object.create(null))}function d(){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 r=e,n=e.indexOf("?");return-1!==n&&(t=Object.assign(p(e),t),r=r.substr(0,n)),r+"?"+c(t)}},3:function(e,t,r){r.d(t,{a:function(){return H},h:function(){return L}});var n=r(467),o=r(45),i=r(296),a=r(4467),s=r(9280),u=r.n(s),c=r(4805),l=r(3506),p=["rest_route"],d=["path","url"],f=["url","path","data","parse"];function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,a.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t){return void 0!==(0,l.g)(e,t)}function m(e){var t=e.split("?"),r=t[1],n=t[0];return r?n+"?"+r.split("&").map((function(e){return e.split("=")})).map((function(e){return e.map(decodeURIComponent)})).sort((function(e,t){return e[0].localeCompare(t[0])})).map((function(e){return e.map(encodeURIComponent)})).map((function(e){return e.join("=")})).join("&"):n}var y=function(e,t){var r,n,o=e.path;return"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(r=e.namespace.replace(/^\/|\/$/g,""),o=(n=e.endpoint.replace(/^\//,""))?r+"/"+n:r),delete e.namespace,delete e.endpoint,t(v(v({},e),{},{path:o}))};function g(e,t){return Promise.resolve(t?e.body:new window.Response(JSON.stringify(e.body),{status:200,statusText:"OK",headers:e.headers}))}var b=function(e){return e.json?e.json():Promise.reject(e)},_=function(e){return function(e){if(!e)return{};var t=e.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(e.headers.get("link")).next},O=function(e){var t=!!e.path&&-1!==e.path.indexOf("per_page=-1"),r=!!e.url&&-1!==e.url.indexOf("per_page=-1");return t||r},j=function(){var e=(0,n.A)(u().mark((function e(t,r){var n,i,a,s,l,p;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!1!==t.parse){e.next=2;break}return e.abrupt("return",r(t));case 2:if(O(t)){e.next=4;break}return e.abrupt("return",r(t));case 4:return e.next=6,H(v(v({},(f={per_page:100},void 0,void 0,h=(u=t).path,w=u.url,v(v({},(0,o.A)(u,d)),{},{url:w&&(0,c.a)(w,f),path:h&&(0,c.a)(h,f)}))),{},{parse:!1}));case 6:return n=e.sent,e.next=9,b(n);case 9:if(i=e.sent,Array.isArray(i)){e.next=12;break}return e.abrupt("return",i);case 12:if(a=_(n)){e.next=15;break}return e.abrupt("return",i);case 15:s=[].concat(i);case 16:if(!a){e.next=27;break}return e.next=19,H(v(v({},t),{},{path:void 0,url:a,parse:!1}));case 19:return l=e.sent,e.next=22,b(l);case 22:p=e.sent,s=s.concat(p),a=_(l),e.next=16;break;case 27:return e.abrupt("return",s);case 28:case"end":return e.stop()}var u,f,h,w}),e)})));return function(_x,t){return e.apply(this,arguments)}}(),x=new Set(["PATCH","PUT","DELETE"]),P=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(function(e){return arguments.length>1&&void 0!==arguments[1]&&!arguments[1]?e:204===e.status?null:e.json?e.json():Promise.reject(e)}(e,t)).catch((function(e){return A(e,t)}))};function A(e){if(arguments.length>1&&void 0!==arguments[1]&&!arguments[1])throw e;return function(e){var t={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))}(e).then((function(e){var t={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw e||t}))}var k,S,T,C,E,D,M,N={Accept:"application/json, */*;q=0.1"},R={credentials:"include"},U=[function(e,t){return"string"!=typeof e.url||w(e.url,"_locale")||(e.url=(0,c.a)(e.url,{_locale:"user"})),"string"!=typeof e.path||w(e.path,"_locale")||(e.path=(0,c.a)(e.path,{_locale:"user"})),t(e)},y,function(e,t){var r=e.method,n=void 0===r?"GET":r;return x.has(n.toUpperCase())&&(e=v(v({},e),{},{headers:v(v({},e.headers),{},{"X-HTTP-Method-Override":n,"Content-Type":"application/json"}),method:"POST"})),t(e)},j],I=function(e){if(e.status>=200&&e.status<300)return e;throw e},z=function(e){var t=e.url,r=e.path,n=e.data,i=e.parse,a=void 0===i||i,s=(0,o.A)(e,f),u=e.body,c=e.headers;return c=v(v({},N),c),n&&(u=JSON.stringify(n),c["Content-Type"]="application/json"),window.fetch(t||r||window.location.href,v(v(v({},R),s),{},{body:u,headers:c})).then((function(e){return Promise.resolve(e).then(I).catch((function(e){return A(e,a)})).then((function(e){return P(e,a)}))}),(function(e){if(e&&"AbortError"===e.name)throw e;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function H(e){return U.reduceRight((function(e,t){return function(r){return t(r,e)}}),z)(e).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(H.nonceEndpoint).then(I).then((function(e){return e.text()})).then((function(t){return H.nonceMiddleware.nonce=t,H(e)}))}))}H.use=function(e){U.unshift(e)},H.setFetchHandler=function(e){z=e},H.createNonceMiddleware=function(e){var t=function e(t,r){var n=t.headers,o=void 0===n?{}:n;for(var i in o)if("x-wp-nonce"===i.toLowerCase()&&o[i]===e.nonce)return r(t);return r(v(v({},t),{},{headers:v(v({},o),{},{"X-WP-Nonce":e.nonce})}))};return t.nonce=e,t},H.createPreloadingMiddleware=function(e){var t=Object.fromEntries(Object.entries(e).map((function(e){var t=(0,i.A)(e,2),r=t[0],n=t[1];return[m(r),n]})));return function(e,r){var n=e.parse,i=void 0===n||n,a=e.path;if(!a&&e.url){var s=(0,c.g)(e.url),u=s.rest_route,l=(0,o.A)(s,p);"string"==typeof u&&(a=(0,c.a)(u,l))}if("string"!=typeof a)return r(e);var d=e.method||"GET",f=m(a);if("GET"===d&&t[f]){var h=t[f];return delete t[f],g(h,!!i)}if("OPTIONS"===d&&t[d]&&t[d][f]){var v=t[d][f];return delete t[d][f],g(v,!!i)}return r(e)}},H.createRootURLMiddleware=function(e){return function(t,r){return y(t,(function(t){var n,o=t.url,i=t.path;return"string"==typeof i&&(n=e,-1!==e.indexOf("?")&&(i=i.replace("?","&")),i=i.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(i=i.replace("?","&")),o=n+i),r(v(v({},t),{},{url:o}))}))}},H.fetchAllMiddleware=j,H.mediaUploadMiddleware=function(e,t){if(!function(e){var t=!!e.method&&"POST"===e.method;return(!!e.path&&-1!==e.path.indexOf("/wp/v2/media")||!!e.url&&-1!==e.url.indexOf("/wp/v2/media"))&&t}(e))return t(e);var r=0,n=function e(n){return r++,t({path:"/wp/v2/media/".concat(n,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return r<5?e(n):(t({path:"/wp/v2/media/".concat(n,"?force=true"),method:"DELETE"}),Promise.reject())}))};return t(v(v({},e),{},{parse:!1})).catch((function(t){var r=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&r?n(r).catch((function(){return!1!==e.parse?Promise.reject({code:"post_process",message:wp.i18n.__("Media upload failed. If this is a photo or a large image, please scale it down and try again.")}):Promise.reject(t)})):A(t,e.parse)})).then((function(t){return P(t,e.parse)}))},H.createThemePreviewMiddleware=function(e){return function(t,r){if("string"==typeof t.url){var n=(0,l.g)(t.url,"wp_theme_preview");void 0===n?t.url=(0,c.a)(t.url,{wp_theme_preview:e}):""===n&&(t.url=(0,l.r)(t.url,"wp_theme_preview"))}if("string"==typeof t.path){var o=(0,l.g)(t.path,"wp_theme_preview");void 0===o?t.path=(0,c.a)(t.path,{wp_theme_preview:e}):""===o&&(t.path=(0,l.r)(t.path,"wp_theme_preview"))}return r(t)}},H.fetchAllMiddleware=null,H.use(H.createRootURLMiddleware((null===(S=null===(k=null===window||void 0===window?void 0:window.parent)||void 0===k?void 0:k.scData)||void 0===S?void 0:S.root_url)||(null===(T=null===window||void 0===window?void 0:window.scData)||void 0===T?void 0:T.root_url))),(null===(C=null===window||void 0===window?void 0:window.scData)||void 0===C?void 0:C.nonce)&&(H.nonceMiddleware=H.createNonceMiddleware(null===(E=null===window||void 0===window?void 0:window.scData)||void 0===E?void 0:E.nonce),H.use(H.nonceMiddleware)),(null===(D=null===window||void 0===window?void 0:window.scData)||void 0===D?void 0:D.nonce_endpoint)&&(H.nonceEndpoint=null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce_endpoint),H.use((function(e,t){return e.path=(0,c.a)(e.path,{t:Date.now()}),t(e)})),H.use((function(e,t){var r=t(e);return r.catch((function(e){return"invalid_json"===e.code&&(e.message=wp.i18n.__("The response is not a valid JSON response.","surecart"),e.additional_errors=[{code:"invalid_json",message:wp.i18n.sprintf(/* translators: %s: URL to debug settings page */ wp.i18n.__("Please ensure that your site is not in debug mode as this may interfere with API responses. %s","surecart"),'<a href="'.concat("https://surecart.com/docs/is-not-a-valid-json-response/",'" target="_blank" rel="noopener noreferrer">').concat(wp.i18n.__("More Information","surecart"),"</a>"))}]),"checkout.finalize_error"===e.code&&(e.additional_errors=[{code:"checkout.finalize_error",message:e.message}],e.message=wp.i18n.__("We were not able to process this order","surecart")),Promise.reject(e)})),r}));var J=function(e){var t={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.","surecart")};if((null==e?void 0:e.code)&&(null==e?void 0:e.message))throw e;if(!e||!e.json)throw t;return e.json().catch((function(){throw t}))},L=function(){var e=(0,n.A)(u().mark((function e(t){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J(t);case 2:if("rest_cookie_invalid_nonce"===(r=e.sent).code){e.next=5;break}throw r;case 5:return e.abrupt("return",window.fetch(H.nonceEndpoint).then((function(e){if(e.status>=200&&e.status<300)return e;throw e})).then((function(e){return e.text()})).then((function(e){H.nonceMiddleware.nonce=e})));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},3506:function(e,t,r){r.d(t,{g:function(){return o},r:function(){return i}});var n=r(4805);function o(e,t){return(0,n.g)(e)[t]}function i(e){var t=e.indexOf("?");if(-1===t)return e;for(var r=(0,n.g)(e),o=e.substr(0,t),i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];a.forEach((function(e){return delete r[e]}));var u=(0,n.b)(r);return u?o+"?"+u:o}},3684:function(e,t,r){r.r(t),r.d(t,{sc_password_nag:function(){return l}});var n=r(467),o=r(3029),i=r(2901),a=r(9280),s=r.n(a),u=r(1346),c=r(3),l=function(){return(0,i.A)((function e(t){(0,o.A)(this,e),(0,u.r)(this,t),this.open=!0,this.type="primary",this.successUrl=void 0,this.set=void 0,this.loading=void 0,this.error=void 0,this.success=void 0,this.enableValidation=!0}),[{key:"handleSetChange",value:function(){var e=this;setTimeout((function(){e.input&&e.input.triggerFocus()}),50)}},{key:"dismiss",value:(t=(0,n.A)(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,this.error="",e.prev=2,e.next=5,(0,c.a)({path:"wp/v2/users/me",method:"PATCH",data:{meta:{default_password_nag:!1}}});case 5:this.open=!1,e.next=12;break;case 8:e.prev=8,e.t0=e.catch(2),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart"),this.loading=!1;case 12:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(){return t.apply(this,arguments)})},{key:"validatePassword",value:function(e){return!!new RegExp("^(?=.*?[#?!@$%^&*-]).{6,}$").test(e)}},{key:"handleSubmit",value:(e=(0,n.A)(s().mark((function e(t){var r,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loading=!0,this.error="",e.prev=2,e.next=5,t.target.getFormJson();case 5:return r=e.sent,n=r.password,e.next=9,(0,c.a)({path:"wp/v2/users/me",method:"PATCH",data:{password:n,meta:{default_password_nag:!1}}});case 9:this.dismiss(),this.success=!0,e.next=17;break;case 13:e.prev=13,e.t0=e.catch(2),this.error=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||wp.i18n.__("Something went wrong","surecart"),this.loading=!1;case 17:case"end":return e.stop()}}),e,this,[[2,13]])}))),function(_x){return e.apply(this,arguments)})},{key:"render",value:function(){var e=this;return this.success?(0,u.h)("sc-alert",{type:"success",open:!0},(0,u.h)("span",{slot:"title"},wp.i18n.__("Success!","surecart")),wp.i18n.__("You have successfully set your password.","surecart")):(0,u.h)(u.H,{tabindex:0,"aria-label":wp.i18n.__("You have not yet set a password. Please set a password for your account.","surecart")},(0,u.h)("sc-alert",{type:this.type,open:this.open,exportparts:"base, icon, text, title, message, close-icon",style:{position:"relative"}},!!this.error&&this.error,this.set?(0,u.h)("sc-dashboard-module",{class:"customer-details"},(0,u.h)("span",{slot:"heading"},wp.i18n.__("Set A Password","surecart")," "),(0,u.h)("sc-button",{type:"text",size:"small",slot:"end",onClick:function(){return e.set=!1}},(0,u.h)("sc-icon",{name:"x",slot:"prefix"}),wp.i18n.__("Cancel","surecart")),(0,u.h)("sc-card",null,(0,u.h)("sc-form",{onScFormSubmit:function(t){return e.handleSubmit(t)}},(0,u.h)("sc-password",{enableValidation:this.enableValidation,label:wp.i18n.__("New Password","surecart"),name:"password",confirmation:!0,ref:function(t){return e.input=t},required:!0}),(0,u.h)("div",null,(0,u.h)("sc-button",{type:"primary",full:!0,submit:!0,busy:this.loading},wp.i18n.__("Set Password","surecart")))))):(0,u.h)(u.F,null,(0,u.h)("slot",{name:"title",slot:"title"},wp.i18n.__("Reminder","surecart")),(0,u.h)("slot",null,wp.i18n.__("You have not yet set a password. Please set a password for your account.","surecart")),(0,u.h)("sc-flex",{"justify-content":"flex-start"},(0,u.h)("sc-button",{size:"small",type:"primary",onClick:function(){return e.set=!0}},wp.i18n.__("Set A Password","surecart")),(0,u.h)("sc-button",{size:"small",type:"text",onClick:function(){return e.dismiss()}},wp.i18n.__("Dismiss","surecart")))),this.loading&&(0,u.h)("sc-block-ui",{spinner:!0})))}}],[{key:"watchers",get:function(){return{set:["handleSetChange"]}}}]);var e,t}();l.style=":host{display:block}"},45:function(e,t,r){r.d(t,{A:function(){return o}});var n=r(8587);function o(e,t){if(null==e)return{};var r,o,i=(0,n.A)(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}},8587:function(e,t,r){function n(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}r.d(t,{A:function(){return n}})}}]);