(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t){var e=function(t,e){if("object"!==i(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!==i(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===i(e)?e:String(e)}function r(t,e){for(var n=0;n",{class:"toggle","data-text-on":e||h.toggle_on,"data-text-off":n||h.toggle_off});t.after(i).addClass("enhanced")}}(c()(this))}))},w=function(t){var e;null!==(e=t)&&void 0!==e&&e.length||(t=g);var n=c()(".yith-wcaf-accordion",t).not(".enhanced");n.length&&n.each((function(){!function(t){var e=c()(".accordion-radio",t);e.length&&(e.on("change",(function(){var n=e.filter(":checked").closest(".accordion-option").find(".accordion-content");c()(".accordion-content",t).not(n).slideUp(),n.slideDown()})).trigger("change"),t.addClass("enhanced"))}(c()(this))}))},k=function(t){var e;null!==(e=t)&&void 0!==e&&e.length||(t=g);var n=c()(".yith-wcaf-attach-file",t).not(".enhanced");n.length&&n.each((function(){var t,e,n=c()(this);(e=(t=n).parent().find('input[type="file"]')).length&&(t.on("click",(function(t){t.preventDefault(),e.trigger("click")})).addClass("enhanced"),e.on("change",(function(e){var n=e.target.files,i=[],o=t.next("small.files-list");for(var r in n)n.hasOwnProperty(r)&&i.push(n[r].name);if(i.length){if(o.length||(o=c()("",{class:"files-list"}),t.after(o)),o.text(i.join(", ")),t.hasClass("auto-submit")){var a=t.closest("form");if(!a.length)return;a.submit()}}else o.length&&o.remove()})))}))},$=function(t){var e;void 0!==c().fn.datepicker&&(null!==(e=t)&&void 0!==e&&e.length||(t=g),c()(".yith-wcaf-enhanced-date-picker",t).add(".date-picker-field",t).add(".date-picker",t).not(".enhanced").each((function(){!function(t){if(void 0!==c().fn.datepicker){var e=t.data("format"),n=t.data("number-of-months"),i=t.data("max-date"),o=t.data("min-date"),r=t.data("altfield"),a=t.data("altformat"),l={dateFormat:e||"yy-mm-dd",numberOfMonths:n||1,maxDate:i||null,minDate:o||null,altField:r?t.next(r).get(0):null,altFormat:a||"",beforeShow:function(t,e){var n;null==e||null===(n=e.dpDiv)||void 0===n||null===(n=n.addClass("yith-wcaf-datepicker"))||void 0===n||n.addClass("yith-plugin-fw-datepicker-div")},onClose:function(t,e){var n;null==e||null===(n=e.dpDiv)||void 0===n||null===(n=n.removeClass("yith-wcaf-datepicker"))||void 0===n||n.removeClass("yith-plugin-fw-datepicker-div")}};try{t.datepicker(l).addClass("enhanced")}catch(t){}}}(c()(this))})))},_=function(){function t(e){var i;n(this,t),l(this,"$container",void 0),l(this,"ERROR_CLASS","woocommerce-invalid"),this.$container=e,null!==(i=this.$container)&&void 0!==i&&i.length&&this.initValidation()}return a(t,[{key:"initValidation",value:function(){this.initForm(),this.initFields()}},{key:"initForm",value:function(){var t=this.$container.is("form")?this.$container:this.$container.find("form");if(t.length){var e=this;t.on("submit yith_wcaf_validate_fields",(function(t){var n=c()(this);return!!e.validateForm(n)||(t.stopImmediatePropagation(),!1)}))}}},{key:"initFields",value:function(){var t=this.getFields(this.$container);if(t.length){var e=this;t.on("keyup change",(function(){var t=c()(this);e.validateField(t)}))}}},{key:"getFieldWrapper",value:function(t){return t.closest(".form-row, .yith-plugin-fw-panel-wc-row")}},{key:"getFields",value:function(t){return c()("input, select, textarea",t).not('input[type="submit"]').not('input[type="hidden"]').not(".select2-search__field")}},{key:"getVisibleFields",value:function(t){var e=this;return this.getFields(t).filter((function(t,n){var i=c()(n);return e.getFieldWrapper(i).is(":visible")}))}},{key:"isFieldValid",value:function(t){var e=this.getFieldWrapper(t),n=t.attr("type"),i=t.val();if(t.prop("required")||e.hasClass("required")||e.hasClass("validate-required")||e.hasClass("yith-plugin-fw--required")||["reg_username","reg_email","reg_password"].includes(t.get(0).id)){if("checkbox"===n&&!t.is(":checked"))throw"missing";if(!i)throw"missing"}var o=e.data("pattern");if(o&&!new RegExp(o).test(i))throw"malformed";var r=e.data("min_length");if(r&&i.lengtha)throw"long";if("number"===n){var l=parseFloat(t.attr("min")),s=parseFloat(t.attr("max")),c=parseFloat(i);if(l&&l>c||s&&s",{class:"error-msg",text:i});n.append(o)}}},{key:"removeError",value:function(t){var e=this.getFieldWrapper(t),n=e.find(".error-msg");e.removeClass(this.ERROR_CLASS),n.remove()}},{key:"scrollToFirstError",value:function(t){var e=t.find(".".concat(this.ERROR_CLASS)).first();if(e.length){var n=this.findScrollableParent(t);n&&n.length||(n=c()("html, body"));var i=e.offset().top-n.offset().top,o=i;n.is("html, body")||(o=n.get(0).scrollTop+i),n.animate({scrollTop:o})}}},{key:"findScrollableParent",value:function(t){var e,n,i=t.get(0);if(!i)return null;do{if(document===i)return null;n="visible"!==(e=window.getComputedStyle(i).overflowY)&&"hidden"!==e}while(!(n&&i.scrollHeight>i.clientHeight)&&(i=i.parentNode));return c()(i)}}]),t}();var C=function(){function t(e){var i,o;n(this,t),l(this,"$container",void 0),l(this,"$fields",void 0),l(this,"dependencies",{}),this.$container=e,null!==(i=this.$container)&&void 0!==i&&i.length&&(this.initFields(),null!==(o=this.$fields)&&void 0!==o&&o.length&&this.initDependencies())}return a(t,[{key:"initFields",value:function(){this.$fields=this.$container.find(":input")}},{key:"initDependencies",value:function(){this.buildDependenciesTree(),Object.keys(this.dependencies).length&&this.handleDependencies()}},{key:"buildDependenciesTree",value:function(){var t=this;this.$fields.closest("[data-dependencies]").each((function(){var e=c()(this),n=e.attr("id");if(n){var i=l({},n,e.data("dependencies"));t.dependencies=c().extend(t.dependencies,i)}})),this.$container.find("[data-dep-target]").each((function(){var e=c()(this),n=e.data("dep-id"),i=e.data("dep-target"),o=e.data("dep-value");if(n&&i&&o){var r=l({},i,l({},n,o.toString().split(",")));t.dependencies=c().extend(t.dependencies,r)}}))}},{key:"handleDependencies",value:function(){this.$fields.on("change",this.applyDependencies.bind(this)),this.applyDependencies()}},{key:"applyDependencies",value:function(){var t=this;c().each(this.dependencies,(function(e,n){var i=t.findFieldContainer(e);i.length&&(t.checkConditions(n)?null==i||i.fadeIn():null==i||i.hide())}))}},{key:"findField",value:function(t){var e=this.$container.find("#".concat(t));return e.length||(e=this.$container.find("#".concat(t,"_field"))),!!e.length&&(e.is(":input")||(e=e.find(":input")),e)}},{key:"findFieldContainer",value:function(t){var e=this.findField(t);if(null==e||!e.length)return!1;var n=e.closest("#".concat(t,"_container"));return n.length||(n=e.closest(".form-row")),n.length||(n=e.closest(".yith-plugin-fw__panel__option")),!!n.length&&n}},{key:"checkConditions",value:function(t){var e=this,n=!0;return c().each(t,(function(t,i){var o,r=e.findField(t);if(n&&null!=r&&r.length){var a,l;if(r.first().is('input[type="radio"]'))o=null===(a=r.filter(":checked"))||void 0===a||null===(a=a.val())||void 0===a?void 0:a.toString();else o=null==r||null===(l=r.val())||void 0===l?void 0:l.toString();n=Array.isArray(i)?i.includes(o):"function"==typeof i?i(o):0===i.indexOf(":")?r.is(i):0===i.indexOf("!:")?!r.is(i.toString().substring(1)):0===i.indexOf("!")?i.toString().substring(1)!==o:i.toString()===o,void 0!==e.dependencies[t]&&(n=n&&e.checkConditions(e.dependencies[t]))}})),n}}]),t}();var O=function(t){var e,n;null!==(e=t)&&void 0!==e&&e.length||(t=g),b(t),$(t),w(t),m(t),k(t),(n=c()('input[type="password"]',t)).length&&n.each((function(){var t=c()(this);if(!t.hasClass("enhanced")){var e=c()("
",{class:"password-wrapper"}),n=c()("",{class:"toggle-button click-to-show",role:"button",href:"",html:'\n\n \n \n \n \n \n \n \n \n \n \n \n \n',title:(null==h?void 0:h.show_password_text)||"Show/Hide password"});t.wrap(e),t.after(n),n.on("click",(function(e){var i="password"===t.attr("type"),o=i?"text":"password",r=i?"click-to-hide":"click-to-show";e.preventDefault(),t.attr("type",o),n.removeClass("click-to-show click-to-hide").addClass(r)})),t.addClass("enhanced")}})),function(){var e=c()("#invoice_type_field",t);if(e.length&&!e.hasClass("enhanced")){var n=1;e.addClass("enhanced").find("label").each((function(){var t=c()(this),e=t.prev(),i="col".concat(n);t.add(e).wrapAll('
')),n++}))}}(),function(){var e=c()("form",t);if(!e.length)return!1;!function(t){var e;null!==(e=t)&&void 0!==e&&e.length||(t=g),new _(t)}(e),function(t){var e;null!==(e=t)&&void 0!==e&&e.length||(t=g),new C(t)}(e)}(),g.trigger("yith_wcaf_init_fields")};function x(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function S(t){for(var e=1;e",{val:t.text(),type:"text"});y.append(n),this.selectContent(n),document.execCommand("copy"),n.remove()}},{key:"selectContent",value:function(t){this.isIos()?t.get(0).setSelectionRange(0,9999):t.select()}},{key:"outputNotification",value:function(){if(!g.triggerHandler("yith_wcaf_hide_link_copied_alert")&&null!=h&&h.link_copied_message){var t=c()("",{class:"copy-confirmation",text:h.link_copied_message});t.prependTo(this.$initiator).fadeIn(300,(function(){setTimeout((function(){t.fadeOut(300,(function(){t.remove()}))}),1e3)}))}}},{key:"isIos",value:function(){return navigator.userAgent.match(/ipad|iphone/i)}}]),t}(),E=function(){function t(e){n(this,t),l(this,"$container",void 0),l(this,"$source",void 0),l(this,"$username",void 0),l(this,"$destination",void 0),l(this,"token",void 0),l(this,"token_var",void 0),l(this,"affiliate",void 0),l(this,"timeout",void 0),l(this,"timeoutInterval",500),null!=e&&e.length&&(this.$container=e,this.token=this.$container.data("token"),this.token_var=this.$container.data("token-var"),this.affiliate=this.$container.data("affiliate"),this.init())}var e;return a(t,[{key:"init",value:function(){this.$source=c()(".origin-url",this.$container),this.$destination=c()(".generated-url",this.$container),this.$username=c()(".username",this.$container),this.$source.length&&this.$destination.length&&(this.initActions(),this.initCopyButton())}},{key:"initActions",value:function(){this.$source.on("change keyup",this.onChange.bind(this)).trigger("change")}},{key:"initCopyButton",value:function(){this.$container.find(".copy-trigger").each((function(){var t=c()(this),e=t.parent().find(".copy-target");e.length&&new M(t,e)}))}},{key:"onChange",value:function(){this.timeout&&clearTimeout(this.timeout),this.$source.val()&&(this.timeout=setTimeout(this.updateUrl.bind(this),this.timeoutInterval))}},{key:"updateUrl",value:(e=P(R().mark((function t(){var e,n,i,o;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.$source.val(),!this.token_var||!this.token){t.next=5;break}n=this.calculateUrl(e,this.token_var,this.token),t.next=9;break;case 5:return i=this.$username.val(),o=this.affiliate,t.next=8,this.requestUrl(e,i,o);case 8:n=t.sent;case 9:this.$destination.val(n);case 10:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})},{key:"calculateUrl",value:function(t,e,n){var i;try{if((i=new URL(t)).origin!==window.location.origin)return"";i.searchParams.set(e,n)}catch(t){return""}return i.toString()}},{key:"requestUrl",value:function(t,e,n){var i=this;return new Promise((function(o){j.get.call(i.$container,"get_referral_url","get_referral_url",{base:t,user:e,affiliate_id:n}).done((function(t){var e,n;null!=t&&t.success?e=null==t||null===(n=t.data)||void 0===n?void 0:n.url:e="";o(e)})).fail((function(){return o("")}))}))}}]),t}(),L=function(){function t(e){n(this,t),l(this,"$container",void 0),l(this,"$opener",void 0),l(this,"$form",void 0),l(this,"$token",void 0),null!=e&&e.length&&(this.$container=e,this.$opener=this.$container.find(".show-referrer-form"),this.$form=this.$container.find("form.referrer-form"),this.$token=this.$form.find('input[name="referrer_code"]'),this.init())}return a(t,[{key:"init",value:function(){this.$opener.on("click",this.onToggle.bind(this)),this.$form.on("submit",this.onSubmit.bind(this))}},{key:"onToggle",value:function(t){t.preventDefault(),this.toggleForm()}},{key:"onSubmit",value:function(t){var e=this;t.preventDefault();var n=this.$token.val();if(!n)return!1;this.$form.addClass("processing"),this.setReferrer(n).done((function(t){e.$form.removeClass("processing"),e.afterSubmit(t)}))}},{key:"afterSubmit",value:function(t){var e,n;(this.$container.find(".woocommerce-error, .woocommerce-message").remove(),null!=t&&null!==(e=t.data)&&void 0!==e&&e.template)&&this.$form.before(null==t||null===(n=t.data)||void 0===n?void 0:n.template);null!=t&&t.success&&(this.$form.slideUp(),this.$token.prop("disabled",!0),g.trigger("yith_wcaf_referrer_set"))}},{key:"toggleForm",value:function(){this.$form.slideToggle()}},{key:"setReferrer",value:function(t){return j.post.call(this.$container,"set_referrer","set_referrer",{referrer:t})}}]),t}(),A=function(){function t(e){n(this,t),l(this,"$opener",void 0),l(this,"$tooltip",void 0),e.length&&(this.$opener=e.first(),this.init())}return a(t,[{key:"init",value:function(){this.$opener.on("mouseenter",this.onMouseEnter.bind(this)).on("mouseleave",this.onMouseLeave.bind(this))}},{key:"hasTooltip",value:function(){return this.$opener.find(".tooltip").length}},{key:"onMouseEnter",value:function(){this.hasTooltip()||this.attachTooltip(),this.showTooltip()}},{key:"onMouseLeave",value:function(){this.hideTooltip()}},{key:"attachTooltip",value:function(){if(!this.hasTooltip()){var t=this.maybeBuildTooltip();this.$opener.append(t)}}},{key:"detachTooltip",value:function(){var t;null!==(t=this.$tooltip)&&void 0!==t&&t.length&&this.$tooltip.detach()}},{key:"showTooltip",value:function(){var t;if(null!==(t=this.$tooltip)&&void 0!==t&&t.length)return this.$tooltip.show().animate({opacity:1})}},{key:"hideTooltip",value:function(){var t,e=this;if(null!==(t=this.$tooltip)&&void 0!==t&&t.length)return this.$tooltip.animate({opacity:0},{complete:function(){e.$tooltip.hide(),e.detachTooltip()}})}},{key:"maybeBuildTooltip",value:function(){var t;if(null===(t=this.$tooltip)||void 0===t||!t.length){var e=this.$opener.data("tip");this.$tooltip=c()("",{html:e,class:"tooltip"})}return this.$tooltip}}]),t}();function I(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function B(t){return B=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},B(t)}function U(){return U="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=B(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},U.apply(this,arguments)}function W(t,e){return W=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},W(t,e)}function q(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,o=B(t);if(e){var r=B(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return function(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return I(t)}(this,n)}}var V=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&W(t,e)}(o,t);var e,i=q(o);function o(t,e){var r;return n(this,o),e=c().extend({beforeSubmit:!1,afterSubmit:!1},e||{}),l(I(r=i.call(this,t,e)),"$form",null),r}return a(o,[{key:"maybeOpenModal",value:function(t){U(B(o.prototype),"maybeOpenModal",this).call(this,t),this.$modal.promise().done(this.maybeInitForm.bind(this))}},{key:"maybeInitForm",value:function(){var t;if(null===(t=this.$form)||void 0===t||!t.length){var e=this.$modal.find("form");e.length&&(O(e),e.on("submit",this.maybeSubmitForm.bind(this)),this.$form=e)}}},{key:"maybeSubmitForm",value:(e=P(R().mark((function t(e){var n,i,o,r=this;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.preventDefault(),"function"==typeof(null===(n=this.args)||void 0===n?void 0:n.beforeSubmit)&&this.args.beforeSubmit.call(this),t.prev=2,t.next=5,this.ajaxSubmit();case 5:o=t.sent,"function"==typeof(null===(i=this.args)||void 0===i?void 0:i.afterSubmit)&&this.args.afterSubmit.call(this,o),t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(2),this.reportError(t.t0),t.abrupt("return");case 13:setTimeout((function(){r.maybeCloseModal(),window.location.reload()}),3e3);case 14:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})},{key:"reportError",value:function(t){var e=this.$form.find(".errors");e.length?e.text(t):this.$form.prepend(c()("

",{class:"errors form-row woocommerce-invalid",text:t})),this.$form.closest(".content").animate({scrollTop:0})}},{key:"hideErrors",value:function(){this.$form.find(".errors").remove()}},{key:"ajaxSubmit",value:function(){var t=this,e=this.$form.data("action"),n=this.$form.data("security");return new Promise((function(i,o){e&&n||o(""),t.hideErrors(),j.post.call(t.$modal,e,n,new FormData(t.$form.get(0)),{processData:!1,contentType:!1}).done((function(t){var e;null!=t&&t.success?i(null==t?void 0:t.data):o(null==t||null===(e=t.data)||void 0===e?void 0:e.message)})).fail((function(){return o("")}))}))}}]),o}(function(){function t(e,i){n(this,t),l(this,"$opener",null),l(this,"$target",null),l(this,"$modal",null),l(this,"$content",null),null!=e&&e.length&&(this.$opener=e,this.args=c().extend({title:!1,shouldOpen:!1,template:!1,onOpen:!1,onClose:!1},i||{}),this.init())}return a(t,[{key:"init",value:function(){var t=this;this.$opener.on("click",(function(e){t.$target=c()(e.target),t.shouldOpen()&&(e.preventDefault(),t.onOpen())}))}},{key:"shouldOpen",value:function(){var t;return"function"!=typeof(null===(t=this.args)||void 0===t?void 0:t.shouldOpen)||this.args.shouldOpen.call(this)}},{key:"onOpen",value:function(){var t,e,n=(null===(t=this.args)||void 0===t?void 0:t.template)||"",i=null;if("function"==typeof n&&(n=n.call(this)),null===(e=this.$content)||void 0===e||!e.length){var o;if(!n)return;"string"==typeof n?i=c()(n).detach():"function"==typeof n?i=n().detach():null!==(o=n)&&void 0!==o&&o.lenght&&(i=n.detach()),this.$content=i}this.maybeOpenModal(this.$content)}},{key:"onClose",value:function(){this.maybeCloseModal()}},{key:"maybeBuildModal",value:function(){var t,e,n=this;if(null!==(t=this.$modal)&&void 0!==t&&t.length)return this.$modal;var i=c()("

",{class:"yith-wcaf-modal"}),o=c()("
",{class:"content pretty-scrollbar"}),r=c()("",{class:"close-button main-close-button",html:"×",role:"button",href:"#"});if(this.$modal=i,i.append(o).append(r),null!==(e=this.args)&&void 0!==e&&e.title){var a=c()("
",{class:"title",html:"

".concat(this.args.title,"

")});i.prepend(a)}return i.on("click",".close-button",(function(t){t.preventDefault(),n.onClose()})),this.$target.closest(".yith-wcaf-section").append(i),this.$modal}},{key:"maybeDestroyModal",value:function(){var t;null!==(t=this.$modal)&&void 0!==t&&t.length&&this.$modal.remove()}},{key:"maybeOpenModal",value:function(t){var e,n=this;null!==(e=this.$modal)&&void 0!==e&&e.length||this.maybeBuildModal(),this.$modal.hasClass("open")||(this.$modal.find(".content").append(t).end().fadeIn((function(){var t,e;(n.$modal.addClass("open"),"function"==typeof(null===(t=n.args)||void 0===t?void 0:t.onOpen))&&(null===(e=n.args)||void 0===e||e.onOpen.call(n))})),y.addClass("yith-wcaf-open-modal"))}},{key:"maybeCloseModal",value:function(){var t,e=this;null!==(t=this.$modal)&&void 0!==t&&t.length||this.maybeBuildModal(),this.$modal.hasClass("open")&&this.$modal.fadeOut((function(){var t,n;(e.$modal.removeClass("open"),y.removeClass("yith-wcaf-open-modal"),"function"==typeof(null===(t=e.args)||void 0===t?void 0:t.onClose))&&(null===(n=e.args)||void 0===n||n.onClose.call(e))}))}}]),t}()),H=function(){function t(e){n(this,t),l(this,"$container",void 0),e.length&&(this.$container=e,this.init())}return a(t,[{key:"init",value:function(){this.initTooltips(),this.initCopyButtons(),this.initLinkGenerator(),this.initSetReferrer(),this.initWithdrawModal(),this.initSettings(),this.setCookie()}},{key:"initTooltips",value:function(){var t=c()("[data-tip]",this.$container);t.length&&t.each((function(){new A(c()(this))}))}},{key:"initCopyButtons",value:function(){this.$container.find(".copy-trigger").each((function(){var t=c()(this),e=t.parent().find(".copy-target");e.length&&new M(t,e)}))}},{key:"initLinkGenerator",value:function(){var t=c()(".link-generator",this.$container);t.length&&new E(t)}},{key:"initSetReferrer",value:function(){var t=c()(".set-referrer-wrapper",this.$container);t.length&&new L(t)}},{key:"initWithdrawModal",value:function(){var t=c()("#withdraw_modal_opener",this.$container);t.length&&new V(t,{template:"#withdraw_modal",title:null==h?void 0:h.withdraw_modal_title,afterSubmit:function(t){if(null!=t&&t.template){var e=this.$modal.find(".content");this.$modal.find(".title").fadeOut(),e.fadeOut((function(){e.empty().html(null==t?void 0:t.template).fadeIn()}))}else this.maybeCloseModal()}})}},{key:"initSettings",value:function(){var t=this.$container;t.length&&O(t)}},{key:"setCookie",value:function(){yith_wcaf.set_cookie_via_ajax&&yith_wcaf.referral_var&&function(){if(yith_wcaf.set_cookie_via_ajax&&yith_wcaf.referral_var){var t=new URLSearchParams(location.search);t.has(yith_wcaf.referral_var)&&j.get.call(null,"set_cookie","",l({},yith_wcaf.referral_var,t.get(yith_wcaf.referral_var)))}}()}}]),t}();c()((function(){return new H(c()(".yith-wcaf"))}));var N=window;for(var Z in e)N[Z]=e[Z];e.__esModule&&Object.defineProperty(N,"__esModule",{value:!0})})();