(()=>{"use strict";var t={228:t=>{var n=Object.prototype.hasOwnProperty,e="~";function r(){}function o(t,n,e){this.fn=t,this.context=n,this.once=e||!1}function i(t,n,r,i,c){if("function"!=typeof r)throw new TypeError("The listener must be a function");var u=new o(r,i||t,c),a=e?e+n:n;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],u]:t._events[a].push(u):(t._events[a]=u,t._eventsCount++),t}function c(t,n){0==--t._eventsCount?t._events=new r:delete t._events[n]}function u(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(e=!1)),u.prototype.eventNames=function(){var t,r,o=[];if(0===this._eventsCount)return o;for(r in t=this._events)n.call(t,r)&&o.push(e?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},u.prototype.listeners=function(t){var n=e?e+t:t,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,c=new Array(i);o{const t=e(228),n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let r;const o=new Uint8Array(16);function i(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const c=[];for(let t=0;t<256;++t)c.push((t+256).toString(16).slice(1));function u(t,n=0){return c[t[n+0]]+c[t[n+1]]+c[t[n+2]]+c[t[n+3]]+"-"+c[t[n+4]]+c[t[n+5]]+"-"+c[t[n+6]]+c[t[n+7]]+"-"+c[t[n+8]]+c[t[n+9]]+"-"+c[t[n+10]]+c[t[n+11]]+c[t[n+12]]+c[t[n+13]]+c[t[n+14]]+c[t[n+15]]}const a=function(t,e,r){if(n.randomUUID&&!e&&!t)return n.randomUUID();const o=(t=t||{}).random||(t.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=o[t];return e}return u(o)};function s(){return t=(new Date).getTime(),parseFloat(t.toString().replace(/(\d{3})$/,".$1"));var t}function f(){return a().replace(/-/g,"")}var l;function p(){return void 0!==window.pdst?l.VersionA:l.VersionB}!function(t){t.VersionA="a",t.VersionB="b"}(l||(l={}));var d={},v=!1,_=function(){d={key:null,lifetime:365,group:null,label:null,experiment:null}};function h(t){return Object.prototype.hasOwnProperty.call(d,t)?d[t]:null}_();var y=function(){return function(t){return"string"==typeof t?t:"number"==typeof t?t.toString():null}},w=function(){return function(t){var n=parseInt(t,10);return isNaN(n)?null:n}},m=function(){return function(t){var n=parseFloat(t);return isNaN(n)?null:n}},O=function(){return function(t){return["True","true","1",1,!0].indexOf(t)>-1||!(["False","false","0",0,!1].indexOf(t)>-1)&&null}},g=function(t){return function(n){var e;if(Array.isArray(n))e=n;else{if(null==n)return null;e=[n]}return t?e.map((function(n){return Object.keys(t).reduce((function(e,r){return e[r]=t[r](n[r]),e}),{})})):e}},b=function(t){return function(n){return n?t?Object.keys(t).reduce((function(e,r){return e[r]=t[r](n[r]),e}),{}):n:{}}};const S=function(){function t(){this.time=s(),this.action=null,this.group=null,this.label=null,this.experiment=null,this.fields={event_id:y()}}return t.prototype.update=function(t){var n=this;t&&Object.keys(this.fields).reduce((function(e,r){r in t&&(n[r]=t[r])}),{})},t.prototype.data=function(){var t=this;return{action:this.action,time:this.time,group:null!==this.group?this.group:h("group"),label:null!==this.label?this.label:h("label"),experiment:null!==this.experiment?this.experiment:h("experiment"),body:Object.keys(this.fields).reduce((function(n,e){return n[e]=t.fields[e](t[e]),n}),{})}},t}();var T,j=(T=function(t,n){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},T(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=t}T(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}),E=function(){return E=Object.assign||function(t){for(var n,e=1,r=arguments.length;e0&&o[o.length-1])||6!==u[0]&&2!==u[0])){c=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0?(C(vt,"1",3650),!0):void 0})()||(function(t){t.addListener("event",(function(n,e){D(n.data()),!0===e&&t.emit("send.events")}))}(t),function(t){t.addListener("debug.events",(function(n){t.addListener("event",n)}))}(t),J(t),function(t){var n=function(n,e){return t.emit("event",new $(n),e)},e=function(n,e){return t.emit("event",new Y(n),e)},r=function(n,e){return t.emit("event",new nt(n),!1!==e)},o=function(n,e){return t.emit("event",new ot(n),e)};t.on("product",n),t.on("PRODUCT",n),t.on("addtocart",e),t.on("ADDTOCART",e),t.on("purchase",r),t.on("PURCHASE",r),t.on("checkout",o),t.on("CHECKOUT",o)}(t),function(t){var n=function(n,e){return t.emit("event",new ut(n),!1!==e)},e=function(n,e){return t.emit("event",new ft(n),e)};t.on("lead",n),t.on("LEAD",n),t.on("signup",e),t.on("SIGNUP",e)}(t),function(t){var n=function(n,e){t.emit("event",new dt(n),!1!==e)};t.on("click",n),t.on("CLICK",n)}(t),function(t){var n={},e=function(e,r){e&&e.hasOwnProperty&&x.forEach((function(t){e.hasOwnProperty(t)&&"string"==typeof e[t]&&(n[t]=e[t])})),t.emit("event",new P(n),r)};t.on("view",e),t.on("VIEW",e)}(t),W(t),function(t){var n=function(n){v?console.hasOwnProperty("warn")&&console.warn("pixel already configured."):(v=!0,n&&(d=Object.keys(n).reduce((function(t,e){return d.hasOwnProperty(e)&&(t[e]=n[e]),t}),Object.assign({},d))),t.emit("configured",d),t.emit("view"))},e=function(n){v?console.hasOwnProperty("warn")&&console.warn("pixel already configured."):(v=!0,n&&(d=Object.keys(n).reduce((function(t,e){return d.hasOwnProperty(e)&&(t[e]=n[e]),t}),Object.assign({},d))),t.emit("configured",d))};t.on("configure",n),t.on("CONFIGURE",n),t.on("conf",e),t.on("CONF",e)}(t),function(t){var n=function(n,e){var r=new yt("CUSTOM_EVENT_1",n);r.action=wt.CUSTOM_EVENT_1,t.emit("event",r,e)},e=function(n,e){var r=new yt("CUSTOM_EVENT_2",n);r.action=wt.CUSTOM_EVENT_2,t.emit("event",r,e)},r=function(n,e){var r=new yt("CUSTOM_EVENT_3",n);r.action=wt.CUSTOM_EVENT_3,t.emit("event",r,e)},o=function(n,e){var r=new yt("CUSTOM_EVENT_4",n);r.action=wt.CUSTOM_EVENT_4,t.emit("event",r,e)},i=function(n,e){var r=new yt("CUSTOM_EVENT_5",n);r.action=wt.CUSTOM_EVENT_5,t.emit("event",r,e)};t.on("CUSTOM_EVENT_1",n),t.on("custom_event_1",n),t.on("CUSTOM_EVENT_2",e),t.on("custom_event_2",e),t.on("CUSTOM_EVENT_3",r),t.on("custom_event_3",r),t.on("CUSTOM_EVENT_4",o),t.on("custom_event_4",o),t.on("CUSTOM_EVENT_5",i),t.on("custom_event_5",i)}(t),setTimeout((function(){!function(t,n){void 0===n&&(n=5e3),F(t);var e=setInterval((function(){F(t)}),n);setTimeout((function(){clearInterval(e)}),6e6),t.addListener("send.events",(function(){F(t)}))}(t)}),1))}(Ot);var gt=function(t){console&&"function"==typeof console.warn&&console.warn("[Pixel SDK Warning] ".concat(t))},bt=function(){for(var t=[],n=0;n0){var e=t[0],r=t[1],o=function(t){var n=t.toLowerCase();return mt.includes(n)?{valid:!0}:{valid:!1,error:"Unsupported event type: '".concat(t,"'. Supported events are: ").concat(mt.join(", "))}}(e);return o.valid||gt(o.error||"Invalid event: ".concat(e)),Ot.emit(e,r,t[2]),new Promise((function(t){Ot.once("api.captured",(function(){t()}))}))}return gt("No event type specified"),Promise.resolve()};window.spdt&&window.spdt.q&&window.spdt.q.length&&window.spdt.q.forEach((function(t){bt.apply(void 0,t)})),window.pdst&&window.pdst.q&&window.pdst.q.length&&window.pdst.q.forEach((function(t){bt.apply(void 0,t)})),window.spdt=function(){for(var t=[],n=0;n