(()=>{"use strict";var e={d:(t,r)=>{for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{CHECKOUT_EVENTS:()=>o,checkoutEvents:()=>c,checkoutEventsEmitter:()=>s});const r=window.wc.wcTypes,o={CHECKOUT_SUCCESS:"checkout_success",CHECKOUT_FAIL:"checkout_fail",CHECKOUT_VALIDATION:"checkout_validation"},s=function(){const e=new Map;return{subscribe(t,r=10,o){let s=e.get(o)||[];const c={listener:t,priority:r},n=s.findIndex(e=>e.priority>r);return-1===n?s.push(c):s.splice(n,0,c),e.set(o,s),()=>{s=e.get(o)||[],s=s.filter(e=>e!==c),e.set(o,s)}},emit:async(t,o)=>await(async(t,o)=>{const s=e.get(t)||[],c=Array.from(s),n=[];for(const{listener:e}of c)try{const t=await e(o);(0,r.isObserverResponse)(t)&&n.push(t)}catch(e){console.error(e)}return n})(t,o),emitWithAbort:async(t,o)=>await(async(t,o)=>{const s=e.get(t)||[],c=Array.from(s),n=[];try{for(const{listener:e}of c){const t=await e(o);if((0,r.isObserverResponse)(t)&&n.push(t),(0,r.isErrorResponse)(t)||(0,r.isFailResponse)(t))return n}}catch(e){return console.error(e),n.push({type:r.responseTypes.ERROR}),n}return n})(t,o),createSubscribeFunction(e){return(t,r=10)=>this.subscribe(t,r,e)}}}(),c={onCheckoutValidation:s.createSubscribeFunction(o.CHECKOUT_VALIDATION),onCheckoutSuccess:s.createSubscribeFunction(o.CHECKOUT_SUCCESS),onCheckoutFail:s.createSubscribeFunction(o.CHECKOUT_FAIL)};(this.wc=this.wc||{}).blocksCheckoutEvents=t})();