woocommerce-paypal-payments/modules/ppcp-googlepay/assets/js/boot-block.js

3 lines
No EOL
190 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see boot-block.js.LICENSE.txt */
(()=>{"use strict";var t={34:(t,e,r)=>{var n=r(4901);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},81:(t,e,r)=>{var n=r(9565),o=r(9306),i=r(8551),a=r(6823),c=r(851),u=TypeError;t.exports=function(t,e){var r=arguments.length<2?c(t):e;if(o(r))return i(n(r,t));throw new u(a(t)+" is not iterable")}},113:(t,e,r)=>{var n=r(6518),o=r(9213).find,i=r(6469),a="find",c=!0;a in[]&&Array(1)[a](function(){c=!1}),n({target:"Array",proto:!0,forced:c},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i(a)},116:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(2652),a=r(9306),c=r(8551),u=r(1767),s=r(9539),l=r(4549)("find",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(t){c(this);try{a(t)}catch(t){s(this,"throw",t)}if(l)return o(l,this,t);var e=u(this),r=0;return i(e,function(e,n){if(t(e,r++))return n(e)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},235:(t,e,r)=>{var n=r(9213).forEach,o=r(4598)("forEach");t.exports=o?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},280:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(6395),a=r(550),c=r(916).CONSTRUCTOR,u=r(3438),s=o("Promise"),l=i&&!c;n({target:"Promise",stat:!0,forced:i||c},{resolve:function(t){return u(l&&this===s?a:this,t)}})},283:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(4901),a=r(9297),c=r(3724),u=r(350).CONFIGURABLE,s=r(3706),l=r(1181),f=l.enforce,p=l.get,h=String,d=Object.defineProperty,y=n("".slice),v=n("".replace),g=n([].join),b=c&&!o(function(){return 8!==d(function(){},"length",{value:8}).length}),m=String(String).split("String"),w=t.exports=function(t,e,r){"Symbol("===y(h(e),0,7)&&(e="["+v(h(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(c?d(t,"name",{value:e,configurable:!0}):t.name=e),b&&r&&a(r,"arity")&&t.length!==r.arity&&d(t,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?c&&d(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var n=f(t);return a(n,"source")||(n.source=g(m,"string"==typeof e?e:"")),t};Function.prototype.toString=w(function(){return i(this)&&p(this).source||s(this)},"toString")},287:(t,e,r)=>{r(6518)({target:"Object",stat:!0},{setPrototypeOf:r(2967)})},298:(t,e,r)=>{var n=r(2195),o=r(5397),i=r(8480).f,a=r(7680),c="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return c&&"Window"===n(t)?function(t){try{return i(t)}catch(t){return a(c)}}(t):i(o(t))}},350:(t,e,r)=>{var n=r(3724),o=r(9297),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,c=o(i,"name"),u=c&&"something"===function(){}.name,s=c&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:c,PROPER:u,CONFIGURABLE:s}},397:(t,e,r)=>{var n=r(7751);t.exports=n("document","documentElement")},421:t=>{t.exports={}},436:(t,e,r)=>{var n,o,i,a,c=r(6518),u=r(6395),s=r(8574),l=r(4576),f=r(9167),p=r(9565),h=r(6840),d=r(2967),y=r(687),v=r(7633),g=r(9306),b=r(4901),m=r(34),w=r(679),S=r(2293),O=r(9225).set,j=r(1955),_=r(3138),x=r(1103),P=r(8265),E=r(1181),C=r(550),k=r(916),T=r(6043),I="Promise",A=k.CONSTRUCTOR,R=k.REJECTION_EVENT,M=k.SUBCLASSING,D=E.getterFor(I),N=E.set,B=C&&C.prototype,F=C,G=B,L=l.TypeError,H=l.document,q=l.process,U=T.f,W=U,$=!!(H&&H.createEvent&&l.dispatchEvent),z="unhandledrejection",V=function(t){var e;return!(!m(t)||!b(e=t.then))&&e},Q=function(t,e){var r,n,o,i=e.value,a=1===e.state,c=a?t.ok:t.fail,u=t.resolve,s=t.reject,l=t.domain;try{c?(a||(2===e.rejection&&Z(e),e.rejection=1),!0===c?r=i:(l&&l.enter(),r=c(i),l&&(l.exit(),o=!0)),r===t.promise?s(new L("Promise-chain cycle")):(n=V(r))?p(n,r,u,s):u(r)):s(i)}catch(t){l&&!o&&l.exit(),s(t)}},J=function(t,e){t.notified||(t.notified=!0,j(function(){for(var r,n=t.reactions;r=n.get();)Q(r,t);t.notified=!1,e&&!t.rejection&&Y(t)}))},K=function(t,e,r){var n,o;$?((n=H.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),l.dispatchEvent(n)):n={promise:e,reason:r},!R&&(o=l["on"+t])?o(n):t===z&&_("Unhandled promise rejection",r)},Y=function(t){p(O,l,function(){var e,r=t.facade,n=t.value;if(X(t)&&(e=x(function(){s?q.emit("unhandledRejection",n,r):K(z,r,n)}),t.rejection=s||X(t)?2:1,e.error))throw e.value})},X=function(t){return 1!==t.rejection&&!t.parent},Z=function(t){p(O,l,function(){var e=t.facade;s?q.emit("rejectionHandled",e):K("rejectionhandled",e,t.value)})},tt=function(t,e,r){return function(n){t(e,n,r)}},et=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,J(t,!0))},rt=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw new L("Promise can't be resolved itself");var n=V(e);n?j(function(){var r={done:!1};try{p(n,e,tt(rt,r,t),tt(et,r,t))}catch(e){et(r,e,t)}}):(t.value=e,t.state=1,J(t,!1))}catch(e){et({done:!1},e,t)}}};if(A&&(G=(F=function(t){w(this,G),g(t),p(n,this);var e=D(this);try{t(tt(rt,e),tt(et,e))}catch(t){et(e,t)}}).prototype,(n=function(t){N(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new P,rejection:!1,state:0,value:null})}).prototype=h(G,"then",function(t,e){var r=D(this),n=U(S(this,F));return r.parent=!0,n.ok=!b(t)||t,n.fail=b(e)&&e,n.domain=s?q.domain:void 0,0===r.state?r.reactions.add(n):j(function(){Q(n,r)}),n.promise}),o=function(){var t=new n,e=D(t);this.promise=t,this.resolve=tt(rt,e),this.reject=tt(et,e)},T.f=U=function(t){return t===F||t===i?new o(t):W(t)},!u&&b(C)&&B!==Object.prototype)){a=B.then,M||h(B,"then",function(t,e){var r=this;return new F(function(t,e){p(a,r,t,e)}).then(t,e)},{unsafe:!0});try{delete B.constructor}catch(t){}d&&d(B,G)}c({global:!0,constructor:!0,wrap:!0,forced:A},{Promise:F}),i=f.Promise,y(F,I,!1,!0),v(I)},511:(t,e,r)=>{var n=r(9167),o=r(9297),i=r(1951),a=r(4913).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});o(e,t)||a(e,t,{value:i.f(t)})}},537:(t,e,r)=>{var n=r(550),o=r(4428),i=r(916).CONSTRUCTOR;t.exports=i||!o(function(t){n.all(t).then(void 0,function(){})})},550:(t,e,r)=>{var n=r(4576);t.exports=n.Promise},566:(t,e,r)=>{var n=r(9504),o=r(9306),i=r(34),a=r(9297),c=r(7680),u=r(616),s=Function,l=n([].concat),f=n([].join),p={};t.exports=u?s.bind:function(t){var e=o(this),r=e.prototype,n=c(arguments,1),u=function(){var r=l(n,c(arguments));return this instanceof u?function(t,e,r){if(!a(p,e)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";p[e]=s("C,a","return new C("+f(n,",")+")")}return p[e](t,r)}(e,r.length,r):e.apply(t,r)};return i(r)&&(u.prototype=r),u}},597:(t,e,r)=>{var n=r(9039),o=r(8227),i=r(9519),a=o("species");t.exports=function(t){return i>=51||!n(function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},616:(t,e,r)=>{var n=r(9039);t.exports=!n(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})},655:(t,e,r)=>{var n=r(6955),o=String;t.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},679:(t,e,r)=>{var n=r(1625),o=TypeError;t.exports=function(t,e){if(n(e,t))return t;throw new o("Incorrect invocation")}},684:t=>{t.exports=function(t,e){var r="function"==typeof Iterator&&Iterator.prototype[t];if(r)try{r.call({next:null},e).next()}catch(t){return!0}}},687:(t,e,r)=>{var n=r(4913).f,o=r(9297),i=r(8227)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},739:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(8981),a=r(2777);n({target:"Date",proto:!0,arity:1,forced:o(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})})},{toJSON:function(t){var e=i(this),r=a(e,"number");return"number"!=typeof r||isFinite(r)?e.toISOString():null}})},741:t=>{var e=Math.ceil,r=Math.floor;t.exports=Math.trunc||function(t){var n=+t;return(n>0?r:e)(n)}},747:(t,e,r)=>{var n=r(6699),o=r(6193),i=r(4659),a=Error.captureStackTrace;t.exports=function(t,e,r,c){i&&(a?a(t,e):n(t,"stack",o(r,c)))}},757:(t,e,r)=>{var n=r(7751),o=r(4901),i=r(1625),a=r(7040),c=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=n("Symbol");return o(e)&&i(e.prototype,c(t))}},825:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(8745),a=r(566),c=r(5548),u=r(8551),s=r(34),l=r(2360),f=r(9039),p=o("Reflect","construct"),h=Object.prototype,d=[].push,y=f(function(){function t(){}return!(p(function(){},[],t)instanceof t)}),v=!f(function(){p(function(){})}),g=y||v;n({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(t,e){c(t),u(e);var r=arguments.length<3?t:c(arguments[2]);if(v&&!y)return p(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return i(d,n,e),new(i(a,t,n))}var o=r.prototype,f=l(s(o)?o:h),g=i(t,f,e);return s(g)?g:f}})},851:(t,e,r)=>{var n=r(6955),o=r(5966),i=r(4117),a=r(6269),c=r(8227)("iterator");t.exports=function(t){if(!i(t))return o(t,c)||o(t,"@@iterator")||a[n(t)]}},875:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(8981),a=r(2787),c=r(2211);n({target:"Object",stat:!0,forced:o(function(){a(1)}),sham:!c},{getPrototypeOf:function(t){return a(i(t))}})},888:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(34),a=r(8551),c=r(6575),u=r(7347),s=r(2787);n({target:"Reflect",stat:!0},{get:function t(e,r){var n,l,f=arguments.length<3?e:arguments[2];return a(e)===f?e[r]:(n=u.f(e,r))?c(n)?n.value:void 0===n.get?void 0:o(n.get,f):i(l=s(e))?t(l,r,f):void 0}})},906:(t,e,r)=>{r(7495);var n,o,i=r(6518),a=r(9565),c=r(4901),u=r(8551),s=r(655),l=(n=!1,(o=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===o.test("abc")&&n),f=/./.test;i({target:"RegExp",proto:!0,forced:!l},{test:function(t){var e=u(this),r=s(t),n=e.exec;if(!c(n))return a(f,e,r);var o=a(n,e,r);return null!==o&&(u(o),!0)}})},916:(t,e,r)=>{var n=r(4576),o=r(550),i=r(4901),a=r(2796),c=r(3706),u=r(8227),s=r(4215),l=r(6395),f=r(9519),p=o&&o.prototype,h=u("species"),d=!1,y=i(n.PromiseRejectionEvent),v=a("Promise",function(){var t=c(o),e=t!==String(o);if(!e&&66===f)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!f||f<51||!/native code/.test(t)){var r=new o(function(t){t(1)}),n=function(t){t(function(){},function(){})};if((r.constructor={})[h]=n,!(d=r.then(function(){})instanceof n))return!0}return!(e||"BROWSER"!==s&&"DENO"!==s||y)});t.exports={CONSTRUCTOR:v,REJECTION_EVENT:y,SUBCLASSING:d}},1034:(t,e,r)=>{var n=r(9565),o=r(9297),i=r(1625),a=r(5213),c=r(7979),u=RegExp.prototype;t.exports=a.correct?function(t){return t.flags}:function(t){return a.correct||!i(u,t)||o(t,"flags")?t.flags:n(c,t)}},1056:(t,e,r)=>{var n=r(4913).f;t.exports=function(t,e,r){r in t||n(t,r,{configurable:!0,get:function(){return e[r]},set:function(t){e[r]=t}})}},1072:(t,e,r)=>{var n=r(1828),o=r(8727);t.exports=Object.keys||function(t){return n(t,o)}},1088:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(6395),a=r(350),c=r(4901),u=r(3994),s=r(2787),l=r(2967),f=r(687),p=r(6699),h=r(6840),d=r(8227),y=r(6269),v=r(7657),g=a.PROPER,b=a.CONFIGURABLE,m=v.IteratorPrototype,w=v.BUGGY_SAFARI_ITERATORS,S=d("iterator"),O="keys",j="values",_="entries",x=function(){return this};t.exports=function(t,e,r,a,d,v,P){u(r,e,a);var E,C,k,T=function(t){if(t===d&&D)return D;if(!w&&t&&t in R)return R[t];switch(t){case O:case j:case _:return function(){return new r(this,t)}}return function(){return new r(this)}},I=e+" Iterator",A=!1,R=t.prototype,M=R[S]||R["@@iterator"]||d&&R[d],D=!w&&M||T(d),N="Array"===e&&R.entries||M;if(N&&(E=s(N.call(new t)))!==Object.prototype&&E.next&&(i||s(E)===m||(l?l(E,m):c(E[S])||h(E,S,x)),f(E,I,!0,!0),i&&(y[I]=x)),g&&d===j&&M&&M.name!==j&&(!i&&b?p(R,"name",j):(A=!0,D=function(){return o(M,this)})),d)if(C={values:T(j),keys:v?D:T(O),entries:T(_)},P)for(k in C)(w||A||!(k in R))&&h(R,k,C[k]);else n({target:e,proto:!0,forced:w||A},C);return i&&!P||R[S]===D||h(R,S,D,{name:d}),y[e]=D,C}},1103:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},1181:(t,e,r)=>{var n,o,i,a=r(8622),c=r(4576),u=r(34),s=r(6699),l=r(9297),f=r(7629),p=r(6119),h=r(421),d="Object already initialized",y=c.TypeError,v=c.WeakMap;if(a||f.state){var g=f.state||(f.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,n=function(t,e){if(g.has(t))throw new y(d);return e.facade=t,g.set(t,e),e},o=function(t){return g.get(t)||{}},i=function(t){return g.has(t)}}else{var b=p("state");h[b]=!0,n=function(t,e){if(l(t,b))throw new y(d);return e.facade=t,s(t,b,e),e},o=function(t){return l(t,b)?t[b]:{}},i=function(t){return l(t,b)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!u(e)||(r=o(e)).type!==t)throw new y("Incompatible receiver, "+t+" required");return r}}}},1240:(t,e,r)=>{var n=r(9504);t.exports=n(1.1.valueOf)},1278:(t,e,r)=>{var n=r(6518),o=r(3724),i=r(5031),a=r(5397),c=r(7347),u=r(2278);n({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var e,r,n=a(t),o=c.f,s=i(n),l={},f=0;s.length>f;)void 0!==(r=o(n,e=s[f++]))&&u(l,e,r);return l}})},1291:(t,e,r)=>{var n=r(741);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},1296:(t,e,r)=>{var n=r(4495);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},1385:(t,e,r)=>{var n=r(9539);t.exports=function(t,e,r){for(var o=t.length-1;o>=0;o--)if(void 0!==t[o])try{r=n(t[o].iterator,e,r)}catch(t){e="throw",r=t}if("throw"===e)throw r;return r}},1454:(t,e,r)=>{r(1701)},1469:(t,e,r)=>{var n=r(7433);t.exports=function(t,e){return new(n(t))(0===e?0:e)}},1481:(t,e,r)=>{var n=r(6518),o=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(t){var e=o.f(this);return(0,e.reject)(t),e.promise}})},1510:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(9297),a=r(655),c=r(5745),u=r(1296),s=c("string-to-symbol-registry"),l=c("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{for:function(t){var e=a(t);if(i(s,e))return s[e];var r=o("Symbol")(e);return s[e]=r,l[r]=e,r}})},1625:(t,e,r)=>{var n=r(9504);t.exports=n({}.isPrototypeOf)},1701:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(8551),c=r(1767),u=r(9462),s=r(6319),l=r(9539),f=r(684),p=r(4549),h=r(6395),d=!h&&!f("map",function(){}),y=!h&&!d&&p("map",TypeError),v=h||d||y,g=u(function(){var t=this.iterator,e=a(o(this.next,t));if(!(this.done=!!e.done))return s(t,this.mapper,[e.value,this.counter++],!0)});n({target:"Iterator",proto:!0,real:!0,forced:v},{map:function(t){a(this);try{i(t)}catch(t){l(this,"throw",t)}return y?o(y,this,t):new g(c(this),{mapper:t})}})},1767:t=>{t.exports=function(t){return{iterator:t,next:t.next,done:!1}}},1828:(t,e,r)=>{var n=r(9504),o=r(9297),i=r(5397),a=r(9617).indexOf,c=r(421),u=n([].push);t.exports=function(t,e){var r,n=i(t),s=0,l=[];for(r in n)!o(c,r)&&o(n,r)&&u(l,r);for(;e.length>s;)o(n,r=e[s++])&&(~a(l,r)||u(l,r));return l}},1951:(t,e,r)=>{var n=r(8227);e.f=n},1955:(t,e,r)=>{var n,o,i,a,c,u=r(4576),s=r(3389),l=r(6080),f=r(9225).set,p=r(8265),h=r(9544),d=r(4265),y=r(7860),v=r(8574),g=u.MutationObserver||u.WebKitMutationObserver,b=u.document,m=u.process,w=u.Promise,S=s("queueMicrotask");if(!S){var O=new p,j=function(){var t,e;for(v&&(t=m.domain)&&t.exit();e=O.get();)try{e()}catch(t){throw O.head&&n(),t}t&&t.enter()};h||v||y||!g||!b?!d&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,c=l(a.then,a),n=function(){c(j)}):v?n=function(){m.nextTick(j)}:(f=l(f,u),n=function(){f(j)}):(o=!0,i=b.createTextNode(""),new g(j).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),S=function(t){O.head||n(),O.add(t)}}t.exports=S},2003:(t,e,r)=>{var n=r(6518),o=r(6395),i=r(916).CONSTRUCTOR,a=r(550),c=r(7751),u=r(4901),s=r(6840),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&u(a)){var f=c("Promise").prototype.catch;l.catch!==f&&s(l,"catch",f,{unsafe:!0})}},2008:(t,e,r)=>{var n=r(6518),o=r(9213).filter;n({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},2062:(t,e,r)=>{var n=r(6518),o=r(9213).map;n({target:"Array",proto:!0,forced:!r(597)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},2106:(t,e,r)=>{var n=r(283),o=r(4913);t.exports=function(t,e,r){return r.get&&n(r.get,e,{getter:!0}),r.set&&n(r.set,e,{setter:!0}),o.f(t,e,r)}},2140:(t,e,r)=>{var n={};n[r(8227)("toStringTag")]="z",t.exports="[object z]"===String(n)},2195:(t,e,r)=>{var n=r(9504),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},2211:(t,e,r)=>{var n=r(9039);t.exports=!n(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},2259:(t,e,r)=>{r(511)("iterator")},2278:(t,e,r)=>{var n=r(3724),o=r(4913),i=r(6980);t.exports=function(t,e,r){n?o.f(t,e,i(0,r)):t[e]=r}},2293:(t,e,r)=>{var n=r(8551),o=r(5548),i=r(4117),a=r(8227)("species");t.exports=function(t,e){var r,c=n(t).constructor;return void 0===c||i(r=n(c)[a])?e:o(r)}},2333:(t,e,r)=>{var n=r(1291),o=r(655),i=r(7750),a=RangeError;t.exports=function(t){var e=o(i(this)),r="",c=n(t);if(c<0||c===1/0)throw new a("Wrong number of repetitions");for(;c>0;(c>>>=1)&&(e+=e))1&c&&(r+=e);return r}},2360:(t,e,r)=>{var n,o=r(8551),i=r(6801),a=r(8727),c=r(421),u=r(397),s=r(4055),l=r(6119),f="prototype",p="script",h=l("IE_PROTO"),d=function(){},y=function(t){return"<"+p+">"+t+"</"+p+">"},v=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},g=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}var t,e,r;g="undefined"!=typeof document?document.domain&&n?v(n):(e=s("iframe"),r="java"+p+":",e.style.display="none",u.appendChild(e),e.src=String(r),(t=e.contentWindow.document).open(),t.write(y("document.F=Object")),t.close(),t.F):v(n);for(var o=a.length;o--;)delete g[f][a[o]];return g()};c[h]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(d[f]=o(t),r=new d,d[f]=null,r[h]=t):r=g(),void 0===e?r:i.f(r,e)}},2478:(t,e,r)=>{var n=r(9504),o=r(8981),i=Math.floor,a=n("".charAt),c=n("".replace),u=n("".slice),s=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,r,n,f,p){var h=r+t.length,d=n.length,y=l;return void 0!==f&&(f=o(f),y=s),c(p,y,function(o,c){var s;switch(a(c,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,r);case"'":return u(e,h);case"<":s=f[u(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>d){var p=i(l/10);return 0===p?o:p<=d?void 0===n[p-1]?a(c,1):n[p-1]+a(c,1):o}s=n[l-1]}return void 0===s?"":s})}},2489:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(8551),c=r(1767),u=r(9462),s=r(6319),l=r(6395),f=r(9539),p=r(684),h=r(4549),d=!l&&!p("filter",function(){}),y=!l&&!d&&h("filter",TypeError),v=l||d||y,g=u(function(){for(var t,e,r=this.iterator,n=this.predicate,i=this.next;;){if(t=a(o(i,r)),this.done=!!t.done)return;if(e=t.value,s(r,n,[e,this.counter++],!0))return e}});n({target:"Iterator",proto:!0,real:!0,forced:v},{filter:function(t){a(this);try{i(t)}catch(t){f(this,"throw",t)}return y?o(y,this,t):new g(c(this),{predicate:t})}})},2529:t=>{t.exports=function(t,e){return{value:t,done:e}}},2577:(t,e,r)=>{r(116)},2603:(t,e,r)=>{var n=r(655);t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:n(t)}},2652:(t,e,r)=>{var n=r(6080),o=r(9565),i=r(8551),a=r(6823),c=r(4209),u=r(6198),s=r(1625),l=r(81),f=r(851),p=r(9539),h=TypeError,d=function(t,e){this.stopped=t,this.result=e},y=d.prototype;t.exports=function(t,e,r){var v,g,b,m,w,S,O,j=r&&r.that,_=!(!r||!r.AS_ENTRIES),x=!(!r||!r.IS_RECORD),P=!(!r||!r.IS_ITERATOR),E=!(!r||!r.INTERRUPTED),C=n(e,j),k=function(t){return v&&p(v,"normal"),new d(!0,t)},T=function(t){return _?(i(t),E?C(t[0],t[1],k):C(t[0],t[1])):E?C(t,k):C(t)};if(x)v=t.iterator;else if(P)v=t;else{if(!(g=f(t)))throw new h(a(t)+" is not iterable");if(c(g)){for(b=0,m=u(t);m>b;b++)if((w=T(t[b]))&&s(y,w))return w;return new d(!1)}v=l(t,g)}for(S=x?t.next:v.next;!(O=o(S,v)).done;){try{w=T(O.value)}catch(t){p(v,"throw",t)}if("object"==typeof w&&w&&s(y,w))return w}return new d(!1)}},2675:(t,e,r)=>{r(6761),r(1510),r(7812),r(3110),r(9773)},2703:(t,e,r)=>{var n=r(4576),o=r(9039),i=r(9504),a=r(655),c=r(3802).trim,u=r(7452),s=n.parseInt,l=n.Symbol,f=l&&l.iterator,p=/^[+-]?0x/i,h=i(p.exec),d=8!==s(u+"08")||22!==s(u+"0x16")||f&&!o(function(){s(Object(f))});t.exports=d?function(t,e){var r=c(a(t));return s(r,e>>>0||(h(p,r)?16:10))}:s},2744:(t,e,r)=>{var n=r(9039);t.exports=!n(function(){return Object.isExtensible(Object.preventExtensions({}))})},2777:(t,e,r)=>{var n=r(9565),o=r(34),i=r(757),a=r(5966),c=r(4270),u=r(8227),s=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,u=a(t,l);if(u){if(void 0===e&&(e="default"),r=n(u,t,e),!o(r)||i(r))return r;throw new s("Can't convert object to primitive value")}return void 0===e&&(e="number"),c(t,e)}},2787:(t,e,r)=>{var n=r(9297),o=r(4901),i=r(8981),a=r(6119),c=r(2211),u=a("IE_PROTO"),s=Object,l=s.prototype;t.exports=c?s.getPrototypeOf:function(t){var e=i(t);if(n(e,u))return e[u];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof s?l:null}},2796:(t,e,r)=>{var n=r(9039),o=r(4901),i=/#|\.prototype\./,a=function(t,e){var r=u[c(t)];return r===l||r!==s&&(o(e)?n(e):!!e)},c=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=a.data={},s=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},2812:t=>{var e=TypeError;t.exports=function(t,r){if(t<r)throw new e("Not enough arguments");return t}},2839:(t,e,r)=>{var n=r(4576).navigator,o=n&&n.userAgent;t.exports=o?String(o):""},2892:(t,e,r)=>{var n=r(6518),o=r(6395),i=r(3724),a=r(4576),c=r(9167),u=r(9504),s=r(2796),l=r(9297),f=r(3167),p=r(1625),h=r(757),d=r(2777),y=r(9039),v=r(8480).f,g=r(7347).f,b=r(4913).f,m=r(1240),w=r(3802).trim,S="Number",O=a[S],j=c[S],_=O.prototype,x=a.TypeError,P=u("".slice),E=u("".charCodeAt),C=s(S,!O(" 0o1")||!O("0b1")||O("+0x1")),k=function(t){var e,r=arguments.length<1?0:O(function(t){var e=d(t,"number");return"bigint"==typeof e?e:function(t){var e,r,n,o,i,a,c,u,s=d(t,"number");if(h(s))throw new x("Cannot convert a Symbol value to a number");if("string"==typeof s&&s.length>2)if(s=w(s),43===(e=E(s,0))||45===e){if(88===(r=E(s,2))||120===r)return NaN}else if(48===e){switch(E(s,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+s}for(a=(i=P(s,2)).length,c=0;c<a;c++)if((u=E(i,c))<48||u>o)return NaN;return parseInt(i,n)}return+s}(e)}(t));return p(_,e=this)&&y(function(){m(e)})?f(Object(r),this,k):r};k.prototype=_,C&&!o&&(_.constructor=k),n({global:!0,constructor:!0,wrap:!0,forced:C},{Number:k});var T=function(t,e){for(var r,n=i?v(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(e,r=n[o])&&!l(t,r)&&b(t,r,g(e,r))};o&&j&&T(c[S],j),(C||o)&&T(c[S],O)},2953:(t,e,r)=>{var n=r(4576),o=r(7400),i=r(9296),a=r(3792),c=r(6699),u=r(687),s=r(8227)("iterator"),l=a.values,f=function(t,e){if(t){if(t[s]!==l)try{c(t,s,l)}catch(e){t[s]=l}if(u(t,e,!0),o[e])for(var r in a)if(t[r]!==a[r])try{c(t,r,a[r])}catch(e){t[r]=a[r]}}};for(var p in o)f(n[p]&&n[p].prototype,p);f(i,"DOMTokenList")},2967:(t,e,r)=>{var n=r(6706),o=r(34),i=r(7750),a=r(3506);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=n(Object.prototype,"__proto__","set"))(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),a(n),o(r)?(e?t(r,n):r.__proto__=n,r):r}}():void 0)},3110:(t,e,r)=>{var n=r(6518),o=r(7751),i=r(8745),a=r(9565),c=r(9504),u=r(9039),s=r(4376),l=r(4901),f=r(5810),p=r(757),h=r(2195),d=r(655),y=r(7680),v=r(8235),g=r(3392),b=r(4495),m=r(7819),w=String,S=o("JSON","stringify"),O=c(/./.exec),j=c("".charAt),_=c("".charCodeAt),x=c("".replace),P=c("".slice),E=c([].push),C=c(1.1.toString),k=/[\uD800-\uDFFF]/g,T=/^[\uD800-\uDBFF]$/,I=/^[\uDC00-\uDFFF]$/,A=g(),R=A.length,M=!b||u(function(){var t=o("Symbol")("stringify detection");return"[null]"!==S([t])||"{}"!==S({a:t})||"{}"!==S(Object(t))}),D=u(function(){return'"\\udf06\\ud834"'!==S("\udf06\ud834")||'"\\udead"'!==S("\udead")}),N=M?function(t,e){var r=y(arguments),n=F(e);if(l(n)||void 0!==t&&!p(t))return r[1]=function(t,e){if(l(n)&&(e=a(n,this,w(t),e)),!p(e))return e},i(S,null,r)}:S,B=function(t,e,r){var n=j(r,e-1),o=j(r,e+1);return O(T,t)&&!O(I,o)||O(I,t)&&!O(T,n)?"\\u"+C(_(t,0),16):t},F=function(t){if(l(t))return t;if(s(t)){for(var e=t.length,r=[],n=0;n<e;n++){var o=t[n];"string"==typeof o?E(r,o):"number"!=typeof o&&"Number"!==h(o)&&"String"!==h(o)||E(r,d(o))}var i=r.length,a=!0;return function(t,e){if(a)return a=!1,e;if(s(this))return e;for(var n=0;n<i;n++)if(r[n]===t)return e}}};S&&n({target:"JSON",stat:!0,arity:3,forced:M||D||!m},{stringify:function(t,e,r){var n=F(e),o=[],i=N(t,function(t,e){var r=l(n)?a(n,this,w(t),e):e;return!m&&f(r)?A+(E(o,r.rawJSON)-1):r},r);if("string"!=typeof i)return i;if(D&&(i=x(i,k,B)),m)return i;for(var c="",u=i.length,s=0;s<u;s++){var p=j(i,s);if('"'===p){var h=v(i,++s).end-1,d=P(i,s,h);c+=P(d,0,R)===A?o[P(d,R)]:'"'+d+'"',s=h}else c+=p}return c}})},3138:t=>{t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}},3167:(t,e,r)=>{var n=r(4901),o=r(34),i=r(2967);t.exports=function(t,e,r){var a,c;return i&&n(a=e.constructor)&&a!==r&&o(c=a.prototype)&&c!==r.prototype&&i(t,c),t}},3179:(t,e,r)=>{var n=r(2140),o=r(6955);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},3362:(t,e,r)=>{r(436),r(6499),r(2003),r(7743),r(1481),r(280)},3389:(t,e,r)=>{var n=r(4576),o=r(3724),i=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!o)return n[t];var e=i(n,t);return e&&e.value}},3392:(t,e,r)=>{var n=r(9504),o=0,i=Math.random(),a=n(1.1.toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},3418:(t,e,r)=>{var n=r(6518),o=r(7916);n({target:"Array",stat:!0,forced:!r(4428)(function(t){Array.from(t)})},{from:o})},3438:(t,e,r)=>{var n=r(8551),o=r(34),i=r(6043);t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var r=i.f(t);return(0,r.resolve)(e),r.promise}},3451:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(421),a=r(34),c=r(9297),u=r(4913).f,s=r(8480),l=r(298),f=r(4124),p=r(3392),h=r(2744),d=!1,y=p("meta"),v=0,g=function(t){u(t,y,{value:{objectID:"O"+v++,weakData:{}}})},b=t.exports={enable:function(){b.enable=function(){},d=!0;var t=s.f,e=o([].splice),r={};r[y]=1,t(r).length&&(s.f=function(r){for(var n=t(r),o=0,i=n.length;o<i;o++)if(n[o]===y){e(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!c(t,y)){if(!f(t))return"F";if(!e)return"E";g(t)}return t[y].objectID},getWeakData:function(t,e){if(!c(t,y)){if(!f(t))return!0;if(!e)return!1;g(t)}return t[y].weakData},onFreeze:function(t){return h&&d&&f(t)&&!c(t,y)&&g(t),t}};i[y]=!0},3500:(t,e,r)=>{var n=r(4576),o=r(7400),i=r(9296),a=r(235),c=r(6699),u=function(t){if(t&&t.forEach!==a)try{c(t,"forEach",a)}catch(e){t.forEach=a}};for(var s in o)o[s]&&u(n[s]&&n[s].prototype);u(i)},3506:(t,e,r)=>{var n=r(3925),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i("Can't set "+o(t)+" as a prototype")}},3517:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(4901),a=r(6955),c=r(7751),u=r(3706),s=function(){},l=c("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=n(f.exec),h=!f.test(s),d=function(t){if(!i(t))return!1;try{return l(s,[],t),!0}catch(t){return!1}},y=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(f,u(t))}catch(t){return!0}};y.sham=!0,t.exports=!l||o(function(){var t;return d(d.call)||!d(Object)||!d(function(){t=!0})||t})?y:d},3579:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(2652),a=r(9306),c=r(8551),u=r(1767),s=r(9539),l=r(4549)("some",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(t){c(this);try{a(t)}catch(t){s(this,"throw",t)}if(l)return o(l,this,t);var e=u(this),r=0;return i(e,function(e,n){if(t(e,r++))return n()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3635:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp;t.exports=n(function(){var t=o(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})},3640:(t,e,r)=>{var n=r(8551),o=r(4270),i=TypeError;t.exports=function(t){if(n(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new i("Incorrect hint");return o(this,t)}},3706:(t,e,r)=>{var n=r(9504),o=r(4901),i=r(7629),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},3717:(t,e)=>{e.f=Object.getOwnPropertySymbols},3724:(t,e,r)=>{var n=r(9039);t.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3772:(t,e,r)=>{r(5746)},3792:(t,e,r)=>{var n=r(5397),o=r(6469),i=r(6269),a=r(1181),c=r(4913).f,u=r(1088),s=r(2529),l=r(6395),f=r(3724),p="Array Iterator",h=a.set,d=a.getterFor(p);t.exports=u(Array,"Array",function(t,e){h(this,{type:p,target:n(t),index:0,kind:e})},function(){var t=d(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=null,s(void 0,!0);switch(t.kind){case"keys":return s(r,!1);case"values":return s(e[r],!1)}return s([r,e[r]],!1)},"values");var y=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&f&&"values"!==y.name)try{c(y,"name",{value:"values"})}catch(t){}},3802:(t,e,r)=>{var n=r(9504),o=r(7750),i=r(655),a=r(7452),c=n("".replace),u=RegExp("^["+a+"]+"),s=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(t){return function(e){var r=i(o(e));return 1&t&&(r=c(r,u,"")),2&t&&(r=c(r,s,"$1")),r}};t.exports={start:l(1),end:l(2),trim:l(3)}},3851:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(5397),a=r(7347).f,c=r(3724);n({target:"Object",stat:!0,forced:!c||o(function(){a(1)}),sham:!c},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},3925:(t,e,r)=>{var n=r(34);t.exports=function(t){return n(t)||null===t}},3949:(t,e,r)=>{r(7588)},3994:(t,e,r)=>{var n=r(7657).IteratorPrototype,o=r(2360),i=r(6980),a=r(687),c=r(6269),u=function(){return this};t.exports=function(t,e,r,s){var l=e+" Iterator";return t.prototype=o(n,{next:i(+!s,r)}),a(t,l,!1,!0),c[l]=u,t}},4006:(t,e,r)=>{var n=r(9504),o=r(6279),i=r(3451).getWeakData,a=r(679),c=r(8551),u=r(4117),s=r(34),l=r(2652),f=r(9213),p=r(9297),h=r(1181),d=h.set,y=h.getterFor,v=f.find,g=f.findIndex,b=n([].splice),m=0,w=function(t){return t.frozen||(t.frozen=new S)},S=function(){this.entries=[]},O=function(t,e){return v(t.entries,function(t){return t[0]===e})};S.prototype={get:function(t){var e=O(this,t);if(e)return e[1]},has:function(t){return!!O(this,t)},set:function(t,e){var r=O(this,t);r?r[1]=e:this.entries.push([t,e])},delete:function(t){var e=g(this.entries,function(e){return e[0]===t});return~e&&b(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,r,n){var f=t(function(t,o){a(t,h),d(t,{type:e,id:m++,frozen:null}),u(o)||l(o,t[n],{that:t,AS_ENTRIES:r})}),h=f.prototype,v=y(e),g=function(t,e,r){var n=v(t),o=i(c(e),!0);return!0===o?w(n).set(e,r):o[n.id]=r,t};return o(h,{delete:function(t){var e=v(this);if(!s(t))return!1;var r=i(t);return!0===r?w(e).delete(t):r&&p(r,e.id)&&delete r[e.id]},has:function(t){var e=v(this);if(!s(t))return!1;var r=i(t);return!0===r?w(e).has(t):r&&p(r,e.id)}}),o(h,r?{get:function(t){var e=v(this);if(s(t)){var r=i(t);if(!0===r)return w(e).get(t);if(r)return r[e.id]}},set:function(t,e){return g(this,t,e)}}:{add:function(t){return g(this,t,!0)}}),f}}},4055:(t,e,r)=>{var n=r(4576),o=r(34),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},4114:(t,e,r)=>{var n=r(6518),o=r(8981),i=r(6198),a=r(4527),c=r(6837);n({target:"Array",proto:!0,arity:1,forced:r(9039)(function(){return 4294967297!==[].push.call({length:4294967296},1)})||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}}()},{push:function(t){var e=o(this),r=i(e),n=arguments.length;c(r+n);for(var u=0;u<n;u++)e[r]=arguments[u],r++;return a(e,r),r}})},4117:t=>{t.exports=function(t){return null==t}},4124:(t,e,r)=>{var n=r(9039),o=r(34),i=r(2195),a=r(5652),c=Object.isExtensible,u=n(function(){c(1)});t.exports=u||a?function(t){return!!o(t)&&(!a||"ArrayBuffer"!==i(t))&&(!c||c(t))}:c},4209:(t,e,r)=>{var n=r(8227),o=r(6269),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},4213:(t,e,r)=>{var n=r(3724),o=r(9504),i=r(9565),a=r(9039),c=r(1072),u=r(3717),s=r(8773),l=r(8981),f=r(7055),p=Object.assign,h=Object.defineProperty,d=o([].concat);t.exports=!p||a(function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return t[r]=7,o.split("").forEach(function(t){e[t]=t}),7!==p({},t)[r]||c(p({},e)).join("")!==o})?function(t,e){for(var r=l(t),o=arguments.length,a=1,p=u.f,h=s.f;o>a;)for(var y,v=f(arguments[a++]),g=p?d(c(v),p(v)):c(v),b=g.length,m=0;b>m;)y=g[m++],n&&!i(h,v,y)||(r[y]=v[y]);return r}:p},4215:(t,e,r)=>{var n=r(4576),o=r(2839),i=r(2195),a=function(t){return o.slice(0,t.length)===t};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},4265:(t,e,r)=>{var n=r(2839);t.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},4270:(t,e,r)=>{var n=r(9565),o=r(4901),i=r(34),a=TypeError;t.exports=function(t,e){var r,c;if("string"===e&&o(r=t.toString)&&!i(c=n(r,t)))return c;if(o(r=t.valueOf)&&!i(c=n(r,t)))return c;if("string"!==e&&o(r=t.toString)&&!i(c=n(r,t)))return c;throw new a("Can't convert object to primitive value")}},4376:(t,e,r)=>{var n=r(2195);t.exports=Array.isArray||function(t){return"Array"===n(t)}},4423:(t,e,r)=>{var n=r(6518),o=r(9617).includes,i=r(9039),a=r(6469);n({target:"Array",proto:!0,forced:i(function(){return!Array(1).includes()})},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},4428:(t,e,r)=>{var n=r(8227)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){try{if(!e&&!o)return!1}catch(t){return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},t(i)}catch(t){}return r}},4495:(t,e,r)=>{var n=r(9519),o=r(9039),i=r(4576).String;t.exports=!!Object.getOwnPropertySymbols&&!o(function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41})},4520:(t,e,r)=>{r(2489)},4527:(t,e,r)=>{var n=r(3724),o=r(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,c=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=c?function(t,e){if(o(t)&&!a(t,"length").writable)throw new i("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},4549:(t,e,r)=>{var n=r(4576);t.exports=function(t,e){var r=n.Iterator,o=r&&r.prototype,i=o&&o[t],a=!1;if(i)try{i.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(t){t instanceof e||(a=!1)}if(!a)return i}},4576:function(t,e,r){var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:(t,e,r)=>{var n=r(9039);t.exports=function(t,e){var r=[][t];return!!r&&n(function(){r.call(null,e||function(){return 1},1)})}},4601:(t,e,r)=>{var n=r(7751),o=r(9297),i=r(6699),a=r(1625),c=r(2967),u=r(7740),s=r(1056),l=r(3167),f=r(2603),p=r(7584),h=r(747),d=r(3724),y=r(6395);t.exports=function(t,e,r,v){var g="stackTraceLimit",b=v?2:1,m=t.split("."),w=m[m.length-1],S=n.apply(null,m);if(S){var O=S.prototype;if(!y&&o(O,"cause")&&delete O.cause,!r)return S;var j=n("Error"),_=e(function(t,e){var r=f(v?e:t,void 0),n=v?new S(t):new S;return void 0!==r&&i(n,"message",r),h(n,_,n.stack,2),this&&a(O,this)&&l(n,this,_),arguments.length>b&&p(n,arguments[b]),n});if(_.prototype=O,"Error"!==w?c?c(_,j):u(_,j,{name:!0}):d&&g in S&&(s(_,S,g),s(_,S,"prepareStackTrace")),u(_,S),!y)try{O.name!==w&&i(O,"name",w),O.constructor=_}catch(t){}return _}}},4659:(t,e,r)=>{var n=r(9039),o=r(6980);t.exports=!n(function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)})},4782:(t,e,r)=>{var n=r(6518),o=r(4376),i=r(3517),a=r(34),c=r(5610),u=r(6198),s=r(5397),l=r(2278),f=r(8227),p=r(597),h=r(7680),d=p("slice"),y=f("species"),v=Array,g=Math.max;n({target:"Array",proto:!0,forced:!d},{slice:function(t,e){var r,n,f,p=s(this),d=u(p),b=c(t,d),m=c(void 0===e?d:e,d);if(o(p)&&(r=p.constructor,(i(r)&&(r===v||o(r.prototype))||a(r)&&null===(r=r[y]))&&(r=void 0),r===v||void 0===r))return h(p,b,m);for(n=new(void 0===r?v:r)(g(m-b,0)),f=0;b<m;b++,f++)b in p&&l(n,f,p[b]);return n.length=f,n}})},4901:t=>{var e="object"==typeof document&&document.all;t.exports=void 0===e&&void 0!==e?function(t){return"function"==typeof t||t===e}:function(t){return"function"==typeof t}},4913:(t,e,r)=>{var n=r(3724),o=r(5917),i=r(8686),a=r(8551),c=r(6969),u=TypeError,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",h="writable";e.f=n?i?function(t,e,r){if(a(t),e=c(e),a(r),"function"==typeof t&&"prototype"===e&&"value"in r&&h in r&&!r[h]){var n=l(t,e);n&&n[h]&&(t[e]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:f in r?r[f]:n[f],writable:!1})}return s(t,e,r)}:s:function(t,e,r){if(a(t),e=c(e),a(r),o)try{return s(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},5031:(t,e,r)=>{var n=r(7751),o=r(9504),i=r(8480),a=r(3717),c=r(8551),u=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(c(t)),r=a.f;return r?u(e,r(t)):e}},5213:(t,e,r)=>{var n=r(4576),o=r(9039),i=n.RegExp,a=!o(function(){var t=!0;try{i(".","d")}catch(e){t=!1}var e={},r="",n=t?"dgimsy":"gimsy",o=function(t,n){Object.defineProperty(e,t,{get:function(){return r+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var c in t&&(a.hasIndices="d"),a)o(c,a[c]);return Object.getOwnPropertyDescriptor(i.prototype,"flags").get.call(e)!==n||r!==n});t.exports={correct:a}},5397:(t,e,r)=>{var n=r(7055),o=r(7750);t.exports=function(t){return n(o(t))}},5440:(t,e,r)=>{var n=r(8745),o=r(9565),i=r(9504),a=r(9228),c=r(9039),u=r(8551),s=r(4901),l=r(34),f=r(1291),p=r(8014),h=r(655),d=r(7750),y=r(7829),v=r(5966),g=r(2478),b=r(1034),m=r(6682),w=r(8227)("replace"),S=Math.max,O=Math.min,j=i([].concat),_=i([].push),x=i("".indexOf),P=i("".slice),E=function(t){return void 0===t?t:String(t)},C="$0"==="a".replace(/./,"$0"),k=!!/./[w]&&""===/./[w]("a","$0");a("replace",function(t,e,r){var i=k?"$":"$0";return[function(t,r){var n=d(this),i=l(t)?v(t,w):void 0;return i?o(i,t,n,r):o(e,h(n),t,r)},function(t,o){var a=u(this),c=h(t);if("string"==typeof o&&-1===x(o,i)&&-1===x(o,"$<")){var l=r(e,a,c,o);if(l.done)return l.value}var d=s(o);d||(o=h(o));var v,w=h(b(a)),C=-1!==x(w,"g");C&&(v=-1!==x(w,"u"),a.lastIndex=0);for(var k,T=[];null!==(k=m(a,c))&&(_(T,k),C);)""===h(k[0])&&(a.lastIndex=y(c,p(a.lastIndex),v));for(var I="",A=0,R=0;R<T.length;R++){for(var M,D=h((k=T[R])[0]),N=S(O(f(k.index),c.length),0),B=[],F=1;F<k.length;F++)_(B,E(k[F]));var G=k.groups;if(d){var L=j([D],B,N,c);void 0!==G&&_(L,G),M=h(n(o,void 0,L))}else M=g(D,c,N,B,G,o);N>=A&&(I+=P(c,A,N)+M,A=N+D.length)}return I+P(c,A)}]},!!c(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})||!C||k)},5472:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(687);n({global:!0},{Reflect:{}}),i(o.Reflect,"Reflect",!0)},5548:(t,e,r)=>{var n=r(3517),o=r(6823),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a constructor")}},5610:(t,e,r)=>{var n=r(1291),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},5652:(t,e,r)=>{var n=r(9039);t.exports=n(function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})},5700:(t,e,r)=>{var n=r(511),o=r(8242);n("toPrimitive"),o()},5745:(t,e,r)=>{var n=r(7629);t.exports=function(t,e){return n[t]||(n[t]=e||{})}},5746:(t,e,r)=>{var n,o=r(2744),i=r(4576),a=r(9504),c=r(6279),u=r(3451),s=r(6468),l=r(4006),f=r(34),p=r(1181).enforce,h=r(9039),d=r(8622),y=Object,v=Array.isArray,g=y.isExtensible,b=y.isFrozen,m=y.isSealed,w=y.freeze,S=y.seal,O=!i.ActiveXObject&&"ActiveXObject"in i,j=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},_=s("WeakMap",j,l),x=_.prototype,P=a(x.set);if(d)if(O){n=l.getConstructor(j,"WeakMap",!0),u.enable();var E=a(x.delete),C=a(x.has),k=a(x.get);c(x,{delete:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),E(this,t)||e.frozen.delete(t)}return E(this,t)},has:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),C(this,t)||e.frozen.has(t)}return C(this,t)},get:function(t){if(f(t)&&!g(t)){var e=p(this);return e.frozen||(e.frozen=new n),C(this,t)?k(this,t):e.frozen.get(t)}return k(this,t)},set:function(t,e){if(f(t)&&!g(t)){var r=p(this);r.frozen||(r.frozen=new n),C(this,t)?P(this,t,e):r.frozen.set(t,e)}else P(this,t,e);return this}})}else o&&h(function(){var t=w([]);return P(new _,t,1),!b(t)})&&c(x,{set:function(t,e){var r;return v(t)&&(b(t)?r=w:m(t)&&(r=S)),P(this,t,e),r&&r(t),this}})},5810:(t,e,r)=>{var n=r(34),o=r(1181).get;t.exports=function(t){if(!n(t))return!1;var e=o(t);return!!e&&"RawJSON"===e.type}},5917:(t,e,r)=>{var n=r(3724),o=r(9039),i=r(4055);t.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},5966:(t,e,r)=>{var n=r(9306),o=r(4117);t.exports=function(t,e){var r=t[e];return o(r)?void 0:n(r)}},6043:(t,e,r)=>{var n=r(9306),o=TypeError,i=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw new o("Bad Promise constructor");e=t,r=n}),this.resolve=n(e),this.reject=n(r)};t.exports.f=function(t){return new i(t)}},6080:(t,e,r)=>{var n=r(7476),o=r(9306),i=r(616),a=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?a(t,e):function(){return t.apply(e,arguments)}}},6099:(t,e,r)=>{var n=r(2140),o=r(6840),i=r(3179);n||o(Object.prototype,"toString",i,{unsafe:!0})},6119:(t,e,r)=>{var n=r(5745),o=r(3392),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},6193:(t,e,r)=>{var n=r(9504),o=Error,i=n("".replace),a=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(a);t.exports=function(t,e){if(u&&"string"==typeof t&&!o.prepareStackTrace)for(;e--;)t=i(t,c,"");return t}},6198:(t,e,r)=>{var n=r(8014);t.exports=function(t){return n(t.length)}},6269:t=>{t.exports={}},6279:(t,e,r)=>{var n=r(6840);t.exports=function(t,e,r){for(var o in e)n(t,o,e[o],r);return t}},6280:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(8745),a=r(4601),c="WebAssembly",u=o[c],s=7!==new Error("e",{cause:7}).cause,l=function(t,e){var r={};r[t]=a(t,e,s),n({global:!0,constructor:!0,arity:1,forced:s},r)},f=function(t,e){if(u&&u[t]){var r={};r[t]=a(c+"."+t,e,s),n({target:c,stat:!0,constructor:!0,arity:1,forced:s},r)}};l("Error",function(t){return function(e){return i(t,this,arguments)}}),l("EvalError",function(t){return function(e){return i(t,this,arguments)}}),l("RangeError",function(t){return function(e){return i(t,this,arguments)}}),l("ReferenceError",function(t){return function(e){return i(t,this,arguments)}}),l("SyntaxError",function(t){return function(e){return i(t,this,arguments)}}),l("TypeError",function(t){return function(e){return i(t,this,arguments)}}),l("URIError",function(t){return function(e){return i(t,this,arguments)}}),f("CompileError",function(t){return function(e){return i(t,this,arguments)}}),f("LinkError",function(t){return function(e){return i(t,this,arguments)}}),f("RuntimeError",function(t){return function(e){return i(t,this,arguments)}})},6319:(t,e,r)=>{var n=r(8551),o=r(9539);t.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){o(t,"throw",e)}}},6395:t=>{t.exports=!1},6468:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(9504),a=r(2796),c=r(6840),u=r(3451),s=r(2652),l=r(679),f=r(4901),p=r(4117),h=r(34),d=r(9039),y=r(4428),v=r(687),g=r(3167);t.exports=function(t,e,r){var b=-1!==t.indexOf("Map"),m=-1!==t.indexOf("Weak"),w=b?"set":"add",S=o[t],O=S&&S.prototype,j=S,_={},x=function(t){var e=i(O[t]);c(O,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(m&&!h(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return m&&!h(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(m&&!h(t))&&e(this,0===t?0:t)}:function(t,r){return e(this,0===t?0:t,r),this})};if(a(t,!f(S)||!(m||O.forEach&&!d(function(){(new S).entries().next()}))))j=r.getConstructor(e,t,b,w),u.enable();else if(a(t,!0)){var P=new j,E=P[w](m?{}:-0,1)!==P,C=d(function(){P.has(1)}),k=y(function(t){new S(t)}),T=!m&&d(function(){for(var t=new S,e=5;e--;)t[w](e,e);return!t.has(-0)});k||((j=e(function(t,e){l(t,O);var r=g(new S,t,j);return p(e)||s(e,r[w],{that:r,AS_ENTRIES:b}),r})).prototype=O,O.constructor=j),(C||T)&&(x("delete"),x("has"),b&&x("get")),(T||E)&&x(w),m&&O.clear&&delete O.clear}return _[t]=j,n({global:!0,constructor:!0,forced:j!==S},_),v(j,t),m||r.setStrong(j,t,b),j}},6469:(t,e,r)=>{var n=r(8227),o=r(2360),i=r(4913).f,a=n("unscopables"),c=Array.prototype;void 0===c[a]&&i(c,a,{configurable:!0,value:o(null)}),t.exports=function(t){c[a][t]=!0}},6499:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(6043),c=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(t){var e=this,r=a.f(e),n=r.resolve,s=r.reject,l=c(function(){var r=i(e.resolve),a=[],c=0,l=1;u(t,function(t){var i=c++,u=!1;l++,o(r,e,t).then(function(t){u||(u=!0,a[i]=t,--l||n(a))},s)}),--l||n(a)});return l.error&&s(l.value),r.promise}})},6518:(t,e,r)=>{var n=r(4576),o=r(7347).f,i=r(6699),a=r(6840),c=r(9433),u=r(7740),s=r(2796);t.exports=function(t,e){var r,l,f,p,h,d=t.target,y=t.global,v=t.stat;if(r=y?n:v?n[d]||c(d,{}):n[d]&&n[d].prototype)for(l in e){if(p=e[l],f=t.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!s(y?l:d+(v?".":"#")+l,t.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(t.sham||f&&f.sham)&&i(p,"sham",!0),a(r,l,p,t)}}},6575:(t,e,r)=>{var n=r(9297);t.exports=function(t){return void 0!==t&&(n(t,"value")||n(t,"writable"))}},6682:(t,e,r)=>{var n=r(9565),o=r(8551),i=r(4901),a=r(2195),c=r(7323),u=TypeError;t.exports=function(t,e){var r=t.exec;if(i(r)){var s=n(r,t,e);return null!==s&&o(s),s}if("RegExp"===a(t))return n(c,t,e);throw new u("RegExp#exec called on incompatible receiver")}},6699:(t,e,r)=>{var n=r(3724),o=r(4913),i=r(6980);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},6706:(t,e,r)=>{var n=r(9504),o=r(9306);t.exports=function(t,e,r){try{return n(o(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(t){}}},6761:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(9565),a=r(9504),c=r(6395),u=r(3724),s=r(4495),l=r(9039),f=r(9297),p=r(1625),h=r(8551),d=r(5397),y=r(6969),v=r(655),g=r(6980),b=r(2360),m=r(1072),w=r(8480),S=r(298),O=r(3717),j=r(7347),_=r(4913),x=r(6801),P=r(8773),E=r(6840),C=r(2106),k=r(5745),T=r(6119),I=r(421),A=r(3392),R=r(8227),M=r(1951),D=r(511),N=r(8242),B=r(687),F=r(1181),G=r(9213).forEach,L=T("hidden"),H="Symbol",q="prototype",U=F.set,W=F.getterFor(H),$=Object[q],z=o.Symbol,V=z&&z[q],Q=o.RangeError,J=o.TypeError,K=o.QObject,Y=j.f,X=_.f,Z=S.f,tt=P.f,et=a([].push),rt=k("symbols"),nt=k("op-symbols"),ot=k("wks"),it=!K||!K[q]||!K[q].findChild,at=function(t,e,r){var n=Y($,e);n&&delete $[e],X(t,e,r),n&&t!==$&&X($,e,n)},ct=u&&l(function(){return 7!==b(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a})?at:X,ut=function(t,e){var r=rt[t]=b(V);return U(r,{type:H,tag:t,description:e}),u||(r.description=e),r},st=function(t,e,r){t===$&&st(nt,e,r),h(t);var n=y(e);return h(r),f(rt,n)?(r.enumerable?(f(t,L)&&t[L][n]&&(t[L][n]=!1),r=b(r,{enumerable:g(0,!1)})):(f(t,L)||X(t,L,g(1,b(null))),t[L][n]=!0),ct(t,n,r)):X(t,n,r)},lt=function(t,e){h(t);var r=d(e),n=m(r).concat(dt(r));return G(n,function(e){u&&!i(ft,r,e)||st(t,e,r[e])}),t},ft=function(t){var e=y(t),r=i(tt,this,e);return!(this===$&&f(rt,e)&&!f(nt,e))&&(!(r||!f(this,e)||!f(rt,e)||f(this,L)&&this[L][e])||r)},pt=function(t,e){var r=d(t),n=y(e);if(r!==$||!f(rt,n)||f(nt,n)){var o=Y(r,n);return!o||!f(rt,n)||f(r,L)&&r[L][n]||(o.enumerable=!0),o}},ht=function(t){var e=Z(d(t)),r=[];return G(e,function(t){f(rt,t)||f(I,t)||et(r,t)}),r},dt=function(t){var e=t===$,r=Z(e?nt:d(t)),n=[];return G(r,function(t){!f(rt,t)||e&&!f($,t)||et(n,rt[t])}),n};s||(E(V=(z=function(){if(p(V,this))throw new J("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,e=A(t),r=function(t){var n=void 0===this?o:this;n===$&&i(r,nt,t),f(n,L)&&f(n[L],e)&&(n[L][e]=!1);var a=g(1,t);try{ct(n,e,a)}catch(t){if(!(t instanceof Q))throw t;at(n,e,a)}};return u&&it&&ct($,e,{configurable:!0,set:r}),ut(e,t)})[q],"toString",function(){return W(this).tag}),E(z,"withoutSetter",function(t){return ut(A(t),t)}),P.f=ft,_.f=st,x.f=lt,j.f=pt,w.f=S.f=ht,O.f=dt,M.f=function(t){return ut(R(t),t)},u&&(C(V,"description",{configurable:!0,get:function(){return W(this).description}}),c||E($,"propertyIsEnumerable",ft,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!s,sham:!s},{Symbol:z}),G(m(ot),function(t){D(t)}),n({target:H,stat:!0,forced:!s},{useSetter:function(){it=!0},useSimple:function(){it=!1}}),n({target:"Object",stat:!0,forced:!s,sham:!u},{create:function(t,e){return void 0===e?b(t):lt(b(t),e)},defineProperty:st,defineProperties:lt,getOwnPropertyDescriptor:pt}),n({target:"Object",stat:!0,forced:!s},{getOwnPropertyNames:ht}),N(),B(z,H),I[L]=!0},6801:(t,e,r)=>{var n=r(3724),o=r(8686),i=r(4913),a=r(8551),c=r(5397),u=r(1072);e.f=n&&!o?Object.defineProperties:function(t,e){a(t);for(var r,n=c(e),o=u(e),s=o.length,l=0;s>l;)i.f(t,r=o[l++],n[r]);return t}},6823:t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},6837:t=>{var e=TypeError;t.exports=function(t){if(t>9007199254740991)throw e("Maximum allowed index exceeded");return t}},6840:(t,e,r)=>{var n=r(4901),o=r(4913),i=r(283),a=r(9433);t.exports=function(t,e,r,c){c||(c={});var u=c.enumerable,s=void 0!==c.name?c.name:e;if(n(r)&&i(r,s,c),c.global)u?t[e]=r:a(e,r);else{try{c.unsafe?t[e]&&(u=!0):delete t[e]}catch(t){}u?t[e]=r:o.f(t,e,{value:r,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return t}},6955:(t,e,r)=>{var n=r(2140),o=r(4901),i=r(2195),a=r(8227)("toStringTag"),c=Object,u="Arguments"===i(function(){return arguments}());t.exports=n?i:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=c(t),a))?r:u?i(e):"Object"===(n=i(e))&&o(e.callee)?"Arguments":n}},6969:(t,e,r)=>{var n=r(2777),o=r(757);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},6980:t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},7040:(t,e,r)=>{var n=r(4495);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(t,e,r)=>{var n=r(9504),o=r(9039),i=r(2195),a=Object,c=n("".split);t.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(t){return"String"===i(t)?c(t,""):a(t)}:a},7323:(t,e,r)=>{var n,o,i=r(9565),a=r(9504),c=r(655),u=r(7979),s=r(8429),l=r(5745),f=r(2360),p=r(1181).get,h=r(3635),d=r(8814),y=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,b=a("".charAt),m=a("".indexOf),w=a("".replace),S=a("".slice),O=(o=/b*/g,i(v,n=/a/,"a"),i(v,o,"a"),0!==n.lastIndex||0!==o.lastIndex),j=s.BROKEN_CARET,_=void 0!==/()??/.exec("")[1];(O||_||j||h||d)&&(g=function(t){var e,r,n,o,a,s,l,h=this,d=p(h),x=c(t),P=d.raw;if(P)return P.lastIndex=h.lastIndex,e=i(g,P,x),h.lastIndex=P.lastIndex,e;var E=d.groups,C=j&&h.sticky,k=i(u,h),T=h.source,I=0,A=x;if(C&&(k=w(k,"y",""),-1===m(k,"g")&&(k+="g"),A=S(x,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==b(x,h.lastIndex-1))&&(T="(?: "+T+")",A=" "+A,I++),r=new RegExp("^(?:"+T+")",k)),_&&(r=new RegExp("^"+T+"$(?!\\s)",k)),O&&(n=h.lastIndex),o=i(v,C?r:h,A),C?o?(o.input=S(o.input,I),o[0]=S(o[0],I),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:O&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),_&&o&&o.length>1&&i(y,o[0],r,function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)}),o&&E)for(o.groups=s=f(null),a=0;a<E.length;a++)s[(l=E[a])[0]]=o[l[1]];return o}),t.exports=g},7347:(t,e,r)=>{var n=r(3724),o=r(9565),i=r(8773),a=r(6980),c=r(5397),u=r(6969),s=r(9297),l=r(5917),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=c(t),e=u(e),l)try{return f(t,e)}catch(t){}if(s(t,e))return a(!o(i.f,t,e),t[e])}},7400:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7433:(t,e,r)=>{var n=r(4376),o=r(3517),i=r(34),a=r(8227)("species"),c=Array;t.exports=function(t){var e;return n(t)&&(e=t.constructor,(o(e)&&(e===c||n(e.prototype))||i(e)&&null===(e=e[a]))&&(e=void 0)),void 0===e?c:e}},7452:t=>{t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},7476:(t,e,r)=>{var n=r(2195),o=r(9504);t.exports=function(t){if("Function"===n(t))return o(t)}},7495:(t,e,r)=>{var n=r(6518),o=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},7550:(t,e,r)=>{r(3579)},7584:(t,e,r)=>{var n=r(34),o=r(6699);t.exports=function(t,e){n(e)&&"cause"in e&&o(t,"cause",e.cause)}},7588:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(2652),a=r(9306),c=r(8551),u=r(1767),s=r(9539),l=r(4549)("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(t){c(this);try{a(t)}catch(t){s(this,"throw",t)}if(l)return o(l,this,t);var e=u(this),r=0;i(e,function(e){t(e,r++)},{IS_RECORD:!0})}})},7629:(t,e,r)=>{var n=r(6395),o=r(4576),i=r(9433),a="__core-js_shared__",c=t.exports=o[a]||i(a,{});(c.versions||(c.versions=[])).push({version:"3.47.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7633:(t,e,r)=>{var n=r(7751),o=r(2106),i=r(8227),a=r(3724),c=i("species");t.exports=function(t){var e=n(t);a&&e&&!e[c]&&o(e,c,{configurable:!0,get:function(){return this}})}},7657:(t,e,r)=>{var n,o,i,a=r(9039),c=r(4901),u=r(34),s=r(2360),l=r(2787),f=r(6840),p=r(8227),h=r(6395),d=p("iterator"),y=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):y=!0),!u(n)||a(function(){var t={};return n[d].call(t)!==t})?n={}:h&&(n=s(n)),c(n[d])||f(n,d,function(){return this}),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},7680:(t,e,r)=>{var n=r(9504);t.exports=n([].slice)},7740:(t,e,r)=>{var n=r(9297),o=r(5031),i=r(7347),a=r(4913);t.exports=function(t,e,r){for(var c=o(e),u=a.f,s=i.f,l=0;l<c.length;l++){var f=c[l];n(t,f)||r&&n(r,f)||u(t,f,s(e,f))}}},7743:(t,e,r)=>{var n=r(6518),o=r(9565),i=r(9306),a=r(6043),c=r(1103),u=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(t){var e=this,r=a.f(e),n=r.reject,s=c(function(){var a=i(e.resolve);u(t,function(t){o(a,e,t).then(r.resolve,n)})});return s.error&&n(s.value),r.promise}})},7750:(t,e,r)=>{var n=r(4117),o=TypeError;t.exports=function(t){if(n(t))throw new o("Can't call method on "+t);return t}},7751:(t,e,r)=>{var n=r(4576),o=r(4901);t.exports=function(t,e){return arguments.length<2?(r=n[t],o(r)?r:void 0):n[t]&&n[t][e];var r}},7764:(t,e,r)=>{var n=r(8183).charAt,o=r(655),i=r(1181),a=r(1088),c=r(2529),u="String Iterator",s=i.set,l=i.getterFor(u);a(String,"String",function(t){s(this,{type:u,string:o(t),index:0})},function(){var t,e=l(this),r=e.string,o=e.index;return o>=r.length?c(void 0,!0):(t=n(r,o),e.index+=t.length,c(t,!1))})},7812:(t,e,r)=>{var n=r(6518),o=r(9297),i=r(757),a=r(6823),c=r(5745),u=r(1296),s=c("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!u},{keyFor:function(t){if(!i(t))throw new TypeError(a(t)+" is not a symbol");if(o(s,t))return s[t]}})},7819:(t,e,r)=>{var n=r(9039);t.exports=!n(function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t})},7829:(t,e,r)=>{var n=r(8183).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},7860:(t,e,r)=>{var n=r(2839);t.exports=/web0s(?!.*chrome)/i.test(n)},7916:(t,e,r)=>{var n=r(6080),o=r(9565),i=r(8981),a=r(6319),c=r(4209),u=r(3517),s=r(6198),l=r(2278),f=r(81),p=r(851),h=Array;t.exports=function(t){var e=i(t),r=u(this),d=arguments.length,y=d>1?arguments[1]:void 0,v=void 0!==y;v&&(y=n(y,d>2?arguments[2]:void 0));var g,b,m,w,S,O,j=p(e),_=0;if(!j||this===h&&c(j))for(g=s(e),b=r?new this(g):h(g);g>_;_++)O=v?y(e[_],_):e[_],l(b,_,O);else for(b=r?new this:[],S=(w=f(e,j)).next;!(m=o(S,w)).done;_++)O=v?a(w,y,[m.value,_],!0):m.value,l(b,_,O);return b.length=_,b}},7979:(t,e,r)=>{var n=r(8551);t.exports=function(){var t=n(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},8014:(t,e,r)=>{var n=r(1291),o=Math.min;t.exports=function(t){var e=n(t);return e>0?o(e,9007199254740991):0}},8111:(t,e,r)=>{var n=r(6518),o=r(4576),i=r(679),a=r(8551),c=r(4901),u=r(2787),s=r(2106),l=r(2278),f=r(9039),p=r(9297),h=r(8227),d=r(7657).IteratorPrototype,y=r(3724),v=r(6395),g="constructor",b="Iterator",m=h("toStringTag"),w=TypeError,S=o[b],O=v||!c(S)||S.prototype!==d||!f(function(){S({})}),j=function(){if(i(this,d),u(this)===d)throw new w("Abstract class Iterator not directly constructable")},_=function(t,e){y?s(d,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===d)throw new w("You can't redefine this property");p(this,t)?this[t]=e:l(this,t,e)}}):d[t]=e};p(d,m)||_(m,b),!O&&p(d,g)&&d[g]!==Object||_(g,j),j.prototype=d,n({global:!0,constructor:!0,forced:O},{Iterator:j})},8183:(t,e,r)=>{var n=r(9504),o=r(1291),i=r(655),a=r(7750),c=n("".charAt),u=n("".charCodeAt),s=n("".slice),l=function(t){return function(e,r){var n,l,f=i(a(e)),p=o(r),h=f.length;return p<0||p>=h?t?"":void 0:(n=u(f,p))<55296||n>56319||p+1===h||(l=u(f,p+1))<56320||l>57343?t?c(f,p):n:t?s(f,p,p+2):l-56320+(n-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},8227:(t,e,r)=>{var n=r(4576),o=r(5745),i=r(9297),a=r(3392),c=r(4495),u=r(7040),s=n.Symbol,l=o("wks"),f=u?s.for||s:s&&s.withoutSetter||a;t.exports=function(t){return i(l,t)||(l[t]=c&&i(s,t)?s[t]:f("Symbol."+t)),l[t]}},8235:(t,e,r)=>{var n=r(9504),o=r(9297),i=SyntaxError,a=parseInt,c=String.fromCharCode,u=n("".charAt),s=n("".slice),l=n(/./.exec),f={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},p=/^[\da-f]{4}$/i,h=/^[\u0000-\u001F]$/;t.exports=function(t,e){for(var r=!0,n="";e<t.length;){var d=u(t,e);if("\\"===d){var y=s(t,e,e+2);if(o(f,y))n+=f[y],e+=2;else{if("\\u"!==y)throw new i('Unknown escape sequence: "'+y+'"');var v=s(t,e+=2,e+4);if(!l(p,v))throw new i("Bad Unicode escape at: "+e);n+=c(a(v,16)),e+=4}}else{if('"'===d){r=!1,e++;break}if(l(h,d))throw new i("Bad control character in string literal at: "+e);n+=d,e++}}if(r)throw new i("Unterminated string at: "+e);return{value:n,end:e}}},8242:(t,e,r)=>{var n=r(9565),o=r(7751),i=r(8227),a=r(6840);t.exports=function(){var t=o("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,c=i("toPrimitive");e&&!e[c]&&a(e,c,function(t){return n(r,this)},{arity:1})}},8265:t=>{var e=function(){this.head=null,this.tail=null};e.prototype={add:function(t){var e={item:t,next:null},r=this.tail;r?r.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=e},8429:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp,i=n(function(){var t=o("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),a=i||n(function(){return!o("a","y").sticky}),c=i||n(function(){var t=o("^r","gy");return t.lastIndex=2,null!==t.exec("str")});t.exports={BROKEN_CARET:c,MISSED_STICKY:a,UNSUPPORTED_Y:i}},8480:(t,e,r)=>{var n=r(1828),o=r(8727).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},8551:(t,e,r)=>{var n=r(34),o=String,i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not an object")}},8574:(t,e,r)=>{var n=r(4215);t.exports="NODE"===n},8622:(t,e,r)=>{var n=r(4576),o=r(4901),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},8686:(t,e,r)=>{var n=r(3724),o=r(9039);t.exports=n&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8706:(t,e,r)=>{var n=r(6518),o=r(9039),i=r(4376),a=r(34),c=r(8981),u=r(6198),s=r(6837),l=r(2278),f=r(1469),p=r(597),h=r(8227),d=r(9519),y=h("isConcatSpreadable"),v=d>=51||!o(function(){var t=[];return t[y]=!1,t.concat()[0]!==t}),g=function(t){if(!a(t))return!1;var e=t[y];return void 0!==e?!!e:i(t)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(t){var e,r,n,o,i,a=c(this),p=f(a,0),h=0;for(e=-1,n=arguments.length;e<n;e++)if(g(i=-1===e?a:arguments[e]))for(o=u(i),s(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else s(h+1),l(p,h++,i);return p.length=h,p}})},8727:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(t,e,r)=>{var n=r(616),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},8773:(t,e)=>{var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},8781:(t,e,r)=>{var n=r(350).PROPER,o=r(6840),i=r(8551),a=r(655),c=r(9039),u=r(1034),s="toString",l=RegExp.prototype,f=l[s],p=c(function(){return"/a/b"!==f.call({source:"a",flags:"b"})}),h=n&&f.name!==s;(p||h)&&o(l,s,function(){var t=i(this);return"/"+a(t.source)+"/"+a(u(t))},{unsafe:!0})},8814:(t,e,r)=>{var n=r(9039),o=r(4576).RegExp;t.exports=n(function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})},8940:(t,e,r)=>{var n=r(6518),o=r(2703);n({global:!0,forced:parseInt!==o},{parseInt:o})},8981:(t,e,r)=>{var n=r(7750),o=Object;t.exports=function(t){return o(n(t))}},8992:(t,e,r)=>{r(8111)},9039:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},9085:(t,e,r)=>{var n=r(6518),o=r(4213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},9167:(t,e,r)=>{var n=r(4576);t.exports=n},9213:(t,e,r)=>{var n=r(6080),o=r(9504),i=r(7055),a=r(8981),c=r(6198),u=r(1469),s=o([].push),l=function(t){var e=1===t,r=2===t,o=3===t,l=4===t,f=6===t,p=7===t,h=5===t||f;return function(d,y,v,g){for(var b,m,w=a(d),S=i(w),O=c(S),j=n(y,v),_=0,x=g||u,P=e?x(d,O):r||p?x(d,0):void 0;O>_;_++)if((h||_ in S)&&(m=j(b=S[_],_,w),t))if(e)P[_]=m;else if(m)switch(t){case 3:return!0;case 5:return b;case 6:return _;case 2:s(P,b)}else switch(t){case 4:return!1;case 7:s(P,b)}return f?-1:o||l?l:P}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},9225:(t,e,r)=>{var n,o,i,a,c=r(4576),u=r(8745),s=r(6080),l=r(4901),f=r(9297),p=r(9039),h=r(397),d=r(7680),y=r(4055),v=r(2812),g=r(9544),b=r(8574),m=c.setImmediate,w=c.clearImmediate,S=c.process,O=c.Dispatch,j=c.Function,_=c.MessageChannel,x=c.String,P=0,E={},C="onreadystatechange";p(function(){n=c.location});var k=function(t){if(f(E,t)){var e=E[t];delete E[t],e()}},T=function(t){return function(){k(t)}},I=function(t){k(t.data)},A=function(t){c.postMessage(x(t),n.protocol+"//"+n.host)};m&&w||(m=function(t){v(arguments.length,1);var e=l(t)?t:j(t),r=d(arguments,1);return E[++P]=function(){u(e,void 0,r)},o(P),P},w=function(t){delete E[t]},b?o=function(t){S.nextTick(T(t))}:O&&O.now?o=function(t){O.now(T(t))}:_&&!g?(a=(i=new _).port2,i.port1.onmessage=I,o=s(a.postMessage,a)):c.addEventListener&&l(c.postMessage)&&!c.importScripts&&n&&"file:"!==n.protocol&&!p(A)?(o=A,c.addEventListener("message",I,!1)):o=C in y("script")?function(t){h.appendChild(y("script"))[C]=function(){h.removeChild(this),k(t)}}:function(t){setTimeout(T(t),0)}),t.exports={set:m,clear:w}},9228:(t,e,r)=>{r(7495);var n=r(9565),o=r(6840),i=r(7323),a=r(9039),c=r(8227),u=r(6699),s=c("species"),l=RegExp.prototype;t.exports=function(t,e,r,f){var p=c(t),h=!a(function(){var e={};return e[p]=function(){return 7},7!==""[t](e)}),d=h&&!a(function(){var e=!1,r=/a/;if("split"===t){var n={};n[s]=function(){return r},(r={constructor:n,flags:""})[p]=/./[p]}return r.exec=function(){return e=!0,null},r[p](""),!e});if(!h||!d||r){var y=/./[p],v=e(p,""[t],function(t,e,r,o,a){var c=e.exec;return c===i||c===l.exec?h&&!a?{done:!0,value:n(y,e,r,o)}:{done:!0,value:n(t,r,e,o)}:{done:!1}});o(String.prototype,t,v[0]),o(l,p,v[1])}f&&u(l[p],"sham",!0)}},9296:(t,e,r)=>{var n=r(4055)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},9297:(t,e,r)=>{var n=r(9504),o=r(8981),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},9306:(t,e,r)=>{var n=r(4901),o=r(6823),i=TypeError;t.exports=function(t){if(n(t))return t;throw new i(o(t)+" is not a function")}},9432:(t,e,r)=>{var n=r(6518),o=r(8981),i=r(1072);n({target:"Object",stat:!0,forced:r(9039)(function(){i(1)})},{keys:function(t){return i(o(t))}})},9433:(t,e,r)=>{var n=r(4576),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(r){n[t]=e}return e}},9457:t=>{var e=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===r}(t)}(t)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((r=t,Array.isArray(r)?[]:{}),t,e):t;var r}function o(t,e,r){return t.concat(e).map(function(t){return n(t,r)})}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}(t))}function a(t,e){try{return e in t}catch(t){return!1}}function c(t,r,u){(u=u||{}).arrayMerge=u.arrayMerge||o,u.isMergeableObject=u.isMergeableObject||e,u.cloneUnlessOtherwiseSpecified=n;var s=Array.isArray(r);return s===Array.isArray(t)?s?u.arrayMerge(t,r,u):function(t,e,r){var o={};return r.isMergeableObject(t)&&i(t).forEach(function(e){o[e]=n(t[e],r)}),i(e).forEach(function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&r.isMergeableObject(e[i])?o[i]=function(t,e){if(!e.customMerge)return c;var r=e.customMerge(t);return"function"==typeof r?r:c}(i,r)(t[i],e[i],r):o[i]=n(e[i],r))}),o}(t,r,u):n(r,u)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,r){return c(t,r,e)},{})};var u=c;t.exports=u},9462:(t,e,r)=>{var n=r(9565),o=r(2360),i=r(6699),a=r(6279),c=r(8227),u=r(1181),s=r(5966),l=r(7657).IteratorPrototype,f=r(2529),p=r(9539),h=r(1385),d=c("toStringTag"),y="IteratorHelper",v="WrapForValidIterator",g="normal",b="throw",m=u.set,w=function(t){var e=u.getterFor(t?v:y);return a(o(l),{next:function(){var r=e(this);if(t)return r.nextHandler();if(r.done)return f(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:f(n,r.done)}catch(t){throw r.done=!0,t}},return:function(){var r=e(this),o=r.iterator;if(r.done=!0,t){var i=s(o,"return");return i?n(i,o):f(void 0,!0)}if(r.inner)try{p(r.inner.iterator,g)}catch(t){return p(o,b,t)}if(r.openIters)try{h(r.openIters,g)}catch(t){return p(o,b,t)}return o&&p(o,g),f(void 0,!0)}})},S=w(!0),O=w(!1);i(O,d,"Iterator Helper"),t.exports=function(t,e,r){var n=function(n,o){o?(o.iterator=n.iterator,o.next=n.next):o=n,o.type=e?v:y,o.returnHandlerResult=!!r,o.nextHandler=t,o.counter=0,o.done=!1,m(this,o)};return n.prototype=e?S:O,n}},9463:(t,e,r)=>{var n=r(6518),o=r(3724),i=r(4576),a=r(9504),c=r(9297),u=r(4901),s=r(1625),l=r(655),f=r(2106),p=r(7740),h=i.Symbol,d=h&&h.prototype;if(o&&u(h)&&(!("description"in d)||void 0!==h().description)){var y={},v=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),e=s(d,this)?new h(t):void 0===t?h():h(t);return""===t&&(y[e]=!0),e};p(v,h),v.prototype=d,d.constructor=v;var g="Symbol(description detection)"===String(h("description detection")),b=a(d.valueOf),m=a(d.toString),w=/^Symbol\((.*)\)[^)]+$/,S=a("".replace),O=a("".slice);f(d,"description",{configurable:!0,get:function(){var t=b(this);if(c(y,t))return"";var e=m(t),r=g?O(e,7,-1):S(e,w,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},9504:(t,e,r)=>{var n=r(616),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);t.exports=n?a:function(t){return function(){return i.apply(t,arguments)}}},9519:(t,e,r)=>{var n,o,i=r(4576),a=r(2839),c=i.process,u=i.Deno,s=c&&c.versions||u&&u.version,l=s&&s.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},9539:(t,e,r)=>{var n=r(9565),o=r(8551),i=r(5966);t.exports=function(t,e,r){var a,c;o(t);try{if(!(a=i(t,"return"))){if("throw"===e)throw r;return r}a=n(a,t)}catch(t){c=!0,a=t}if("throw"===e)throw r;if(c)throw a;return o(a),r}},9544:(t,e,r)=>{var n=r(2839);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},9565:(t,e,r)=>{var n=r(616),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},9572:(t,e,r)=>{var n=r(9297),o=r(6840),i=r(3640),a=r(8227)("toPrimitive"),c=Date.prototype;n(c,a)||o(c,a,i)},9617:(t,e,r)=>{var n=r(5397),o=r(5610),i=r(6198),a=function(t){return function(e,r,a){var c=n(e),u=i(c);if(0===u)return!t&&-1;var s,l=o(a,u);if(t&&r!=r){for(;u>l;)if((s=c[l++])!=s)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},9773:(t,e,r)=>{var n=r(6518),o=r(4495),i=r(9039),a=r(3717),c=r(8981);n({target:"Object",stat:!0,forced:!o||i(function(){a.f(1)})},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(c(t)):[]}})},9868:(t,e,r)=>{var n=r(6518),o=r(9504),i=r(1291),a=r(1240),c=r(2333),u=r(9039),s=RangeError,l=String,f=Math.floor,p=o(c),h=o("".slice),d=o(1.1.toFixed),y=function(t,e,r){return 0===e?r:e%2==1?y(t,e-1,r*t):y(t*t,e/2,r)},v=function(t,e,r){for(var n=-1,o=r;++n<6;)o+=e*t[n],t[n]=o%1e7,o=f(o/1e7)},g=function(t,e){for(var r=6,n=0;--r>=0;)n+=t[r],t[r]=f(n/e),n=n%e*1e7},b=function(t){for(var e=6,r="";--e>=0;)if(""!==r||0===e||0!==t[e]){var n=l(t[e]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:u(function(){return"0.000"!==d(8e-5,3)||"1"!==d(.9,0)||"1.25"!==d(1.255,2)||"1000000000000000128"!==d(0xde0b6b3a7640080,0)})||!u(function(){d({})})},{toFixed:function(t){var e,r,n,o,c=a(this),u=i(t),f=[0,0,0,0,0,0],d="",m="0";if(u<0||u>20)throw new s("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return l(c);if(c<0&&(d="-",c=-c),c>1e-21)if(r=(e=function(t){for(var e=0,r=t;r>=4096;)e+=12,r/=4096;for(;r>=2;)e+=1,r/=2;return e}(c*y(2,69,1))-69)<0?c*y(2,-e,1):c/y(2,e,1),r*=4503599627370496,(e=52-e)>0){for(v(f,0,r),n=u;n>=7;)v(f,1e7,0),n-=7;for(v(f,y(10,n,1),0),n=e-1;n>=23;)g(f,1<<23),n-=23;g(f,1<<n),v(f,1,1),g(f,2),m=b(f)}else v(f,0,r),v(f,1<<-e,0),m=b(f)+p("0",u);return u>0?d+((o=m.length)<=u?"0."+p("0",u-o)+m:h(m,0,o-u)+"."+h(m,o-u)):d+m}})}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n].call(i.exports,i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r(2675),r(9463),r(2259),r(6280),r(3418),r(3792),r(4114),r(4782),r(6099),r(7495),r(906),r(8781),r(7764),r(5440),r(8992),r(3949),r(3500),r(2953);const n=window.wp.element;function o(t,e){void 0===e&&(e=Promise),function(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}(t,e);var r=t.url,n=t.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e(function(t,e){if("undefined"==typeof document)return t();var o,i,a,c;i=(o={url:r,attributes:n,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(r,'" failed to load.'));return window.fetch?fetch(r).then(function(r){return 200===r.status&&e(t),r.text()}).then(function(t){var r=function(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}(t);e(new Error(r))}).catch(function(t){e(t)}):e(t)}}).onSuccess,a=o.onError,c=function(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach(function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])}),r}(o.url,o.attributes),c.onerror=a,c.onload=i,document.head.insertBefore(c,document.head.firstElementChild)})}const i=window.wc.wcBlocksRegistry,a=window.wp.i18n;function c(t,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=t,Object.keys(e).forEach(function(t){r.setAttribute(t,e[t]),"data-csp-nonce"===t&&r.setAttribute("nonce",e["data-csp-nonce"])}),r}function u(t,e){if(void 0===e&&(e=Promise),l(t,e),"undefined"==typeof document)return e.resolve(null);var r=function(t){var e="https://www.paypal.com/sdk/js";t.sdkBaseUrl&&(e=t.sdkBaseUrl,delete t.sdkBaseUrl);var r,n,o=t,i=Object.keys(o).filter(function(t){return void 0!==o[t]&&null!==o[t]&&""!==o[t]}).reduce(function(t,e){var r,n=o[e].toString();return r=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)).substring(0,4)?t.dataAttributes[e]=n:t.queryParams[e]=n,t},{queryParams:{},dataAttributes:{}}),a=i.queryParams,c=i.dataAttributes;return a["merchant-id"]&&-1!==a["merchant-id"].indexOf(",")&&(c["data-merchant-id"]=a["merchant-id"],a["merchant-id"]="*"),{url:"".concat(e,"?").concat((r=a,n="",Object.keys(r).forEach(function(t){0!==n.length&&(n+="&"),n+=t+"="+r[t]}),n)),dataAttributes:c}}(t),n=r.url,o=r.dataAttributes,i=o["data-namespace"]||"paypal",a=s(i);return function(t,e){var r=document.querySelector('script[src="'.concat(t,'"]'));if(null===r)return null;var n=c(t,e),o=r.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach(function(t){o.dataset[t]!==n.dataset[t]&&(i=!1)}),i?r:null}(n,o)&&a?e.resolve(a):function(t,e){void 0===e&&(e=Promise),l(t,e);var r=t.url,n=t.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e(function(t,e){if("undefined"==typeof document)return t();!function(t){var e=t.onSuccess,r=t.onError,n=c(t.url,t.attributes);n.onerror=r,n.onload=e,document.head.insertBefore(n,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(r,'" failed to load.'));return window.fetch?fetch(r).then(function(r){return 200===r.status&&e(t),r.text()}).then(function(t){var r=function(t){var e=t.split("/* Original Error:")[1];return e?e.replace(/\n/g,"").replace("*/","").trim():t}(t);e(new Error(r))}).catch(function(t){e(t)}):e(t)}})})}({url:n,attributes:o},e).then(function(){var t=s(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))})}function s(t){return window[t]}function l(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const f=(t,e,r,n=null)=>{fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.nonce})}).then(t=>t.json()).then(o=>{var i;((t,e)=>!(!t||t.user!==e||(new Date).getTime()>=1e3*t.expiration))(o,e.user)&&(i=o,sessionStorage.setItem("ppcp-data-client-id",JSON.stringify(i)),t["data-client-token"]=o.token,u(t).then(t=>{"function"==typeof r&&r(t)}).catch(t=>{"function"==typeof n&&n(t)}))})};window.widgetBuilder=window.widgetBuilder||new class{constructor(){this.paypal=null,this.buttons=new Map,this.messages=new Map,this.renderEventName="ppcp-render",document.ppcpWidgetBuilderStatus=()=>{console.log({buttons:this.buttons,messages:this.messages})},jQuery(document).off(this.renderEventName).on(this.renderEventName,()=>{this.renderAll()})}setPaypal(t){this.paypal=t,jQuery(document).trigger("ppcp-paypal-loaded",t)}registerButtons(t,e){t=this.sanitizeWrapper(t),this.buttons.set(this.toKey(t),{wrapper:t,options:e})}renderButtons(t){t=this.sanitizeWrapper(t);const e=this.toKey(t);if(!this.buttons.has(e))return;if(this.hasRendered(t))return;const r=this.buttons.get(e),n=this.paypal.Buttons(r.options);if(!n.isEligible())return void this.buttons.delete(e);const o=this.buildWrapperTarget(t);o&&(n.hasReturned()?n.resume():n.render(o))}renderAllButtons(){for(const[t]of this.buttons)this.renderButtons(t)}registerMessages(t,e){this.messages.set(t,{wrapper:t,options:e})}renderMessages(t){if(!this.messages.has(t))return;const e=this.messages.get(t);if(this.hasRendered(t))return void document.querySelector(t).setAttribute("data-pp-amount",e.options.amount);const r=this.paypal.Messages(e.options);r.render(e.wrapper),setTimeout(()=>{this.hasRendered(t)||r.render(e.wrapper)},100)}renderAllMessages(){for(const[t,e]of this.messages)this.renderMessages(t)}renderAll(){this.renderAllButtons(),this.renderAllMessages()}hasRendered(t){let e=t;if(Array.isArray(t)){e=t[0];for(const r of t.slice(1))e+=" .item-"+r}const r=document.querySelector(e);return r&&r.hasChildNodes()}sanitizeWrapper(t){return Array.isArray(t)&&1===(t=t.filter(t=>!!t)).length&&(t=t[0]),t}buildWrapperTarget(t){let e=t;if(Array.isArray(t)){const r=jQuery(t[0]);if(!r.length)return;const n="item-"+t[1];let o=r.find("."+n);o.length||(o=jQuery(`<div class="${n}"></div>`),r.append(o)),e=o.get(0)}return jQuery(e).length?e:null}toKey(t){return Array.isArray(t)?JSON.stringify(t):t}};const p=window.widgetBuilder;var h=r(9457),d=r.n(h);const y=t=>t.replace(/([-_]\w)/g,function(t){return t[1].toUpperCase()}),v=t=>{let e=(t=>{const e={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[y(r)]=t[r]);return e})(t.url_params);t.script_attributes&&(e=d()(e,t.script_attributes));const r=(t=>{const e=t?.save_payment_methods?.id_token;return e&&!0===t?.user?.is_logged?{"data-user-id-token":e}:{}})(t);return d().all([e,r])},g=new Map,b=new Map,m=async(t,e)=>{if(!t)throw new Error("Namespace is required");if(g.has(t))return console.log(`Script already loaded for namespace: ${t}`),g.get(t);if(b.has(t))return console.log(`Script loading in progress for namespace: ${t}`),b.get(t);const r={...v(e),"data-namespace":t},n=await(async(t,e)=>e.data_client_id?.set_attribute&&!0!==e.vault_v3_enabled?new Promise((r,n)=>{f(t,e.data_client_id,t=>{p.setPaypal(t),r(t)},n)}):null)(r,e);if(n)return n;const o=new Promise((e,n)=>{u(r).then(r=>{p.setPaypal(r),g.set(t,r),console.log(`Script loaded for namespace: ${t}`),e(r)}).catch(e=>{console.error(`Failed to load script for namespace: ${t}`,e),n(e)}).finally(()=>{b.delete(t)})});return b.set(t,o),o};r(5700),r(9572),r(2892),r(875),r(287),r(3362),window.ppcpResources=window.ppcpResources||{};const w=window.ppcpResources.ButtonModuleWatcher=window.ppcpResources.ButtonModuleWatcher||new class{constructor(){this.contextBootstrapRegistry={},this.contextBootstrapWatchers=[]}watchContextBootstrap(t){this.contextBootstrapWatchers.push(t),Object.values(this.contextBootstrapRegistry).forEach(t)}registerContextBootstrap(t,e){this.contextBootstrapRegistry[t]={context:t,handler:e};for(const e of this.contextBootstrapWatchers)e(this.contextBootstrapRegistry[t])}};r(8706),r(2008),r(113),r(4423),r(2062),r(9085),r(3851),r(1278),r(9432),r(8940),r(825),r(888),r(5472),r(3772),r(4520),r(2577),r(1454),r(7550);const S=Object.freeze({INVALIDATE:"ppcp_invalidate_methods",RENDER:"ppcp_render_method",REDRAW:"ppcp_redraw_method"});function O(t,e){return{Default:{...t.style,...e.style},MiniCart:{...t.mini_cart_style,...e.mini_cart_style}}}function j(t){return Object.values(S).includes(t)}function _({event:t,paymentMethod:e="",callback:r}){if(!j(t))throw new Error(`Invalid event: ${t}`);const n=e?`${t}-${e}`:t;document.body.addEventListener(n,r)}class x{#t="";#e=!1;#r=null;constructor(...t){t.length&&(this.#t=`[${t.join(" | ")}]`)}set enabled(t){this.#e=t}log(...t){this.#e&&console.log(this.#t,...t)}error(...t){console.error(this.#t,...t)}group(t=null){this.#e&&(t&&!this.#r||(console.groupEnd(),this.#r=null),t&&(console.group(t),this.#r=t))}}class P{constructor(t,e){this.selector=t,this.selectorInContainer=e,this.containers=[],this.reloadContainers(),jQuery(window).resize(()=>{this.refresh()}).resize(),jQuery(document).on("ppcp-smart-buttons-init",()=>{this.refresh()}),jQuery(document).on("ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled",(t,e)=>{this.refresh(),setTimeout(this.refresh.bind(this),200)}),new MutationObserver(this.observeElementsCallback.bind(this)).observe(document.body,{childList:!0,subtree:!0})}observeElementsCallback(t,e){const r=this.selector+", .widget_shopping_cart, .widget_shopping_cart_content";let n=!1;for(const e of t)"childList"===e.type&&e.addedNodes.forEach(t=>{t.matches&&t.matches(r)&&(n=!0)});n&&(this.reloadContainers(),this.refresh())}reloadContainers(){jQuery(this.selector).each((t,e)=>{const r=jQuery(e).parent();this.containers.some(t=>t.is(r))||this.containers.push(r)})}refresh(){for(const t of this.containers){const e=jQuery(t),r=e.width();e.removeClass("ppcp-width-500 ppcp-width-300 ppcp-width-min"),r>=500?e.addClass("ppcp-width-500"):r>=300?e.addClass("ppcp-width-300"):e.addClass("ppcp-width-min");const n=e.children(":visible").first();e.find(this.selectorInContainer).each((t,e)=>{const r=jQuery(e);if(r.is(n))return r.css("margin-top","0px"),!0;const o=r.height(),i=Math.max(11,Math.round(.3*o));r.css("margin-top",`${i}px`)})}}}const E="ppcp-gateway",C={Cart:"cart",Checkout:"checkout",BlockCart:"cart-block",BlockCheckout:"checkout-block",Product:"product",MiniCart:"mini-cart",PayNow:"pay-now",Preview:"preview",Blocks:["cart-block","checkout-block"],Gateways:["checkout","pay-now"]},k=()=>{const t=document.querySelector('input[name="payment_method"]:checked');return t?t.value:null},T=t=>"string"==typeof t?document.querySelector(t):t;class I{static methodId="generic";static cssClass="";#n;#o=!1;#i=!1;#a;#c;#u;#s=[];#l;#f;#p;#h;#d;#y=null;#v=!0;#g=!0;#b=null;#m=[];static createButton(t,e,r,n,o,i,a=null){const c=(()=>{const t="__ppcpPBInstances";return document.body[t]||Object.defineProperty(document.body,t,{value:new Map,enumerable:!1,writable:!1,configurable:!1}),document.body[t]})(),u=`${this.methodId}.${t}`;if(!c.has(u)){const s=new this(t,e,r,n,o,i,a);c.set(u,s)}return c.get(u)}static getWrappers(t,e){throw new Error("Must be implemented in the child class")}static getStyles(t,e){throw new Error("Must be implemented in the child class")}constructor(t,e=null,r={},n={},o=null,i={},a=null){if(this.methodId===I.methodId)throw new Error("Cannot initialize the PaymentButton base class");r||(r={});const c=!!r?.is_debug,u=this.methodId.replace(/^ppcp?-/,"");this.#a=t,this.#l=r,this.#f=n,this.#p=e,this.#h=o,this.#d=i,this.onClick=a,this.#n=new x(u,t),c&&(this.#n.enabled=!0,((t,e)=>{window.ppcpPaymentButtonList=window.ppcpPaymentButtonList||{};const r=window.ppcpPaymentButtonList;r[t]=r[t]||[],r[t].push(e)})(u,this)),this.#c=this.constructor.getWrappers(this.#l,this.#f),this.applyButtonStyles(this.#l),this.registerValidationRules(this.#w.bind(this),this.#S.bind(this)),((t,e=".ppcp-button-apm")=>{let r=e;if(!window.ppcpApmButtons){if(t&&t.button){const n=t.button.wrapper;jQuery(n).children('div[class^="item-"]').length>0&&(e+=`, ${n} div[class^="item-"]`,r+=', div[class^="item-"]')}window.ppcpApmButtons=new P(e,r)}})(this.#f),this.initEventListeners()}get methodId(){return this.constructor.methodId}get cssClass(){return this.constructor.cssClass}get isInitialized(){return this.#o}get context(){return this.#a}get buttonConfig(){return this.#l}get ppcpConfig(){return this.#f}get externalHandler(){return this.#p||{}}get contextHandler(){return this.#h||{}}get requiresShipping(){return"function"==typeof this.contextHandler.shippingAllowed&&this.contextHandler.shippingAllowed()}get wrappers(){return this.#c}get style(){return C.MiniCart===this.context?this.#u.MiniCart:this.#u.Default}get wrapperId(){return C.MiniCart===this.context?this.wrappers.MiniCart:this.isSeparateGateway?this.wrappers.Gateway:C.Blocks.includes(this.context)?this.wrappers.Block:this.wrappers.Default}get isInsideClassicGateway(){return C.Gateways.includes(this.context)}get isSeparateGateway(){return this.#l.is_wc_gateway_enabled&&this.isInsideClassicGateway}get isCurrentGateway(){if(!this.isInsideClassicGateway)return!0;const t=k();return this.isSeparateGateway?this.methodId===t:E===t}get isPreview(){return C.Preview===this.context}get isEligible(){return this.#y}set isEligible(t){t!==this.#y&&(this.#y=t,this.triggerRedraw())}get isVisible(){return this.#v}set isVisible(t){this.#v!==t&&(this.#v=t,this.triggerRedraw())}get isEnabled(){return this.#g}set isEnabled(t){this.#g!==t&&(this.#g=t,this.triggerRedraw())}get wrapperElement(){return document.getElementById(this.wrapperId)}get ppcpButtonWrapperSelector(){return C.Blocks.includes(this.context)?null:this.context===C.MiniCart?this.ppcpConfig?.button?.mini_cart_wrapper:this.ppcpConfig?.button?.wrapper}get isPresent(){return this.wrapperElement instanceof HTMLElement}get isButtonAttached(){if(!this.#b)return!1;let t=this.#b.parentElement;for(;t?.parentElement;){if("BODY"===t.tagName)return!0;t=t.parentElement}return!1}log(...t){this.#n.log(...t)}error(...t){this.#n.error(...t)}logGroup(t=null){this.#n.group(t)}#w(t,e){this.#m.push({check:t,errorMessage:e,shouldPass:!1})}#S(t){this.#m.push({check:t,shouldPass:!0})}registerValidationRules(t,e){}validateConfiguration(t=!1){for(const e of this.#m){const r=e.check();if(e.shouldPass&&r)return!0;if(!e.shouldPass&&r)return!t&&e.errorMessage&&this.error(e.errorMessage),!1}return!0}applyButtonStyles(t,e=null){e||(e=this.ppcpConfig),this.#u=this.constructor.getStyles(t,e),this.isInitialized&&this.triggerRedraw()}configure(){}init(){this.#o=!0}reinit(){this.#o=!1,this.#y=!1}triggerRedraw(){this.showPaymentGateway(),function({event:t,paymentMethod:e=""}){if(!j(t))throw new Error(`Invalid event: ${t}`);const r=e?`${t}-${e}`:t;document.body.dispatchEvent(new Event(r))}({event:S.REDRAW,paymentMethod:this.methodId})}syncProductButtonsState(){const t=document.querySelector(this.ppcpButtonWrapperSelector);var e;t&&(this.isVisible=!!((e=t).offsetWidth||e.offsetHeight||e.getClientRects().length),this.isEnabled=!(t=>{const e=T(t);return!!e&&jQuery(e).hasClass("ppcp-disabled")})(t))}initEventListeners(){if(_({event:S.REDRAW,paymentMethod:this.methodId,callback:()=>this.refresh()}),this.isInsideClassicGateway){const t=this.isSeparateGateway?this.methodId:E;_({event:S.INVALIDATE,callback:()=>this.isVisible=!1}),_({event:S.RENDER,paymentMethod:t,callback:()=>this.isVisible=!0})}this.context===C.Product&&(jQuery(document).on("ppcp-shown ppcp-hidden ppcp-enabled ppcp-disabled",(t,e)=>{jQuery(e.selector).is(this.ppcpButtonWrapperSelector)&&this.syncProductButtonsState()}),this.syncProductButtonsState())}refresh(){this.isPresent&&(this.isEligible?(this.applyWrapperStyles(),this.isEligible&&this.isCurrentGateway&&this.isVisible&&(this.isButtonAttached||(this.log("refresh.addButton"),this.addButton()))):this.wrapperElement.style.display="none")}showPaymentGateway(){if(this.#i||!this.isSeparateGateway||!this.isEligible)return;const t=`style[data-hide-gateway="${this.methodId}"]`,e=`#${this.wrappers.Default}`,r=document.querySelector(`.wc_payment_method.payment_method_${this.methodId}`);document.querySelectorAll(t).forEach(t=>t.remove()),"none"!==r.style.display&&""!==r.style.display||(r.style.display="block"),document.querySelectorAll(e).forEach(t=>t.remove()),this.log("Show gateway"),this.#i=!0,this.isVisible=this.isCurrentGateway}applyWrapperStyles(){const t=this.wrapperElement;if(!t)return;const{shape:e,height:r}=this.style;for(const e of this.#s)t.classList.remove(e);this.#s=[];const n=[`ppcp-button-${e}`,"ppcp-button-apm",this.cssClass];t.classList.add(...n),this.#s.push(...n),r&&(t.style.height=`${r}px`),t.style.display=this.isVisible?"block":"none";const o=this.context===C.Product?"form.cart":null;((t,e,r=null)=>{const n=T(t);n&&(e?(jQuery(n).removeClass("ppcp-disabled").off("mouseup").find("> *").css("pointer-events",""),((t,e)=>{jQuery(document).trigger("ppcp-enabled",{handler:"ButtonsDisabler.setEnabled",action:"enable",selector:t,element:e})})(t,n)):(jQuery(n).addClass("ppcp-disabled").on("mouseup",function(t){if(t.stopImmediatePropagation(),r){const t=jQuery(r);t.find(".single_add_to_cart_button").hasClass("disabled")&&t.find(":submit").trigger("click")}}).find("> *").css("pointer-events","none"),((t,e)=>{jQuery(document).trigger("ppcp-disabled",{handler:"ButtonsDisabler.setEnabled",action:"disable",selector:t,element:e})})(t,n)))})(t,this.isEnabled,o)}addButton(){throw new Error("Must be implemented by the child class")}insertButton(t){if(!this.isPresent)return;const e=this.wrapperElement;this.#b&&this.removeButton(),this.log("insertButton",t),this.#b=t,e.appendChild(this.#b)}removeButton(){if(this.isPresent&&this.#b){this.log("removeButton");try{this.wrapperElement.removeChild(this.#b)}catch(t){}this.#b=null}}}function A(t){return A="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},A(t)}function R(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,M(n.key),n)}}function M(t){var e=function(t){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=A(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==A(e)?e:e+""}r(739),r(3110);const D=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=e},(e=[{key:"update",value:function(t){var e=this;return new Promise(function(r,n){fetch(e.config.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.config.nonce,paymentData:t})}).then(function(t){return t.json()}).then(function(t){t.success&&r(t.data)})})}}])&&R(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}(),N={"#billing_email":["email_address"],"#billing_last_name":["name","surname"],"#billing_first_name":["name","given_name"],"#billing_country":["address","country_code"],"#billing_address_1":["address","address_line_1"],"#billing_address_2":["address","address_line_2"],"#billing_state":["address","admin_area_1"],"#billing_city":["address","admin_area_2"],"#billing_postcode":["address","postal_code"],"#billing_phone":["phone"]};function B(t){return{email_address:t.email_address,phone:t.phone,name:{surname:t.name?.surname,given_name:t.name?.given_name},address:{country_code:t.address?.country_code,address_line_1:t.address?.address_line_1,address_line_2:t.address?.address_line_2,admin_area_1:t.address?.admin_area_1,admin_area_2:t.address?.admin_area_2,postal_code:t.address?.postal_code}}}function F(){const t=window?.PayPalCommerceGateway?.payer??window._PpcpPayerSessionDetails;if(!t)return null;const e=function(){const t={};return Object.entries(N).forEach(([e,r])=>{const n=(t=>document.querySelector(t)?.value)(e);n&&((t,e,r)=>{let n=t;for(let t=0;t<e.length-1;t++)n=n[e[t]]=n[e[t]]||{};n[e[e.length-1]]=r})(t,r,n)}),t.phone&&"string"==typeof t.phone&&(t.phone={phone_type:"HOME",phone_number:{national_number:t.phone}}),t}();return e?function(t,e){const r=(t,e)=>{for(const[n,o]of Object.entries(e))null!=o&&(t[n]="object"==typeof o?r(t[n]||{},o):o);return t};return r(B(t),B(e))}(t,e):B(t)}function G(t,e=!1){var r,n;(r=t)&&"object"==typeof r&&(window._PpcpPayerSessionDetails=B(r)),e&&(n=t,Object.entries(N).forEach(([t,e])=>{const r=((t,e)=>e.reduce((t,e)=>t?.[e],t))(n,e);((t,e,r)=>{null!=r&&e&&("phone"===t[0]&&"object"==typeof r&&(r=r.phone_number?.national_number),e.value=r)})(e,document.querySelector(t),r)}))}function L(t){return t.toLowerCase().trim().replace(/[^a-z0-9_-]/g,"_")}function H(t){try{const e=JSON.parse(t);return{data:e.data,expires:e.expires||0}}catch(t){return null}}function q(t){return t?Date.now()+1e3*t:0}class U{#O="";#j=null;constructor(t){this.#O=L(t)+":",this.#_()}#_(){this.canUseLocalStorage&&Object.keys(localStorage).forEach(t=>{if(!t.startsWith(this.#O))return;const e=H(localStorage.getItem(t));e&&e.expires>0&&e.expires<Date.now()&&localStorage.removeItem(t)})}#x(t){const e=L(t);if(0===e.length)throw new Error("Name cannot be empty after sanitization");return`${this.#O}${e}`}get canUseLocalStorage(){return null===this.#j&&(this.#j=function(){try{const t="__ppcp_test__";return localStorage.setItem(t,"test"),localStorage.removeItem(t),!0}catch(t){return!1}}()),this.#j}set(t,e,r=0){if(!this.canUseLocalStorage)throw new Error("Local storage is not available");const n=function(t,e){const r={data:t,expires:q(e)};return JSON.stringify(r)}(e,r),o=this.#x(t);localStorage.setItem(o,n)}get(t){if(!this.canUseLocalStorage)throw new Error("Local storage is not available");const e=this.#x(t),r=H(localStorage.getItem(e));return r?r.data:null}clear(t){if(!this.canUseLocalStorage)throw new Error("Local storage is not available");const e=this.#x(t);localStorage.removeItem(e)}}function W(t){return W="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},W(t)}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,K(n.key),n)}}function z(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(z=function(){return!!t})()}function V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(t)}function Q(t,e){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Q(t,e)}function J(t,e,r){return(e=K(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function K(t){var e=function(t){if("object"!=W(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=W(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==W(e)?e:e+""}var Y=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=V(e),function(t,e){if(e&&("object"==W(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,z()?Reflect.construct(e,r||[],V(t).constructor):e.apply(t,r))}(this,e,["ppcp-googlepay"])}return 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&&Q(t,e)}(e,t),r=e,(n=[{key:"getPayer",value:function(){return this.get(e.PAYER)}},{key:"setPayer",value:function(t){this.set(e.PAYER,t,e.PAYER_TTL)}},{key:"clearPayer",value:function(){this.clear(e.PAYER)}}])&&$(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(U);J(Y,"PAYER","payer"),J(Y,"PAYER_TTL",900);const X=new Y;function Z(t){return Z="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},Z(t)}function tt(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return et(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(et(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,et(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,et(f,"constructor",s),et(s,"constructor",u),u.displayName="GeneratorFunction",et(s,o,"GeneratorFunction"),et(f),et(f,o,"Generator"),et(f,n,function(){return this}),et(f,"toString",function(){return"[object Generator]"}),(tt=function(){return{w:i,m:p}})()}function et(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}et=function(t,e,r,n){function i(e,r){et(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},et(t,e,r,n)}function rt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function nt(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){rt(i,n,o,a,c,"next",t)}function c(t){rt(i,n,o,a,c,"throw",t)}a(void 0)})}}function ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function it(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(r),!0).forEach(function(e){ht(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function at(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,dt(n.key),n)}}function ct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ct=function(){return!!t})()}function ut(t,e,r,n){var o=st(lt(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof o?function(t){return o.apply(r,t)}:o}function st(){return st="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=lt(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},st.apply(null,arguments)}function lt(t){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lt(t)}function ft(t,e){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ft(t,e)}function pt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function ht(t,e,r){return(e=dt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function dt(t){var e=function(t){if("object"!=Z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Z(e)?e:e+""}function yt(t,e,r){return t.set(gt(t,e),r),r}function vt(t,e){return t.get(gt(t,e))}function gt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}var bt="failed",mt="payerAction";function wt(t){return{country_code:null==t?void 0:t.countryCode,address_line_1:null==t?void 0:t.address1,address_line_2:null==t?void 0:t.address2,admin_area_1:null==t?void 0:t.administrativeArea,admin_area_2:null==t?void 0:t.locality,postal_code:null==t?void 0:t.postalCode}}function St(t){var e,r=null==t||null===(e=t.paymentMethodData)||void 0===e||null===(e=e.info)||void 0===e?void 0:e.billingAddress;return{email_address:null==t?void 0:t.email,name:{given_name:r.name.split(" ")[0],surname:r.name.split(" ").slice(1).join(" ")},address:wt(r)}}function Ot(t){var e,r,n=null!==(e=null==t?void 0:t.shippingAddress)&&void 0!==e?e:null==t||null===(r=t.paymentMethodData)||void 0===r||null===(r=r.info)||void 0===r?void 0:r.billingAddress;return{name:{full_name:null==n?void 0:n.name},address:wt(n)}}var jt=new WeakMap,_t=new WeakMap,xt=new WeakMap,Pt=new WeakMap,Et=new WeakMap,Ct=new WeakMap,kt=function(t){function e(t,r,n,o,i,a){var c,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),pt(c=function(t,e,r){return e=lt(e),function(t,e){if(e&&("object"==Z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ct()?Reflect.construct(e,r||[],lt(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o,i,a,u]),jt,null),pt(c,_t,null),pt(c,xt,null),ht(c,"googlePayConfig",null),pt(c,Pt,0),pt(c,Et,1e3),pt(c,Ct,null),c.init=c.init.bind(c),c.onPaymentDataChanged=c.onPaymentDataChanged.bind(c),c.onButtonClick=c.onButtonClick.bind(c),c.onClick=u,c.log("Create instance"),c}return 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&&ft(t,e)}(e,t),r=e,n=[{key:"requiresShipping",get:function(){var t;return ut(e,"requiresShipping",this,1)&&(null===(t=this.buttonConfig.shipping)||void 0===t?void 0:t.enabled)}},{key:"googlePayApi",get:function(){var t;return null===(t=window.google)||void 0===t||null===(t=t.payments)||void 0===t?void 0:t.api}},{key:"paymentsClient",get:function(){return vt(jt,this)}},{key:"transactionInfo",get:function(){return vt(_t,this)},set:function(t){yt(_t,this,t),this.refresh()}},{key:"registerValidationRules",value:function(t,e){var r=this;return t(function(){return!["TEST","PRODUCTION"].includes(r.buttonConfig.environment)},"Invalid environment: ".concat(this.buttonConfig.environment)),e(function(){return r.isPreview}),t(function(){return!r.googlePayConfig},"No API configuration - missing configure() call?"),t(function(){return!r.transactionInfo},"No transactionInfo - missing configure() call?"),t(function(){var t;return!(null!==(t=r.contextHandler)&&void 0!==t&&t.validateContext())},"Invalid context handler."),t(function(){var t;return(null===(t=r.buttonAttributes)||void 0===t?void 0:t.height)&&isNaN(parseInt(r.buttonAttributes.height))},"Invalid height in buttonAttributes"),t(function(){var t;return(null===(t=r.buttonAttributes)||void 0===t?void 0:t.borderRadius)&&isNaN(parseInt(r.buttonAttributes.borderRadius))},"Invalid borderRadius in buttonAttributes"),!0}},{key:"configure",value:function(t,e){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vt(Pt,this)||yt(Pt,this,Date.now()),null!=n&&n.height&&null!=n&&n.borderRadius&&yt(Ct,this,it({},n));var o=null!=n&&n.height?n:vt(Ct,this);if(Date.now()-vt(Pt,this)>vt(Et,this))return this.log("GooglePay: Timeout waiting for buttonAttributes - proceeding with initialization"),this.googlePayConfig=t,yt(_t,this,e),this.buttonAttributes=o||n,this.allowedPaymentMethods=this.googlePayConfig.allowedPaymentMethods,this.baseCardPaymentMethod=this.allowedPaymentMethods[0],void this.init();null!=o&&o.height&&null!=o&&o.borderRadius?(yt(Pt,this,0),this.googlePayConfig=t,yt(_t,this,e),this.buttonAttributes=o,this.allowedPaymentMethods=this.googlePayConfig.allowedPaymentMethods,this.baseCardPaymentMethod=this.allowedPaymentMethods[0],this.init()):setTimeout(function(){return r.configure(t,e,n)},100)}},{key:"init",value:function(){var t=this;this.isInitialized||this.validateConfiguration()&&(ut(e,"init",this,3)([]),yt(jt,this,this.createPaymentsClient()),this.paymentsClient.isReadyToPay(this.buildReadyToPayRequest(this.allowedPaymentMethods,this.googlePayConfig)).then(function(e){t.log("PaymentsClient.isReadyToPay response:",e),t.isEligible=!!e.result}).catch(function(e){t.error(e),t.isEligible=!1}))}},{key:"reinit",value:function(){this.validateConfiguration(!0)&&(ut(e,"reinit",this,3)([]),this.init())}},{key:"preparePaymentDataCallbacks",value:function(){var t={};return this.isPreview||this.requiresShipping&&(t.onPaymentDataChanged=this.onPaymentDataChanged),t}},{key:"createPaymentsClient",value:function(){if(!this.googlePayApi)return null;var t=this.preparePaymentDataCallbacks();return new this.googlePayApi.PaymentsClient({environment:this.buttonConfig.environment,paymentDataCallbacks:t})}},{key:"buildReadyToPayRequest",value:function(t,e){return this.log("Ready To Pay request",e,t),Object.assign({},e,{allowedPaymentMethods:t})}},{key:"addButton",value:function(){var t,r,n;if(this.paymentsClient){null!==(t=this.buttonAttributes)&&void 0!==t&&t.height||null===(r=vt(Ct,this))||void 0===r||!r.height||(this.buttonAttributes=it({},vt(Ct,this))),this.removeButton();var o=this.baseCardPaymentMethod,i=this.style,a=i.color,c=i.type,u={buttonColor:a||"black",buttonSizeMode:"fill",buttonLocale:i.language||"en",buttonType:c||"pay",buttonRadius:parseInt(null===(n=this.buttonAttributes)||void 0===n?void 0:n.borderRadius,10),onClick:this.onButtonClick,allowedPaymentMethods:[o]},s=this.paymentsClient.createButton(u);yt(xt,this,s),ut(e,"insertButton",this,3)([s]),this.applyWrapperStyles()}}},{key:"applyWrapperStyles",value:function(){var t;ut(e,"applyWrapperStyles",this,3)([]);var r=this.wrapperElement;if(r){var n=null!==(t=this.buttonAttributes)&&void 0!==t&&t.height?this.buttonAttributes:vt(Ct,this);if(null!=n&&n.height){var o=parseInt(n.height,10);isNaN(o)||(r.style.height="".concat(o,"px"),r.style.minHeight="".concat(o,"px"))}}}},{key:"removeButton",value:function(){if(this.isPresent&&vt(xt,this)){this.log("removeButton");try{this.wrapperElement.removeChild(vt(xt,this))}catch(t){}yt(xt,this,null)}}},{key:"onButtonClick",value:(a=nt(tt().m(function t(){var e,r,n,o,i=this;return tt().w(function(t){for(;;)switch(t.n){case 0:return this.logGroup("onButtonClick"),e=function(){var t=nt(tt().m(function t(){var e,r;return tt().w(function(t){for(;;)if(0===t.n)return window.ppcpFundingSource="googlepay",null===(e=i.onClick)||void 0===e||e.call(i),r=i.paymentDataRequest(),i.log("onButtonClick: paymentDataRequest",r,i.context),t.a(2,i.paymentsClient.loadPaymentData(r).then(function(t){return i.log("loadPaymentData response:",t),t}).catch(function(t){throw i.error("loadPaymentData failed:",t),t}))},t)}));return function(){return t.apply(this,arguments)}}(),r=function(){var t=nt(tt().m(function t(){return tt().w(function(t){for(;;)switch(t.n){case 0:if("function"==typeof i.contextHandler.validateForm){t.n=1;break}return t.a(2,Promise.resolve());case 1:return t.a(2,i.contextHandler.validateForm().catch(function(t){throw i.error("Form validation failed:",t),t}))}},t)}));return function(){return t.apply(this,arguments)}}(),n=function(){var t=nt(tt().m(function t(){return tt().w(function(t){for(;;)switch(t.n){case 0:if("function"==typeof i.contextHandler.transactionInfo){t.n=1;break}return t.a(2,Promise.resolve());case 1:return t.a(2,i.contextHandler.transactionInfo().then(function(t){i.transactionInfo=t}).catch(function(t){throw i.error("Failed to get transaction info:",t),t}))}},t)}));return function(){return t.apply(this,arguments)}}(),t.n=1,r().then(n).then(e);case 1:if(o=t.v,this.logGroup(),o){t.n=2;break}return t.a(2);case 2:return t.a(2,this.processPayment(o))}},t,this)})),function(){return a.apply(this,arguments)})},{key:"paymentDataRequest",value:function(){var t=this.requiresShipping,e=[];return t&&e.push("SHIPPING_ADDRESS","SHIPPING_OPTION"),it(it({},{apiVersion:2,apiVersionMinor:0}),{},{allowedPaymentMethods:this.googlePayConfig.allowedPaymentMethods,transactionInfo:this.transactionInfo.finalObject,merchantInfo:this.googlePayConfig.merchantInfo,callbackIntents:e,emailRequired:!0,shippingAddressRequired:t,shippingOptionRequired:t,shippingAddressParameters:this.shippingAddressParameters()})}},{key:"shippingAddressParameters",value:function(){return{allowedCountryCodes:this.buttonConfig.shipping.countries,phoneNumberRequired:!0}}},{key:"onPaymentDataChanged",value:function(t){var e=this;return this.log("onPaymentDataChanged",t),new Promise(function(){var r=nt(tt().m(function r(n,o){var i,a,c,u,s,l,f,p;return tt().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,a={},r.n=1,new D(e.buttonConfig.ajax.update_payment_data).update(t);case 1:if(c=r.v,u=e.transactionInfo,s=["checkout-block","checkout","cart-block","cart","mini-cart","pay-now"].includes(e.context),e.log("onPaymentDataChanged:updatedData",c),e.log("onPaymentDataChanged:transactionInfo",u),c.country_code=u.countryCode,c.currency_code=u.currencyCode,null!==(i=c.shipping_options)&&void 0!==i&&null!==(i=i.shippingOptions)&&void 0!==i&&i.length){r.n=2;break}return a.error=e.unserviceableShippingAddressError(),n(a),r.a(2);case 2:["INITIALIZE","SHIPPING_ADDRESS"].includes(t.callbackTrigger)&&(a.newShippingOptionParameters=e.sanitizeShippingOptions(c.shipping_options)),c.total&&s?(u.setTotal(c.total,c.shipping_fee),e.syncShippingOptionWithForm(null==t||null===(l=t.shippingOptionData)||void 0===l?void 0:l.id)):u.shippingFee=e.getShippingCosts(null==t||null===(f=t.shippingOptionData)||void 0===f?void 0:f.id,c.shipping_options),a.newTransactionInfo=e.calculateNewTransactionInfo(u),n(a),r.n=4;break;case 3:r.p=3,p=r.v,e.error("Error during onPaymentDataChanged:",p),o(p);case 4:return r.a(2)}},r,null,[[0,3]])}));return function(t,e){return r.apply(this,arguments)}}())}},{key:"sanitizeShippingOptions",value:function(t){var e=t.shippingOptions.map(function(t){return{id:t.id,label:t.label,description:t.description}}),r=t.defaultSelectedOptionId;return e.some(function(t){return t.id===r})||(r=e[0].id),{defaultSelectedOptionId:r,shippingOptions:e}}},{key:"getShippingCosts",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.shippingOptions,n=void 0===r?[]:r,o=e.defaultSelectedOptionId,i=void 0===o?"":o;if(null==n||!n.length)return this.log("Cannot calculate shipping cost: No Shipping Options"),0;var a=function(t){return n.find(function(e){return e.id===t})},c=a("shipping_option_unselected"!==t&&a(t)?t:i);return Number(null==c?void 0:c.cost)||0}},{key:"unserviceableShippingAddressError",value:function(){return{reason:"SHIPPING_ADDRESS_UNSERVICEABLE",message:"Cannot ship to the selected address",intent:"SHIPPING_ADDRESS"}}},{key:"calculateNewTransactionInfo",value:function(t){return t.finalObject}},{key:"processPayment",value:(i=nt(tt().m(function t(e){var r,n,o,i,a,c,u,s,l,f,h,d,y,v=this;return tt().w(function(t){for(;;)switch(t.p=t.n){case 0:return this.logGroup("processPayment"),n=St(e),o=Ot(e),i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n={transactionState:t};return(e||r)&&(n.error={intent:e,message:r}),v.log("processPaymentResponse",n),n},a=function(t){return v.error(t),i("ERROR","PAYMENT_AUTHORIZATION",t)},c=function(){var t=nt(tt().m(function t(r){var n,o,i;return tt().w(function(t){for(;;)switch(t.n){case 0:return n={orderId:r,paymentMethodData:e.paymentMethodData},t.n=1,p.paypal.Googlepay().confirmOrder(n);case 1:o=t.v,v.log("confirmOrder",o),i=null==o?void 0:o.status,t.n="APPROVED"===i?2:"PAYER_ACTION_REQUIRED"===i?3:4;break;case 2:return t.a(2,"approved");case 3:return t.a(2,mt);case 4:return t.a(2,bt);case 5:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}(),u=function(t){return v.log("initiatePayerAction",t),p.paypal.Googlepay().initiatePayerAction({orderId:t})},s=function(){var t=nt(tt().m(function t(e){var r;return tt().w(function(t){for(;;)switch(t.n){case 0:return r=!0,v.log("approveOrder",e),t.n=1,v.contextHandler.approveOrder({orderID:e,payer:n,shippingAddress:o},{restart:function(){return new Promise(function(t){r=!1,t()})},order:{get:function(){return new Promise(function(t){t(null)})}}});case 1:return t.a(2,r)}},t)}));return function(e){return t.apply(this,arguments)}}(),X.setPayer(n),G(n),t.p=1,t.n=2,this.contextHandler.createOrder();case 2:return l=t.v,this.log("createOrder",l),t.n=3,c(l);case 3:if(f=t.v,bt!==f){t.n=4;break}r=a("TRANSACTION FAILED"),t.n=8;break;case 4:if(mt!==f){t.n=6;break}return t.n=5,u(l);case 5:h=t.v,this.log("3DS verification completed",h);case 6:return t.n=7,s(l);case 7:d=t.v,r=d?i("SUCCESS"):a("FAILED TO APPROVE");case 8:t.n=10;break;case 9:t.p=9,y=t.v,r=a(y.message);case 10:return this.logGroup(),t.a(2,r)}},t,this,[[1,9]])})),function(t){return i.apply(this,arguments)})},{key:"syncShippingOptionWithForm",value:function(t){for(var e=[".woocommerce-shipping-methods",".wc-block-components-shipping-rates-control",".wc-block-components-totals-shipping"],r=t.replace(/"/g,""),n=0,o=e;n<o.length;n++){var i="".concat(o[n],' input[type="radio"][value="').concat(r,'"]'),a=document.querySelector(i);if(a)return a.click(),!0}for(var c=0,u=e;c<u.length;c++){var s="".concat(u[c],' select option[value="').concat(r,'"]'),l=document.querySelector(s);if(l){var f=l.closest("select");if(f)return f.value=r,f.dispatchEvent(new Event("change")),!0}}return!1}}],o=[{key:"getWrappers",value:function(t,e){var r,n,o;return function(t="",e="",r="",n="",o=""){const i=t=>t.replace(/^#/,"");return{Default:i(t),SmartButton:i(r),Block:i(n),Gateway:i(o),MiniCart:i(e)}}((null==t||null===(r=t.button)||void 0===r?void 0:r.wrapper)||"",(null==t||null===(n=t.button)||void 0===n?void 0:n.mini_cart_wrapper)||"",(null==e||null===(o=e.button)||void 0===o?void 0:o.wrapper)||"","ppc-button-googlepay-container","ppc-button-ppcp-googlepay")}},{key:"getStyles",value:function(t,e){var r=O((null==e?void 0:e.button)||{},(null==t?void 0:t.button)||{});return"buy"===r.MiniCart.type&&(r.MiniCart.type="pay"),r}}],n&&at(r.prototype,n),o&&at(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a}(I);ht(kt,"methodId","ppcp-googlepay"),ht(kt,"cssClass","google-pay");const Tt=kt,It=class{constructor(t,e,r,n){this.id=t,this.quantity=e,this.variations=r,this.extra=n}data(){return{id:this.id,quantity:this.quantity,variations:this.variations,extra:this.extra}}},At=class extends It{constructor(t,e,r,n){super(t,e,null,n),this.booking=r}data(){return{...super.data(),booking:this.booking}}};class Rt{constructor(t="form.woocommerce-checkout"){this.target=t}setTarget(t){this.target=t}block(){jQuery(this.target).block({message:null,overlayCSS:{background:"#fff",opacity:.6},baseZ:1e4})}unblock(){jQuery(this.target).unblock()}static fullPage(){return new Rt(window)}}const Mt=Rt,Dt=(t,e)=>(r,n)=>{const o=Mt.fullPage();o.block();const i=!t.config.vaultingEnabled||"venmo"!==r.paymentSource,a={nonce:t.config.ajax.approve_order.nonce,order_id:r.orderID,funding_source:window.ppcpFundingSource,should_create_wc_order:i};return i&&r.payer&&(a.payer=r.payer),i&&r.shippingAddress&&(a.shipping_address=r.shippingAddress),fetch(t.config.ajax.approve_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(a)}).then(t=>t.json()).then(r=>{if(!r.success)return e.genericError(),n.restart().catch(()=>{e.genericError()});const o=r.data?.order_received_url;var i;i=o||t.config.redirect,setTimeout(()=>{window.location.href=i},200)}).finally(()=>{o.unblock()})},Nt=class{constructor(t=[]){this.cartItemKeys=t}getEndpoint(){let t="/?wc-ajax=%%endpoint%%";return"undefined"!=typeof wc_cart_fragments_params&&wc_cart_fragments_params.wc_ajax_url&&(t=wc_cart_fragments_params.wc_ajax_url),t.toString().replace("%%endpoint%%","remove_from_cart")}addFromPurchaseUnits(t){for(const e of t||[])for(const t of e.items||[])t.cart_item_key&&this.cartItemKeys.push(t.cart_item_key);return this}removeFromCart(){return new Promise((t,e)=>{if(!this.cartItemKeys||!this.cartItemKeys.length)return void t();const r=this.cartItemKeys.length;let n=0;const o=()=>{n++,n>=r&&t()};for(const t of this.cartItemKeys){const e=new URLSearchParams;e.append("cart_item_key",t),t?fetch(this.getEndpoint(),{method:"POST",credentials:"same-origin",body:e}).then(function(t){return t.json()}).then(()=>{o()}).catch(()=>{o()}):o()}})}};class Bt{static getPrefixedFields(t,e){const r=new FormData(t),n={};for(const[t,o]of r.entries())e&&!t.startsWith(e)||(n[t]=o);return n}static getFilteredFields(t,e,r){const n=new FormData(t),o={},i={};for(let[t,a]of n.entries()){if(-1!==t.indexOf("[]")){const e=t;i[e]=i[e]||0,t=t.replace("[]",`[${i[e]}]`),i[e]++}t&&(e&&-1!==e.indexOf(t)||r&&r.some(e=>t.startsWith(e))||(o[t]=a))}return o}}const Ft=class{static PAYPAL_PARAMS=["onApprove","token","PayerID","payerID","button_session_id","billingToken","orderID","switch_initiated_time","onCancel","onError"];static cleanHashParams(){if(!window.location.hash)return;const t=window.location.hash.substring(1).split("&").filter(t=>{const e=t.split("=")[0];return!this.PAYPAL_PARAMS.includes(e)});if(t.length>0){const e="#"+t.join("&");window.history.replaceState(null,"",window.location.pathname+window.location.search+e)}else window.history.replaceState(null,"",window.location.pathname+window.location.search)}static isResumeFlow(){return!!window.location.hash&&window.location.hash.substring(1).split("&").some(t=>"switch_initiated_time"===t.split("=")[0])}static reloadButtonsIfRequired(t){this.isResumeFlow()&&(this.cleanHashParams(),jQuery(t).trigger("ppcp-reload-buttons"))}},Gt=class{constructor(t,e,r,n){this.config=t,this.updateCart=e,this.formElement=r,this.errorHandler=n,this.cartHelper=null}subscriptionsConfiguration(t){return{createSubscription:(e,r)=>r.subscription.create({plan_id:t}),onApprove:(t,e)=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID})}).then(t=>t.json()).then(()=>{const t=this.getSubscriptionProducts();fetch(this.config.ajax.change_cart.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.change_cart.nonce,products:t})}).then(t=>t.json()).then(t=>{if(!t.success)throw console.log(t),Error(t.data.message);location.href=this.config.redirect})})},onError:t=>{console.error(t),Ft.reloadButtonsIfRequired(this.config.button.wrapper)}}}getSubscriptionProducts(){const t=document.querySelector('[name="add-to-cart"]').value;return[new It(t,1,this.variations(),this.extraFields())]}configuration(){return{createOrder:this.createOrder(),onApprove:Dt(this,this.errorHandler),onError:t=>{this.refreshMiniCart(),this.isBookingProduct()&&t.message?(this.errorHandler.clear(),this.errorHandler.message(t.message)):this.errorHandler.genericError(),Ft.reloadButtonsIfRequired(this.config.button.wrapper)},onCancel:()=>{this.isBookingProduct()?this.cleanCart():this.refreshMiniCart(),Ft.reloadButtonsIfRequired(this.config.button.wrapper)}}}getProducts(){if(this.isBookingProduct()){const t=document.querySelector('[name="add-to-cart"]').value;return[new At(t,1,Bt.getPrefixedFields(this.formElement,"wc_bookings_field"),this.extraFields())]}if(this.isGroupedProduct()){const t=[];return this.formElement.querySelectorAll('input[type="number"]').forEach(e=>{if(!e.value)return;const r=e.getAttribute("name").match(/quantity\[([\d]*)\]/);if(2!==r.length)return;const n=parseInt(r[1]),o=parseInt(e.value);t.push(new It(n,o,null,this.extraFields()))}),t}const t=document.querySelector('[name="add-to-cart"]').value,e=document.querySelector('[name="quantity"]').value,r=this.variations();return[new It(t,e,r,this.extraFields())]}extraFields(){return Bt.getFilteredFields(this.formElement,["add-to-cart","quantity","product_id","variation_id"],["attribute_","wc_bookings_field"])}createOrder(){return this.cartHelper=null,(t,e,r={})=>(this.errorHandler.clear(),this.updateCart.update(t=>{this.cartHelper=(new Nt).addFromPurchaseUnits(t);const e=F(),r=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"";return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,purchase_units:t,payer:e,bn_code:r,payment_method:E,funding_source:window.ppcpFundingSource,context:this.config.context})}).then(function(t){return t.json()}).then(function(t){if(!t.success)throw console.error(t),Error(t.data.message);return t.data.id})},this.getProducts(),r.updateCartOptions||{}))}variations(){return this.hasVariations()?[...this.formElement.querySelectorAll("[name^='attribute_']")].map(t=>({value:t.value,name:t.name})):null}hasVariations(){return this.formElement.classList.contains("variations_form")}isGroupedProduct(){return this.formElement.classList.contains("grouped_form")}isBookingProduct(){return!!this.formElement.querySelector(".wc-booking-product-id")}cleanCart(){this.cartHelper.removeFromCart().then(()=>{this.refreshMiniCart()}).catch(t=>{this.refreshMiniCart()})}refreshMiniCart(){jQuery(document.body).trigger("wc_fragment_refresh")}},Lt=class{constructor(t,e){this.endpoint=t,this.nonce=e}simulate(t,e){return new Promise((r,n)=>{fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,products:e})}).then(t=>t.json()).then(e=>{if(!e.success)return void n(e.data);const o=t(e.data);r(o)})})}},Ht=class{constructor(t,e){this.genericErrorText=t,this.wrapper=e}genericError(){this.clear(),this.message(this.genericErrorText)}appendPreparedErrorMessageElement(t){this._getMessageContainer().replaceWith(t)}message(t){this._addMessage(t),this._scrollToMessages()}messages(t){t.forEach(t=>this._addMessage(t)),this._scrollToMessages()}currentHtml(){return this._getMessageContainer().outerHTML}_addMessage(t){if(0===t.length)throw new Error("A new message text must be a non-empty string.");const e=this._getMessageContainer(),r=this._prepareMessageElement(t);e.appendChild(r)}_scrollToMessages(){jQuery.scroll_to_notices(jQuery(".woocommerce-error"))}_getMessageContainer(){let t=document.querySelector("ul.woocommerce-error");return null===t&&(t=document.createElement("ul"),t.setAttribute("class","woocommerce-error"),t.setAttribute("role","alert"),jQuery(this.wrapper).prepend(t)),t}_prepareMessageElement(t){const e=document.createElement("li");return e.innerHTML=t,e}clear(){jQuery(".woocommerce-error, .woocommerce-message").remove()}},qt=class{constructor(t,e){this.endpoint=t,this.nonce=e}update(t,e,r={}){return new Promise((n,o)=>{fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,products:e,...r})}).then(t=>t.json()).then(e=>{if(!e.success)return void o(e.data);const r=t(e.data);n(r)})})}},Ut=class{constructor(t,e){this.config=t,this.errorHandler=e}subscriptionsConfiguration(t){return{createSubscription:(e,r)=>r.subscription.create({plan_id:t}),onApprove:t=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID,should_create_wc_order:!this.config.vaultingEnabled||"venmo"!==t.paymentSource})}).then(t=>t.json()).then(t=>{if(!t.success)throw Error(t.data.message);const e=t.data?.order_received_url;location.href=e||this.config.redirect})},onError:t=>{console.error(t)}}}configuration(){return{createOrder:()=>{const t=F(),e=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"";return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,purchase_units:[],payment_method:E,funding_source:window.ppcpFundingSource,bn_code:e,payer:t,context:this.config.context})}).then(function(t){return t.json()}).then(function(t){if(!t.success)throw console.error(t),Error(t.data.message);return t.data.id})},onApprove:Dt(this,this.errorHandler),onCancel:()=>{Ft.reloadButtonsIfRequired(this.config.button.wrapper)},onError:()=>{this.errorHandler.genericError(),Ft.reloadButtonsIfRequired(this.config.button.wrapper)}}}};function Wt(t){return Wt="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},Wt(t)}function $t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zt(n.key),n)}}function zt(t){var e=function(t){if("object"!=Wt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Wt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wt(e)?e:e+""}function Vt(t,e,r){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,r)}function Qt(t,e){return t.get(Kt(t,e))}function Jt(t,e,r){return t.set(Kt(t,e),r),r}function Kt(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}r(9868);var Yt=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,te=new WeakMap,ee=function(){return t=function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Vt(this,Yt,""),Vt(this,Xt,""),Vt(this,Zt,0),Vt(this,te,0),Jt(Yt,this,o),Jt(Xt,this,n),r=this.toAmount(r),e=this.toAmount(e),this.shippingFee=r,this.amount=e-r},(e=[{key:"amount",get:function(){return Qt(Zt,this)},set:function(t){Jt(Zt,this,this.toAmount(t))}},{key:"shippingFee",get:function(){return Qt(te,this)},set:function(t){Jt(te,this,this.toAmount(t))}},{key:"currencyCode",get:function(){return Qt(Xt,this)}},{key:"countryCode",get:function(){return Qt(Yt,this)}},{key:"totalPrice",get:function(){return(Qt(Zt,this)+Qt(te,this)).toFixed(2)}},{key:"finalObject",get:function(){return{countryCode:this.countryCode,currencyCode:this.currencyCode,totalPriceStatus:"FINAL",totalPrice:this.totalPrice}}},{key:"toAmount",value:function(t){return t=Number(t)||0,Math.round(100*t)/100}},{key:"setTotal",value:function(t,e){(t=this.toAmount(t))&&(this.shippingFee=e,this.amount=t-this.shippingFee)}}])&&$t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function re(t){return re="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},re(t)}function ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oe(n.key),n)}}function oe(t){var e=function(t){if("object"!=re(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=re(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==re(e)?e:e+""}var ie=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.buttonConfig=e,this.ppcpConfig=r,this.externalHandler=n},(e=[{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.cart}},{key:"shippingAllowed",value:function(){return this.buttonConfig.shipping.enabled&&this.buttonConfig.shipping.configured}},{key:"transactionInfo",value:function(){var t=this;return new Promise(function(e,r){fetch(t.ppcpConfig.ajax.cart_script_params.endpoint,{method:"GET",credentials:"same-origin"}).then(function(t){return t.json()}).then(function(t){if(t.success){var r=t.data,n=new ee(r.total,r.shipping_fee,r.currency_code,r.country_code);e(n)}})})}},{key:"createOrder",value:function(){return this.actionHandler().configuration().createOrder(null,null)}},{key:"approveOrder",value:function(t,e){return this.actionHandler().configuration().onApprove(t,e)}},{key:"actionHandler",value:function(){return new Ut(this.ppcpConfig,this.errorHandler())}},{key:"errorHandler",value:function(){return new Ht(this.ppcpConfig.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper"))}}])&&ne(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const ae=ie;function ce(t){return ce="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},ce(t)}function ue(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,se(n.key),n)}}function se(t){var e=function(t){if("object"!=ce(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ce(e)?e:e+""}function le(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(le=function(){return!!t})()}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function pe(t,e){return pe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},pe(t,e)}const he=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=fe(e),function(t,e){if(e&&("object"==ce(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,le()?Reflect.construct(e,r||[],fe(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&pe(t,e)}(e,t),r=e,(n=[{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.product}},{key:"transactionInfo",value:function(){var t=this,e=new Ht(this.ppcpConfig.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper")),r=new Gt(null,null,document.querySelector("form.cart"),e),n=PayPalCommerceGateway.data_client_id.has_subscriptions&&PayPalCommerceGateway.data_client_id.paypal_subscriptions_enabled?r.getSubscriptionProducts():r.getProducts();return new Promise(function(e,r){new Lt(t.ppcpConfig.ajax.simulate_cart.endpoint,t.ppcpConfig.ajax.simulate_cart.nonce).simulate(function(t){var r=new ee(t.total,t.shipping_fee,t.currency_code,t.country_code);e(r)},n)})}},{key:"createOrder",value:function(){return this.actionHandler().configuration().createOrder(null,null,{updateCartOptions:{keepShipping:!0}})}},{key:"actionHandler",value:function(){return new Gt(this.ppcpConfig,new qt(this.ppcpConfig.ajax.change_cart.endpoint,this.ppcpConfig.ajax.change_cart.nonce),document.querySelector("form.cart"),this.errorHandler())}}])&&ue(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(ae);function de(t){return de="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},de(t)}function ye(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ye=function(){return!!t})()}function ve(t){return ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ve(t)}function ge(t,e){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ge(t,e)}const be=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=ve(e),function(t,e){if(e&&("object"==de(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ye()?Reflect.construct(e,r||[],ve(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&ge(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(ae);!function(){var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var n,o="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,r){return t==Array.prototype||t==Object.prototype||(t[e]=r.value),t},i=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof r.g&&r.g];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function a(t,e){if(e)t:{var r=i;t=t.split(".");for(var n=0;n<t.length-1;n++){var a=t[n];if(!(a in r))break t;r=r[a]}(e=e(n=r[t=t[t.length-1]]))!=n&&null!=e&&o(r,t,{configurable:!0,writable:!0,value:e})}}function c(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function u(t){var r="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return r?r.call(t):{next:e(t)}}if(a("Symbol",function(t){function e(t,e){this.A=t,o(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.A};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",n=0;return function t(o){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(r+(o||"")+"_"+n++,o)}}),a("Symbol.iterator",function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<r.length;n++){var a=i[r[n]];"function"==typeof a&&"function"!=typeof a.prototype[t]&&o(a.prototype,t,{configurable:!0,writable:!0,value:function(){return c(e(this))}})}return t}),"function"==typeof Object.setPrototypeOf)n=Object.setPrototypeOf;else{var s;t:{var l={};try{l.__proto__={a:!0},s=l.a;break t}catch(t){}s=!1}n=s?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var f=n;function p(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function h(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function d(t,e){return t.h=3,{value:e}}function y(t){this.g=new p,this.G=t}function v(t,e,r,n){try{var o=e.call(t.g.j,r);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.g.m=!1,o;var i=o.value}catch(e){return t.g.j=null,t.g.s(e),g(t)}return t.g.j=null,n.call(t.g,i),g(t)}function g(t){for(;t.g.h;)try{var e=t.G(t.g);if(e)return t.g.m=!1,{value:e.value,done:!1}}catch(e){t.g.v=void 0,t.g.s(e)}if(t.g.m=!1,t.g.l){if(e=t.g.l,t.g.l=null,e.F)throw e.D;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function b(t){this.next=function(e){return t.o(e)},this.throw=function(e){return t.s(e)},this.return=function(e){return function(t,e){h(t.g);var r=t.g.j;return r?v(t,"return"in r?r.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),g(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function m(t,e){return e=new b(new y(e)),f&&t.prototype&&f(e,t.prototype),e}if(p.prototype.o=function(t){this.v=t},p.prototype.s=function(t){this.l={D:t,F:!0},this.h=this.C||this.u},p.prototype.return=function(t){this.l={return:t},this.h=this.u},y.prototype.o=function(t){return h(this.g),this.g.j?v(this,this.g.j.next,t,this.g.o):(this.g.o(t),g(this))},y.prototype.s=function(t){return h(this.g),this.g.j?v(this,this.g.j.throw,t,this.g.o):(this.g.s(t),g(this))},a("Array.prototype.entries",function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var r=0,n=!1,o={next:function(){if(!n&&r<t.length){var o=r++;return{value:e(o,t[o]),done:!1}}return n=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,function(t,e){return[t,e]})}}),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var w=function(t,e){for(var r=0;r<t.length;r++)e(t[r])},S=function(t){return t.replace(/\r?\n|\r/g,"\r\n")},O=function(t,e,r){return e instanceof Blob?(r=void 0!==r?String(r+""):"string"==typeof e.name?e.name:"blob",e.name===r&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new File([e],r)),[String(t),e]):[String(t),String(e)]},j=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},_="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,x=_.FormData,P=_.XMLHttpRequest&&_.XMLHttpRequest.prototype.send,E=_.Request&&_.fetch,C=_.navigator&&_.navigator.sendBeacon,k=_.Element&&_.Element.prototype,T=_.Symbol&&Symbol.toStringTag;T&&(Blob.prototype[T]||(Blob.prototype[T]="Blob"),"File"in _&&!File.prototype[T]&&(File.prototype[T]="File"));try{new File([],"")}catch(t){_.File=function(t,e,r){return t=new Blob(t,r||{}),Object.defineProperties(t,{name:{value:e},lastModified:{value:+(r&&void 0!==r.lastModified?new Date(r.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),T&&Object.defineProperty(t,T,{value:"File"}),t}}var I=function(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},A=function(t){this.i=[];var e=this;t&&w(t.elements,function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type&&!t.matches("form fieldset[disabled] *"))if("file"===t.type){var r=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];w(r,function(r){e.append(t.name,r)})}else"select-multiple"===t.type||"select-one"===t.type?w(t.options,function(r){!r.disabled&&r.selected&&e.append(t.name,r.value)}):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(r="textarea"===t.type?S(t.value):t.value,e.append(t.name,r))})};if((t=A.prototype).append=function(t,e,r){j(arguments,2),this.i.push(O(t,e,r))},t.delete=function(t){j(arguments,1);var e=[];t=String(t),w(this.i,function(r){r[0]!==t&&e.push(r)}),this.i=e},t.entries=function t(){var e,r=this;return m(t,function(t){if(1==t.h&&(e=0),3!=t.h)return e<r.i.length?t=d(t,r.i[e]):(t.h=0,t=void 0),t;e++,t.h=2})},t.forEach=function(t,e){j(arguments,1);for(var r=u(this),n=r.next();!n.done;n=r.next()){var o=u(n.value);n=o.next().value,o=o.next().value,t.call(e,o,n,this)}},t.get=function(t){j(arguments,1);var e=this.i;t=String(t);for(var r=0;r<e.length;r++)if(e[r][0]===t)return e[r][1];return null},t.getAll=function(t){j(arguments,1);var e=[];return t=String(t),w(this.i,function(r){r[0]===t&&e.push(r[1])}),e},t.has=function(t){j(arguments,1),t=String(t);for(var e=0;e<this.i.length;e++)if(this.i[e][0]===t)return!0;return!1},t.keys=function t(){var e,r,n,o=this;return m(t,function(t){if(1==t.h&&(e=u(o),r=e.next()),3!=t.h)return r.done?void(t.h=0):(n=r.value,d(t,u(n).next().value));r=e.next(),t.h=2})},t.set=function(t,e,r){j(arguments,2),t=String(t);var n=[],o=O(t,e,r),i=!0;w(this.i,function(e){e[0]===t?i&&(i=!n.push(o)):n.push(e)}),i&&n.push(o),this.i=n},t.values=function t(){var e,r,n,o,i=this;return m(t,function(t){if(1==t.h&&(e=u(i),r=e.next()),3!=t.h)return r.done?void(t.h=0):(n=r.value,(o=u(n)).next(),d(t,o.next().value));r=e.next(),t.h=2})},A.prototype._asNative=function(){for(var t=new x,e=u(this),r=e.next();!r.done;r=e.next()){var n=u(r.value);r=n.next().value,n=n.next().value,t.append(r,n)}return t},A.prototype._blob=function(){var t="----formdata-polyfill-"+Math.random(),e=[],r="--"+t+'\r\nContent-Disposition: form-data; name="';return this.forEach(function(t,n){return"string"==typeof t?e.push(r+I(S(n))+'"\r\n\r\n'+S(t)+"\r\n"):e.push(r+I(S(n))+'"; filename="'+I(t.name)+'"\r\nContent-Type: '+(t.type||"application/octet-stream")+"\r\n\r\n",t,"\r\n")}),e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},A.prototype[Symbol.iterator]=function(){return this.entries()},A.prototype.toString=function(){return"[object FormData]"},k&&!k.matches&&(k.matches=k.matchesSelector||k.mozMatchesSelector||k.msMatchesSelector||k.oMatchesSelector||k.webkitMatchesSelector||function(t){for(var e=(t=(this.document||this.ownerDocument).querySelectorAll(t)).length;0<=--e&&t.item(e)!==this;);return-1<e}),T&&(A.prototype[T]="FormData"),P){var R=_.XMLHttpRequest.prototype.setRequestHeader;_.XMLHttpRequest.prototype.setRequestHeader=function(t,e){R.call(this,t,e),"content-type"===t.toLowerCase()&&(this.B=!0)},_.XMLHttpRequest.prototype.send=function(t){t instanceof A?(t=t._blob(),this.B||this.setRequestHeader("Content-Type",t.type),P.call(this,t)):P.call(this,t)}}E&&(_.fetch=function(t,e){return e&&e.body&&e.body instanceof A&&(e.body=e.body._blob()),E.call(this,t,e)}),C&&(_.navigator.sendBeacon=function(t,e){return e instanceof A&&(e=e._asNative()),C.call(this,t,e)}),_.FormData=A}}();class me{constructor(t,e){this.url=t,this.nonce=e}async validate(t){const e=new FormData(t),r=await fetch(this.url,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.nonce,form_encoded:new URLSearchParams(e).toString()})}),n=await r.json();if(!n.success){if(n.data.refresh&&jQuery(document.body).trigger("update_checkout"),n.data.errors)return n.data.errors;throw Error(n.data.message)}return[]}}const we=class{constructor(t,e,r){this.config=t,this.errorHandler=e,this.spinner=r}subscriptionsConfiguration(t){return{createSubscription:async(e,r)=>{try{await(n=this.config,new Promise(async(t,e)=>{try{const r=new Mt,o=new Ht(n.labels.error.generic,document.querySelector(".woocommerce-notices-wrapper")),i="checkout"===n.context?"form.checkout":"form#order_review",a=n.early_checkout_validation_enabled?new me(n.ajax.validate_checkout.endpoint,n.ajax.validate_checkout.nonce):null;if(!a)return void t();a.validate(document.querySelector(i)).then(n=>{n.length>0?(r.unblock(),o.clear(),o.messages(n),jQuery(document.body).trigger("checkout_error",[o.currentHtml()]),e()):t()})}catch(t){console.error(t),e()}}))}catch(t){throw{type:"form-validation-error"}}var n;return r.subscription.create({plan_id:t})},onApprove:(t,e)=>{fetch(this.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID})}).then(t=>t.json()).then(t=>{document.querySelector("#place_order").click()})},onError:t=>{console.error(t)}}}configuration(){const t=this.spinner;return{createOrder:(e,r)=>{const n=F(),o=void 0!==this.config.bn_codes[this.config.context]?this.config.bn_codes[this.config.context]:"",i=this.errorHandler,a="checkout"===this.config.context?"form.checkout":"form#order_review",c=new FormData(document.querySelector(a)),u=!!jQuery("#createaccount").is(":checked"),s=k(),l=window.ppcpFundingSource,f=!!document.getElementById("wc-ppcp-credit-card-gateway-new-payment-method")?.checked;return fetch(this.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:this.config.ajax.create_order.nonce,payer:n,bn_code:o,context:this.config.context,order_id:this.config.order_id,payment_method:s,funding_source:l,form_encoded:new URLSearchParams(c).toString(),createaccount:u,save_payment_method:f})}).then(function(t){return t.json()}).then(function(e){if(!e.success){if(t.unblock(),void 0!==e.messages){const t=new DOMParser;i.appendPreparedErrorMessageElement(t.parseFromString(e.messages,"text/html").querySelector("ul"))}else i.clear(),e.data.refresh&&jQuery(document.body).trigger("update_checkout"),e.data.errors?.length>0?i.messages(e.data.errors):e.data.details?.length>0?i.message(e.data.details.map(t=>`${t.issue} ${t.description}`).join("<br/>")):i.message(e.data.message),jQuery(document.body).trigger("checkout_error",[i.currentHtml()]);throw{type:"create-order-error",data:e.data}}const r=document.createElement("input");return r.setAttribute("type","hidden"),r.setAttribute("name","ppcp-resume-order"),r.setAttribute("value",e.data.custom_id),document.querySelector(a).appendChild(r),e.data.id})},onApprove:(e=this,r=this.errorHandler,(t,n)=>{const o=Mt.fullPage();return o.block(),r.clear(),Ft.isResumeFlow()&&Ft.cleanHashParams(),fetch(e.config.ajax.approve_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:e.config.ajax.approve_order.nonce,order_id:t.orderID,funding_source:window.ppcpFundingSource})}).then(t=>t.json()).then(t=>{if(!t.success){if(100===t.data.code?r.message(t.data.message):r.genericError(),void 0!==n&&void 0!==n.restart)return n.restart();throw new Error(t.data.message)}k().startsWith("ppcp-")||jQuery(`input[name="payment_method"][value="${E}"]`).prop("checked",!0),document.querySelector("#place_order").click()}).finally(()=>{o.unblock()})}),onCancel:()=>{t.unblock(),Ft.reloadButtonsIfRequired(this.config.button.wrapper)},onError:e=>{console.error(e),t.unblock(),e&&"create-order-error"===e.type||(this.errorHandler.genericError(),Ft.reloadButtonsIfRequired(this.config.button.wrapper))}};var e,r}};function Se(t){return Se="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},Se(t)}function Oe(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return je(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(je(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,je(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,je(f,"constructor",s),je(s,"constructor",u),u.displayName="GeneratorFunction",je(s,o,"GeneratorFunction"),je(f),je(f,o,"Generator"),je(f,n,function(){return this}),je(f,"toString",function(){return"[object Generator]"}),(Oe=function(){return{w:i,m:p}})()}function je(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}je=function(t,e,r,n){function i(e,r){je(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},je(t,e,r,n)}function _e(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function xe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Pe(n.key),n)}}function Pe(t){var e=function(t){if("object"!=Se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=Se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Se(e)?e:e+""}function Ee(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ee=function(){return!!t})()}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ce(t)}function ke(t,e){return ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ke(t,e)}const Te=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Ce(e),function(t,e){if(e&&("object"==Se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ee()?Reflect.construct(e,r||[],Ce(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&ke(t,e)}(e,t),r=e,n=[{key:"validateForm",value:function(){var t=this;return new Promise(function(){var e,r=(e=Oe().m(function e(r,n){var o,i,a,c,u;return Oe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,o=new Mt,i=t.errorHandler(),a="checkout"===t.ppcpConfig.context?"form.checkout":"form#order_review",c=t.ppcpConfig.early_checkout_validation_enabled?new me(t.ppcpConfig.ajax.validate_checkout.endpoint,t.ppcpConfig.ajax.validate_checkout.nonce):null){e.n=1;break}return r(),e.a(2);case 1:c.validate(document.querySelector(a)).then(function(t){t.length>0?(o.unblock(),i.clear(),i.messages(t),jQuery(document.body).trigger("checkout_error",[i.currentHtml()]),n()):r()}),e.n=3;break;case 2:e.p=2,u=e.v,console.error(u),n();case 3:return e.a(2)}},e,null,[[0,2]])}),function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(t){_e(i,n,o,a,c,"next",t)}function c(t){_e(i,n,o,a,c,"throw",t)}a(void 0)})});return function(t,e){return r.apply(this,arguments)}}())}},{key:"actionHandler",value:function(){return new we(this.ppcpConfig,this.errorHandler(),new Mt)}}],n&&xe(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(ae);function Ie(t){return Ie="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},Ie(t)}function Ae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ae=function(){return!!t})()}function Re(t){return Re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Re(t)}function Me(t,e){return Me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Me(t,e)}const De=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Re(e),function(t,e){if(e&&("object"==Ie(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Ae()?Reflect.construct(e,r||[],Re(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&Me(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(ae);function Ne(t){return Ne="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},Ne(t)}function Be(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Be=function(){return!!t})()}function Fe(t){return Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Fe(t)}function Ge(t,e){return Ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ge(t,e)}const Le=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Fe(e),function(t,e){if(e&&("object"==Ne(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Be()?Reflect.construct(e,r||[],Fe(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&Ge(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(ae);function He(t){return He="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},He(t)}function qe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(qe=function(){return!!t})()}function Ue(t){return Ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ue(t)}function We(t,e){return We=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},We(t,e)}const $e=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Ue(e),function(t,e){if(e&&("object"==He(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,qe()?Reflect.construct(e,r||[],Ue(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&We(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(ae);function ze(t){return ze="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},ze(t)}function Ve(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return Qe(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Qe(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Qe(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Qe(f,"constructor",s),Qe(s,"constructor",u),u.displayName="GeneratorFunction",Qe(s,o,"GeneratorFunction"),Qe(f),Qe(f,o,"Generator"),Qe(f,n,function(){return this}),Qe(f,"toString",function(){return"[object Generator]"}),(Ve=function(){return{w:i,m:p}})()}function Qe(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Qe=function(t,e,r,n){function i(e,r){Qe(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Qe(t,e,r,n)}function Je(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ke(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ye(n.key),n)}}function Ye(t){var e=function(t){if("object"!=ze(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ze(e)?e:e+""}function Xe(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Xe=function(){return!!t})()}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ze(t)}function tr(t,e){return tr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},tr(t,e)}const er=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=Ze(e),function(t,e){if(e&&("object"==ze(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Xe()?Reflect.construct(e,r||[],Ze(t).constructor):e.apply(t,r))}(this,e,arguments)}return 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&&tr(t,e)}(e,t),r=e,n=[{key:"validateContext",value:function(){var t;return null===(t=this.ppcpConfig)||void 0===t||null===(t=t.locations_with_subscription_product)||void 0===t||!t.payorder}},{key:"transactionInfo",value:function(){var t=this;return new Promise(function(){var e,r=(e=Ve().m(function e(r,n){var o,i;return Ve().w(function(e){for(;;)switch(e.n){case 0:o=t.ppcpConfig.pay_now,i=new ee(o.total,o.shipping_fee,o.currency_code,o.country_code),r(i);case 1:return e.a(2)}},e)}),function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(t){Je(i,n,o,a,c,"next",t)}function c(t){Je(i,n,o,a,c,"throw",t)}a(void 0)})});return function(t,e){return r.apply(this,arguments)}}())}},{key:"actionHandler",value:function(){return new we(this.ppcpConfig,this.errorHandler(),new Mt)}}],n&&Ke(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(ae);function rr(t){return rr="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},rr(t)}function nr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,or(n.key),n)}}function or(t){var e=function(t){if("object"!=rr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==rr(e)?e:e+""}function ir(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ir=function(){return!!t})()}function ar(t){return ar=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ar(t)}function cr(t,e){return cr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},cr(t,e)}var ur=function(t){function e(t,r,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=ar(e),function(t,e){if(e&&("object"==rr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ir()?Reflect.construct(e,r||[],ar(t).constructor):e.apply(t,r))}(this,e,[t,r,n])}return 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&&cr(t,e)}(e,t),r=e,(n=[{key:"transactionInfo",value:function(){throw new Error("Transaction info fail. This is just a preview.")}},{key:"createOrder",value:function(){throw new Error("Create order fail. This is just a preview.")}},{key:"approveOrder",value:function(t,e){throw new Error("Approve order fail. This is just a preview.")}},{key:"actionHandler",value:function(){throw new Error("Action handler fail. This is just a preview.")}},{key:"errorHandler",value:function(){throw new Error("Error handler fail. This is just a preview.")}}])&&nr(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(ae);const sr=ur;function lr(t){return lr="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},lr(t)}function fr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pr(n.key),n)}}function pr(t){var e=function(t){if("object"!=lr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=lr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==lr(e)?e:e+""}var hr=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"create",value:function(t,e,r,n){switch(t){case"product":return new he(e,r,n);case"cart":return new be(e,r,n);case"checkout":return new Te(e,r,n);case"pay-now":return new er(e,r,n);case"mini-cart":return new $e(e,r,n);case"cart-block":return new De(e,r,n);case"checkout-block":return new Le(e,r,n);case"preview":return new sr(e,r,n)}}}],null&&fr(t.prototype,null),e&&fr(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();const dr=hr;function yr(t){return yr="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},yr(t)}function vr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return gr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}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 i,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function gr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function br(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return mr(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(mr(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,mr(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,mr(f,"constructor",s),mr(s,"constructor",u),u.displayName="GeneratorFunction",mr(s,o,"GeneratorFunction"),mr(f),mr(f,o,"Generator"),mr(f,n,function(){return this}),mr(f,"toString",function(){return"[object Generator]"}),(br=function(){return{w:i,m:p}})()}function mr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}mr=function(t,e,r,n){function i(e,r){mr(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},mr(t,e,r,n)}function wr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Sr(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){wr(i,n,o,a,c,"next",t)}function c(t){wr(i,n,o,a,c,"throw",t)}a(void 0)})}}function Or(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jr(n.key),n)}}function jr(t){var e=function(t){if("object"!=yr(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yr(e)?e:e+""}var _r=function(){return t=function t(e,r,n){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.namespace=e,this.buttonConfig=r,this.ppcpConfig=n,this.buttonAttributes=i,this.onClick=a,this.googlePayConfig=null,this.transactionInfo=null,this.contextHandler=null,this.buttons=[],w.watchContextBootstrap(function(){var t=Sr(br().m(function t(e){var i,a;return br().w(function(t){for(;;)switch(t.n){case 0:if(o.contextHandler=dr.create(e.context,r,n,e.handler),i=Tt.createButton(e.context,e.handler,r,n,o.contextHandler,o.buttonAttributes,o.onClick),o.buttons.push(i),a=function(){i.configure(o.googlePayConfig,o.transactionInfo,o.buttonAttributes),i.init()},!o.googlePayConfig||!o.transactionInfo){t.n=1;break}a(),t.n=3;break;case 1:return t.n=2,o.init();case 2:o.googlePayConfig&&o.transactionInfo&&a();case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}())},e=[{key:"init",value:(n=Sr(br().m(function t(){var e,r,n,o;return br().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,this.googlePayConfig){t.n=2;break}return t.n=1,window[this.namespace].Googlepay().config();case 1:this.googlePayConfig=t.v;case 2:if(this.transactionInfo){t.n=4;break}return t.n=3,this.fetchTransactionInfo();case 3:this.transactionInfo=t.v;case 4:if(this.googlePayConfig)if(this.transactionInfo){e=vr(this.buttons);try{for(e.s();!(r=e.n()).done;)(n=r.value).configure(this.googlePayConfig,this.transactionInfo,this.buttonAttributes),n.init()}catch(t){e.e(t)}finally{e.f()}}else console.error("No transactionInfo found during init");else console.error("No GooglePayConfig received during init");t.n=6;break;case 5:t.p=5,o=t.v,console.error("Error during initialization:",o);case 6:return t.a(2)}},t,this,[[0,5]])})),function(){return n.apply(this,arguments)})},{key:"fetchTransactionInfo",value:(r=Sr(br().m(function t(){var e;return br().w(function(t){for(;;)switch(t.p=t.n){case 0:if(t.p=0,this.contextHandler){t.n=1;break}throw new Error("ContextHandler is not initialized");case 1:return t.n=2,this.contextHandler.transactionInfo();case 2:return t.a(2,t.v);case 3:throw t.p=3,e=t.v,console.error("Error fetching transaction info:",e),e;case 4:return t.a(2)}},t,this,[[0,3]])})),function(){return r.apply(this,arguments)})},{key:"reinit",value:function(){var t,e=vr(this.buttons);try{for(e.s();!(t=e.n()).done;)t.value.reinit()}catch(t){e.e(t)}finally{e.f()}}}],e&&Or(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n}();const xr=_r;function Pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const Er=function(t,e,r,o,i,a){var c,u,s,l=(u=(0,n.useState)(null),s=2,function(t){if(Array.isArray(t))return t}(u)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(u,s)||function(t,e){if(t){if("string"==typeof t)return Pr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pr(t,e):void 0}}(u,s)||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.")}()),f=l[0],p=l[1],h=function(t,e,r){return(0,n.useMemo)(function(){var n,o=O((null==e?void 0:e.button)||{},(null==t?void 0:t.button)||{});return r&&o.Default&&(o.Default.height=r.height||o.Default.height,o.Default.borderRadius=r.borderRadius||o.Default.borderRadius),"buy"===(null===(n=o.MiniCart)||void 0===n?void 0:n.type)&&(o.MiniCart.type="pay"),o},[t,e,r])}(r,o,a);return(0,n.useEffect)(function(){var e,n;if(null!=t&&t.defaultView&&r&&i){var o=null===(e=t.defaultView.google)||void 0===e||null===(e=e.payments)||void 0===e?void 0:e.api;if(o){var a=new o.PaymentsClient({environment:"TEST"}),c={allowedPaymentMethods:i.allowedPaymentMethods,buttonColor:r.buttonColor||"black",buttonType:r.buttonType||"pay",buttonLocale:r.buttonLocale||"en",buttonSizeMode:"fill",buttonRadius:parseInt(null==h||null===(n=h.Default)||void 0===n?void 0:n.borderRadius),onClick:function(t){t.preventDefault()}},u=a.createButton(c);return p(u),function(){p(null)}}}},[t,e,r,o,i,h]),{button:f,containerStyles:{height:null!=h&&null!==(c=h.Default)&&void 0!==c&&c.height?"".concat(h.Default.height,"px"):""}}};function Cr(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return kr(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(kr(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,kr(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,kr(f,"constructor",s),kr(s,"constructor",u),u.displayName="GeneratorFunction",kr(s,o,"GeneratorFunction"),kr(f),kr(f,o,"Generator"),kr(f,n,function(){return this}),kr(f,"toString",function(){return"[object Generator]"}),(Cr=function(){return{w:i,m:p}})()}function kr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}kr=function(t,e,r,n){function i(e,r){kr(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},kr(t,e,r,n)}function Tr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Ir(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const Ar=function(t,e){var r,o,i=(r=(0,n.useState)(!1),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return Ir(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ir(t,e):void 0}}(r,o)||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.")}()),a=i[0],c=i[1];return e.url_params.components+=",googlepay",(0,n.useEffect)(function(){var r=function(){var r,n=(r=Cr().m(function r(){var n;return Cr().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,m(t,e);case 1:c(!0),r.n=3;break;case 2:r.p=2,n=r.v,console.error("Error loading PayPal script: ".concat(n));case 3:return r.a(2)}},r,null,[[0,2]])}),function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(t){Tr(i,n,o,a,c,"next",t)}function c(t){Tr(i,n,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();r()},[t,e]),a};function Rr(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return Mr(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Mr(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Mr(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Mr(f,"constructor",s),Mr(s,"constructor",u),u.displayName="GeneratorFunction",Mr(s,o,"GeneratorFunction"),Mr(f),Mr(f,o,"Generator"),Mr(f,n,function(){return this}),Mr(f,"toString",function(){return"[object Generator]"}),(Rr=function(){return{w:i,m:p}})()}function Mr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Mr=function(t,e,r,n){function i(e,r){Mr(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Mr(t,e,r,n)}function Dr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const Br=function(t,e,r){var i,a,c=(i=(0,n.useState)(!1),a=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(i,a)||function(t,e){if(t){if("string"==typeof t)return Nr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Nr(t,e):void 0}}(i,a)||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.")}()),u=c[0],s=c[1];return(0,n.useEffect)(function(){if(t){var n=function(e){if(document!==t){var r=document.querySelector('script[src^="'.concat(e,'"]'));if(r){var n=t.createElement("script");n.src=r.src,n.async=r.async,n.type=r.type,t.head.appendChild(n)}else console.error("Script not found in the document:",e)}},i=function(){var t,i=(t=Rr().m(function t(){var i;return Rr().w(function(t){for(;;)switch(t.p=t.n){case 0:if(r){t.n=1;break}return t.a(2);case 1:if(e&&e.sdk_url){t.n=2;break}return console.error("Invalid buttonConfig or missing sdk_url"),t.a(2);case 2:return t.p=2,t.n=3,o({url:e.sdk_url}).then(function(){n(e.sdk_url)});case 3:s(!0),t.n=5;break;case 4:t.p=4,i=t.v,console.error("Failed to load Googlepay script:",i);case 5:return t.a(2)}},t,null,[[2,4]])}),function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){Dr(i,n,o,a,c,"next",t)}function c(t){Dr(i,n,o,a,c,"throw",t)}a(void 0)})});return function(){return i.apply(this,arguments)}}();i()}},[t,e,r]),u};function Fr(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,s=Object.create(u.prototype);return Gr(s,"_invoke",function(r,n,o){var i,c,u,s=0,l=o||[],f=!1,p={p:0,n:0,v:t,a:h,f:h.bind(t,4),d:function(e,r){return i=e,c=0,u=t,p.n=r,a}};function h(r,n){for(c=r,u=n,e=0;!f&&s&&!o&&e<l.length;e++){var o,i=l[e],h=p.p,d=i[2];r>3?(o=d===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=h&&((o=r<2&&h<i[1])?(c=0,p.v=n,p.n=i[1]):h<d&&(o=r<3||i[0]>n||n>d)&&(i[4]=r,i[5]=n,p.n=d,c=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,d){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),c=l,u=d;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),h(c,u)):p.n=u:p.v=u);try{if(s=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,c=1,u=e}finally{s=1}}return{value:e,done:f}}}(r,o,i),!0),s}var a={};function c(){}function u(){}function s(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Gr(e={},n,function(){return this}),e),f=s.prototype=c.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,Gr(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=s,Gr(f,"constructor",s),Gr(s,"constructor",u),u.displayName="GeneratorFunction",Gr(s,o,"GeneratorFunction"),Gr(f),Gr(f,o,"Generator"),Gr(f,n,function(){return this}),Gr(f,"toString",function(){return"[object Generator]"}),(Fr=function(){return{w:i,m:p}})()}function Gr(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Gr=function(t,e,r,n){function i(e,r){Gr(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Gr(t,e,r,n)}function Lr(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function Hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const qr=function(t,e){var r,o,i=(r=(0,n.useState)(null),o=2,function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return Hr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hr(t,e):void 0}}(r,o)||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.")}()),a=i[0],c=i[1];return(0,n.useEffect)(function(){var r=function(){var r,n=(r=Fr().m(function r(){var n,o;return Fr().w(function(r){for(;;)switch(r.p=r.n){case 0:if(e){r.n=1;break}return r.a(2);case 1:return r.p=1,r.n=2,window[t].Googlepay().config();case 2:n=r.v,c(n),r.n=4;break;case 3:r.p=3,o=r.v,console.error("Failed to fetch Google Pay config:",o);case 4:return r.a(2)}},r,null,[[1,3]])}),function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(t){Lr(i,n,o,a,c,"next",t)}function c(t){Lr(i,n,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();r()},[t,e]),a};function Ur(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}const Wr=function(t){var e,r,o=t.namespace,i=t.buttonConfig,a=t.ppcpConfig,c=t.buttonAttributes,u=(e=(0,n.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return Ur(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ur(t,e):void 0}}(e,r)||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.")}()),s=u[0],l=u[1],f=Ar(o,a),p=Br(s,i,f),h=qr(o,p),d=Er(s,o,i,a,h,c),y=d.button,v=d.containerStyles;return React.createElement(React.Fragment,null,React.createElement("div",{id:"express-payment-method-ppcp-googlepay",style:v,ref:function(t){if(t){for(l(t.ownerDocument);t.firstChild;)t.removeChild(t.firstChild);y&&t.appendChild(y)}}}),y&&React.createElement("style",null,".block-editor-iframe__html .gpay-card-info-animated-progress-bar-container {\n display: none !important\n }"))},$r=function(t){var e=t.namespace,r=t.buttonConfig,n=t.ppcpConfig,o=t.buttonAttributes;return React.createElement(Wr,{namespace:e,buttonConfig:r,ppcpConfig:n,buttonAttributes:o})};function zr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Vr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vr(t,e):void 0}}(t,e)||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 Vr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Qr=wc.wcSettings.getSetting("ppcp-gateway_data").scriptData,Jr=wc.wcSettings.getSetting("ppcp-googlepay_data"),Kr=Jr.scriptData,Yr="ppcpBlocksPaypalGooglepay";void 0===window.PayPalCommerceGateway&&(window.PayPalCommerceGateway=Qr);var Xr=function(t){var e=t.isEditing,r=t.buttonAttributes,i=t.onClick,a=zr((0,n.useState)(!1),2),c=a[0],u=a[1],s=zr((0,n.useState)(!1),2),l=s[0],f=s[1],p=zr((0,n.useState)(null),2),h=p[0],d=p[1];return(0,n.useEffect)(function(){e||(o({url:Kr.sdk_url}).then(function(){f(!0)}),Qr.url_params.components+=",googlepay",m(Yr,Qr).then(function(){u(!0)}).catch(function(t){console.error("Failed to load PayPal script: ",t)}))},[e]),(0,n.useEffect)(function(){var t;if(!e&&h&&null!==(t=wp.data)&&void 0!==t&&t.subscribe){var r=null,n=wp.data.subscribe((t=>{const e={timeoutId:null,args:null},r=()=>{e.timeoutId&&window.clearTimeout(e.timeoutId),e.timeoutId=null,e.args=null},n=()=>{e.timeoutId&&(t.apply(null,e.args||[]),r())},o=(...t)=>{r(),e.args=t,e.timeoutId=window.setTimeout(n,300)};return o.cancel=r,o.flush=n,o})(function(){wp.data.select("wc/store/cart")&&(r=setTimeout(function(){h.buttons.forEach(function(t){return t.addButton()})},1e3))}));return function(){r&&clearTimeout(r),n&&n()}}},[e,h]),(0,n.useEffect)(function(){if(!e&&c&&l&&!h){var t=new xr(Yr,Kr,Qr,r,i);d(t)}},[c,l,e,h,r]),e?React.createElement($r,{namespace:Yr,buttonConfig:Kr,ppcpConfig:Qr,buttonAttributes:r}):React.createElement("div",{id:Kr.button.wrapper.replace("#",""),className:"ppcp-button-apm ppcp-button-googlepay"})};null!=Kr&&Kr.is_enabled&&(0,i.registerExpressPaymentMethod)({name:Jr.id,title:"PayPal - ".concat(Jr.title),description:(0,a.__)("Eligible users will see the PayPal button.","woocommerce-paypal-payments"),gatewayId:"ppcp-gateway",paymentMethodId:"ppcp-gateway",label:React.createElement("div",{dangerouslySetInnerHTML:{__html:Jr.title}}),content:React.createElement(Xr,{isEditing:!1}),edit:React.createElement(Xr,{isEditing:!0}),ariaLabel:Jr.title,canMakePayment:function(){return Jr.enabled},supports:{features:["products"],style:["height","borderRadius"]}})})();
//# sourceMappingURL=boot-block.js.map