index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/662.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[662],{448:function(n,t,e){e.d(t,{a:function(){return d},b:function(){return s},g:function(){return l}});var r=e(4942),i=e(885);function o(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function a(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?o(Object(e),!0).forEach((function(t){(0,r.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):o(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function u(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return c(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:i}}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,a=!0,u=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return a=n.done,n},e:function(n){u=!0,o=n},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw o}}}}function c(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function s(n){for(var t,e="",r=Object.entries(n);t=r.shift();){var o=t,a=(0,i.Z)(o,2),c=a[0],s=a[1];if(Array.isArray(s)||s&&s.constructor===Object){var l,d=u(Object.entries(s).reverse());try{for(d.s();!(l=d.n()).done;){var p=(0,i.Z)(l.value,2),v=p[0],f=p[1];r.unshift(["".concat(c,"[").concat(v,"]"),f])}}catch(n){d.e(n)}finally{d.f()}}else void 0!==s&&(null===s&&(s=""),e+="&"+[c,s].map(encodeURIComponent).join("="))}return e.substr(1)}function l(n){return(function(n){var t;try{t=new URL(n,"http://example.com").search.substring(1)}catch(n){}if(t)return t}(n)||"").replace(/\+/g,"%20").split("&").reduce((function(n,t){var e=t.split("=").filter(Boolean).map(decodeURIComponent),r=(0,i.Z)(e,2),o=r[0],u=r[1],c=void 0===u?"":u;return o&&function(n,t,e){for(var r=t.length,i=r-1,o=0;o<r;o++){var u=t[o];!u&&Array.isArray(n)&&(u=n.length.toString());var c=!isNaN(Number(t[o+1]));n[u]=o===i?e:n[u]||(c?[]:{}),Array.isArray(n[u])&&!c&&(n[u]=a({},n[u])),n=n[u]}}(n,o.replace(/\]/g,"").split("["),c),n}),{})}function d(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return n;var e=n,r=n.indexOf("?");return-1!==r&&(t=Object.assign(l(n),t),e=e.substr(0,r)),e+"?"+s(t)}},2846:function(n,t,e){e.d(t,{i:function(){return o},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(n,t){return o(t)?n:n/100},o=function(n){var t;return r.includes(null===(t=null==n?void 0:n.toLowerCase)||void 0===t?void 0:t.call(n))}},930:function(n,t,e){e.d(t,{a:function(){return G},h:function(){return W}});var r=e(5861),i=e(5987),o=e(885),a=e(4942),u=e(1284),c=e.n(u),s=e(448),l=["rest_route"],d=["path","url"],p=["url","path","data","parse"];function v(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return f(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?f(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(n){throw n},f:i}}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,a=!0,u=!1;return{s:function(){e=e.call(n)},n:function(){var n=e.next();return a=n.done,n},e:function(n){u=!0,o=n},f:function(){try{a||null==e.return||e.return()}finally{if(u)throw o}}}}function f(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function h(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,r)}return e}function _(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?h(Object(e),!0).forEach((function(t){(0,a.Z)(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):h(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}var w=function(n,t){var e,r,i=n.path;return"string"==typeof n.namespace&&"string"==typeof n.endpoint&&(e=n.namespace.replace(/^\/|\/$/g,""),i=(r=n.endpoint.replace(/^\//,""))?e+"/"+r:e),delete n.namespace,delete n.endpoint,t(_(_({},n),{},{path:i}))};function m(n){for(var t,e="",r=Object.entries(n);t=r.shift();){var i=t,a=(0,o.Z)(i,2),u=a[0],c=a[1];if(Array.isArray(c)||c&&c.constructor===Object){var s,l=v(Object.entries(c).reverse());try{for(l.s();!(s=l.n()).done;){var d=(0,o.Z)(s.value,2),p=d[0],f=d[1];r.unshift(["".concat(u,"[").concat(p,"]"),f])}}catch(n){l.e(n)}finally{l.f()}}else void 0!==c&&(null===c&&(c=""),e+="&"+[u,c].map(encodeURIComponent).join("="))}return e.substr(1)}function y(n){return(function(n){var t;try{t=new URL(n,"http://example.com").search.substring(1)}catch(n){}if(t)return t}(n)||"").replace(/\+/g,"%20").split("&").reduce((function(n,t){var e=t.split("=").filter(Boolean).map(decodeURIComponent),r=(0,o.Z)(e,2),i=r[0],a=r[1],u=void 0===a?"":a;return i&&function(n,t,e){for(var r=t.length,i=r-1,o=0;o<r;o++){var a=t[o];!a&&Array.isArray(n)&&(a=n.length.toString()),a=["__proto__","constructor","prototype"].includes(a)?a.toUpperCase():a;var u=!isNaN(Number(t[o+1]));n[a]=o===i?e:n[a]||(u?[]:{}),Array.isArray(n[a])&&!u&&(n[a]=_({},n[a])),n=n[a]}}(n,i.replace(/\]/g,"").split("["),u),n}),Object.create(null))}function b(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return n;var e=n,r=n.indexOf("?");return-1!==r&&(t=Object.assign(y(n),t),e=e.substr(0,r)),e+"?"+m(t)}function g(n,t){return void 0!==function(n,t){return y(n)[t]}(n,t)}function O(n){var t=n.split("?"),e=t[1],r=t[0];return e?r+"?"+e.split("&").map((function(n){return n.split("=")})).map((function(n){return n.map(decodeURIComponent)})).sort((function(n,t){return n[0].localeCompare(t[0])})).map((function(n){return n.map(encodeURIComponent)})).map((function(n){return n.join("=")})).join("&"):r}function x(n,t){return Promise.resolve(t?n.body:new window.Response(JSON.stringify(n.body),{status:200,statusText:"OK",headers:n.headers}))}var j=function(n){return n.json?n.json():Promise.reject(n)},P=function(n){return function(n){if(!n)return{};var t=n.match(/<([^>]+)>; rel="next"/);return t?{next:t[1]}:{}}(n.headers.get("link")).next},k=function(n){var t=!!n.path&&-1!==n.path.indexOf("per_page=-1"),e=!!n.url&&-1!==n.url.indexOf("per_page=-1");return t||e},A=function(){var n=(0,r.Z)(c().mark((function n(t,e){var r,o,a,u,s,l;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!1!==t.parse){n.next=2;break}return n.abrupt("return",e(t));case 2:if(k(t)){n.next=4;break}return n.abrupt("return",e(t));case 4:return n.next=6,G(_(_({},(p={per_page:100},void 0,void 0,v=(c=t).path,f=c.url,_(_({},(0,i.Z)(c,d)),{},{url:f&&b(f,p),path:v&&b(v,p)}))),{},{parse:!1}));case 6:return r=n.sent,n.next=9,j(r);case 9:if(o=n.sent,Array.isArray(o)){n.next=12;break}return n.abrupt("return",o);case 12:if(a=P(r)){n.next=15;break}return n.abrupt("return",o);case 15:u=[].concat(o);case 16:if(!a){n.next=27;break}return n.next=19,G(_(_({},t),{},{path:void 0,url:a,parse:!1}));case 19:return s=n.sent,n.next=22,j(s);case 22:l=n.sent,u=u.concat(l),a=P(s),n.next=16;break;case 27:return n.abrupt("return",u);case 28:case"end":return n.stop()}var c,p,v,f}),n)})));return function(_x,t){return n.apply(this,arguments)}}(),S=new Set(["PATCH","PUT","DELETE"]),T=function(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?204===n.status?null:n.json?n.json():Promise.reject(n):n},C=function(n){var t={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.")};if(!n||!n.json)throw t;return n.json().catch((function(){throw t}))},U=function(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Promise.resolve(T(n,t)).catch((function(n){return R(n,t)}))};function R(n){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)throw n;return C(n).then((function(n){var t={code:"unknown_error",message:wp.i18n.__("An unknown error occurred.")};throw n||t}))}var D,N,I,M,Z,E,F,X={Accept:"application/json, */*;q=0.1"},Y={credentials:"include"},L=[function(n,t){return"string"!=typeof n.url||g(n.url,"_locale")||(n.url=b(n.url,{_locale:"user"})),"string"!=typeof n.path||g(n.path,"_locale")||(n.path=b(n.path,{_locale:"user"})),t(n)},w,function(n,t){var e=n.method,r=void 0===e?"GET":e;return S.has(r.toUpperCase())&&(n=_(_({},n),{},{headers:_(_({},n.headers),{},{"X-HTTP-Method-Override":r,"Content-Type":"application/json"}),method:"POST"})),t(n)},A],z=function(n){if(n.status>=200&&n.status<300)return n;throw n},B=function(n){var t=n.url,e=n.path,r=n.data,o=n.parse,a=void 0===o||o,u=(0,i.Z)(n,p),c=n.body,s=n.headers;return s=_(_({},X),s),r&&(c=JSON.stringify(r),s["Content-Type"]="application/json"),window.fetch(t||e||window.location.href,_(_(_({},Y),u),{},{body:c,headers:s})).then((function(n){return Promise.resolve(n).then(z).catch((function(n){return R(n,a)})).then((function(n){return U(n,a)}))}),(function(n){if(n&&"AbortError"===n.name)throw n;throw{code:"fetch_error",message:wp.i18n.__("You are probably offline.")}}))};function G(n){return L.reduceRight((function(n,t){return function(e){return t(e,n)}}),B)(n).catch((function(t){return"rest_cookie_invalid_nonce"!==t.code?Promise.reject(t):window.fetch(G.nonceEndpoint).then(z).then((function(n){return n.text()})).then((function(t){return G.nonceMiddleware.nonce=t,G(n)}))}))}G.use=function(n){L.unshift(n)},G.setFetchHandler=function(n){B=n},G.createNonceMiddleware=function(n){var t=function n(t,e){var r=t.headers,i=void 0===r?{}:r;for(var o in i)if("x-wp-nonce"===o.toLowerCase()&&i[o]===n.nonce)return e(t);return e(_(_({},t),{},{headers:_(_({},i),{},{"X-WP-Nonce":n.nonce})}))};return t.nonce=n,t},G.createPreloadingMiddleware=function(n){var t=Object.fromEntries(Object.entries(n).map((function(n){var t=(0,o.Z)(n,2),e=t[0],r=t[1];return[O(e),r]})));return function(n,e){var r=n.parse,o=void 0===r||r,a=n.path;if(!a&&n.url){var u=y(n.url),c=u.rest_route,s=(0,i.Z)(u,l);"string"==typeof c&&(a=b(c,s))}if("string"!=typeof a)return e(n);var d=n.method||"GET",p=O(a);if("GET"===d&&t[p]){var v=t[p];return delete t[p],x(v,!!o)}if("OPTIONS"===d&&t[d]&&t[d][p]){var f=t[d][p];return delete t[d][p],x(f,!!o)}return e(n)}},G.createRootURLMiddleware=function(n){return function(t,e){return w(t,(function(t){var r,i=t.url,o=t.path;return"string"==typeof o&&(r=n,-1!==n.indexOf("?")&&(o=o.replace("?","&")),o=o.replace(/^\//,""),"string"==typeof r&&-1!==r.indexOf("?")&&(o=o.replace("?","&")),i=r+o),e(_(_({},t),{},{url:i}))}))}},G.fetchAllMiddleware=A,G.mediaUploadMiddleware=function(n,t){if(!function(n){var t=!!n.method&&"POST"===n.method;return(!!n.path&&-1!==n.path.indexOf("/wp/v2/media")||!!n.url&&-1!==n.url.indexOf("/wp/v2/media"))&&t}(n))return t(n);var e=0,r=function n(r){return e++,t({path:"/wp/v2/media/".concat(r,"/post-process"),method:"POST",data:{action:"create-image-subsizes"},parse:!1}).catch((function(){return e<5?n(r):(t({path:"/wp/v2/media/".concat(r,"?force=true"),method:"DELETE"}),Promise.reject())}))};return t(_(_({},n),{},{parse:!1})).catch((function(t){var e=t.headers.get("x-wp-upload-attachment-id");return t.status>=500&&t.status<600&&e?r(e).catch((function(){return!1!==n.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)})):R(t,n.parse)})).then((function(t){return U(t,n.parse)}))},G.fetchAllMiddleware=null,G.use(G.createRootURLMiddleware((null===(N=null===(D=null===window||void 0===window?void 0:window.parent)||void 0===D?void 0:D.scData)||void 0===N?void 0:N.root_url)||(null===(I=null===window||void 0===window?void 0:window.scData)||void 0===I?void 0:I.root_url))),(null===(M=null===window||void 0===window?void 0:window.scData)||void 0===M?void 0:M.nonce)&&(G.nonceMiddleware=G.createNonceMiddleware(null===(Z=null===window||void 0===window?void 0:window.scData)||void 0===Z?void 0:Z.nonce),G.use(G.nonceMiddleware)),(null===(E=null===window||void 0===window?void 0:window.scData)||void 0===E?void 0:E.nonce_endpoint)&&(G.nonceEndpoint=null===(F=null===window||void 0===window?void 0:window.scData)||void 0===F?void 0:F.nonce_endpoint),G.use((function(n,t){return n.path=(0,s.a)(n.path,{t:Date.now()}),t(n)}));var J=function(n){var t={code:"invalid_json",message:wp.i18n.__("The response is not a valid JSON response.","surecart")};if((null==n?void 0:n.code)&&(null==n?void 0:n.message))throw n;if(!n||!n.json)throw t;return n.json().catch((function(){throw t}))},W=function(){var n=(0,r.Z)(c().mark((function n(t){var e;return c().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,J(t);case 2:if("rest_cookie_invalid_nonce"===(e=n.sent).code){n.next=5;break}throw e;case 5:return n.abrupt("return",window.fetch(G.nonceEndpoint).then((function(n){if(n.status>=200&&n.status<300)return n;throw n})).then((function(n){return n.text()})).then((function(n){G.nonceMiddleware.nonce=n})));case 6:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}()},2400:function(n,t,e){e.d(t,{a:function(){return i},b:function(){return p},c:function(){return f},d:function(){return a},g:function(){return o},i:function(){return s},p:function(){return v},t:function(){return u}});var r=e(2846),i=function(n){return(null==n?void 0:n.amount_off)&&(null==n?void 0:n.currency)?o({amount:n.amount_off,currency:n.currency}):(null==n?void 0:n.percent_off)?wp.i18n.sprintf(wp.i18n.__("%1d%% off","surecart"),0|n.percent_off):""},o=function(n){var t=n.amount,e=n.currency,i=function(n,t){return r.z.includes(t)?n:n/100}(t,e);return"".concat(new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(parseFloat(i.toFixed(2))))},a=function(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"usd",e=new Intl.NumberFormat(void 0,{style:"currency",currency:t}).formatToParts();return null===(n=e.find((function(n){return"currency"===n.type})))||void 0===n?void 0:n.value},u=function(n,t){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(t){case"day":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d day","%d days",n,"surecart"):wp.i18n._n("day","%d days",n,"surecart"),n));case"week":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d week","%d weeks",n,"surecart"):wp.i18n._n("week","%d weeks",n,"surecart"),n));case"month":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d month","%d months",n,"surecart"):wp.i18n._n("month","%d months",n,"surecart"),n));case"year":return"".concat(e," ").concat(wp.i18n.sprintf(i?wp.i18n._n("%d year","%d years",n,"surecart"):wp.i18n._n("year","%d years",n,"surecart"),n));default:return r}},c=function(n,t){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(t){case"day":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d day","%d days",n,"surecart"):wp.i18n._n("day","%d days",n,"surecart"),n));case"week":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d wk","%d wks",n,"surecart"):wp.i18n._n("wk","%d wks",n,"surecart"),n));case"month":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d mo","%d months",n,"surecart"):wp.i18n._n("mo","%d mos",n,"surecart"),n));case"year":return" / ".concat(wp.i18n.sprintf(r?wp.i18n._n("%d yr","%d yrs",n,"surecart"):wp.i18n._n("yr","%d yrs",n,"surecart"),n));default:return e}},s=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n)return"";var e=t.showOnce,r=t.labels,i=t.abbreviate,o=r||{},a=o.interval,u=void 0===a?wp.i18n.__("every","surecart"):a;return"".concat(l(n,u,e?wp.i18n.__("once","surecart"):"",i)," ").concat(d(n,i))},l=function(n,t){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 n.recurring_interval_count&&n.recurring_interval&&1!==(null==n?void 0:n.recurring_period_count)?r?c(n.recurring_interval_count,n.recurring_interval,e):u(n.recurring_interval_count,n.recurring_interval," ".concat(t),e):""},d=function(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(null==n?void 0:n.recurring_period_count)&&1!==(null==n?void 0:n.recurring_period_count)?t?"x ".concat(n.recurring_period_count):" (".concat(wp.i18n.sprintf(wp.i18n._n("%d payment","%d payments",n.recurring_period_count,"surecart"),n.recurring_period_count),")"):""},p=function(n){return wp.i18n.sprintf(wp.i18n._n("%d payment remaining","%d payments remaining",n,"surecart"),n)},v=function(n){var t;return n?"".concat(null===(t=null==n?void 0:n.product)||void 0===t?void 0:t.name," ").concat((null==n?void 0:n.name)?"— ".concat(n.name):""):""},f=function(n){switch(n){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")}}},662:function(n,t,e){e.r(t),e.d(t,{sc_subscription_details:function(){return h},sc_subscription_status_badge:function(){return _}});var r=e(5861),i=e(5671),o=e(3144),a=e(1284),u=e.n(a),c=e(8860),s=e(930),l=e(2400),d=e(448);function p(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeStyle:"medium",dateStyle:"full"},e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=new Intl.DateTimeFormat(e,t);return r.format(new Date(1e3*n))}var v=function(n,t){return["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"].includes(t.toUpperCase())?n:n/100},f=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return new Intl.NumberFormat([],{style:"currency",currency:t.toUpperCase(),currencyDisplay:"symbol"}).format(v(n,t.toUpperCase()))},h=function(){function n(t){(0,i.Z)(this,n),(0,c.r)(this,t),this.subscription=void 0,this.pendingPrice=void 0,this.hideRenewalText=void 0,this.activationsModal=void 0,this.loading=void 0,this.hasPendingUpdate=void 0}var t,e;return(0,o.Z)(n,[{key:"renderName",value:function(){var n,t,e;return"string"!=typeof(null===(t=null===(n=this.subscription)||void 0===n?void 0:n.price)||void 0===t?void 0:t.product)?(0,l.p)(null===(e=this.subscription)||void 0===e?void 0:e.price):wp.i18n.__("Subscription","surecart")}},{key:"handleSubscriptionChange",value:(e=(0,r.Z)(u().mark((function n(){var t,e,r,i;return u().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.hasPendingUpdate=!!(null===(e=Object.keys((null===(t=null==this?void 0:this.subscription)||void 0===t?void 0:t.pending_update)||{}))||void 0===e?void 0:e.length),!(null===(i=null===(r=null==this?void 0:this.subscription)||void 0===r?void 0:r.pending_update)||void 0===i?void 0:i.price)||(null==this?void 0:this.pendingPrice)||this.hideRenewalText){n.next=5;break}return n.next=4,this.fetchPrice(this.subscription.pending_update.price);case 4:this.pendingPrice=n.sent;case 5:case"end":return n.stop()}}),n,this)}))),function(){return e.apply(this,arguments)})},{key:"componentWillLoad",value:function(){this.handleSubscriptionChange()}},{key:"fetchPrice",value:(t=(0,r.Z)(u().mark((function n(t){var e;return u().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,this.loading=!0,n.next=4,(0,s.a)({path:(0,d.a)("surecart/v1/prices/".concat(t),{expand:["product"]})});case 4:return e=n.sent,n.abrupt("return",e);case 8:n.prev=8,n.t0=n.catch(0),console.error(n.t0);case 11:return n.prev=11,this.loading=!1,n.finish(11);case 14:case"end":return n.stop()}}),n,this,[[0,8,11,14]])}))),function(n){return t.apply(this,arguments)})},{key:"renderRenewalText",value:function(){var n,t,e,r,i,o,a,u,s,d,v,h,_,w,m,y,b,g,O,x,j,_x,P,k,A=(0,c.h)("sc-subscription-status-badge",{subscription:null==this?void 0:this.subscription});return(null===(n=null==this?void 0:this.subscription)||void 0===n?void 0:n.cancel_at_period_end)&&(null===(t=null==this?void 0:this.subscription)||void 0===t?void 0:t.current_period_end_at)?(0,c.h)("span",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Renewal Update - Your plan will be canceled on %s","surecart"),p(this.subscription.current_period_end_at))},A," ",wp.i18n.sprintf(wp.i18n.__("Your plan will be canceled on","surecart"))," ",(0,c.h)("sc-format-date",{date:1e3*this.subscription.current_period_end_at,month:"long",day:"numeric",year:"numeric"})):this.hasPendingUpdate?this.pendingPrice||(null===(r=null===(e=this.subscription)||void 0===e?void 0:e.pending_update)||void 0===r?void 0:r.ad_hoc_amount)?(null===(o=null===(i=this.subscription)||void 0===i?void 0:i.pending_update)||void 0===o?void 0:o.ad_hoc_amount)?(0,c.h)("span",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Renewal Update - Your plan switches to %1s on %2s","surecart"),f(null===(u=null===(a=this.subscription)||void 0===a?void 0:a.pending_update)||void 0===u?void 0:u.ad_hoc_amount,(null===(s=this.pendingPrice)||void 0===s?void 0:s.currency)||(null===(v=null===(d=this.subscription)||void 0===d?void 0:d.price)||void 0===v?void 0:v.currency)),p(this.subscription.current_period_end_at))},wp.i18n.__("Your plan switches to","surecart")," ",(0,c.h)("strong",null,(0,c.h)("sc-format-number",{type:"currency",currency:(null===(h=this.pendingPrice)||void 0===h?void 0:h.currency)||(null===(w=null===(_=this.subscription)||void 0===_?void 0:_.price)||void 0===w?void 0:w.currency),value:null===(y=null===(m=this.subscription)||void 0===m?void 0:m.pending_update)||void 0===y?void 0:y.ad_hoc_amount})," ",(0,l.i)(this.pendingPrice||(null===(b=this.subscription)||void 0===b?void 0:b.price)))," ",wp.i18n.__("on","surecart")," ",(0,c.h)("sc-format-date",{date:this.subscription.current_period_end_at,type:"timestamp",month:"long",day:"numeric",year:"numeric"})):(0,c.h)("span",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Renewal Update - Your plan switches to %1s on %2s","surecart"),this.pendingPrice.product.name,p(this.subscription.current_period_end_at))},wp.i18n.__("Your plan switches to","surecart")," ",(0,c.h)("strong",null,this.pendingPrice.product.name)," ",wp.i18n.__("on","surecart")," ",(0,c.h)("sc-format-date",{date:this.subscription.current_period_end_at,type:"timestamp",month:"long",day:"numeric",year:"numeric"})):(0,c.h)("sc-skeleton",null):"trialing"===(null===(g=null==this?void 0:this.subscription)||void 0===g?void 0:g.status)&&(null===(O=null==this?void 0:this.subscription)||void 0===O?void 0:O.trial_end_at)?(0,c.h)("span",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Renewal Update - Your plan begins on %s.","surecart"),p(this.subscription.trial_end_at))},A," ",wp.i18n.sprintf(wp.i18n.__("Your plan begins on","surecart"))," ",(0,c.h)("sc-format-date",{date:null===(x=null==this?void 0:this.subscription)||void 0===x?void 0:x.trial_end_at,type:"timestamp",month:"long",day:"numeric",year:"numeric"})):"active"===(null===(j=this.subscription)||void 0===j?void 0:j.status)&&(null===(_x=this.subscription)||void 0===_x?void 0:_x.current_period_end_at)?(0,c.h)("span",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Renewal Update - Your next payment is on %s","surecart"),p(this.subscription.current_period_end_at))},A," ",null===(null===(P=this.subscription)||void 0===P?void 0:P.remaining_period_count)?wp.i18n.__("Your plan renews on","surecart"):wp.i18n.__("Your next payment is on","surecart")," ",(0,c.h)("sc-format-date",{date:null===(k=null==this?void 0:this.subscription)||void 0===k?void 0:k.current_period_end_at,type:"timestamp",month:"long",day:"numeric",year:"numeric"})):A}},{key:"getActivations",value:function(){var n,t,e,r;return((null===(r=null===(e=null===(t=null===(n=this.subscription)||void 0===n?void 0:n.purchase)||void 0===t?void 0:t.license)||void 0===e?void 0:e.activations)||void 0===r?void 0:r.data)||[]).filter((function(n){return null==n?void 0:n.counted}))}},{key:"renderActivations",value:function(){var n,t=this,e=this.getActivations();return(null==e?void 0:e.length)?(0,c.h)("sc-flex",{justifyContent:"flex-start",alignItems:"center"},(0,c.h)("sc-tag",{size:"small"},null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.name),(null==e?void 0:e.length)>1&&(0,c.h)("sc-text",{style:{"--font-size":"var(--sc-font-size-small)",cursor:"pointer"},onClick:function(n){n.preventDefault(),n.stopImmediatePropagation(),t.activationsModal=!0}},"+ ",(null==e?void 0:e.length)-1," More")):null}},{key:"showWarning",value:function(){var n,t,e,r,i,o,a;return!(null===(n=this.subscription)||void 0===n?void 0:n.payment_method)&&!this.subscription.manual_payment&&!!["active","past_due","unpaid","incomplete"].includes(null===(t=this.subscription)||void 0===t?void 0:t.status)&&((null===(r=null===(e=this.subscription)||void 0===e?void 0:e.price)||void 0===r?void 0:r.ad_hoc)?0!==(null===(i=this.subscription)||void 0===i?void 0:i.ad_hoc_amount):0!==(null===(a=null===(o=this.subscription)||void 0===o?void 0:o.price)||void 0===a?void 0:a.amount))}},{key:"render",value:function(){var n=this;return(0,c.h)("div",{class:"subscription-details"},this.hasPendingUpdate&&(0,c.h)("div",null,(0,c.h)("sc-tag",{size:"small",type:"warning"},wp.i18n.__("Update Scheduled","surecart"))),(0,c.h)("sc-flex",{alignItems:"center",justifyContent:"flex-start"},(0,c.h)("sc-text",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Plan name - %s","surecart"),this.renderName()),style:{"--font-weight":"var(--sc-font-weight-bold)"}},this.renderName()),this.renderActivations()),!this.hideRenewalText&&(0,c.h)("div",null,this.renderRenewalText()," "),(0,c.h)("slot",null),(0,c.h)("sc-dialog",{label:wp.i18n.__("Activations","surecart"),onScRequestClose:function(){return n.activationsModal=!1},open:!!this.activationsModal},(0,c.h)("sc-card",{"no-padding":!0,style:{"--overflow":"hidden"}},(0,c.h)("sc-stacked-list",null,(this.getActivations()||[]).map((function(n){return(0,c.h)("sc-stacked-list-row",{style:{"--columns":"2"},mobileSize:0},(0,c.h)("sc-text",{style:{"--line-height":"var(--sc-line-height-dense)"}},(0,c.h)("strong",null,null==n?void 0:n.name),(0,c.h)("div",null,(0,c.h)("sc-text",{style:{"--color":"var(--sc-color-gray-500)"}},null==n?void 0:n.fingerprint))),(0,c.h)("sc-text",{style:{"--color":"var(--sc-color-gray-500)"}},(0,c.h)("sc-format-date",{type:"timestamp",month:"short",day:"numeric",year:"numeric",date:null==n?void 0:n.created_at})))}))))),this.showWarning()&&(0,c.h)("div",null,(0,c.h)("sc-tag",{type:"warning"},(0,c.h)("div",{class:"subscription-details__missing-method"},(0,c.h)("sc-icon",{name:"alert-triangle"}),wp.i18n.__("Payment Method Missing","surecart")))))}}],[{key:"watchers",get:function(){return{subscription:["handleSubscriptionChange"]}}}]),n}();h.style=":host{display:block}.subscription-details{display:grid;gap:0.25em;color:var(--sc-input-label-color)}.subscription-details__missing-method{display:flex;align-items:center;gap:var(--sc-spacing-x-small)}";var _=function(){function n(t){(0,i.Z)(this,n),(0,c.r)(this,t),this.status=void 0,this.subscription=void 0,this.size="medium",this.pill=!1,this.clearable=!1}return(0,o.Z)(n,[{key:"getType",value:function(){var n,t,e;if(null===(n=this.subscription)||void 0===n?void 0:n.cancel_at_period_end)return"info";switch(this.status||(null===(t=this.subscription)||void 0===t?void 0:t.status)){case"incomplete":case"past_due":case"unpaid":return"warning";case"trialing":return"info";case"active":case"completed":return"success";case"canceled":return(null===(e=this.subscription)||void 0===e?void 0:e.restore_at)?"info":"danger"}}},{key:"getText",value:function(){var n,t,e,r,i;if((null===(n=this.subscription)||void 0===n?void 0:n.cancel_at_period_end)&&this.subscription.current_period_end_at&&"canceled"!==(null===(t=this.subscription)||void 0===t?void 0:t.status))return(0,c.h)(c.F,null,(null===(e=this.subscription)||void 0===e?void 0:e.restore_at)?wp.i18n.__("Pauses","surecart"):wp.i18n.__("Cancels","surecart")," ",(0,c.h)("sc-format-date",{type:"timestamp",date:this.subscription.current_period_end_at,month:"short",day:"numeric"}));switch(this.status||(null===(r=this.subscription)||void 0===r?void 0:r.status)){case"incomplete":return wp.i18n.__("Incomplete","surecart");case"trialing":return wp.i18n.__("Trialing","surecart");case"active":return wp.i18n.__("Active","surecart");case"past_due":return wp.i18n.__("Past Due","surecart");case"canceled":return(null===(i=this.subscription)||void 0===i?void 0:i.restore_at)?"Paused":wp.i18n.__("Canceled","surecart");case"completed":return wp.i18n.__("Completed","surecart");case"unpaid":return wp.i18n.__("Unpaid","surecart")}}},{key:"render",value:function(){return(0,c.h)("sc-tag",{"aria-label":wp.i18n.sprintf(wp.i18n.__("Plan Status - %s","surecart"),this.getText()),type:this.getType()},this.getText())}}]),n}();_.style=":host{display:inline-block}"},4942:function(n,t,e){function r(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}e.d(t,{Z:function(){return r}})},5987:function(n,t,e){e.d(t,{Z:function(){return i}});var r=e(3366);function i(n,t){if(null==n)return{};var e,i,o=(0,r.Z)(n,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(i=0;i<a.length;i++)e=a[i],t.indexOf(e)>=0||Object.prototype.propertyIsEnumerable.call(n,e)&&(o[e]=n[e])}return o}},3366:function(n,t,e){function r(n,t){if(null==n)return{};var e,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)e=o[r],t.indexOf(e)>=0||(i[e]=n[e]);return i}e.d(t,{Z:function(){return r}})}}]);