(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t);const n=window.jQuery;var i=e.n(n);const r=window.wp.apiFetch;var o=e.n(r);const a=window.wp.hooks,l=window.wcPPCP.utils,u=window.lodash;var s=["color","label"];function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o=[],a=!0,l=!1;try{for(n=n.call(e);!(a=(i=n.next()).done)&&(o.push(i.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==n.return||n.return()}finally{if(l)throw r}}return o}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function g(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(){return m="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=_(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},m.apply(this,arguments)}function _(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=w(e)););return e}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function P(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function w(e){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},w(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k(e,t)}(l,e);var t,n,r,o,a=(r=l,o=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(e){return!1}}(),function(){var e,t=w(r);if(o){var n=w(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return P(this,e)});function l(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(n=a.call(this,t)).cart=e,n.retryCount=0,n.initialize(),n}return t=l,(n=[{key:"initialize",value:function(){this.actions.addAction("fragments_changed",this.onFragmentsChanged.bind(this)),i()(document.body).on("wc_ppcp_on_destroy",this.createButton.bind(this)),m(w(l.prototype),"initialize",this).call(this)}},{key:"needsShipping",value:function(){return this.cart.needsShipping()}},{key:"createButton",value:function(){if(!this.getButtonContainer()&&this.retryCount<10)return this.retryCount+=1,setTimeout(this.createButton.bind(this),500);m(w(l.prototype),"createButton",this).call(this)}},{key:"getButtonContainer",value:function(){var e=document.querySelectorAll(".wc-ppcp-minicart-".concat(this.id));return e&&e.length>0?e:(i()(".woocommerce-mini-cart__buttons").append('<a id="wc-ppcp-minicart-'.concat(this.id,'"></a>')),document.getElementById("wc-ppcp-minicart-".concat(this.id)))}},{key:"getPage",value:function(){return"minicart"}},{key:"handleBillingToken",value:function(e){m(w(l.prototype),"handleBillingToken",this).call(this,e),this.processCartCheckout()}},{key:"createOrder",value:function(e,t){return this.cart.createOrder({payment_method:this.id}).then((function(e){return e}))}},{key:"onFragmentsChanged",value:function(){this.cart.isEmpty()||m(w(l.prototype),"initialize",this).call(this)}}])&&b(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(function(){function e(t){var n=t.id,i=t.context,r=t.actions,o=t.container,a=void 0===o?null:o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=n,this.actions=r,this.buttons={},this.buttonActions={},this.context=i,this.settings=(0,l.getSetting)("".concat(n,"_data")),this.container=a||"li.payment_method_".concat(n),this.order_field_key="".concat(this.id,"_paypal_order_id"),this.billing_token_key="".concat(this.id,"_billing_token")}var t,n;return t=e,n=[{key:"initialize",value:function(){var e=this;this.loadPayPalScript().then((function(){e.initializeEvents(),e.createButton()}))}},{key:"initializeEvents",value:function(){}},{key:"isActive",value:function(){return null!==this.getData()}},{key:"loadPayPalScript",value:function(){var e=this;return new Promise((function(t,n){(0,l.loadPayPalSdk)(e.getPayPalSDKArgs()).then((function(n){e.paypal=n,t()})).catch((function(t){console.log(t),null!=t&&t.code&&e.submitError((0,l.getErrorMessage)(t)),n()}))}))}},{key:"getPayPalSDKArgs",value:function(){return(0,l.getPayPalQueryParams)()}},{key:"getClientId",value:function(){var e=(0,l.getSetting)("generalData"),t=e.clientId,n=void 0===t?null:t,i=e.environment;return n||"sandbox"!=i||(n="sb"),n}},{key:"getData",value:function(){return i()("".concat(this.container)).find(".wc-ppcp-payment-method-data").data("payment-method-data")||null}},{key:"setData",value:function(e){i()("".concat(this.container)).find(".wc-ppcp-payment-method-data").data("payment-method-data",e)}},{key:"setOption",value:function(e,t){var n=this.getData();n&&(n[e]=t,this.setData(n))}},{key:"setVariable",value:function(e,t){(0,l.getSetting)("".concat(this.id,"_data"))[e]=t}},{key:"getVariable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=(0,l.getSetting)("".concat(this.id,"_data"));return n.hasOwnProperty(e)?n[e]:(t&&this.setVariable(e,t),t)}},{key:"getOption",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.getData();return n.hasOwnProperty(e)?n[e]:(t&&this.setOption(e,t),t)}},{key:"createButton",value:function(){var e=this,t=this.getButtonContainer();t&&!i()(t).find(".paypal-buttons").length&&(this.getSortedFunding(this.getFunding()).forEach((function(n){var i=e.paypal.Buttons(e.getButtonOptions(n));if(e.buttons[n]=i,i.isEligible())if(t instanceof NodeList){var r,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=y(e))){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},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 o,a=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw o}}}}(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.render(a)}}catch(e){o.e(e)}finally{o.f()}}else i.render(t)})),this.$button=i()(t),a.defaultHooks.doAction("wcPPCPButtonCreated",this))}},{key:"getButton",value:function(){return this.$button}},{key:"destroyButtons",value:function(){var e=this;Object.keys(this.buttons).forEach((function(t){e.buttons[t].close&&e.buttons[t].close()}))}},{key:"disableButtons",value:function(){var e=this;Object.keys(this.buttonActions).forEach((function(t){e.buttonActions[t].disable()}))}},{key:"enableButtons",value:function(){var e=this;Object.keys(this.buttonActions).forEach((function(t){e.buttonActions[t].enable()}))}},{key:"getFunding",value:function(){var e,t,n,i,r,o,a,l=[],u=(null===(e=this.settings)||void 0===e?void 0:e.funding)||[];return null!==(t=this.settings)&&void 0!==t&&null!==(n=t.paypal_sections)&&void 0!==n&&n.includes(this.getPage())&&l.push(paypal.FUNDING.PAYPAL),u.includes("paylater")&&null!==(i=this.settings)&&void 0!==i&&null!==(r=i.paylater_sections)&&void 0!==r&&r.includes(this.getPage())&&this.isCheckoutFlow()&&l.push(paypal.FUNDING.PAYLATER),u.includes("card")&&null!==(o=this.settings)&&void 0!==o&&null!==(a=o.credit_card_sections)&&void 0!==a&&a.includes(this.getPage())&&l.push(paypal.FUNDING.CARD),l}},{key:"isFundingActive",value:function(e){var t,n;return null===(t=this.settings)||void 0===t||null===(n=t.funding)||void 0===n?void 0:n.includes(e)}},{key:"isSectionEnabled",value:function(e,t){var n,i,r="".concat(e,"_sections");return null===(n=this.settings)||void 0===n||null===(i=n[r])||void 0===i?void 0:i.includes(t)}},{key:"getSortedFunding",value:function(e){var t=this.settings.buttons_order||[];return e.sort((function(e,n){return t.indexOf(e)<t.indexOf(n)?-1:1})),e}},{key:"getButtonContainer",value:function(){return null}},{key:"getButtonOptions",value:function(e){var t=this,n={fundingSource:e,style:this.getButtonStyle(e),onInit:function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];t.onInit.apply(t,[e].concat(r)),i()(document.body).triggerHandler("wc_ppcp_on_init",[t,e])},onClick:function(){t.onClick.apply(t,arguments),i()(document.body).triggerHandler("wc_ppcp_on_click",[t,e])},onApprove:function(n,r){t.onApprove(n,r),i()(document.body).triggerHandler("wc_ppcp_on_approve",[t,e])},onCancel:function(n){t.orderId=n.orderID,i()(document.body).triggerHandler("wc_ppcp_on_cancel",[t,e,n])},onError:function(n){t.currentError?(t.submitError(t.currentError),t.currentError=null):t.submitError(n),i()(document.body).triggerHandler("wc_ppcp_on_error",[t,e,n])},onDestroy:function(){i()(document.body).triggerHandler("wc_ppcp_on_destroy",[t,e])}};return this.isCheckoutFlow()?(n.createOrder=function(e,n){return t.createOrder(e,n)},this.needsShipping()&&e!==paypal.FUNDING.VENMO&&(n.onShippingChange=function(){return t.onShippingChange.apply(t,arguments)})):n.createBillingAgreement=function(){return t.createBillingAgreement.apply(t,arguments)},n}},{key:"needsShipping",value:function(){return this.getOption("needsShipping",!1)}},{key:"isCheckoutFlow",value:function(){var e;return"true"!==(null===(e=(0,l.getPayPalQueryParams)())||void 0===e?void 0:e.vault)}},{key:"getTotal",value:function(){return this.getOption("total",0)}},{key:"getButtonStyle",value:function(e){var t,n,i,r,o,a,l,u,c,d=null;switch(e){case paypal.FUNDING.PAYPAL:d=null===(t=this.settings)||void 0===t||null===(n=t.buttons)||void 0===n?void 0:n.paypal;break;case paypal.FUNDING.PAYLATER:d=null===(i=this.settings)||void 0===i||null===(r=i.buttons)||void 0===r?void 0:r.paylater;break;case paypal.FUNDING.CARD:(d=p({},null===(o=this.settings)||void 0===o||null===(a=o.buttons)||void 0===a?void 0:a.card)).tagline?(delete d.tagline,d.layout="vertical"):d.layout="horizontal";break;case paypal.FUNDING.VENMO:var f=null===(l=this.settings)||void 0===l||null===(u=l.buttons)||void 0===u?void 0:u.paypal;f.color,f.label,d=function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(f,s)}return null!==(c=d)&&void 0!==c&&c.height&&(d.height=parseInt(d.height)),d}},{key:"onApprove",value:function(e,t){var n=this;if((0,l.setFieldValue)(this.order_field_key,e.orderID,""),e.billingToken)return(0,l.setFieldValue)(this.billing_token_key,e.billingToken,""),this.fetchBillingToken(e.billingToken).then((function(t){n.handleBillingToken(t,e)})).catch((function(e){return n.submitError(null==e?void 0:e.message)}));t.order.get().then((function(t){n.handleOnApproveResponse(e,t)})).catch((function(e){return n.submitError(e)}))}},{key:"handleOnApproveResponse",value:function(e,t){this.populateCheckoutFields(t),this.processCartCheckout()}},{key:"fetchBillingToken",value:function(e){return o()({method:"GET",path:"/wc-ppcp/v1/billing-agreement/token/".concat(e)})}},{key:"handleBillingToken",value:function(e,t){var n,i,r,o;if((0,u.isEmpty)(e.payer_info.billing_address)||this.populateBillingAddressFields((0,l.convertPayPalAddressToCart)(e.payer_info.billing_address)),null!=e&&null!==(n=e.payer_info)&&void 0!==n&&n.first_name&&((0,l.isValid)("billing_first_name")||(0,l.setFieldValue)("first_name",e.payer_info.first_name,"billing")),null!=e&&null!==(i=e.payer_info)&&void 0!==i&&i.last_name&&((0,l.isValid)("billing_last_name")||(0,l.setFieldValue)("last_name",e.payer_info.last_name,"billing")),null!=e&&null!==(r=e.payer_info)&&void 0!==r&&r.email&&((0,l.isValid)("billing_email")||(0,l.setFieldValue)("billing_email",e.payer_info.email)),null!=e&&null!==(o=e.payer_info)&&void 0!==o&&o.phone&&((0,l.isValid)("billing_phone")||(0,l.setFieldValue)("billing_phone",e.payer_info.phone)),this.needsShipping()&&e.shipping_address&&!(0,u.isEmpty)(e.shipping_address)){var a,s,c=(0,l.convertPayPalAddressToCart)(e.shipping_address);this.populateNameFields((0,l.extractFullName)(null!==(a=e.shipping_address.recipient_name)&&void 0!==a?a:""),"shipping"),this.populateShippingAddressFields(c),(0,l.isValidAddress)(this.getCartFullAddress("billing"),["phone","email"])||((0,l.isValidFieldValue)((0,l.getFieldValue)("billing_first_name"))||(0,l.isValidFieldValue)((0,l.getFieldValue)("billing_last_name"))||this.populateNameFields(null!==(s=e.shipping_address.recipient_name)&&void 0!==s?s:"","billing"),this.populateBillingAddressFields(c))}}},{key:"createOrder",value:function(e,t){return t.order.create(args)}},{key:"createBillingAgreement",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return o()({method:"POST",url:(0,l.getRestPath)("/wc-ppcp/v1/billing-agreement/token"),data:p({payment_method:this.id,context:this.getPage()},i)}).then((function(e){return e})).catch((function(e){n.currentError=e}))}},{key:"onShippingChange",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,l.convertPayPalAddressToCart)((null==e?void 0:e.shipping_address)||{},!0),a=(null==e||null===(n=e.selected_shipping_option)||void 0===n?void 0:n.id)||"";return o()({method:"POST",url:(0,l.getRestRoute)("cart/shipping"),data:p({order_id:e.orderID,address:r,shipping_method:a,payment_method:this.id},i)}).then((function(e){return e.code?t.reject():t.resolve()})).catch((function(e){return t.reject()}))}},{key:"submitError",value:function(e){}},{key:"getShippingPrefix",value:function(){return"shipping"}},{key:"getCartAddress",value:function(e){return{address_1:(0,l.getFieldValue)("address_1",e),address_2:(0,l.getFieldValue)("address_2",e),state:(0,l.getFieldValue)("state",e),city:(0,l.getFieldValue)("city",e),postcode:(0,l.getFieldValue)("postcode",e),country:(0,l.getFieldValue)("country",e)}}},{key:"getCartFullAddress",value:function(e){return{first_name:(0,l.getFieldValue)("first_name",e),last_name:(0,l.getFieldValue)("last_name",e),address_1:(0,l.getFieldValue)("address_1",e),address_2:(0,l.getFieldValue)("address_2",e),state:(0,l.getFieldValue)("state",e),city:(0,l.getFieldValue)("city",e),postcode:(0,l.getFieldValue)("postcode",e),country:(0,l.getFieldValue)("country",e)}}},{key:"onInit",value:function(e,t,n){this.buttonActions[e]=n}},{key:"onClick",value:function(e,t){}},{key:"isPage",value:function(e){return this.getPage()===e}},{key:"getPage",value:function(){var e,t=null===(e=(0,l.getSetting)("generalData"))||void 0===e?void 0:e.page;return"cart"==t&&i()(document.body).is(".woocommerce-checkout")&&(t="checkout"),t}},{key:"populateShippingAddressFields",value:function(e){for(var t in e)(0,l.setFieldValue)(t,e[t],"shipping")}},{key:"populateBillingAddressFields",value:function(e){for(var t in e)(0,l.setFieldValue)(t,e[t],"billing")}},{key:"populateNameFields",value:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(Array.isArray(e)){var r=c(e,2);t=r[0],n=r[1]}else t=e.given_name,n=e.surname;(0,l.setFieldValue)("first_name",t,i),(0,l.setFieldValue)("last_name",n,i)}},{key:"populateCheckoutFields",value:function(e){var t,n,i,r,o,a,s,c;if(!(0,u.isEmpty)(null==e||null===(t=e.payer)||void 0===t?void 0:t.address)){var d=(0,l.convertPayPalAddressToCart)(e.payer.address);this.populateBillingAddressFields(d)}if(null!=e&&null!==(n=e.payer)&&void 0!==n&&n.name&&this.populateNameFields(e.payer.name,"billing"),null!=e&&null!==(i=e.payer)&&void 0!==i&&i.email_address&&(0,l.setFieldValue)("billing_email",e.payer.email_address),null!=e&&null!==(r=e.payer)&&void 0!==r&&null!==(o=r.phone)&&void 0!==o&&null!==(a=o.phone_number)&&void 0!==a&&a.national_number&&((0,l.setFieldValue)("billing_phone",e.payer.phone.phone_number.national_number),(0,l.setFieldValue)("shipping_phone",e.payer.phone.phone_number.national_number)),this.needsShipping()&&null!=e&&null!==(s=e.purchase_units)&&void 0!==s&&null!==(c=s[0])&&void 0!==c&&c.shipping){var p,f,y=(0,l.convertPayPalAddressToCart)(e.purchase_units[0].shipping.address);if(this.populateShippingAddressFields(y),null!==(p=e.purchase_units[0].shipping)&&void 0!==p&&null!==(f=p.name)&&void 0!==f&&f.full_name){var h=(0,l.extractFullName)(e.purchase_units[0].shipping.name.full_name);this.populateNameFields(h,"shipping")}(0,l.isValidAddress)(this.getCartFullAddress("billing"),["phone","email"])||this.populateBillingAddressFields(y)}}},{key:"processCartCheckout",value:function(){var e=this;return this.showProcessing(),o()({method:"POST",url:(0,l.getRestRoute)("cart/checkout"),data:this.getCartCheckoutData()}).then((function(t){if(t.result&&"success"==t.result)window.location=t.redirect;else if(t.messages)return e.submitError(t.messages)})).catch((function(t){t.code&&e.submitError(t.message)}))}},{key:"getCartCheckoutData",value:function(){return p({payment_method:this.id,context:this.getPage()},(0,l.fieldsToJson)())}},{key:"getProcessingSelector",value:function(){return"body"}},{key:"showProcessing",value:function(){var e;null===(e=i()(this.getProcessingSelector()))||void 0===e||e.block({message:this.getProcessingMessage(),overlayCSS:{background:"#fff",opacity:.6}})}},{key:"hideProcessing",value:function(){var e;null===(e=i()(this.getProcessingSelector()))||void 0===e||e.unblock()}},{key:"getProcessingMessage",value:function(){return'<div class="wc-ppcp-loader">\n                        <div></div>\n                        <div></div>\n                        <div></div>\n                      </div>'}},{key:"getFullName",value:function(e){var t=[(0,l.getFieldValue)("first_name",e),(0,l.getFieldValue)("last_name",e)].filter(Boolean);return 0==t.length?null:1==t.length?t[0]:"".concat(t[0]," ").concat(t[1])}}],n&&g(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}());const F=window.wcPPCP.cart;var S=e.n(F);const A=window.wcPPCP.actions;var j=e.n(A);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V(e,t)}function B(e,t){if(t&&("object"===C(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V(e,t)}(o,e);var t,n,i,r=(n=o,i=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(e){return!1}}(),function(){var e,t=T(n);if(i){var r=T(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return B(this,e)});function o(){return E(this,o),r.apply(this,arguments)}return t=o,Object.defineProperty(t,"prototype",{writable:!1}),t}(O))(S(),{id:"ppcp",actions:new(j()),context:"cart"}),(this.wcPPCP=this.wcPPCP||{}).paypalMinicart=t})();