index of
/
home
/
thefkyzp
/
hulmvisaadvisor.com
/
wp-content
/
plugins
/
surecart
/
dist
/
File: /home/thefkyzp/hulmvisaadvisor.com/wp-content/plugins/surecart/dist/5421.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[5421],{2846:function(n,t,e){e.d(t,{i:function(){return i},m:function(){return r},z:function(){return o}});var o=["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"],r=function(n,t){return i(t)?n:n/100},i=function(n){var t;return o.includes(null===(t=null==n?void 0:n.toLowerCase)||void 0===t?void 0:t.call(n))}},6715:function(n,t,e){function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",t=document.createElement("div");t.id="a11y-speak-".concat(n),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",n),t.setAttribute("aria-relevant","additions text"),t.setAttribute("aria-atomic","true");var e=document,o=e.body;return o&&o.appendChild(t),t}e.d(t,{s:function(){return a}});var r,i="";function a(n,t){!function(){for(var n=document.getElementsByClassName("a11y-speak-region"),t=document.getElementById("a11y-speak-intro-text"),e=0;e<n.length;e++)n[e].textContent="";t&&t.setAttribute("hidden","hidden")}(),n=function(n){return n=n.replace(/<[^<>]+>/g," "),i===n&&(n+=" "),i=n,n}(n);var e=document.getElementById("a11y-speak-intro-text"),o=document.getElementById("a11y-speak-assertive"),r=document.getElementById("a11y-speak-polite");o&&"assertive"===t?o.textContent=n:r&&(r.textContent=n),e&&e.removeAttribute("hidden")}r=function(){var n=document.getElementById("a11y-speak-intro-text"),t=document.getElementById("a11y-speak-assertive"),e=document.getElementById("a11y-speak-polite");null===n&&function(){var n=document.createElement("p");n.id="a11y-speak-intro-text",n.className="a11y-speak-intro-text",n.textContent=wp.i18n.__("Notifications"),n.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;"),n.setAttribute("hidden","hidden");var t=document.body;t&&t.appendChild(n)}(),null===t&&o("assertive"),null===e&&o("polite")},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",r):r())},2134:function(n,t,e){function o(){return"rtl"===document.dir}e.d(t,{i:function(){return o}})},2400:function(n,t,e){e.d(t,{a:function(){return r},b:function(){return d},c:function(){return h},d:function(){return a},g:function(){return i},i:function(){return c},p:function(){return v},t:function(){return u}});var o=e(2846),r=function(n){return(null==n?void 0:n.amount_off)&&(null==n?void 0:n.currency)?i({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):""},i=function(n){var t=n.amount,e=n.currency,r=function(n,t){return o.z.includes(t)?n:n/100}(t,e);return"".concat(new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format(parseFloat(r.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"),o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wp.i18n.__("once","surecart"),r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];switch(t){case"day":return"".concat(e," ").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(e," ").concat(wp.i18n.sprintf(r?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(r?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(r?wp.i18n._n("%d year","%d years",n,"surecart"):wp.i18n._n("year","%d years",n,"surecart"),n));default:return o}},s=function(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wp.i18n.__("once","surecart"),o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];switch(t){case"day":return" / ".concat(wp.i18n.sprintf(o?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(o?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(o?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(o?wp.i18n._n("%d yr","%d yrs",n,"surecart"):wp.i18n._n("yr","%d yrs",n,"surecart"),n));default:return e}},c=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n)return"";var e=t.showOnce,o=t.labels,r=t.abbreviate,i=o||{},a=i.interval,u=void 0===a?wp.i18n.__("every","surecart"):a;return"".concat(l(n,u,e?wp.i18n.__("once","surecart"):"",r)," ").concat(p(n,r))},l=function(n,t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wp.i18n.__("once","surecart"),o=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)?o?s(n.recurring_interval_count,n.recurring_interval,e):u(n.recurring_interval_count,n.recurring_interval," ".concat(t),e):""},p=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),")"):""},d=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):""):""},h=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")}}},5421:function(n,t,e){e.r(t),e.d(t,{sc_coupon_form:function(){return c}});var o=e(5671),r=e(3144),i=e(8860),a=e(6715),u=e(2134),s=e(2400),c=function(){function n(t){(0,o.Z)(this,n),(0,i.r)(this,t),this.scApplyCoupon=(0,i.c)(this,"scApplyCoupon",7),this.label=void 0,this.loading=void 0,this.busy=void 0,this.placeholder=void 0,this.error=void 0,this.forceOpen=void 0,this.discount=void 0,this.currency=void 0,this.discountAmount=void 0,this.showInterval=void 0,this.open=void 0,this.collapsed=void 0,this.value=void 0,this.buttonText=void 0}return(0,r.Z)(n,[{key:"handleOpenChange",value:function(n){var t=this;n&&setTimeout((function(){return t.input.triggerFocus()}),50)}},{key:"handleDiscountChange",value:function(n,t){var e,o,r=this;(null===(e=null==n?void 0:n.promotion)||void 0===e?void 0:e.code)!==(null===(o=null==t?void 0:t.promotion)||void 0===o?void 0:o.code)&&setTimeout((function(){var n,t;(null===(t=null===(n=null==r?void 0:r.discount)||void 0===n?void 0:n.promotion)||void 0===t?void 0:t.code)?r.couponTag.shadowRoot.querySelector("*").focus():r.addCouponTrigger.focus()}),50)}},{key:"handleBlur",value:function(){this.value||(this.open=!1,this.error="")}},{key:"getHumanReadableDiscount",value:function(){var n,t,e;return(null===(n=null==this?void 0:this.discount)||void 0===n?void 0:n.coupon)&&(null===(t=null==this?void 0:this.discount)||void 0===t?void 0:t.coupon.percent_off)?(0,s.a)(null===(e=null==this?void 0:this.discount)||void 0===e?void 0:e.coupon):""}},{key:"applyCoupon",value:function(){this.scApplyCoupon.emit(this.input.value.toUpperCase())}},{key:"handleKeyDown",value:function(n){"Enter"===(null==n?void 0:n.code)?this.applyCoupon():"Escape"===(null==n?void 0:n.code)&&(this.scApplyCoupon.emit(null),this.open=!1,(0,a.s)(wp.i18n.__("Coupon code field closed.","surecart"),"assertive"))}},{key:"translateHumanDiscountWithDuration",value:function(n){var t;if(!this.showInterval)return n;var e=null===(t=this.discount)||void 0===t?void 0:t.coupon,o=e.duration,r=e.duration_in_months;switch(o){case"once":return"".concat(n," ").concat(wp.i18n.__("once","surecart"));case"repeating":var i=wp.i18n.sprintf(wp.i18n._n("%d month","%d months",r,"surecart"),r);// translators: %s is the discount amount, %s is the duration (e.g. 3 months) return wp.i18n.sprintf(wp.i18n.__("%s for %s","surecart"),n,i);default:return n}}},{key:"render",value:function(){var n,t,e,o,r,c,l,p,d,v=this;if(this.loading)return(0,i.h)("sc-skeleton",{style:{width:"120px",display:"inline-block"}});if(null===(t=null===(n=null==this?void 0:this.discount)||void 0===n?void 0:n.promotion)||void 0===t?void 0:t.code){var h=this.getHumanReadableDiscount();return(0,i.h)("sc-line-item",{exportparts:"description:info, price-description:discount, price:amount"},(0,i.h)("span",{slot:"description"},(0,i.h)("div",{part:"discount-label"},wp.i18n.__("Discount","surecart")),(0,i.h)("sc-tag",{exportparts:"base:coupon-tag",type:"redeemable"===(null===(e=this.discount)||void 0===e?void 0:e.redeemable_status)?"success":"warning",class:"coupon-tag",clearable:!0,onScClear:function(){v.scApplyCoupon.emit(null),v.open=!1},onKeyDown:function(n){"Enter"!==n.key&&"Escape"!==n.key||((0,a.s)(wp.i18n.__("Coupon was removed.","surecart"),"assertive"),v.scApplyCoupon.emit(null),v.open=!1)},ref:function(n){return v.couponTag=n},role:"button","aria-label":wp.i18n.sprintf(wp.i18n.__("Press enter to remove coupon code %s.","surecart"),(null===(r=null===(o=null==this?void 0:this.discount)||void 0===o?void 0:o.promotion)||void 0===r?void 0:r.code)||this.input.value||"")},null===(l=null===(c=null==this?void 0:this.discount)||void 0===c?void 0:c.promotion)||void 0===l?void 0:l.code)),"redeemable"===(null===(p=this.discount)||void 0===p?void 0:p.redeemable_status)?(0,i.h)(i.F,null,h&&(0,i.h)("span",{class:"coupon-human-discount",slot:"price-description"},this.translateHumanDiscountWithDuration(h)),(0,i.h)("span",{slot:"price"},(0,i.h)("sc-format-number",{type:"currency",currency:null==this?void 0:this.currency,value:null==this?void 0:this.discountAmount}))):(0,i.h)("div",{class:"coupon__status",slot:"price-description"},(0,i.h)("sc-icon",{name:"alert-triangle"}),(0,s.c)(null===(d=this.discount)||void 0===d?void 0:d.redeemable_status)))}return this.collapsed?(0,i.h)("div",{part:"base",class:{"coupon-form":!0,"coupon-form--is-open":this.open||this.forceOpen,"coupon-form--has-value":!!this.value,"coupon-form--is-rtl":(0,u.i)()}},(0,i.h)("div",{part:"label",class:"trigger",onMouseDown:function(){v.open||(v.open=!0)},onKeyDown:function(n){if("Enter"!==n.key&&" "!==n.key)return!0;v.open||(v.open=!0,(0,a.s)(wp.i18n.__("Coupon code field opened. Press Escape button to close it.","surecart"),"assertive"))},tabindex:"0",ref:function(n){return v.addCouponTrigger=n},role:"button"},(0,i.h)("slot",{name:"label"},this.label)),(0,i.h)("div",{class:"form",part:"form"},(0,i.h)("sc-input",{exportparts:"base:input__base, input, form-control:input__form-control",value:this.value,onScInput:function(n){return v.value=n.target.value},placeholder:this.placeholder,onScBlur:function(){return v.handleBlur()},onKeyDown:function(n){return v.handleKeyDown(n)},ref:function(n){return v.input=n},"aria-label":wp.i18n.__("Add coupon code.","surecart")},(0,i.h)("sc-button",{exportparts:"base:button__base, label:button_label",slot:"suffix",type:"text",loading:this.busy,size:"medium",class:"coupon-button",onClick:function(){return v.applyCoupon()}},(0,i.h)("slot",null,this.buttonText))),(0,i.h)("sc-button",{exportparts:"base:button__base, label:button_label",type:"primary",outline:!0,loading:this.busy,size:"medium",class:"coupon-button-mobile",onClick:function(){return v.applyCoupon()}},(0,i.h)("slot",null,this.buttonText)),!!this.error&&(0,i.h)("sc-alert",{exportparts:"base:error__base, icon:error__icon, text:error__text, title:error_title, message:error__message",type:"danger",open:!0},(0,i.h)("span",{slot:"title"},this.error))),this.loading&&(0,i.h)("sc-block-ui",{exportparts:"base:block-ui, content:block-ui__content"})):(0,i.h)("div",{class:{"coupon-form":!0,"coupon-form--has-value":!!this.value,"coupon-form--is-rtl":(0,u.i)()}},(0,i.h)("sc-input",{label:this.label,exportparts:"base:input__base, input, form-control:input__form-control",value:this.value,onScInput:function(n){return v.value=n.target.value},placeholder:this.placeholder,onScBlur:function(){return v.handleBlur()},onKeyDown:function(n){return v.handleKeyDown(n)},ref:function(n){return v.input=n}},(0,i.h)("sc-button",{exportparts:"base:button__base, label:button_label",slot:"suffix",type:"text",loading:this.busy,size:"medium",class:"coupon-button",onClick:function(){return v.applyCoupon()}},(0,i.h)("slot",null,this.buttonText))),(0,i.h)("sc-button",{exportparts:"base:button__base, label:button_label",type:"primary",outline:!0,loading:this.busy,size:"medium",class:"coupon-button-mobile",onClick:function(){return v.applyCoupon()}},(0,i.h)("slot",null,this.buttonText)),!!this.error&&(0,i.h)("sc-alert",{exportparts:"base:error__base, icon:error__icon, text:error__text, title:error_title, message:error__message",type:"danger",open:!0},(0,i.h)("span",{slot:"title"},this.error)))}}],[{key:"watchers",get:function(){return{open:["handleOpenChange"],discount:["handleDiscountChange"]}}}]),n}();c.style=":host {\n display: block;\n}\n\nsc-button {\n color: var(--sc-color-primary-500);\n}\n\n.coupon-form {\n position: relative;\n container-type: inline-size;\n}\n.coupon-form .coupon-button {\n opacity: 0;\n visibility: hidden;\n transform: scale(0.9);\n transition: all var(--sc-transition-fast) ease;\n color: var(--sc-input-color);\n}\n.coupon-form .coupon-button-mobile {\n margin-top: var(--sc-input-label-margin);\n display: none;\n}\n.coupon-form--has-value .coupon-button {\n opacity: 1;\n visibility: visible;\n transform: scale(1);\n}\n\n@container (max-width: 320px) {\n .coupon-form .coupon-button {\n display: none;\n }\n .coupon-form .coupon-button-mobile {\n display: block;\n }\n}\n.form {\n opacity: 0;\n visibility: hidden;\n height: 0;\n transform: translateY(5px);\n transition: opacity var(--sc-transition-medium) ease, transform var(--sc-transition-medium) ease;\n position: relative;\n gap: var(--sc-spacing-small);\n}\n\n.coupon-form--is-open .form {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n height: auto;\n margin: var(--sc-spacing-small) 0;\n}\n.coupon-form--is-open .trigger {\n display: none;\n}\n\n.trigger {\n cursor: pointer;\n font-size: var(--sc-font-size-small);\n line-height: var(--sc-line-height-dense);\n color: var(--sc-input-label-color);\n user-select: none;\n}\n.trigger:hover {\n text-decoration: underline;\n}\n\n.coupon-form--is-rtl .trigger {\n text-align: right;\n}\n\n.coupon__status {\n font-size: var(--sc-font-size-small);\n line-height: var(--sc-line-height-dense);\n color: var(--sc-color-warning-700);\n display: inline-flex;\n gap: var(--sc-spacing-x-small);\n align-items: flex-start;\n text-align: left;\n}\n.coupon__status sc-icon {\n flex: 0 0 1em;\n margin-top: 0.25em;\n}"}}]);