@ordersune/crm-web-sdk 1.0.17 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/ordersune-crm-web-sdk-1.0.19.tgz +0 -0
- package/dist/ordersune-crm-web-sdk-1.0.20.tgz +0 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types/index.d.ts +84 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/web-sdk.d.ts +50 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("OrdersuneCRMWebSDK",[],t):"object"==typeof exports?exports.OrdersuneCRMWebSDK=t():e.OrdersuneCRMWebSDK=t()}(this,()=>(()=>{"use strict";var e={11:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const r=i(746),s=[];for(let e=0;e<256;++e)s.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return(s[e[t+0]]+s[e[t+1]]+s[e[t+2]]+s[e[t+3]]+"-"+s[e[t+4]]+s[e[t+5]]+"-"+s[e[t+6]]+s[e[t+7]]+"-"+s[e[t+8]]+s[e[t+9]]+"-"+s[e[t+10]]+s[e[t+11]]+s[e[t+12]]+s[e[t+13]]+s[e[t+14]]+s[e[t+15]]).toLowerCase()}t.unsafeStringify=unsafeStringify,t.default=function stringify(e,t=0){const i=unsafeStringify(e,t);if(!(0,r.default)(i))throw TypeError("Stringified UUID is invalid");return i}},182:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.validate=t.v7=t.v6ToV1=t.v6=t.v5=t.v4=t.v3=t.v1ToV6=t.v1=t.stringify=t.parse=t.NIL=t.MAX=void 0;var r=i(196);Object.defineProperty(t,"MAX",{enumerable:!0,get:function(){return r.default}});var s=i(465);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return s.default}});var n=i(797);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return n.default}});var o=i(11);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.default}});var a=i(425);Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return a.default}});var d=i(568);Object.defineProperty(t,"v1ToV6",{enumerable:!0,get:function(){return d.default}});var u=i(591);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return u.default}});var l=i(286);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return l.default}});var c=i(557);Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return c.default}});var h=i(356);Object.defineProperty(t,"v6",{enumerable:!0,get:function(){return h.default}});var g=i(268);Object.defineProperty(t,"v6ToV1",{enumerable:!0,get:function(){return g.default}});var p=i(299);Object.defineProperty(t,"v7",{enumerable:!0,get:function(){return p.default}});var y=i(746);Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return y.default}});var m=i(770);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return m.default}})},196:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default="ffffffff-ffff-ffff-ffff-ffffffffffff"},266:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.log=void 0;t.log=(e,t,...i)=>{e&&console.log("[OrderSune CRM]",t,...i)}},268:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(797),s=i(11);t.default=function v6ToV1(e){const t=function _v6ToV1(e){return Uint8Array.of((15&e[3])<<4|e[4]>>4&15,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|15&e[6],e[7],(15&e[1])<<4|(240&e[2])>>4,(15&e[2])<<4|(240&e[3])>>4,16|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}("string"==typeof e?(0,r.default)(e):e);return"string"==typeof e?(0,s.unsafeStringify)(t):t}},286:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(779),s=i(291),n=i(11);t.default=function v4(e,t,i){if(r.default.randomUUID&&!t&&!e)return r.default.randomUUID();const o=(e=e||{}).random??e.rng?.()??(0,s.default)();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){if((i=i||0)<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[i+e]=o[e];return t}return(0,n.unsafeStringify)(o)}},291:(e,t)=>{let i;Object.defineProperty(t,"__esModule",{value:!0});const r=new Uint8Array(16);t.default=function rng(){if(!i){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");i=crypto.getRandomValues.bind(crypto)}return i(r)}},299:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const r=i(291),s=i(11),n={};function updateV7State(e,t,i){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=i[6]<<23|i[7]<<16|i[8]<<8|i[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++),e}function v7Bytes(e,t,i,r,s=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(r){if(s<0||s+16>r.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`)}else r=new Uint8Array(16),s=0;return t??=Date.now(),i??=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9],r[s++]=t/1099511627776&255,r[s++]=t/4294967296&255,r[s++]=t/16777216&255,r[s++]=t/65536&255,r[s++]=t/256&255,r[s++]=255&t,r[s++]=112|i>>>28&15,r[s++]=i>>>20&255,r[s++]=128|i>>>14&63,r[s++]=i>>>6&255,r[s++]=i<<2&255|3&e[10],r[s++]=e[11],r[s++]=e[12],r[s++]=e[13],r[s++]=e[14],r[s++]=e[15],r}t.updateV7State=updateV7State,t.default=function v7(e,t,i){let o;if(e)o=v7Bytes(e.random??e.rng?.()??(0,r.default)(),e.msecs,e.seq,t,i);else{const e=Date.now(),s=(0,r.default)();updateV7State(n,e,s),o=v7Bytes(s,n.msecs,n.seq,t,i)}return t??(0,s.unsafeStringify)(o)}},338:(e,t)=>{function getOutputLength(e){return 14+(e+64>>>9<<4)+1}function safeAdd(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function md5cmn(e,t,i,r,s,n){return safeAdd(function bitRotateLeft(e,t){return e<<t|e>>>32-t}(safeAdd(safeAdd(t,e),safeAdd(r,n)),s),i)}function md5ff(e,t,i,r,s,n,o){return md5cmn(t&i|~t&r,e,t,s,n,o)}function md5gg(e,t,i,r,s,n,o){return md5cmn(t&r|i&~r,e,t,s,n,o)}function md5hh(e,t,i,r,s,n,o){return md5cmn(t^i^r,e,t,s,n,o)}function md5ii(e,t,i,r,s,n,o){return md5cmn(i^(t|~r),e,t,s,n,o)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function md5(e){return function uint32ToUint8(e){const t=new Uint8Array(4*e.length);for(let i=0;i<4*e.length;i++)t[i]=e[i>>2]>>>i%4*8&255;return t}(function wordsToMd5(e,t){const i=new Uint32Array(getOutputLength(t)).fill(0);i.set(e),i[t>>5]|=128<<t%32,i[i.length-1]=t,e=i;let r=1732584193,s=-271733879,n=-1732584194,o=271733878;for(let t=0;t<e.length;t+=16){const i=r,a=s,d=n,u=o;r=md5ff(r,s,n,o,e[t],7,-680876936),o=md5ff(o,r,s,n,e[t+1],12,-389564586),n=md5ff(n,o,r,s,e[t+2],17,606105819),s=md5ff(s,n,o,r,e[t+3],22,-1044525330),r=md5ff(r,s,n,o,e[t+4],7,-176418897),o=md5ff(o,r,s,n,e[t+5],12,1200080426),n=md5ff(n,o,r,s,e[t+6],17,-1473231341),s=md5ff(s,n,o,r,e[t+7],22,-45705983),r=md5ff(r,s,n,o,e[t+8],7,1770035416),o=md5ff(o,r,s,n,e[t+9],12,-1958414417),n=md5ff(n,o,r,s,e[t+10],17,-42063),s=md5ff(s,n,o,r,e[t+11],22,-1990404162),r=md5ff(r,s,n,o,e[t+12],7,1804603682),o=md5ff(o,r,s,n,e[t+13],12,-40341101),n=md5ff(n,o,r,s,e[t+14],17,-1502002290),s=md5ff(s,n,o,r,e[t+15],22,1236535329),r=md5gg(r,s,n,o,e[t+1],5,-165796510),o=md5gg(o,r,s,n,e[t+6],9,-1069501632),n=md5gg(n,o,r,s,e[t+11],14,643717713),s=md5gg(s,n,o,r,e[t],20,-373897302),r=md5gg(r,s,n,o,e[t+5],5,-701558691),o=md5gg(o,r,s,n,e[t+10],9,38016083),n=md5gg(n,o,r,s,e[t+15],14,-660478335),s=md5gg(s,n,o,r,e[t+4],20,-405537848),r=md5gg(r,s,n,o,e[t+9],5,568446438),o=md5gg(o,r,s,n,e[t+14],9,-1019803690),n=md5gg(n,o,r,s,e[t+3],14,-187363961),s=md5gg(s,n,o,r,e[t+8],20,1163531501),r=md5gg(r,s,n,o,e[t+13],5,-1444681467),o=md5gg(o,r,s,n,e[t+2],9,-51403784),n=md5gg(n,o,r,s,e[t+7],14,1735328473),s=md5gg(s,n,o,r,e[t+12],20,-1926607734),r=md5hh(r,s,n,o,e[t+5],4,-378558),o=md5hh(o,r,s,n,e[t+8],11,-2022574463),n=md5hh(n,o,r,s,e[t+11],16,1839030562),s=md5hh(s,n,o,r,e[t+14],23,-35309556),r=md5hh(r,s,n,o,e[t+1],4,-1530992060),o=md5hh(o,r,s,n,e[t+4],11,1272893353),n=md5hh(n,o,r,s,e[t+7],16,-155497632),s=md5hh(s,n,o,r,e[t+10],23,-1094730640),r=md5hh(r,s,n,o,e[t+13],4,681279174),o=md5hh(o,r,s,n,e[t],11,-358537222),n=md5hh(n,o,r,s,e[t+3],16,-722521979),s=md5hh(s,n,o,r,e[t+6],23,76029189),r=md5hh(r,s,n,o,e[t+9],4,-640364487),o=md5hh(o,r,s,n,e[t+12],11,-421815835),n=md5hh(n,o,r,s,e[t+15],16,530742520),s=md5hh(s,n,o,r,e[t+2],23,-995338651),r=md5ii(r,s,n,o,e[t],6,-198630844),o=md5ii(o,r,s,n,e[t+7],10,1126891415),n=md5ii(n,o,r,s,e[t+14],15,-1416354905),s=md5ii(s,n,o,r,e[t+5],21,-57434055),r=md5ii(r,s,n,o,e[t+12],6,1700485571),o=md5ii(o,r,s,n,e[t+3],10,-1894986606),n=md5ii(n,o,r,s,e[t+10],15,-1051523),s=md5ii(s,n,o,r,e[t+1],21,-2054922799),r=md5ii(r,s,n,o,e[t+8],6,1873313359),o=md5ii(o,r,s,n,e[t+15],10,-30611744),n=md5ii(n,o,r,s,e[t+6],15,-1560198380),s=md5ii(s,n,o,r,e[t+13],21,1309151649),r=md5ii(r,s,n,o,e[t+4],6,-145523070),o=md5ii(o,r,s,n,e[t+11],10,-1120210379),n=md5ii(n,o,r,s,e[t+2],15,718787259),s=md5ii(s,n,o,r,e[t+9],21,-343485551),r=safeAdd(r,i),s=safeAdd(s,a),n=safeAdd(n,d),o=safeAdd(o,u)}return Uint32Array.of(r,s,n,o)}(function uint8ToUint32(e){if(0===e.length)return new Uint32Array;const t=new Uint32Array(getOutputLength(8*e.length)).fill(0);for(let i=0;i<e.length;i++)t[i>>2]|=(255&e[i])<<i%4*8;return t}(e),8*e.length))}},356:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(11),s=i(425),n=i(568);t.default=function v6(e,t,i){e??={},i??=0;let o=(0,s.default)({...e,_v6:!0},new Uint8Array(16));if(o=(0,n.default)(o),t){for(let e=0;e<16;e++)t[i+e]=o[e];return t}return(0,r.unsafeStringify)(o)}},423:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WebSDK=void 0;const r=i(266),s=i(182),n="os.";t.WebSDK=class WebSDK{constructor(e){var t,i,n;if(this.maxBatchSize=10,this.batchInterval=1e4,this.sdkVersion="1.0.7",this.eventQueue=[],this.purchaseBatch=[],this.attributeQueue={},this.isProcessingQueue=!1,!e.apiKey||!e.endpoint)throw new Error("API key and endpoint are required");this.apiKey=e.apiKey,this.endpoint=e.endpoint,this.debug=null!==(t=e.debug)&&void 0!==t&&t,this.maxBatchSize=null!==(i=e.batchSize)&&void 0!==i?i:10,this.batchInterval=null!==(n=e.batchInterval)&&void 0!==n?n:1e4,this.deviceId=this.getStoredDeviceId()||(0,s.v4)(),this.guestUserId=this.getGuestUserId(),this.initialize().catch(e=>{(0,r.log)(this.debug,"Async initialization failed",e)})}async initialize(){try{(0,r.log)(this.debug,"SDK Initialized"),this.storeDeviceId(),await this.initializeDeviceDetails(),await this.loadCustomAttributes();const e=this.getStoredUserProfile();e?(this.currentUser=e,(0,r.log)(this.debug,"Loaded user profile",this.currentUser)):this.identify("");try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;this.trackCustomAttribute("timezone",e)}catch(e){(0,r.log)(this.debug,"Failed to detect timezone",e)}this.startBatchProcessing(),this.trackEvent("app_started",{})}catch(e){throw(0,r.log)(this.debug,"Initialization failed",e),e}}identify(e){if("string"!=typeof e)throw new Error("User ID must be a string");const t=this.getStoredUserProfile();(null==t?void 0:t.id)!==e&&((0,r.log)(this.debug,"Identifying user",e),this.currentUser=e?{id:e,guestUserId:this.guestUserId}:{id:this.guestUserId,guestUserId:this.guestUserId},this.storeUserProfile())}clearUserData(){this.deviceId=(0,s.v4)(),this.guestUserId=this.getGuestUserId(),this.initializeDeviceDetails(),this.currentUser={id:this.guestUserId,guestUserId:this.guestUserId},this.attributeQueue={},this.eventQueue=[],this.purchaseBatch=[],this.storeDeviceId(),sessionStorage.setItem(`${n}${this.apiKey}.current_user`,JSON.stringify(this.currentUser)),sessionStorage.removeItem(`${n}${this.apiKey}.custom_attributes`),this.debug&&(0,r.log)(this.debug,"User data cleared, new device ID generated")}trackEvent(e,t={},i={}){if(!e||"string"!=typeof e)throw new Error("Event name is required and must be a string");const r={deviceId:this.deviceId,eventName:e,timestamp:i.timestamp||Date.now(),requestId:i.requestId||(0,s.v4)(),properties:t};this.queueEvent(r)}setToken(e){this.deviceDetails&&(this.deviceDetails={...this.deviceDetails,pushToken:e})}trackCustomAttribute(e,t){if(!e||"string"!=typeof e)throw new Error("Attribute name is required and must be a string");this.attributeQueue={...this.attributeQueue,[e]:t},(0,r.log)(this.debug,"Custom attribute queued",e,t),this.storeCustomAttributes()}logProductPurchase(e,t,i,s,n,o,a,d){const u=this.buildPurchasePayload({externalId:e,itemId:t,itemName:i,unitPrice:s,quantity:n,source:o,channel:a,itemCategory:d});this.purchaseBatch.push(u),this.debug&&(0,r.log)(this.debug,"Purchase event queued",u)}getUserProfile(){return this.currentUser}async forceSend(){(this.eventQueue.length>0||this.purchaseBatch.length>0||this.attributeQueue.length>0)&&await this.processBatch()}dispose(){this.batchProcessingInterval&&clearInterval(this.batchProcessingInterval),(this.eventQueue.length>0||this.purchaseBatch.length>0||this.attributeQueue.length>0)&&this.processBatch().catch(e=>{(0,r.log)(this.debug,"Error during disposal",e)})}getStoredDeviceId(){return sessionStorage.getItem(`${n}${this.apiKey}.device_id`)}getStoredUserProfile(){const e=sessionStorage.getItem(`${n}${this.apiKey}.current_user`);return e?JSON.parse(e):null}storeDeviceId(){sessionStorage.setItem(`${n}${this.apiKey}.device_id`,this.deviceId)}storeUserProfile(){this.currentUser&&sessionStorage.setItem(`${n}${this.apiKey}.current_user`,JSON.stringify(this.currentUser))}storeCustomAttributes(){const e=sessionStorage.getItem(`${n}${this.apiKey}.custom_attributes`),t={...e?JSON.parse(e):{},...this.attributeQueue};sessionStorage.setItem(`${n}${this.apiKey}.custom_attributes`,JSON.stringify(t))}async loadCustomAttributes(){const e=sessionStorage.getItem(`${n}${this.apiKey}.custom_attributes`);e&&(this.attributeQueue={...this.attributeQueue,...JSON.parse(e)})}getGuestUserId(){return`guest_user_${this.deviceId}`}buildPurchasePayload({externalId:e,itemId:t,itemName:i,unitPrice:r,quantity:s,source:n,channel:o,itemCategory:a}){return{external_id:e,item_id:t,item_name:i,item_category:a,quantity:s,unit_price:r,total_price:r*s,source:n,channel:o,purchased_at:Date.now()}}async initializeDeviceDetails(){this.deviceDetails={deviceId:this.deviceId,platform:"web"}}startBatchProcessing(){this.batchProcessingInterval=setInterval(()=>{(this.eventQueue.length>0||this.purchaseBatch.length>0||this.attributeQueue.length>0)&&this.processBatch().catch(e=>{(0,r.log)(this.debug,"Batch processing failed",e)})},this.batchInterval)}queueEvent(e){this.eventQueue.push(e),(0,r.log)(this.debug,"Event queued",e),this.eventQueue.length>=this.maxBatchSize&&this.processBatch().catch(e=>{(0,r.log)(this.debug,"Batch processing failed",e)})}async processBatch(){if(this.isProcessingQueue)return;this.isProcessingQueue=!0;const e=[...this.eventQueue],t=[...this.purchaseBatch],i={...this.attributeQueue};this.eventQueue=[],this.purchaseBatch=[],this.attributeQueue={};try{await this.sendBatchToServer(e,t,i)}catch(s){throw this.eventQueue.unshift(...e),this.purchaseBatch.unshift(...t),this.attributeQueue={...this.attributeQueue,...i},(0,r.log)(this.debug,"Batch processing failed",s),s}finally{this.isProcessingQueue=!1}}async sendBatchToServer(e,t,i){var s,o;this.deviceDetails||await this.initializeDeviceDetails();const a={sdkVersion:this.sdkVersion,deviceInfo:this.deviceDetails,userId:null===(s=this.currentUser)||void 0===s?void 0:s.id,guestUserId:null===(o=this.currentUser)||void 0===o?void 0:o.guestUserId,time:Date.now(),events:e,purchases:t,userAttributes:i};(0,r.log)(this.debug,"Sending batch to server",a);try{const e=await fetch(`${this.endpoint}/analytics/data`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(a)});if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);this.debug&&(0,r.log)(this.debug,`Batch dispatched successfully: ${a.events.length} events, ${a.purchases.length} purchases, ${Object.keys(a.userAttributes).length} attributes`),await e.json(),Object.keys(i).length>0&&(this.attributeQueue={},sessionStorage.removeItem(`${n}${this.apiKey}.custom_attributes`))}catch(e){throw(0,r.log)(this.debug,"Failed to send payload to server",e),e}}displayInAppMessage(e,t,i){const r=JSON.parse(e),s=r.header,n=r.message,o=r.modal.button1,a=r.modal.button2,d=o.type||"",u=a.type||"",l=r.mediaConfig.inAppImage;this.showInAppMessage({context:i,title:s,body:n,primaryButtonText:d,secondaryButtonText:u,imageUrl:l,buttonPropertiesPrimary:o,buttonPropertiesSecondary:a,dismissMessageAutomatically:r.modal.dismissMessageAutomatically,dismissMessageInSeconds:r.modal.dismissMessageInSeconds,headerColor:r.modal.headerColor,messageColor:r.modal.messageColor,closeColor:r.modal.closeColor,campaignId:t})}hexToColor(e){return 6===(e=e.toUpperCase().replace("#","")).length?`#${e}`:`#${e.substring(2)}`}openWebUrl(e){e&&window.open(e,"_blank")}showInAppMessage(e){const{title:t,body:i,primaryButtonText:r,secondaryButtonText:s,imageUrl:n,onClose:o,buttonPropertiesPrimary:a,buttonPropertiesSecondary:d,dismissMessageAutomatically:u,dismissMessageInSeconds:l,headerColor:c,messageColor:h,closeColor:g,campaignId:p}=e,y=document.createElement("div");y.style.position="fixed",y.style.top="0",y.style.left="0",y.style.width="100%",y.style.height="100%",y.style.backgroundColor="rgba(0, 0, 0, 0.5)",y.style.display="flex",y.style.justifyContent="center",y.style.alignItems="center",y.style.zIndex="9999";const m=document.createElement("div");m.style.backgroundColor="white",m.style.borderRadius="12px",m.style.padding="16px",m.style.maxWidth="400px",m.style.width="90%",m.style.boxShadow="0 4px 6px rgba(0, 0, 0, 0.1)",m.style.position="relative";const b=document.createElement("button");b.innerHTML="×",b.style.position="absolute",b.style.top="8px",b.style.right="8px",b.style.background="none",b.style.border="none",b.style.fontSize="20px",b.style.cursor="pointer",b.style.color=this.hexToColor(g),b.onclick=()=>{o&&o(),this.logInAppMessageClick(p,!1,!0,!0),document.body.removeChild(y)};const v=document.createElement("div");if(v.style.display="flex",v.style.flexDirection="column",v.style.alignItems="center",v.style.textAlign="center",n&&""!==n.trim()){const e=document.createElement("img");e.src=n,e.style.width="100px",e.style.height="100px",e.style.marginBottom="16px",e.style.marginTop="16px",e.onerror=()=>{e.style.display="none"},v.appendChild(e)}const I=document.createElement("h2");I.textContent=t,I.style.fontSize="22px",I.style.fontWeight="600",I.style.color=this.hexToColor(c),I.style.margin="8px 0",v.appendChild(I);const C=document.createElement("p");C.textContent=i,C.style.fontSize="14px",C.style.color=this.hexToColor(h),C.style.fontWeight="500",C.style.margin="8px 0 24px 0",v.appendChild(C);const onPrimaryButtonPress=()=>{"redirect_to_web_url"!==a.webOnClickValue&&"deeplink_into_app"!==a.webOnClickValue||this.openWebUrl(a.webOnClickAction||"")},onSecondaryButtonPress=()=>{"redirect_to_web_url"!==d.webOnClickValue&&"deeplink_into_app"!==d.webOnClickValue||this.openWebUrl(d.webOnClickAction||"")},w=document.createElement("div");if(w.style.display="flex",w.style.justifyContent="center",w.style.width="100%",w.style.gap="16px",s&&""!==s.trim()){const e=document.createElement("button");e.textContent=r,e.style.flex="1",e.style.maxWidth="140px",e.style.padding="12px",e.style.backgroundColor=this.hexToColor(a.backgroundColor),e.style.color=this.hexToColor(a.textColor),e.style.border=`2px solid ${this.hexToColor(a.borderColor)}`,e.style.borderRadius="8px",e.style.fontSize="16px",e.style.fontWeight="600",e.style.cursor="pointer",e.onclick=()=>{document.body.removeChild(y),onPrimaryButtonPress()},w.appendChild(e);const t=document.createElement("button");t.textContent=s,t.style.flex="1",t.style.maxWidth="140px",t.style.padding="12px",t.style.backgroundColor=this.hexToColor(d.backgroundColor),t.style.color=this.hexToColor(d.textColor),t.style.border=`2px solid ${this.hexToColor(d.borderColor)}`,t.style.borderRadius="8px",t.style.fontSize="16px",t.style.fontWeight="600",t.style.cursor="pointer",t.onclick=()=>{document.body.removeChild(y),this.logInAppMessageClick(p,!0,!0,!1),onSecondaryButtonPress()},w.appendChild(t)}else if(r&&""!==r.trim()){const e=document.createElement("button");e.textContent=r,e.style.width="100%",e.style.padding="12px",e.style.backgroundColor=this.hexToColor(a.backgroundColor),e.style.color=this.hexToColor(a.textColor),e.style.border=`2px solid ${this.hexToColor(a.borderColor)}`,e.style.borderRadius="8px",e.style.fontSize="16px",e.style.fontWeight="600",e.style.cursor="pointer",e.onclick=()=>{document.body.removeChild(y),this.logInAppMessageClick(p,!0,!0,!1),onPrimaryButtonPress()},w.appendChild(e)}m.appendChild(b),m.appendChild(v),v.appendChild(w),y.appendChild(m),document.body.appendChild(y),u&&setTimeout(()=>{document.body.contains(y)&&document.body.removeChild(y)},1e3*parseInt(l)),y.addEventListener("click",e=>{e.target===y&&document.body.removeChild(y)})}async logInAppMessageClick(e,t,i,r){const s=await this.buildCampaignPayload(e,i,t,r);await this.processCampaignClick(s)}async logClick(e){this.currentUser&&this.deviceDetails||((0,r.log)(this.debug,"SDK not fully initialized, waiting for initialization"),await this.initialize()),(this.eventQueue.length>0||this.purchaseBatch.length>0||Object.keys(this.attributeQueue).length>0)&&await this.forceSend();const t=await this.buildCampaignPayload(e,!0,!0);await this.processCampaignClick(t)}async processCampaignClick(e){try{const t=await fetch(`${this.endpoint}/analytics/clicks`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(e)});if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);this.debug&&(0,r.log)(this.debug,`process campaign click dispatched successfully: ${e.campaignId}`)}catch(e){throw(0,r.log)(this.debug,"Error processing campaign click:",e),e}}async buildCampaignPayload(e,t,i,r){const s=Date.now(),n={campaignId:e,opened:t,clicked:i,deviceId:this.deviceId,timestamp:s};return void 0!==r&&(n.dismissed=r),n}}},425:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateV1State=void 0;const r=i(291),s=i(11),n={};function updateV1State(e,t,i){return e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0),e.node||(e.node=i.slice(10,16),e.node[0]|=1,e.clockseq=16383&(i[8]<<8|i[9])),e.msecs=t,e}function v1Bytes(e,t,i,r,s,n,o=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else n=new Uint8Array(16),o=0;t??=Date.now(),i??=0,r??=16383&(e[8]<<8|e[9]),s??=e.slice(10,16);const a=(1e4*(268435455&(t+=122192928e5))+i)%4294967296;n[o++]=a>>>24&255,n[o++]=a>>>16&255,n[o++]=a>>>8&255,n[o++]=255&a;const d=t/4294967296*1e4&268435455;n[o++]=d>>>8&255,n[o++]=255&d,n[o++]=d>>>24&15|16,n[o++]=d>>>16&255,n[o++]=r>>>8|128,n[o++]=255&r;for(let e=0;e<6;++e)n[o++]=s[e];return n}t.updateV1State=updateV1State,t.default=function v1(e,t,i){let o;const a=e?._v6??!1;if(e){const t=Object.keys(e);1===t.length&&"_v6"===t[0]&&(e=void 0)}if(e)o=v1Bytes(e.random??e.rng?.()??(0,r.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,i);else{const e=Date.now(),s=(0,r.default)();updateV1State(n,e,s),o=v1Bytes(s,n.msecs,n.nsecs,a?void 0:n.clockseq,a?void 0:n.node,t,i)}return t??(0,s.unsafeStringify)(o)}},465:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default="00000000-0000-0000-0000-000000000000"},557:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const r=i(829),s=i(988);var n=i(988);function v5(e,t,i,n){return(0,s.default)(80,r.default,e,t,i,n)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return n.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return n.URL}}),v5.DNS=s.DNS,v5.URL=s.URL,t.default=v5},568:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(797),s=i(11);t.default=function v1ToV6(e){const t=function _v1ToV6(e){return Uint8Array.of((15&e[6])<<4|e[7]>>4&15,(15&e[7])<<4|(240&e[4])>>4,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,(15&e[1])<<4|(240&e[2])>>4,96|15&e[2],e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}("string"==typeof e?(0,r.default)(e):e);return"string"==typeof e?(0,s.unsafeStringify)(t):t}},591:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const r=i(338),s=i(988);var n=i(988);function v3(e,t,i,n){return(0,s.default)(48,r.default,e,t,i,n)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return n.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return n.URL}}),v3.DNS=s.DNS,v3.URL=s.URL,t.default=v3},697:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i},746:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(697);t.default=function validate(e){return"string"==typeof e&&r.default.test(e)}},770:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(746);t.default=function version(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},779:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});const i="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:i}},797:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const r=i(746);t.default=function parse(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,255&t,(t=parseInt(e.slice(9,13),16))>>>8,255&t,(t=parseInt(e.slice(14,18),16))>>>8,255&t,(t=parseInt(e.slice(19,23),16))>>>8,255&t,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,255&t)}},829:(e,t)=>{function f(e,t,i,r){switch(e){case 0:return t&i^~t&r;case 1:case 3:return t^i^r;case 2:return t&i^t&r^i&r}}function ROTL(e,t){return e<<t|e>>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function sha1(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128;const s=(e=r).length/4+2,n=Math.ceil(s/16),o=new Array(n);for(let t=0;t<n;++t){const i=new Uint32Array(16);for(let r=0;r<16;++r)i[r]=e[64*t+4*r]<<24|e[64*t+4*r+1]<<16|e[64*t+4*r+2]<<8|e[64*t+4*r+3];o[t]=i}o[n-1][14]=8*(e.length-1)/Math.pow(2,32),o[n-1][14]=Math.floor(o[n-1][14]),o[n-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<n;++e){const r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=ROTL(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let s=i[0],n=i[1],a=i[2],d=i[3],u=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),o=ROTL(s,5)+f(i,n,a,d)+u+t[i]+r[e]>>>0;u=d,d=a,a=ROTL(n,30)>>>0,n=s,s=o}i[0]=i[0]+s>>>0,i[1]=i[1]+n>>>0,i[2]=i[2]+a>>>0,i[3]=i[3]+d>>>0,i[4]=i[4]+u>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}},988:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=t.stringToBytes=void 0;const r=i(797),s=i(11);function stringToBytes(e){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let i=0;i<e.length;++i)t[i]=e.charCodeAt(i);return t}t.stringToBytes=stringToBytes,t.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",t.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",t.default=function v35(e,t,i,n,o,a){const d="string"==typeof i?stringToBytes(i):i,u="string"==typeof n?(0,r.default)(n):n;if("string"==typeof n&&(n=(0,r.default)(n)),16!==n?.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+d.length);if(l.set(u),l.set(d,u.length),l=t(l),l[6]=15&l[6]|e,l[8]=63&l[8]|128,o){a=a||0;for(let e=0;e<16;++e)o[a+e]=l[e];return o}return(0,s.unsafeStringify)(l)}}},t={};function __webpack_require__(i){var r=t[i];if(void 0!==r)return r.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,__webpack_require__),s.exports}var i={};return __webpack_require__(423),i=i.named})());
|
|
1
|
+
function a0_0x3f24(){const _0x4d6961=['.device_id','relative','startBatchProcessing','500','Purchase\x20event\x20queued','trackEvent','textContent','URL','deviceDetails','.custom_attributes','width','ffffffff-ffff-ffff-ffff-ffffffffffff','[OrderSune\x20CRM]','getItem','Initialization\x20failed','processBatch','UUID\x20byte\x20range\x20','__esModule','28OegSdp','body','resolvedOptions','object','Error\x20processing\x20campaign\x20click:','campaignId','6ba7b810-9dad-11d1-80b4-00c04fd430c8','Loaded\x20user\x20profile','192604kkJmQa','appendChild','NIL','purchases','.current_user','Random\x20bytes\x20length\x20must\x20be\x20>=\x2016','×','User\x20data\x20cleared,\x20new\x20device\x20ID\x20generated','initialize','button2','onclick','endpoint','20px','process\x20campaign\x20click\x20dispatched\x20successfully:\x20','Stringified\x20UUID\x20is\x20invalid','contains','src','left','_blank','right','getStoredDeviceId','msecs','flex','/analytics/data','buildPurchasePayload','Invalid\x20UUID','User\x20ID\x20must\x20be\x20a\x20string','backgroundColor','getGuestUserId','userAttributes','alignItems','6pafIZt','8px','isProcessingQueue','undefined','gap','seq','forceSend','DateTimeFormat','default','setToken','WebSDK','createElement','randomUUID','white','00000000-0000-0000-0000-000000000000','140px','webOnClickAction','addEventListener','HTTP\x20error!\x20status:\x20','logClick','Attribute\x20name\x20is\x20required\x20and\x20must\x20be\x20a\x20string','stringify','flexDirection','processCampaignClick','justifyContent','apiKey','DNS','floor','guest_user_','guestUserId','removeItem','getRandomValues','open','replace','inAppImage','padding','borderColor','displayInAppMessage','pointer','0\x204px\x206px\x20rgba(0,\x200,\x200,\x200.1)','2px\x20solid\x20','trim','621QWdgDI','setItem','length','textColor','app_started','Event\x20name\x20is\x20required\x20and\x20must\x20be\x20a\x20string','slice','3029AcRrUw','deeplink_into_app','web','style','none','parse','dismissed','random','zIndex','column','button','100%','now','Batch\x20processing\x20failed','1647228zpGUYR','application/json','validate','display','clockseq','removeChild','getStoredUserProfile','getUserProfile','maxWidth','dismissMessageAutomatically','fontSize','\x20purchases,\x20','6ba7b811-9dad-11d1-80b4-00c04fd430c8','showInAppMessage','sdkVersion','sendBatchToServer','pow','269793kCupiK','closeColor','rgba(0,\x200,\x200,\x200.5)','webOnClickValue','attributeQueue','crypto.getRandomValues()\x20not\x20supported.\x20See\x20https://github.com/uuidjs/uuid#getrandomvalues-not-supported','14px','set','toUpperCase','logInAppMessageClick','redirect_to_web_url','updateV1State','deviceId','initializeDeviceDetails','log','height','currentUser','charCodeAt','_v6','batchInterval','unsafeStringify','SDK\x20Initialized','test','\x20is\x20out\x20of\x20buffer\x20bounds','eventQueue','12px','events','boxShadow','1834231vboxaO','storeCustomAttributes','headerColor','clearUserData','9999','SDK\x20not\x20fully\x20initialized,\x20waiting\x20for\x20initialization','updateV7State','logProductPurchase','fixed','maxBatchSize','v1ToV6','color','400px','loadCustomAttributes','Sending\x20batch\x20to\x20server','Namespace\x20must\x20be\x20array-like\x20(16\x20iterable\x20integer\x20values,\x200-255)','string','requestId','debug','modal','bind','API\x20key\x20and\x20endpoint\x20are\x20required','buildCampaignPayload','trackCustomAttribute','queueEvent','center','keys','22px','POST','top','ceil','version','fill','29320vrzYct','button1','batchSize','defineProperty','exports','{\x22name\x22:\x22@ordersune/crm-web-sdk\x22,\x22version\x22:\x221.0.20\x22,\x22main\x22:\x22dist/index.js\x22,\x22types\x22:\x22dist/index.d.ts\x22,\x22publishConfig\x22:{\x22access\x22:\x22public\x22},\x22scripts\x22:{\x22build\x22:\x22npm\x20run\x20build:bundle\x20&&\x20npm\x20run\x20build:types\x22,\x22build:bundle\x22:\x22webpack\x20--config\x20webpack.config.js\x22,\x22build:types\x22:\x22tsc\x20--emitDeclarationOnly\x20--outDir\x20dist\x22,\x22prepare\x22:\x22npm\x20run\x20build\x20&&\x20husky\x22,\x22release\x22:\x22bash\x20-c\x20\x27read\x20-p\x20\x5c\x22Enter\x20OTP\x20from\x20authenticator:\x20\x5c\x22\x20OTP\x20&&\x20GIT_AUTHOR_NAME=\x5c\x22$(git\x20config\x20user.name)\x5c\x22\x20GIT_AUTHOR_EMAIL=\x5c\x22$(git\x20config\x20user.email)\x5c\x22\x20GIT_COMMITTER_NAME=\x5c\x22$(git\x20config\x20user.name)\x5c\x22\x20GIT_COMMITTER_EMAIL=\x5c\x22$(git\x20config\x20user.email)\x5c\x22\x20NPM_CONFIG_OTP=$OTP\x20semantic-release\x20--no-ci\x27\x22,\x22lint:commit\x22:\x22commitlint\x20--edit\x22},\x22files\x22:[\x22dist\x22,\x22README.md\x22],\x22dependencies\x22:{\x22uuid\x22:\x22^11.0.3\x22},\x22devDependencies\x22:{\x22@commitlint/cli\x22:\x22^20.1.0\x22,\x22@commitlint/config-conventional\x22:\x22^20.0.0\x22,\x22@semantic-release/changelog\x22:\x22^6.0.3\x22,\x22@semantic-release/git\x22:\x22^10.0.1\x22,\x22@semantic-release/npm\x22:\x22^13.1.2\x22,\x22@types/uuid\x22:\x22^9.0.0\x22,\x22husky\x22:\x22^9.1.7\x22,\x22javascript-obfuscator\x22:\x22^4.1.1\x22,\x22semantic-release\x22:\x22^25.0.2\x22,\x22terser-webpack-plugin\x22:\x22^5.3.14\x22,\x22ts-loader\x22:\x22^9.5.4\x22,\x22typescript\x22:\x22^5.0.0\x22,\x22webpack\x22:\x22^5.103.0\x22,\x22webpack-cli\x22:\x22^6.0.1\x22,\x22webpack-obfuscator\x22:\x22^3.5.1\x22}}','div','16px','stringToBytes','MAX','100px','margin','push','rng','unshift','storeDeviceId','fontWeight','type','storeUserProfile','batchProcessingInterval','hexToColor','600','OrdersuneCRMWebSDK','Failed\x20to\x20detect\x20timezone','border','target','150015aptAZB','textAlign','borderRadius','nsecs','openWebUrl','Error\x20during\x20disposal','toLowerCase','20hLPEcX','timeZone','Event\x20queued','marginTop','toString','purchaseBatch','background','absolute','status','node','catch','position','timestamp','8px\x200\x2024px\x200','cursor','message'];a0_0x3f24=function(){return _0x4d6961;};return a0_0x3f24();}function a0_0x40ae(_0x2e17f3,_0x4162ed){const _0x3f240c=a0_0x3f24();return a0_0x40ae=function(_0x40aec7,_0x1d75e1){_0x40aec7=_0x40aec7-0x147;let _0x17543d=_0x3f240c[_0x40aec7];return _0x17543d;},a0_0x40ae(_0x2e17f3,_0x4162ed);}(function(_0x5d76bd,_0x113fe7){const _0x451cf4=a0_0x40ae,_0x48e9a0=_0x5d76bd();while(!![]){try{const _0x510d41=-parseInt(_0x451cf4(0x1f4))/0x1+parseInt(_0x451cf4(0x1a4))/0x2+parseInt(_0x451cf4(0x213))/0x3+-parseInt(_0x451cf4(0x19c))/0x4*(-parseInt(_0x451cf4(0x173))/0x5)+parseInt(_0x451cf4(0x1c3))/0x6*(-parseInt(_0x451cf4(0x22f))/0x7)+parseInt(_0x451cf4(0x159))/0x8*(-parseInt(_0x451cf4(0x1ed))/0x9)+parseInt(_0x451cf4(0x17a))/0xa*(parseInt(_0x451cf4(0x202))/0xb);if(_0x510d41===_0x113fe7)break;else _0x48e9a0['push'](_0x48e9a0['shift']());}catch(_0x52c15b){_0x48e9a0['push'](_0x48e9a0['shift']());}}}(a0_0x3f24,0x2b68b),!function webpackUniversalModuleDefinition(_0x173efc,_0x113257){const _0x4f857c=a0_0x40ae;_0x4f857c(0x19f)==typeof exports&&_0x4f857c(0x19f)==typeof module?module[_0x4f857c(0x15d)]=_0x113257():'function'==typeof define&&define['amd']?define('OrdersuneCRMWebSDK',[],_0x113257):'object'==typeof exports?exports['OrdersuneCRMWebSDK']=_0x113257():_0x173efc[_0x4f857c(0x16f)]=_0x113257();}(this,()=>((()=>{'use strict';var _0x50732d={0xb:(_0x23a27c,_0x554fec,_0xf3bc67)=>{const _0x242a74=a0_0x40ae;Object[_0x242a74(0x15c)](_0x554fec,_0x242a74(0x19b),{'value':!0x0}),_0x554fec['unsafeStringify']=void 0x0;const _0x1841de=_0xf3bc67(0x2ea),_0x4714f9=[];for(let _0x4f1917=0x0;_0x4f1917<0x100;++_0x4f1917)_0x4714f9[_0x242a74(0x165)]((_0x4f1917+0x100)[_0x242a74(0x17e)](0x10)['slice'](0x1));function _0x466c82(_0x5b73fc,_0x33dd12=0x0){const _0x2bdee9=_0x242a74;return(_0x4714f9[_0x5b73fc[_0x33dd12+0x0]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x1]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x2]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x3]]+'-'+_0x4714f9[_0x5b73fc[_0x33dd12+0x4]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x5]]+'-'+_0x4714f9[_0x5b73fc[_0x33dd12+0x6]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x7]]+'-'+_0x4714f9[_0x5b73fc[_0x33dd12+0x8]]+_0x4714f9[_0x5b73fc[_0x33dd12+0x9]]+'-'+_0x4714f9[_0x5b73fc[_0x33dd12+0xa]]+_0x4714f9[_0x5b73fc[_0x33dd12+0xb]]+_0x4714f9[_0x5b73fc[_0x33dd12+0xc]]+_0x4714f9[_0x5b73fc[_0x33dd12+0xd]]+_0x4714f9[_0x5b73fc[_0x33dd12+0xe]]+_0x4714f9[_0x5b73fc[_0x33dd12+0xf]])[_0x2bdee9(0x179)]();}_0x554fec[_0x242a74(0x227)]=_0x466c82,_0x554fec[_0x242a74(0x1cb)]=function _0x3c8aa6(_0x32ccd4,_0x1617b4=0x0){const _0x5a14e4=_0x242a74,_0x28cc01=_0x466c82(_0x32ccd4,_0x1617b4);if(!(0x0,_0x1841de['default'])(_0x28cc01))throw TypeError(_0x5a14e4(0x1b2));return _0x28cc01;};},0xb6:(_0x442dcc,_0x3435a4,_0x2d833f)=>{const _0x3ceb7a=a0_0x40ae;Object[_0x3ceb7a(0x15c)](_0x3435a4,_0x3ceb7a(0x19b),{'value':!0x0}),_0x3435a4['version']=_0x3435a4[_0x3ceb7a(0x204)]=_0x3435a4['v7']=_0x3435a4['v6ToV1']=_0x3435a4['v6']=_0x3435a4['v5']=_0x3435a4['v4']=_0x3435a4['v3']=_0x3435a4[_0x3ceb7a(0x239)]=_0x3435a4['v1']=_0x3435a4[_0x3ceb7a(0x1d8)]=_0x3435a4['parse']=_0x3435a4[_0x3ceb7a(0x1a6)]=_0x3435a4[_0x3ceb7a(0x162)]=void 0x0;var _0x3ed2fc=_0x2d833f(0xc4);Object['defineProperty'](_0x3435a4,_0x3ceb7a(0x162),{'enumerable':!0x0,'get':function(){const _0x559eb8=_0x3ceb7a;return _0x3ed2fc[_0x559eb8(0x1cb)];}});var _0x160fa0=_0x2d833f(0x1d1);Object['defineProperty'](_0x3435a4,'NIL',{'enumerable':!0x0,'get':function(){return _0x160fa0['default'];}});var _0x2e7fb9=_0x2d833f(0x31d);Object[_0x3ceb7a(0x15c)](_0x3435a4,_0x3ceb7a(0x1f9),{'enumerable':!0x0,'get':function(){return _0x2e7fb9['default'];}});var _0x2d8b1f=_0x2d833f(0xb);Object[_0x3ceb7a(0x15c)](_0x3435a4,_0x3ceb7a(0x1d8),{'enumerable':!0x0,'get':function(){const _0x5b8a6f=_0x3ceb7a;return _0x2d8b1f[_0x5b8a6f(0x1cb)];}});var _0x47db63=_0x2d833f(0x1a9);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v1',{'enumerable':!0x0,'get':function(){const _0x1d8772=_0x3ceb7a;return _0x47db63[_0x1d8772(0x1cb)];}});var _0x303aed=_0x2d833f(0x238);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v1ToV6',{'enumerable':!0x0,'get':function(){const _0x2893a2=_0x3ceb7a;return _0x303aed[_0x2893a2(0x1cb)];}});var _0x4a6d5c=_0x2d833f(0x24f);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v3',{'enumerable':!0x0,'get':function(){const _0x2188ab=_0x3ceb7a;return _0x4a6d5c[_0x2188ab(0x1cb)];}});var _0x33f274=_0x2d833f(0x11e);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v4',{'enumerable':!0x0,'get':function(){const _0x5b4223=_0x3ceb7a;return _0x33f274[_0x5b4223(0x1cb)];}});var _0x531452=_0x2d833f(0x22d);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v5',{'enumerable':!0x0,'get':function(){return _0x531452['default'];}});var _0x57f96a=_0x2d833f(0x164);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v6',{'enumerable':!0x0,'get':function(){const _0x4c788e=_0x3ceb7a;return _0x57f96a[_0x4c788e(0x1cb)];}});var _0x58a022=_0x2d833f(0x10c);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v6ToV1',{'enumerable':!0x0,'get':function(){const _0x474e9a=_0x3ceb7a;return _0x58a022[_0x474e9a(0x1cb)];}});var _0x346a36=_0x2d833f(0x12b);Object[_0x3ceb7a(0x15c)](_0x3435a4,'v7',{'enumerable':!0x0,'get':function(){const _0x392b1d=_0x3ceb7a;return _0x346a36[_0x392b1d(0x1cb)];}});var _0x4ef031=_0x2d833f(0x2ea);Object[_0x3ceb7a(0x15c)](_0x3435a4,_0x3ceb7a(0x204),{'enumerable':!0x0,'get':function(){const _0x130d01=_0x3ceb7a;return _0x4ef031[_0x130d01(0x1cb)];}});var _0x12d299=_0x2d833f(0x302);Object['defineProperty'](_0x3435a4,_0x3ceb7a(0x157),{'enumerable':!0x0,'get':function(){return _0x12d299['default'];}});},0xc4:(_0x52c3b5,_0x3000f7)=>{const _0x42ea71=a0_0x40ae;Object[_0x42ea71(0x15c)](_0x3000f7,_0x42ea71(0x19b),{'value':!0x0}),_0x3000f7[_0x42ea71(0x1cb)]=_0x42ea71(0x195);},0x10a:(_0x88e4cb,_0x1f62af)=>{const _0x529d38=a0_0x40ae;Object[_0x529d38(0x15c)](_0x1f62af,_0x529d38(0x19b),{'value':!0x0}),_0x1f62af[_0x529d38(0x221)]=void 0x0,_0x1f62af[_0x529d38(0x221)]=(_0x24fbe2,_0x3389b2,..._0x2855ae)=>{const _0xf30dc3=_0x529d38;_0x24fbe2&&console['log'](_0xf30dc3(0x196),_0x3389b2,..._0x2855ae);};},0x10c:(_0x3a0614,_0x3661cf,_0x3216f1)=>{const _0x1f7adf=a0_0x40ae;Object['defineProperty'](_0x3661cf,'__esModule',{'value':!0x0});const _0x5e9581=_0x3216f1(0x31d),_0xc61643=_0x3216f1(0xb);_0x3661cf[_0x1f7adf(0x1cb)]=function _0x197665(_0x2b17c2){const _0x8db979=_0x1f7adf,_0x1e819f=function _0x4ae409(_0x49d62f){return Uint8Array['of']((0xf&_0x49d62f[0x3])<<0x4|_0x49d62f[0x4]>>0x4&0xf,(0xf&_0x49d62f[0x4])<<0x4|(0xf0&_0x49d62f[0x5])>>0x4,(0xf&_0x49d62f[0x5])<<0x4|0xf&_0x49d62f[0x6],_0x49d62f[0x7],(0xf&_0x49d62f[0x1])<<0x4|(0xf0&_0x49d62f[0x2])>>0x4,(0xf&_0x49d62f[0x2])<<0x4|(0xf0&_0x49d62f[0x3])>>0x4,0x10|(0xf0&_0x49d62f[0x0])>>0x4,(0xf&_0x49d62f[0x0])<<0x4|(0xf0&_0x49d62f[0x1])>>0x4,_0x49d62f[0x8],_0x49d62f[0x9],_0x49d62f[0xa],_0x49d62f[0xb],_0x49d62f[0xc],_0x49d62f[0xd],_0x49d62f[0xe],_0x49d62f[0xf]);}(_0x8db979(0x148)==typeof _0x2b17c2?(0x0,_0x5e9581[_0x8db979(0x1cb)])(_0x2b17c2):_0x2b17c2);return _0x8db979(0x148)==typeof _0x2b17c2?(0x0,_0xc61643['unsafeStringify'])(_0x1e819f):_0x1e819f;};},0x11e:(_0x237171,_0x4bcb14,_0x1b3a34)=>{const _0x258657=a0_0x40ae;Object[_0x258657(0x15c)](_0x4bcb14,_0x258657(0x19b),{'value':!0x0});const _0x43d3f4=_0x1b3a34(0x30b),_0x40e78d=_0x1b3a34(0x123),_0x4d8de3=_0x1b3a34(0xb);_0x4bcb14['default']=function _0x4b135d(_0x30c141,_0x6239ad,_0x5ae53f){const _0x205497=_0x258657;if(_0x43d3f4[_0x205497(0x1cb)][_0x205497(0x1cf)]&&!_0x6239ad&&!_0x30c141)return _0x43d3f4[_0x205497(0x1cb)]['randomUUID']();const _0x17a0a8=(_0x30c141=_0x30c141||{})[_0x205497(0x1fb)]??_0x30c141[_0x205497(0x166)]?.()??(0x0,_0x40e78d[_0x205497(0x1cb)])();if(_0x17a0a8[_0x205497(0x1ef)]<0x10)throw new Error(_0x205497(0x1a9));if(_0x17a0a8[0x6]=0xf&_0x17a0a8[0x6]|0x40,_0x17a0a8[0x8]=0x3f&_0x17a0a8[0x8]|0x80,_0x6239ad){if((_0x5ae53f=_0x5ae53f||0x0)<0x0||_0x5ae53f+0x10>_0x6239ad[_0x205497(0x1ef)])throw new RangeError('UUID\x20byte\x20range\x20'+_0x5ae53f+':'+(_0x5ae53f+0xf)+'\x20is\x20out\x20of\x20buffer\x20bounds');for(let _0x402a32=0x0;_0x402a32<0x10;++_0x402a32)_0x6239ad[_0x5ae53f+_0x402a32]=_0x17a0a8[_0x402a32];return _0x6239ad;}return(0x0,_0x4d8de3[_0x205497(0x227)])(_0x17a0a8);};},0x123:(_0x58a1c4,_0x5a982f)=>{const _0xbd4374=a0_0x40ae;let _0x5d24ef;Object['defineProperty'](_0x5a982f,'__esModule',{'value':!0x0});const _0x4aba34=new Uint8Array(0x10);_0x5a982f[_0xbd4374(0x1cb)]=function _0x1dcaca(){const _0x24a4a2=_0xbd4374;if(!_0x5d24ef){if('undefined'==typeof crypto||!crypto[_0x24a4a2(0x1e2)])throw new Error(_0x24a4a2(0x218));_0x5d24ef=crypto[_0x24a4a2(0x1e2)][_0x24a4a2(0x14c)](crypto);}return _0x5d24ef(_0x4aba34);};},0x12b:(_0x50aa93,_0x17d33e,_0x20ea1f)=>{const _0x4545cd=a0_0x40ae;Object[_0x4545cd(0x15c)](_0x17d33e,_0x4545cd(0x19b),{'value':!0x0}),_0x17d33e['updateV7State']=void 0x0;const _0x3b377a=_0x20ea1f(0x123),_0x2af5f2=_0x20ea1f(0xb),_0x1a0835={};function _0x53a86f(_0x14185e,_0x1e6676,_0x5af841){const _0x2d0d6e=_0x4545cd;return _0x14185e[_0x2d0d6e(0x1b9)]??=-0x1/0x0,_0x14185e[_0x2d0d6e(0x1c8)]??=0x0,_0x1e6676>_0x14185e[_0x2d0d6e(0x1b9)]?(_0x14185e['seq']=_0x5af841[0x6]<<0x17|_0x5af841[0x7]<<0x10|_0x5af841[0x8]<<0x8|_0x5af841[0x9],_0x14185e[_0x2d0d6e(0x1b9)]=_0x1e6676):(_0x14185e['seq']=_0x14185e[_0x2d0d6e(0x1c8)]+0x1|0x0,0x0===_0x14185e['seq']&&_0x14185e[_0x2d0d6e(0x1b9)]++),_0x14185e;}function _0x34b8dc(_0x29309d,_0xac04d2,_0x4eb73b,_0x154afe,_0x39c9fd=0x0){const _0x5b3c92=_0x4545cd;if(_0x29309d[_0x5b3c92(0x1ef)]<0x10)throw new Error(_0x5b3c92(0x1a9));if(_0x154afe){if(_0x39c9fd<0x0||_0x39c9fd+0x10>_0x154afe['length'])throw new RangeError(_0x5b3c92(0x19a)+_0x39c9fd+':'+(_0x39c9fd+0xf)+_0x5b3c92(0x22a));}else _0x154afe=new Uint8Array(0x10),_0x39c9fd=0x0;return _0xac04d2??=Date[_0x5b3c92(0x200)](),_0x4eb73b??=0x7f*_0x29309d[0x6]<<0x18|_0x29309d[0x7]<<0x10|_0x29309d[0x8]<<0x8|_0x29309d[0x9],_0x154afe[_0x39c9fd++]=_0xac04d2/0x10000000000&0xff,_0x154afe[_0x39c9fd++]=_0xac04d2/0x100000000&0xff,_0x154afe[_0x39c9fd++]=_0xac04d2/0x1000000&0xff,_0x154afe[_0x39c9fd++]=_0xac04d2/0x10000&0xff,_0x154afe[_0x39c9fd++]=_0xac04d2/0x100&0xff,_0x154afe[_0x39c9fd++]=0xff&_0xac04d2,_0x154afe[_0x39c9fd++]=0x70|_0x4eb73b>>>0x1c&0xf,_0x154afe[_0x39c9fd++]=_0x4eb73b>>>0x14&0xff,_0x154afe[_0x39c9fd++]=0x80|_0x4eb73b>>>0xe&0x3f,_0x154afe[_0x39c9fd++]=_0x4eb73b>>>0x6&0xff,_0x154afe[_0x39c9fd++]=_0x4eb73b<<0x2&0xff|0x3&_0x29309d[0xa],_0x154afe[_0x39c9fd++]=_0x29309d[0xb],_0x154afe[_0x39c9fd++]=_0x29309d[0xc],_0x154afe[_0x39c9fd++]=_0x29309d[0xd],_0x154afe[_0x39c9fd++]=_0x29309d[0xe],_0x154afe[_0x39c9fd++]=_0x29309d[0xf],_0x154afe;}_0x17d33e[_0x4545cd(0x235)]=_0x53a86f,_0x17d33e[_0x4545cd(0x1cb)]=function _0x2e53a8(_0xf73df8,_0x464e6d,_0x3a0fc2){const _0x163bf3=_0x4545cd;let _0x3ff076;if(_0xf73df8)_0x3ff076=_0x34b8dc(_0xf73df8[_0x163bf3(0x1fb)]??_0xf73df8[_0x163bf3(0x166)]?.()??(0x0,_0x3b377a[_0x163bf3(0x1cb)])(),_0xf73df8[_0x163bf3(0x1b9)],_0xf73df8[_0x163bf3(0x1c8)],_0x464e6d,_0x3a0fc2);else{const _0x2dbf77=Date[_0x163bf3(0x200)](),_0x1592c1=(0x0,_0x3b377a[_0x163bf3(0x1cb)])();_0x53a86f(_0x1a0835,_0x2dbf77,_0x1592c1),_0x3ff076=_0x34b8dc(_0x1592c1,_0x1a0835[_0x163bf3(0x1b9)],_0x1a0835['seq'],_0x464e6d,_0x3a0fc2);}return _0x464e6d??(0x0,_0x2af5f2['unsafeStringify'])(_0x3ff076);};},0x14a:_0x3a9243=>{const _0x2e6d63=a0_0x40ae;_0x3a9243[_0x2e6d63(0x15d)]=JSON['parse'](_0x2e6d63(0x15e));},0x152:(_0xfdb10c,_0x2924a3)=>{const _0x121419=a0_0x40ae;function _0x6cc48e(_0xb85ea1){return 0xe+(_0xb85ea1+0x40>>>0x9<<0x4)+0x1;}function _0x5360c0(_0x54342d,_0x1937eb){const _0x17fe91=(0xffff&_0x54342d)+(0xffff&_0x1937eb);return(_0x54342d>>0x10)+(_0x1937eb>>0x10)+(_0x17fe91>>0x10)<<0x10|0xffff&_0x17fe91;}function _0x463c6f(_0x469163,_0x3c8964,_0x16689d,_0x4d3879,_0x2cfe26,_0x878896){return _0x5360c0(function _0x3a83d2(_0x36d556,_0x1f8f9d){return _0x36d556<<_0x1f8f9d|_0x36d556>>>0x20-_0x1f8f9d;}(_0x5360c0(_0x5360c0(_0x3c8964,_0x469163),_0x5360c0(_0x4d3879,_0x878896)),_0x2cfe26),_0x16689d);}function _0x8af238(_0x4d6781,_0x968f1a,_0x2e53dc,_0x4510ca,_0x548f26,_0x413477,_0x4737f5){return _0x463c6f(_0x968f1a&_0x2e53dc|~_0x968f1a&_0x4510ca,_0x4d6781,_0x968f1a,_0x548f26,_0x413477,_0x4737f5);}function _0x102afb(_0x35962a,_0x24fab7,_0x378693,_0x5cd512,_0x3a08d4,_0x51d708,_0x4b6d23){return _0x463c6f(_0x24fab7&_0x5cd512|_0x378693&~_0x5cd512,_0x35962a,_0x24fab7,_0x3a08d4,_0x51d708,_0x4b6d23);}function _0x577ce7(_0xe1f829,_0x7bc285,_0x2bfeca,_0x426dd1,_0x59b3ae,_0x438b77,_0x35c837){return _0x463c6f(_0x7bc285^_0x2bfeca^_0x426dd1,_0xe1f829,_0x7bc285,_0x59b3ae,_0x438b77,_0x35c837);}function _0x231620(_0x5a76b4,_0x2eecf1,_0x547560,_0x15cad9,_0x2ef990,_0x34fcc1,_0x168c8e){return _0x463c6f(_0x547560^(_0x2eecf1|~_0x15cad9),_0x5a76b4,_0x2eecf1,_0x2ef990,_0x34fcc1,_0x168c8e);}Object['defineProperty'](_0x2924a3,_0x121419(0x19b),{'value':!0x0}),_0x2924a3['default']=function _0x121f79(_0x151ac6){return function _0x1c60bb(_0x3e8315){const _0x5de136=a0_0x40ae,_0x45b4be=new Uint8Array(0x4*_0x3e8315[_0x5de136(0x1ef)]);for(let _0x2e9c93=0x0;_0x2e9c93<0x4*_0x3e8315['length'];_0x2e9c93++)_0x45b4be[_0x2e9c93]=_0x3e8315[_0x2e9c93>>0x2]>>>_0x2e9c93%0x4*0x8&0xff;return _0x45b4be;}(function _0x1e5099(_0x50820e,_0x54ea5b){const _0xa0fd53=a0_0x40ae,_0x4a3970=new Uint32Array(_0x6cc48e(_0x54ea5b))[_0xa0fd53(0x158)](0x0);_0x4a3970['set'](_0x50820e),_0x4a3970[_0x54ea5b>>0x5]|=0x80<<_0x54ea5b%0x20,_0x4a3970[_0x4a3970['length']-0x1]=_0x54ea5b,_0x50820e=_0x4a3970;let _0x58fd25=0x67452301,_0xa2e035=-0x10325477,_0x360022=-0x67452302,_0x4fa134=0x10325476;for(let _0x57526a=0x0;_0x57526a<_0x50820e['length'];_0x57526a+=0x10){const _0x40073e=_0x58fd25,_0x489bc3=_0xa2e035,_0x1031c3=_0x360022,_0x1d6547=_0x4fa134;_0x58fd25=_0x8af238(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a],0x7,-0x28955b88),_0x4fa134=_0x8af238(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x1],0xc,-0x173848aa),_0x360022=_0x8af238(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x2],0x11,0x242070db),_0xa2e035=_0x8af238(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x3],0x16,-0x3e423112),_0x58fd25=_0x8af238(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x4],0x7,-0xa83f051),_0x4fa134=_0x8af238(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x5],0xc,0x4787c62a),_0x360022=_0x8af238(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x6],0x11,-0x57cfb9ed),_0xa2e035=_0x8af238(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x7],0x16,-0x2b96aff),_0x58fd25=_0x8af238(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x8],0x7,0x698098d8),_0x4fa134=_0x8af238(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x9],0xc,-0x74bb0851),_0x360022=_0x8af238(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xa],0x11,-0xa44f),_0xa2e035=_0x8af238(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xb],0x16,-0x76a32842),_0x58fd25=_0x8af238(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0xc],0x7,0x6b901122),_0x4fa134=_0x8af238(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xd],0xc,-0x2678e6d),_0x360022=_0x8af238(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xe],0x11,-0x5986bc72),_0xa2e035=_0x8af238(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xf],0x16,0x49b40821),_0x58fd25=_0x102afb(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x1],0x5,-0x9e1da9e),_0x4fa134=_0x102afb(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x6],0x9,-0x3fbf4cc0),_0x360022=_0x102afb(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xb],0xe,0x265e5a51),_0xa2e035=_0x102afb(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a],0x14,-0x16493856),_0x58fd25=_0x102afb(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x5],0x5,-0x29d0efa3),_0x4fa134=_0x102afb(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xa],0x9,0x2441453),_0x360022=_0x102afb(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xf],0xe,-0x275e197f),_0xa2e035=_0x102afb(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x4],0x14,-0x182c0438),_0x58fd25=_0x102afb(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x9],0x5,0x21e1cde6),_0x4fa134=_0x102afb(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xe],0x9,-0x3cc8f82a),_0x360022=_0x102afb(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x3],0xe,-0xb2af279),_0xa2e035=_0x102afb(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x8],0x14,0x455a14ed),_0x58fd25=_0x102afb(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0xd],0x5,-0x561c16fb),_0x4fa134=_0x102afb(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x2],0x9,-0x3105c08),_0x360022=_0x102afb(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x7],0xe,0x676f02d9),_0xa2e035=_0x102afb(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xc],0x14,-0x72d5b376),_0x58fd25=_0x577ce7(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x5],0x4,-0x5c6be),_0x4fa134=_0x577ce7(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x8],0xb,-0x788e097f),_0x360022=_0x577ce7(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xb],0x10,0x6d9d6122),_0xa2e035=_0x577ce7(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xe],0x17,-0x21ac7f4),_0x58fd25=_0x577ce7(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x1],0x4,-0x5b4115bc),_0x4fa134=_0x577ce7(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x4],0xb,0x4bdecfa9),_0x360022=_0x577ce7(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x7],0x10,-0x944b4a0),_0xa2e035=_0x577ce7(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xa],0x17,-0x41404390),_0x58fd25=_0x577ce7(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0xd],0x4,0x289b7ec6),_0x4fa134=_0x577ce7(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a],0xb,-0x155ed806),_0x360022=_0x577ce7(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x3],0x10,-0x2b10cf7b),_0xa2e035=_0x577ce7(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x6],0x17,0x4881d05),_0x58fd25=_0x577ce7(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x9],0x4,-0x262b2fc7),_0x4fa134=_0x577ce7(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xc],0xb,-0x1924661b),_0x360022=_0x577ce7(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xf],0x10,0x1fa27cf8),_0xa2e035=_0x577ce7(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x2],0x17,-0x3b53a99b),_0x58fd25=_0x231620(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a],0x6,-0xbd6ddbc),_0x4fa134=_0x231620(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x7],0xa,0x432aff97),_0x360022=_0x231620(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xe],0xf,-0x546bdc59),_0xa2e035=_0x231620(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x5],0x15,-0x36c5fc7),_0x58fd25=_0x231620(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0xc],0x6,0x655b59c3),_0x4fa134=_0x231620(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0x3],0xa,-0x70f3336e),_0x360022=_0x231620(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0xa],0xf,-0x100b83),_0xa2e035=_0x231620(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x1],0x15,-0x7a7ba22f),_0x58fd25=_0x231620(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x8],0x6,0x6fa87e4f),_0x4fa134=_0x231620(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xf],0xa,-0x1d31920),_0x360022=_0x231620(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x6],0xf,-0x5cfebcec),_0xa2e035=_0x231620(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0xd],0x15,0x4e0811a1),_0x58fd25=_0x231620(_0x58fd25,_0xa2e035,_0x360022,_0x4fa134,_0x50820e[_0x57526a+0x4],0x6,-0x8ac817e),_0x4fa134=_0x231620(_0x4fa134,_0x58fd25,_0xa2e035,_0x360022,_0x50820e[_0x57526a+0xb],0xa,-0x42c50dcb),_0x360022=_0x231620(_0x360022,_0x4fa134,_0x58fd25,_0xa2e035,_0x50820e[_0x57526a+0x2],0xf,0x2ad7d2bb),_0xa2e035=_0x231620(_0xa2e035,_0x360022,_0x4fa134,_0x58fd25,_0x50820e[_0x57526a+0x9],0x15,-0x14792c6f),_0x58fd25=_0x5360c0(_0x58fd25,_0x40073e),_0xa2e035=_0x5360c0(_0xa2e035,_0x489bc3),_0x360022=_0x5360c0(_0x360022,_0x1031c3),_0x4fa134=_0x5360c0(_0x4fa134,_0x1d6547);}return Uint32Array['of'](_0x58fd25,_0xa2e035,_0x360022,_0x4fa134);}(function _0x5502a8(_0x251d75){const _0x534e78=a0_0x40ae;if(0x0===_0x251d75[_0x534e78(0x1ef)])return new Uint32Array();const _0x2393c1=new Uint32Array(_0x6cc48e(0x8*_0x251d75[_0x534e78(0x1ef)]))[_0x534e78(0x158)](0x0);for(let _0x4dcc9b=0x0;_0x4dcc9b<_0x251d75['length'];_0x4dcc9b++)_0x2393c1[_0x4dcc9b>>0x2]|=(0xff&_0x251d75[_0x4dcc9b])<<_0x4dcc9b%0x4*0x8;return _0x2393c1;}(_0x151ac6),0x8*_0x151ac6['length']));};},0x164:(_0x2fddf5,_0x39ed65,_0x5b977d)=>{const _0x7dc25d=a0_0x40ae;Object['defineProperty'](_0x39ed65,'__esModule',{'value':!0x0});const _0x1f37ec=_0x5b977d(0xb),_0x4962a3=_0x5b977d(0x1a9),_0x2e7583=_0x5b977d(0x238);_0x39ed65[_0x7dc25d(0x1cb)]=function _0x51b2ce(_0x44819b,_0x26edd7,_0x5e565a){const _0x5a703d=_0x7dc25d;_0x44819b??={},_0x5e565a??=0x0;let _0xa60ec0=(0x0,_0x4962a3[_0x5a703d(0x1cb)])({..._0x44819b,'_v6':!0x0},new Uint8Array(0x10));if(_0xa60ec0=(0x0,_0x2e7583[_0x5a703d(0x1cb)])(_0xa60ec0),_0x26edd7){for(let _0x217a4e=0x0;_0x217a4e<0x10;_0x217a4e++)_0x26edd7[_0x5e565a+_0x217a4e]=_0xa60ec0[_0x217a4e];return _0x26edd7;}return(0x0,_0x1f37ec['unsafeStringify'])(_0xa60ec0);};},0x1a7:(_0x426dd4,_0x4ec9aa,_0x48d1cc)=>{const _0x3ad494=a0_0x40ae;Object[_0x3ad494(0x15c)](_0x4ec9aa,_0x3ad494(0x19b),{'value':!0x0}),_0x4ec9aa[_0x3ad494(0x1cd)]=void 0x0;const _0x20a62a=_0x48d1cc(0x10a),_0x2d6623=_0x48d1cc(0xb6),_0x4aa90b=_0x48d1cc(0x14a),_0x2b7aaa='os.',_0x4f9ba6=_0x4aa90b[_0x3ad494(0x157)];_0x4ec9aa['WebSDK']=class WebSDK{constructor(_0x21e0cf){const _0x87ff28=_0x3ad494;var _0x46db04,_0xd55c6c,_0x1f2f6d;if(this[_0x87ff28(0x238)]=0xa,this[_0x87ff28(0x226)]=0x2710,this['sdkVersion']=_0x4f9ba6,this['eventQueue']=[],this[_0x87ff28(0x17f)]=[],this[_0x87ff28(0x217)]={},this[_0x87ff28(0x1c5)]=!0x1,!_0x21e0cf[_0x87ff28(0x1dc)]||!_0x21e0cf['endpoint'])throw new Error(_0x87ff28(0x14d));this['apiKey']=_0x21e0cf[_0x87ff28(0x1dc)],this[_0x87ff28(0x1af)]=_0x21e0cf['endpoint'],this[_0x87ff28(0x14a)]=null!==(_0x46db04=_0x21e0cf[_0x87ff28(0x14a)])&&void 0x0!==_0x46db04&&_0x46db04,this[_0x87ff28(0x238)]=null!==(_0xd55c6c=_0x21e0cf[_0x87ff28(0x15b)])&&void 0x0!==_0xd55c6c?_0xd55c6c:0xa,this[_0x87ff28(0x226)]=null!==(_0x1f2f6d=_0x21e0cf[_0x87ff28(0x226)])&&void 0x0!==_0x1f2f6d?_0x1f2f6d:0x2710,this[_0x87ff28(0x21f)]=this[_0x87ff28(0x1b8)]()||(0x0,_0x2d6623['v4'])(),this[_0x87ff28(0x1e0)]=this[_0x87ff28(0x1c0)](),this[_0x87ff28(0x1ac)]()[_0x87ff28(0x184)](_0x4839d7=>{const _0x5539a3=_0x87ff28;(0x0,_0x20a62a[_0x5539a3(0x221)])(this['debug'],'Async\x20initialization\x20failed',_0x4839d7);});}async[_0x3ad494(0x1ac)](){const _0x5f2304=_0x3ad494;try{(0x0,_0x20a62a[_0x5f2304(0x221)])(this[_0x5f2304(0x14a)],_0x5f2304(0x228)),this[_0x5f2304(0x168)](),await this[_0x5f2304(0x220)](),await this[_0x5f2304(0x23c)]();const _0x2d886a=this['getStoredUserProfile']();_0x2d886a?(this[_0x5f2304(0x223)]=_0x2d886a,(0x0,_0x20a62a['log'])(this['debug'],_0x5f2304(0x1a3),this[_0x5f2304(0x223)])):this['identify']('');try{const _0xe1fc41=Intl[_0x5f2304(0x1ca)]()[_0x5f2304(0x19e)]()[_0x5f2304(0x17b)];this['trackCustomAttribute']('timezone',_0xe1fc41);}catch(_0x79fa9e){(0x0,_0x20a62a[_0x5f2304(0x221)])(this['debug'],_0x5f2304(0x170),_0x79fa9e);}this[_0x5f2304(0x18c)](),this[_0x5f2304(0x18f)](_0x5f2304(0x1f1),{});}catch(_0x36a578){throw(0x0,_0x20a62a[_0x5f2304(0x221)])(this[_0x5f2304(0x14a)],_0x5f2304(0x198),_0x36a578),_0x36a578;}}['identify'](_0x5d2827){const _0x2fc395=_0x3ad494;if(_0x2fc395(0x148)!=typeof _0x5d2827)throw new Error(_0x2fc395(0x1be));const _0x4db4e2=this[_0x2fc395(0x208)]();(null==_0x4db4e2?void 0x0:_0x4db4e2['id'])!==_0x5d2827&&((0x0,_0x20a62a[_0x2fc395(0x221)])(this[_0x2fc395(0x14a)],'Identifying\x20user',_0x5d2827),this[_0x2fc395(0x223)]=_0x5d2827?{'id':_0x5d2827,'guestUserId':this['guestUserId']}:{'id':this[_0x2fc395(0x1e0)],'guestUserId':this[_0x2fc395(0x1e0)]},this[_0x2fc395(0x16b)]());}[_0x3ad494(0x232)](){const _0x5aa4e3=_0x3ad494;this[_0x5aa4e3(0x21f)]=(0x0,_0x2d6623['v4'])(),this[_0x5aa4e3(0x1e0)]=this[_0x5aa4e3(0x1c0)](),this[_0x5aa4e3(0x220)](),this['currentUser']={'id':this[_0x5aa4e3(0x1e0)],'guestUserId':this['guestUserId']},this[_0x5aa4e3(0x217)]={},this[_0x5aa4e3(0x22b)]=[],this['purchaseBatch']=[],this[_0x5aa4e3(0x168)](),sessionStorage['setItem'](''+_0x2b7aaa+this['apiKey']+_0x5aa4e3(0x1a8),JSON[_0x5aa4e3(0x1d8)](this[_0x5aa4e3(0x223)])),sessionStorage[_0x5aa4e3(0x1e1)](''+_0x2b7aaa+this[_0x5aa4e3(0x1dc)]+_0x5aa4e3(0x193)),this[_0x5aa4e3(0x14a)]&&(0x0,_0x20a62a[_0x5aa4e3(0x221)])(this[_0x5aa4e3(0x14a)],_0x5aa4e3(0x1ab));}['trackEvent'](_0x328681,_0x745f31={},_0x1c8f1c={}){const _0x364f8f=_0x3ad494;if(!_0x328681||_0x364f8f(0x148)!=typeof _0x328681)throw new Error(_0x364f8f(0x1f2));const _0x13cfd5={'deviceId':this[_0x364f8f(0x21f)],'eventName':_0x328681,'timestamp':_0x1c8f1c[_0x364f8f(0x186)]||Date[_0x364f8f(0x200)](),'requestId':_0x1c8f1c[_0x364f8f(0x149)]||(0x0,_0x2d6623['v4'])(),'properties':_0x745f31};this[_0x364f8f(0x150)](_0x13cfd5);}[_0x3ad494(0x1cc)](_0x548090){const _0x22d977=_0x3ad494;this['deviceDetails']&&(this[_0x22d977(0x192)]={...this['deviceDetails'],'pushToken':_0x548090});}[_0x3ad494(0x14f)](_0x3b9c29,_0x4bcd47){const _0x99b1c0=_0x3ad494;if(!_0x3b9c29||'string'!=typeof _0x3b9c29)throw new Error(_0x99b1c0(0x1d7));this[_0x99b1c0(0x217)]={...this['attributeQueue'],[_0x3b9c29]:_0x4bcd47},(0x0,_0x20a62a[_0x99b1c0(0x221)])(this[_0x99b1c0(0x14a)],'Custom\x20attribute\x20queued',_0x3b9c29,_0x4bcd47),this[_0x99b1c0(0x230)]();}[_0x3ad494(0x236)](_0x1419c7,_0x4e5472,_0x844638,_0x2c070f,_0x471df2,_0x238005,_0x2289a3,_0x5c6070){const _0x491906=_0x3ad494,_0x1f35ec=this[_0x491906(0x1bc)]({'externalId':_0x1419c7,'itemId':_0x4e5472,'itemName':_0x844638,'unitPrice':_0x2c070f,'quantity':_0x471df2,'source':_0x238005,'channel':_0x2289a3,'itemCategory':_0x5c6070});this[_0x491906(0x17f)]['push'](_0x1f35ec),this[_0x491906(0x14a)]&&(0x0,_0x20a62a['log'])(this[_0x491906(0x14a)],_0x491906(0x18e),_0x1f35ec);}[_0x3ad494(0x209)](){return this['currentUser'];}async[_0x3ad494(0x1c9)](){const _0x1fe216=_0x3ad494;(this[_0x1fe216(0x22b)]['length']>0x0||this['purchaseBatch'][_0x1fe216(0x1ef)]>0x0||this[_0x1fe216(0x217)][_0x1fe216(0x1ef)]>0x0)&&await this[_0x1fe216(0x199)]();}['dispose'](){const _0x37e8c3=_0x3ad494;this[_0x37e8c3(0x16c)]&&clearInterval(this[_0x37e8c3(0x16c)]),(this['eventQueue']['length']>0x0||this[_0x37e8c3(0x17f)][_0x37e8c3(0x1ef)]>0x0||this['attributeQueue']['length']>0x0)&&this['processBatch']()['catch'](_0xf13e40=>{const _0x440d09=_0x37e8c3;(0x0,_0x20a62a['log'])(this[_0x440d09(0x14a)],_0x440d09(0x178),_0xf13e40);});}[_0x3ad494(0x1b8)](){const _0x38a2bf=_0x3ad494;return sessionStorage[_0x38a2bf(0x197)](''+_0x2b7aaa+this['apiKey']+'.device_id');}[_0x3ad494(0x208)](){const _0x5bee87=_0x3ad494,_0x2efa19=sessionStorage[_0x5bee87(0x197)](''+_0x2b7aaa+this[_0x5bee87(0x1dc)]+_0x5bee87(0x1a8));return _0x2efa19?JSON[_0x5bee87(0x1f9)](_0x2efa19):null;}['storeDeviceId'](){const _0x23705d=_0x3ad494;sessionStorage[_0x23705d(0x1ee)](''+_0x2b7aaa+this[_0x23705d(0x1dc)]+_0x23705d(0x18a),this[_0x23705d(0x21f)]);}[_0x3ad494(0x16b)](){const _0x1c0014=_0x3ad494;this[_0x1c0014(0x223)]&&sessionStorage[_0x1c0014(0x1ee)](''+_0x2b7aaa+this[_0x1c0014(0x1dc)]+'.current_user',JSON[_0x1c0014(0x1d8)](this['currentUser']));}['storeCustomAttributes'](){const _0x45275e=_0x3ad494,_0x5a5ce2=sessionStorage[_0x45275e(0x197)](''+_0x2b7aaa+this[_0x45275e(0x1dc)]+_0x45275e(0x193)),_0x2946f0={..._0x5a5ce2?JSON[_0x45275e(0x1f9)](_0x5a5ce2):{},...this[_0x45275e(0x217)]};sessionStorage[_0x45275e(0x1ee)](''+_0x2b7aaa+this[_0x45275e(0x1dc)]+_0x45275e(0x193),JSON[_0x45275e(0x1d8)](_0x2946f0));}async[_0x3ad494(0x23c)](){const _0x33a5b1=_0x3ad494,_0x55e62d=sessionStorage[_0x33a5b1(0x197)](''+_0x2b7aaa+this['apiKey']+'.custom_attributes');_0x55e62d&&(this[_0x33a5b1(0x217)]={...this[_0x33a5b1(0x217)],...JSON[_0x33a5b1(0x1f9)](_0x55e62d)});}[_0x3ad494(0x1c0)](){const _0x1d08e9=_0x3ad494;return _0x1d08e9(0x1df)+this['deviceId'];}[_0x3ad494(0x1bc)]({externalId:_0x455589,itemId:_0x56fb62,itemName:_0x33a134,unitPrice:_0x367247,quantity:_0x4e8d5d,source:_0x42baff,channel:_0x343ed4,itemCategory:_0x5be333}){const _0x4c3a77=_0x3ad494;return{'external_id':_0x455589,'item_id':_0x56fb62,'item_name':_0x33a134,'item_category':_0x5be333,'quantity':_0x4e8d5d,'unit_price':_0x367247,'total_price':_0x367247*_0x4e8d5d,'source':_0x42baff,'channel':_0x343ed4,'purchased_at':Date[_0x4c3a77(0x200)]()};}async['initializeDeviceDetails'](){const _0x1b4801=_0x3ad494;this['deviceDetails']={'deviceId':this[_0x1b4801(0x21f)],'platform':_0x1b4801(0x1f6)};}[_0x3ad494(0x18c)](){const _0x18f124=_0x3ad494;this[_0x18f124(0x16c)]=setInterval(()=>{const _0x46f08e=_0x18f124;(this['eventQueue']['length']>0x0||this[_0x46f08e(0x17f)]['length']>0x0||this[_0x46f08e(0x217)][_0x46f08e(0x1ef)]>0x0)&&this[_0x46f08e(0x199)]()['catch'](_0x3182df=>{const _0x4c1112=_0x46f08e;(0x0,_0x20a62a[_0x4c1112(0x221)])(this[_0x4c1112(0x14a)],_0x4c1112(0x201),_0x3182df);});},this[_0x18f124(0x226)]);}[_0x3ad494(0x150)](_0x1a5f15){const _0x495722=_0x3ad494;this[_0x495722(0x22b)][_0x495722(0x165)](_0x1a5f15),(0x0,_0x20a62a[_0x495722(0x221)])(this[_0x495722(0x14a)],_0x495722(0x17c),_0x1a5f15),this[_0x495722(0x22b)][_0x495722(0x1ef)]>=this[_0x495722(0x238)]&&this[_0x495722(0x199)]()['catch'](_0x5772d4=>{const _0x2ada1e=_0x495722;(0x0,_0x20a62a[_0x2ada1e(0x221)])(this[_0x2ada1e(0x14a)],_0x2ada1e(0x201),_0x5772d4);});}async['processBatch'](){const _0x3e7e2d=_0x3ad494;if(this[_0x3e7e2d(0x1c5)])return;this[_0x3e7e2d(0x1c5)]=!0x0;const _0x611b56=[...this[_0x3e7e2d(0x22b)]],_0x133cdb=[...this['purchaseBatch']],_0x5e71a1={...this['attributeQueue']};this['eventQueue']=[],this['purchaseBatch']=[],this['attributeQueue']={};try{await this['sendBatchToServer'](_0x611b56,_0x133cdb,_0x5e71a1);}catch(_0x70e93c){throw this[_0x3e7e2d(0x22b)]['unshift'](..._0x611b56),this['purchaseBatch'][_0x3e7e2d(0x167)](..._0x133cdb),this[_0x3e7e2d(0x217)]={...this[_0x3e7e2d(0x217)],..._0x5e71a1},(0x0,_0x20a62a['log'])(this[_0x3e7e2d(0x14a)],'Batch\x20processing\x20failed',_0x70e93c),_0x70e93c;}finally{this['isProcessingQueue']=!0x1;}}async[_0x3ad494(0x211)](_0x130fc8,_0x13254e,_0x3c4c63){const _0x49ddbe=_0x3ad494;var _0x3be2ab,_0x56b4ac;this[_0x49ddbe(0x192)]||await this['initializeDeviceDetails']();const _0xc2ea15={'sdkVersion':this[_0x49ddbe(0x210)],'deviceInfo':this[_0x49ddbe(0x192)],'userId':null===(_0x3be2ab=this[_0x49ddbe(0x223)])||void 0x0===_0x3be2ab?void 0x0:_0x3be2ab['id'],'guestUserId':null===(_0x56b4ac=this['currentUser'])||void 0x0===_0x56b4ac?void 0x0:_0x56b4ac[_0x49ddbe(0x1e0)],'time':Date[_0x49ddbe(0x200)](),'events':_0x130fc8,'purchases':_0x13254e,'userAttributes':_0x3c4c63};(0x0,_0x20a62a[_0x49ddbe(0x221)])(this[_0x49ddbe(0x14a)],_0x49ddbe(0x23d),_0xc2ea15);try{const _0x48c31f=await fetch(this[_0x49ddbe(0x1af)]+_0x49ddbe(0x1bb),{'method':'POST','headers':{'Content-Type':_0x49ddbe(0x203),'x-api-key':this['apiKey']},'body':JSON['stringify'](_0xc2ea15)});if(!_0x48c31f['ok'])throw new Error(_0x49ddbe(0x1d5)+_0x48c31f[_0x49ddbe(0x182)]);this[_0x49ddbe(0x14a)]&&(0x0,_0x20a62a['log'])(this[_0x49ddbe(0x14a)],'Batch\x20dispatched\x20successfully:\x20'+_0xc2ea15[_0x49ddbe(0x22d)]['length']+'\x20events,\x20'+_0xc2ea15[_0x49ddbe(0x1a7)]['length']+_0x49ddbe(0x20d)+Object[_0x49ddbe(0x152)](_0xc2ea15[_0x49ddbe(0x1c1)])[_0x49ddbe(0x1ef)]+'\x20attributes'),await _0x48c31f['json'](),Object['keys'](_0x3c4c63)[_0x49ddbe(0x1ef)]>0x0&&(this[_0x49ddbe(0x217)]={},sessionStorage['removeItem'](''+_0x2b7aaa+this[_0x49ddbe(0x1dc)]+_0x49ddbe(0x193)));}catch(_0x2398b7){throw(0x0,_0x20a62a[_0x49ddbe(0x221)])(this[_0x49ddbe(0x14a)],'Failed\x20to\x20send\x20payload\x20to\x20server',_0x2398b7),_0x2398b7;}}[_0x3ad494(0x1e8)](_0x2895fe,_0x585f86,_0x1d0202){const _0x1da806=_0x3ad494,_0x4b7c76=JSON[_0x1da806(0x1f9)](_0x2895fe),_0x55e892=_0x4b7c76['header'],_0x540a00=_0x4b7c76[_0x1da806(0x189)],_0x172313=_0x4b7c76['modal'][_0x1da806(0x15a)],_0x5ad75c=_0x4b7c76['modal'][_0x1da806(0x1ad)],_0x2893eb=_0x172313[_0x1da806(0x16a)]||'',_0x1fee02=_0x5ad75c[_0x1da806(0x16a)]||'',_0x3849e7=_0x4b7c76['mediaConfig'][_0x1da806(0x1e5)];this[_0x1da806(0x20f)]({'context':_0x1d0202,'title':_0x55e892,'body':_0x540a00,'primaryButtonText':_0x2893eb,'secondaryButtonText':_0x1fee02,'imageUrl':_0x3849e7,'buttonPropertiesPrimary':_0x172313,'buttonPropertiesSecondary':_0x5ad75c,'dismissMessageAutomatically':_0x4b7c76[_0x1da806(0x14b)][_0x1da806(0x20b)],'dismissMessageInSeconds':_0x4b7c76[_0x1da806(0x14b)]['dismissMessageInSeconds'],'headerColor':_0x4b7c76[_0x1da806(0x14b)][_0x1da806(0x231)],'messageColor':_0x4b7c76[_0x1da806(0x14b)]['messageColor'],'closeColor':_0x4b7c76['modal'][_0x1da806(0x214)],'campaignId':_0x585f86});}['hexToColor'](_0x1692f7){const _0xc22eed=_0x3ad494;return 0x6===(_0x1692f7=_0x1692f7[_0xc22eed(0x21b)]()[_0xc22eed(0x1e4)]('#',''))[_0xc22eed(0x1ef)]?'#'+_0x1692f7:'#'+_0x1692f7['substring'](0x2);}[_0x3ad494(0x177)](_0x1de608){const _0x26d91c=_0x3ad494;_0x1de608&&window[_0x26d91c(0x1e3)](_0x1de608,_0x26d91c(0x1b6));}[_0x3ad494(0x20f)](_0xff6bd6){const _0x206b4a=_0x3ad494,{title:_0x1db3fa,body:_0x190c7b,primaryButtonText:_0x5a04f4,secondaryButtonText:_0x13362f,imageUrl:_0x32d70e,onClose:_0x1a3d55,buttonPropertiesPrimary:_0xfaf98e,buttonPropertiesSecondary:_0x123fbd,dismissMessageAutomatically:_0x48c2b3,dismissMessageInSeconds:_0x3a9b9f,headerColor:_0x590df0,messageColor:_0x33c132,closeColor:_0x163848,campaignId:_0x19fc5e}=_0xff6bd6,_0x37b900=document[_0x206b4a(0x1ce)](_0x206b4a(0x15f));_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x185)]=_0x206b4a(0x237),_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x155)]='0',_0x37b900['style'][_0x206b4a(0x1b5)]='0',_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x194)]='100%',_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x222)]='100%',_0x37b900[_0x206b4a(0x1f7)]['backgroundColor']=_0x206b4a(0x215),_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x205)]=_0x206b4a(0x1ba),_0x37b900[_0x206b4a(0x1f7)][_0x206b4a(0x1db)]=_0x206b4a(0x151),_0x37b900['style'][_0x206b4a(0x1c2)]='center',_0x37b900['style'][_0x206b4a(0x1fc)]=_0x206b4a(0x233);const _0x3d179c=document[_0x206b4a(0x1ce)](_0x206b4a(0x15f));_0x3d179c[_0x206b4a(0x1f7)][_0x206b4a(0x1bf)]=_0x206b4a(0x1d0),_0x3d179c[_0x206b4a(0x1f7)][_0x206b4a(0x175)]=_0x206b4a(0x22c),_0x3d179c[_0x206b4a(0x1f7)]['padding']=_0x206b4a(0x160),_0x3d179c[_0x206b4a(0x1f7)][_0x206b4a(0x20a)]=_0x206b4a(0x23b),_0x3d179c['style'][_0x206b4a(0x194)]='90%',_0x3d179c[_0x206b4a(0x1f7)][_0x206b4a(0x22e)]=_0x206b4a(0x1ea),_0x3d179c[_0x206b4a(0x1f7)]['position']=_0x206b4a(0x18b);const _0x5c94ae=document['createElement'](_0x206b4a(0x1fe));_0x5c94ae['innerHTML']=_0x206b4a(0x1aa),_0x5c94ae[_0x206b4a(0x1f7)]['position']=_0x206b4a(0x181),_0x5c94ae[_0x206b4a(0x1f7)][_0x206b4a(0x155)]=_0x206b4a(0x1c4),_0x5c94ae[_0x206b4a(0x1f7)][_0x206b4a(0x1b7)]=_0x206b4a(0x1c4),_0x5c94ae['style'][_0x206b4a(0x180)]=_0x206b4a(0x1f8),_0x5c94ae['style']['border']=_0x206b4a(0x1f8),_0x5c94ae[_0x206b4a(0x1f7)][_0x206b4a(0x20c)]=_0x206b4a(0x1b0),_0x5c94ae[_0x206b4a(0x1f7)][_0x206b4a(0x188)]=_0x206b4a(0x1e9),_0x5c94ae['style'][_0x206b4a(0x23a)]=this[_0x206b4a(0x16d)](_0x163848),_0x5c94ae[_0x206b4a(0x1ae)]=()=>{const _0x29a191=_0x206b4a;_0x1a3d55&&_0x1a3d55(),this[_0x29a191(0x21c)](_0x19fc5e,!0x1,!0x0,!0x0),document[_0x29a191(0x19d)][_0x29a191(0x207)](_0x37b900);};const _0x58fa5a=document[_0x206b4a(0x1ce)](_0x206b4a(0x15f));if(_0x58fa5a[_0x206b4a(0x1f7)][_0x206b4a(0x205)]='flex',_0x58fa5a[_0x206b4a(0x1f7)][_0x206b4a(0x1d9)]=_0x206b4a(0x1fd),_0x58fa5a['style']['alignItems']=_0x206b4a(0x151),_0x58fa5a[_0x206b4a(0x1f7)][_0x206b4a(0x174)]=_0x206b4a(0x151),_0x32d70e&&''!==_0x32d70e['trim']()){const _0x1545b7=document['createElement']('img');_0x1545b7[_0x206b4a(0x1b4)]=_0x32d70e,_0x1545b7[_0x206b4a(0x1f7)][_0x206b4a(0x194)]=_0x206b4a(0x163),_0x1545b7[_0x206b4a(0x1f7)][_0x206b4a(0x222)]=_0x206b4a(0x163),_0x1545b7['style']['marginBottom']=_0x206b4a(0x160),_0x1545b7['style'][_0x206b4a(0x17d)]='16px',_0x1545b7['onerror']=()=>{const _0x486bab=_0x206b4a;_0x1545b7[_0x486bab(0x1f7)][_0x486bab(0x205)]='none';},_0x58fa5a['appendChild'](_0x1545b7);}const _0x52954f=document['createElement']('h2');_0x52954f['textContent']=_0x1db3fa,_0x52954f[_0x206b4a(0x1f7)][_0x206b4a(0x20c)]=_0x206b4a(0x153),_0x52954f['style']['fontWeight']=_0x206b4a(0x16e),_0x52954f[_0x206b4a(0x1f7)][_0x206b4a(0x23a)]=this[_0x206b4a(0x16d)](_0x590df0),_0x52954f[_0x206b4a(0x1f7)][_0x206b4a(0x164)]='8px\x200',_0x58fa5a[_0x206b4a(0x1a5)](_0x52954f);const _0xaf181d=document[_0x206b4a(0x1ce)]('p');_0xaf181d[_0x206b4a(0x190)]=_0x190c7b,_0xaf181d['style'][_0x206b4a(0x20c)]=_0x206b4a(0x219),_0xaf181d[_0x206b4a(0x1f7)]['color']=this[_0x206b4a(0x16d)](_0x33c132),_0xaf181d[_0x206b4a(0x1f7)][_0x206b4a(0x169)]=_0x206b4a(0x18d),_0xaf181d[_0x206b4a(0x1f7)][_0x206b4a(0x164)]=_0x206b4a(0x187),_0x58fa5a['appendChild'](_0xaf181d);const _0x270f6b=()=>{const _0x3c7f88=_0x206b4a;_0x3c7f88(0x21d)!==_0xfaf98e[_0x3c7f88(0x216)]&&_0x3c7f88(0x1f5)!==_0xfaf98e[_0x3c7f88(0x216)]||this[_0x3c7f88(0x177)](_0xfaf98e['webOnClickAction']||'');},_0x1c0dd8=()=>{const _0x13bb3d=_0x206b4a;_0x13bb3d(0x21d)!==_0x123fbd[_0x13bb3d(0x216)]&&_0x13bb3d(0x1f5)!==_0x123fbd['webOnClickValue']||this[_0x13bb3d(0x177)](_0x123fbd[_0x13bb3d(0x1d3)]||'');},_0x2b3224=document[_0x206b4a(0x1ce)](_0x206b4a(0x15f));if(_0x2b3224['style'][_0x206b4a(0x205)]=_0x206b4a(0x1ba),_0x2b3224[_0x206b4a(0x1f7)][_0x206b4a(0x1db)]=_0x206b4a(0x151),_0x2b3224[_0x206b4a(0x1f7)][_0x206b4a(0x194)]=_0x206b4a(0x1ff),_0x2b3224[_0x206b4a(0x1f7)][_0x206b4a(0x1c7)]=_0x206b4a(0x160),_0x13362f&&''!==_0x13362f['trim']()){const _0x24967e=document[_0x206b4a(0x1ce)](_0x206b4a(0x1fe));_0x24967e['textContent']=_0x5a04f4,_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x1ba)]='1',_0x24967e[_0x206b4a(0x1f7)]['maxWidth']='140px',_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x1e6)]='12px',_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x1bf)]=this[_0x206b4a(0x16d)](_0xfaf98e[_0x206b4a(0x1bf)]),_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x23a)]=this[_0x206b4a(0x16d)](_0xfaf98e[_0x206b4a(0x1f0)]),_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x171)]=_0x206b4a(0x1eb)+this[_0x206b4a(0x16d)](_0xfaf98e[_0x206b4a(0x1e7)]),_0x24967e[_0x206b4a(0x1f7)]['borderRadius']=_0x206b4a(0x1c4),_0x24967e[_0x206b4a(0x1f7)]['fontSize']=_0x206b4a(0x160),_0x24967e[_0x206b4a(0x1f7)][_0x206b4a(0x169)]=_0x206b4a(0x16e),_0x24967e['style'][_0x206b4a(0x188)]=_0x206b4a(0x1e9),_0x24967e['onclick']=()=>{const _0x7902c=_0x206b4a;document['body'][_0x7902c(0x207)](_0x37b900),_0x270f6b();},_0x2b3224[_0x206b4a(0x1a5)](_0x24967e);const _0x53d1d0=document[_0x206b4a(0x1ce)]('button');_0x53d1d0[_0x206b4a(0x190)]=_0x13362f,_0x53d1d0['style']['flex']='1',_0x53d1d0[_0x206b4a(0x1f7)][_0x206b4a(0x20a)]=_0x206b4a(0x1d2),_0x53d1d0['style'][_0x206b4a(0x1e6)]='12px',_0x53d1d0[_0x206b4a(0x1f7)][_0x206b4a(0x1bf)]=this[_0x206b4a(0x16d)](_0x123fbd[_0x206b4a(0x1bf)]),_0x53d1d0[_0x206b4a(0x1f7)][_0x206b4a(0x23a)]=this[_0x206b4a(0x16d)](_0x123fbd[_0x206b4a(0x1f0)]),_0x53d1d0[_0x206b4a(0x1f7)][_0x206b4a(0x171)]=_0x206b4a(0x1eb)+this['hexToColor'](_0x123fbd[_0x206b4a(0x1e7)]),_0x53d1d0[_0x206b4a(0x1f7)]['borderRadius']=_0x206b4a(0x1c4),_0x53d1d0['style'][_0x206b4a(0x20c)]=_0x206b4a(0x160),_0x53d1d0[_0x206b4a(0x1f7)]['fontWeight']=_0x206b4a(0x16e),_0x53d1d0[_0x206b4a(0x1f7)][_0x206b4a(0x188)]=_0x206b4a(0x1e9),_0x53d1d0['onclick']=()=>{const _0x5bf841=_0x206b4a;document['body'][_0x5bf841(0x207)](_0x37b900),this[_0x5bf841(0x21c)](_0x19fc5e,!0x0,!0x0,!0x1),_0x1c0dd8();},_0x2b3224[_0x206b4a(0x1a5)](_0x53d1d0);}else{if(_0x5a04f4&&''!==_0x5a04f4[_0x206b4a(0x1ec)]()){const _0x432fd8=document['createElement']('button');_0x432fd8[_0x206b4a(0x190)]=_0x5a04f4,_0x432fd8['style'][_0x206b4a(0x194)]='100%',_0x432fd8[_0x206b4a(0x1f7)][_0x206b4a(0x1e6)]=_0x206b4a(0x22c),_0x432fd8[_0x206b4a(0x1f7)][_0x206b4a(0x1bf)]=this['hexToColor'](_0xfaf98e[_0x206b4a(0x1bf)]),_0x432fd8['style'][_0x206b4a(0x23a)]=this['hexToColor'](_0xfaf98e[_0x206b4a(0x1f0)]),_0x432fd8['style'][_0x206b4a(0x171)]=_0x206b4a(0x1eb)+this[_0x206b4a(0x16d)](_0xfaf98e[_0x206b4a(0x1e7)]),_0x432fd8['style'][_0x206b4a(0x175)]=_0x206b4a(0x1c4),_0x432fd8[_0x206b4a(0x1f7)][_0x206b4a(0x20c)]=_0x206b4a(0x160),_0x432fd8[_0x206b4a(0x1f7)][_0x206b4a(0x169)]=_0x206b4a(0x16e),_0x432fd8[_0x206b4a(0x1f7)][_0x206b4a(0x188)]=_0x206b4a(0x1e9),_0x432fd8['onclick']=()=>{const _0xf7b660=_0x206b4a;document['body'][_0xf7b660(0x207)](_0x37b900),this['logInAppMessageClick'](_0x19fc5e,!0x0,!0x0,!0x1),_0x270f6b();},_0x2b3224[_0x206b4a(0x1a5)](_0x432fd8);}}_0x3d179c['appendChild'](_0x5c94ae),_0x3d179c[_0x206b4a(0x1a5)](_0x58fa5a),_0x58fa5a[_0x206b4a(0x1a5)](_0x2b3224),_0x37b900[_0x206b4a(0x1a5)](_0x3d179c),document[_0x206b4a(0x19d)][_0x206b4a(0x1a5)](_0x37b900),_0x48c2b3&&setTimeout(()=>{const _0x38180b=_0x206b4a;document[_0x38180b(0x19d)][_0x38180b(0x1b3)](_0x37b900)&&document['body']['removeChild'](_0x37b900);},0x3e8*parseInt(_0x3a9b9f)),_0x37b900[_0x206b4a(0x1d4)]('click',_0x5c75fe=>{const _0x3099d1=_0x206b4a;_0x5c75fe[_0x3099d1(0x172)]===_0x37b900&&document[_0x3099d1(0x19d)][_0x3099d1(0x207)](_0x37b900);});}async[_0x3ad494(0x21c)](_0x4a55e8,_0x2c4ccd,_0x40efcc,_0x3856c2){const _0x3e667d=await this['buildCampaignPayload'](_0x4a55e8,_0x40efcc,_0x2c4ccd,_0x3856c2);await this['processCampaignClick'](_0x3e667d);}async[_0x3ad494(0x1d6)](_0x255a91){const _0x21301a=_0x3ad494;this[_0x21301a(0x223)]&&this[_0x21301a(0x192)]||((0x0,_0x20a62a[_0x21301a(0x221)])(this[_0x21301a(0x14a)],_0x21301a(0x234)),await this['initialize']()),(this['eventQueue'][_0x21301a(0x1ef)]>0x0||this[_0x21301a(0x17f)]['length']>0x0||Object[_0x21301a(0x152)](this['attributeQueue'])[_0x21301a(0x1ef)]>0x0)&&await this[_0x21301a(0x1c9)]();const _0x11db5a=await this[_0x21301a(0x14e)](_0x255a91,!0x0,!0x0);await this[_0x21301a(0x1da)](_0x11db5a);}async['processCampaignClick'](_0x232e04){const _0xf05200=_0x3ad494;try{const _0xeaa41e=await fetch(this['endpoint']+'/analytics/clicks',{'method':_0xf05200(0x154),'headers':{'Content-Type':_0xf05200(0x203),'x-api-key':this['apiKey']},'body':JSON[_0xf05200(0x1d8)](_0x232e04)});if(!_0xeaa41e['ok'])throw new Error(_0xf05200(0x1d5)+_0xeaa41e[_0xf05200(0x182)]);this[_0xf05200(0x14a)]&&(0x0,_0x20a62a[_0xf05200(0x221)])(this['debug'],_0xf05200(0x1b1)+_0x232e04[_0xf05200(0x1a1)]);}catch(_0x2b5d4){throw(0x0,_0x20a62a[_0xf05200(0x221)])(this['debug'],_0xf05200(0x1a0),_0x2b5d4),_0x2b5d4;}}async[_0x3ad494(0x14e)](_0x40df0d,_0x5f52cb,_0x1581da,_0xb0c9ff){const _0x2a387b=_0x3ad494,_0x57fdc9=Date[_0x2a387b(0x200)](),_0x49234b={'campaignId':_0x40df0d,'opened':_0x5f52cb,'clicked':_0x1581da,'deviceId':this[_0x2a387b(0x21f)],'timestamp':_0x57fdc9};return void 0x0!==_0xb0c9ff&&(_0x49234b[_0x2a387b(0x1fa)]=_0xb0c9ff),_0x49234b;}};},0x1a9:(_0x36b478,_0x40cd57,_0x710a5)=>{const _0x43001e=a0_0x40ae;Object[_0x43001e(0x15c)](_0x40cd57,_0x43001e(0x19b),{'value':!0x0}),_0x40cd57[_0x43001e(0x21e)]=void 0x0;const _0x2f9519=_0x710a5(0x123),_0x3a8611=_0x710a5(0xb),_0x1b260a={};function _0x3bb3ed(_0x3a6371,_0x3568fa,_0x238c86){const _0x13d132=_0x43001e;return _0x3a6371[_0x13d132(0x1b9)]??=-0x1/0x0,_0x3a6371[_0x13d132(0x176)]??=0x0,_0x3568fa===_0x3a6371[_0x13d132(0x1b9)]?(_0x3a6371[_0x13d132(0x176)]++,_0x3a6371[_0x13d132(0x176)]>=0x2710&&(_0x3a6371[_0x13d132(0x183)]=void 0x0,_0x3a6371[_0x13d132(0x176)]=0x0)):_0x3568fa>_0x3a6371[_0x13d132(0x1b9)]?_0x3a6371['nsecs']=0x0:_0x3568fa<_0x3a6371[_0x13d132(0x1b9)]&&(_0x3a6371[_0x13d132(0x183)]=void 0x0),_0x3a6371['node']||(_0x3a6371[_0x13d132(0x183)]=_0x238c86[_0x13d132(0x1f3)](0xa,0x10),_0x3a6371[_0x13d132(0x183)][0x0]|=0x1,_0x3a6371[_0x13d132(0x206)]=0x3fff&(_0x238c86[0x8]<<0x8|_0x238c86[0x9])),_0x3a6371[_0x13d132(0x1b9)]=_0x3568fa,_0x3a6371;}function _0x37c69c(_0x255b51,_0xeda9dd,_0x11a79d,_0x4d46e5,_0x1a7677,_0x42c347,_0x5d953c=0x0){const _0x1a83ce=_0x43001e;if(_0x255b51[_0x1a83ce(0x1ef)]<0x10)throw new Error('Random\x20bytes\x20length\x20must\x20be\x20>=\x2016');if(_0x42c347){if(_0x5d953c<0x0||_0x5d953c+0x10>_0x42c347[_0x1a83ce(0x1ef)])throw new RangeError('UUID\x20byte\x20range\x20'+_0x5d953c+':'+(_0x5d953c+0xf)+'\x20is\x20out\x20of\x20buffer\x20bounds');}else _0x42c347=new Uint8Array(0x10),_0x5d953c=0x0;_0xeda9dd??=Date[_0x1a83ce(0x200)](),_0x11a79d??=0x0,_0x4d46e5??=0x3fff&(_0x255b51[0x8]<<0x8|_0x255b51[0x9]),_0x1a7677??=_0x255b51[_0x1a83ce(0x1f3)](0xa,0x10);const _0x23126a=(0x2710*(0xfffffff&(_0xeda9dd+=0xb1d069b5400))+_0x11a79d)%0x100000000;_0x42c347[_0x5d953c++]=_0x23126a>>>0x18&0xff,_0x42c347[_0x5d953c++]=_0x23126a>>>0x10&0xff,_0x42c347[_0x5d953c++]=_0x23126a>>>0x8&0xff,_0x42c347[_0x5d953c++]=0xff&_0x23126a;const _0x1a0882=_0xeda9dd/0x100000000*0x2710&0xfffffff;_0x42c347[_0x5d953c++]=_0x1a0882>>>0x8&0xff,_0x42c347[_0x5d953c++]=0xff&_0x1a0882,_0x42c347[_0x5d953c++]=_0x1a0882>>>0x18&0xf|0x10,_0x42c347[_0x5d953c++]=_0x1a0882>>>0x10&0xff,_0x42c347[_0x5d953c++]=_0x4d46e5>>>0x8|0x80,_0x42c347[_0x5d953c++]=0xff&_0x4d46e5;for(let _0x59b6f9=0x0;_0x59b6f9<0x6;++_0x59b6f9)_0x42c347[_0x5d953c++]=_0x1a7677[_0x59b6f9];return _0x42c347;}_0x40cd57[_0x43001e(0x21e)]=_0x3bb3ed,_0x40cd57[_0x43001e(0x1cb)]=function _0x4ec991(_0x167a24,_0x5531ac,_0x311332){const _0x1371ab=_0x43001e;let _0x34f5bd;const _0x4ae6c4=_0x167a24?.[_0x1371ab(0x225)]??!0x1;if(_0x167a24){const _0x4f3859=Object[_0x1371ab(0x152)](_0x167a24);0x1===_0x4f3859[_0x1371ab(0x1ef)]&&_0x1371ab(0x225)===_0x4f3859[0x0]&&(_0x167a24=void 0x0);}if(_0x167a24)_0x34f5bd=_0x37c69c(_0x167a24[_0x1371ab(0x1fb)]??_0x167a24[_0x1371ab(0x166)]?.()??(0x0,_0x2f9519[_0x1371ab(0x1cb)])(),_0x167a24[_0x1371ab(0x1b9)],_0x167a24['nsecs'],_0x167a24[_0x1371ab(0x206)],_0x167a24[_0x1371ab(0x183)],_0x5531ac,_0x311332);else{const _0x540015=Date[_0x1371ab(0x200)](),_0x49a769=(0x0,_0x2f9519[_0x1371ab(0x1cb)])();_0x3bb3ed(_0x1b260a,_0x540015,_0x49a769),_0x34f5bd=_0x37c69c(_0x49a769,_0x1b260a[_0x1371ab(0x1b9)],_0x1b260a['nsecs'],_0x4ae6c4?void 0x0:_0x1b260a[_0x1371ab(0x206)],_0x4ae6c4?void 0x0:_0x1b260a['node'],_0x5531ac,_0x311332);}return _0x5531ac??(0x0,_0x3a8611[_0x1371ab(0x227)])(_0x34f5bd);};},0x1d1:(_0x25df34,_0x28b8b8)=>{const _0x3c2d13=a0_0x40ae;Object[_0x3c2d13(0x15c)](_0x28b8b8,_0x3c2d13(0x19b),{'value':!0x0}),_0x28b8b8[_0x3c2d13(0x1cb)]=_0x3c2d13(0x1d1);},0x22d:(_0x5044a9,_0x5c8202,_0x2d8c62)=>{const _0xc656fe=a0_0x40ae;Object[_0xc656fe(0x15c)](_0x5c8202,_0xc656fe(0x19b),{'value':!0x0}),_0x5c8202[_0xc656fe(0x191)]=_0x5c8202['DNS']=void 0x0;const _0x5ca6cc=_0x2d8c62(0x33d),_0xa69076=_0x2d8c62(0x3dc);var _0x257e20=_0x2d8c62(0x3dc);function _0x641ed5(_0x5b55d6,_0x3027a0,_0x2fdab8,_0xb84b43){const _0x1868ea=_0xc656fe;return(0x0,_0xa69076[_0x1868ea(0x1cb)])(0x50,_0x5ca6cc[_0x1868ea(0x1cb)],_0x5b55d6,_0x3027a0,_0x2fdab8,_0xb84b43);}Object[_0xc656fe(0x15c)](_0x5c8202,_0xc656fe(0x1dd),{'enumerable':!0x0,'get':function(){const _0x2db0c0=_0xc656fe;return _0x257e20[_0x2db0c0(0x1dd)];}}),Object[_0xc656fe(0x15c)](_0x5c8202,_0xc656fe(0x191),{'enumerable':!0x0,'get':function(){const _0x617ef5=_0xc656fe;return _0x257e20[_0x617ef5(0x191)];}}),_0x641ed5['DNS']=_0xa69076[_0xc656fe(0x1dd)],_0x641ed5[_0xc656fe(0x191)]=_0xa69076['URL'],_0x5c8202[_0xc656fe(0x1cb)]=_0x641ed5;},0x238:(_0x12ce71,_0x2e3708,_0xcd5bd6)=>{const _0x3009ef=a0_0x40ae;Object[_0x3009ef(0x15c)](_0x2e3708,_0x3009ef(0x19b),{'value':!0x0});const _0x6844d0=_0xcd5bd6(0x31d),_0x238d9b=_0xcd5bd6(0xb);_0x2e3708[_0x3009ef(0x1cb)]=function _0x369442(_0x49d56a){const _0x102c9f=_0x3009ef,_0x173d19=function _0x116ba2(_0x3f1cef){return Uint8Array['of']((0xf&_0x3f1cef[0x6])<<0x4|_0x3f1cef[0x7]>>0x4&0xf,(0xf&_0x3f1cef[0x7])<<0x4|(0xf0&_0x3f1cef[0x4])>>0x4,(0xf&_0x3f1cef[0x4])<<0x4|(0xf0&_0x3f1cef[0x5])>>0x4,(0xf&_0x3f1cef[0x5])<<0x4|(0xf0&_0x3f1cef[0x0])>>0x4,(0xf&_0x3f1cef[0x0])<<0x4|(0xf0&_0x3f1cef[0x1])>>0x4,(0xf&_0x3f1cef[0x1])<<0x4|(0xf0&_0x3f1cef[0x2])>>0x4,0x60|0xf&_0x3f1cef[0x2],_0x3f1cef[0x3],_0x3f1cef[0x8],_0x3f1cef[0x9],_0x3f1cef[0xa],_0x3f1cef[0xb],_0x3f1cef[0xc],_0x3f1cef[0xd],_0x3f1cef[0xe],_0x3f1cef[0xf]);}(_0x102c9f(0x148)==typeof _0x49d56a?(0x0,_0x6844d0['default'])(_0x49d56a):_0x49d56a);return _0x102c9f(0x148)==typeof _0x49d56a?(0x0,_0x238d9b[_0x102c9f(0x227)])(_0x173d19):_0x173d19;};},0x24f:(_0x1b5c93,_0x242aab,_0xd4170d)=>{const _0x152584=a0_0x40ae;Object['defineProperty'](_0x242aab,_0x152584(0x19b),{'value':!0x0}),_0x242aab[_0x152584(0x191)]=_0x242aab[_0x152584(0x1dd)]=void 0x0;const _0xa2dbf1=_0xd4170d(0x152),_0x2e9197=_0xd4170d(0x3dc);var _0x431985=_0xd4170d(0x3dc);function _0x4d5b85(_0x5eaeaf,_0x39dcbc,_0x58340c,_0x520144){const _0x4cae5c=_0x152584;return(0x0,_0x2e9197[_0x4cae5c(0x1cb)])(0x30,_0xa2dbf1[_0x4cae5c(0x1cb)],_0x5eaeaf,_0x39dcbc,_0x58340c,_0x520144);}Object[_0x152584(0x15c)](_0x242aab,_0x152584(0x1dd),{'enumerable':!0x0,'get':function(){const _0x429120=_0x152584;return _0x431985[_0x429120(0x1dd)];}}),Object['defineProperty'](_0x242aab,_0x152584(0x191),{'enumerable':!0x0,'get':function(){return _0x431985['URL'];}}),_0x4d5b85[_0x152584(0x1dd)]=_0x2e9197[_0x152584(0x1dd)],_0x4d5b85[_0x152584(0x191)]=_0x2e9197[_0x152584(0x191)],_0x242aab[_0x152584(0x1cb)]=_0x4d5b85;},0x2b9:(_0x16e1f4,_0xa97c66)=>{const _0x1f2434=a0_0x40ae;Object[_0x1f2434(0x15c)](_0xa97c66,'__esModule',{'value':!0x0}),_0xa97c66[_0x1f2434(0x1cb)]=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;},0x2ea:(_0x524259,_0x3c449d,_0x4fdd15)=>{const _0x3b7168=a0_0x40ae;Object[_0x3b7168(0x15c)](_0x3c449d,_0x3b7168(0x19b),{'value':!0x0});const _0x16736c=_0x4fdd15(0x2b9);_0x3c449d[_0x3b7168(0x1cb)]=function _0x293b17(_0x1a56cd){const _0x238f5c=_0x3b7168;return _0x238f5c(0x148)==typeof _0x1a56cd&&_0x16736c[_0x238f5c(0x1cb)][_0x238f5c(0x229)](_0x1a56cd);};},0x302:(_0x46c3b2,_0x218c43,_0x88a3e)=>{const _0x542b20=a0_0x40ae;Object[_0x542b20(0x15c)](_0x218c43,_0x542b20(0x19b),{'value':!0x0});const _0x5ab4d1=_0x88a3e(0x2ea);_0x218c43[_0x542b20(0x1cb)]=function _0xbb1efc(_0xc28c8a){const _0x379f05=_0x542b20;if(!(0x0,_0x5ab4d1[_0x379f05(0x1cb)])(_0xc28c8a))throw TypeError(_0x379f05(0x1bd));return parseInt(_0xc28c8a[_0x379f05(0x1f3)](0xe,0xf),0x10);};},0x30b:(_0xc796d9,_0x3888d6)=>{const _0x189166=a0_0x40ae;Object['defineProperty'](_0x3888d6,'__esModule',{'value':!0x0});const _0x46e9aa=_0x189166(0x1c6)!=typeof crypto&&crypto[_0x189166(0x1cf)]&&crypto[_0x189166(0x1cf)]['bind'](crypto);_0x3888d6['default']={'randomUUID':_0x46e9aa};},0x31d:(_0x4234fd,_0x268243,_0x31ffaf)=>{Object['defineProperty'](_0x268243,'__esModule',{'value':!0x0});const _0x6cb7f2=_0x31ffaf(0x2ea);_0x268243['default']=function _0x570447(_0x3ad946){const _0x378b2f=a0_0x40ae;if(!(0x0,_0x6cb7f2[_0x378b2f(0x1cb)])(_0x3ad946))throw TypeError(_0x378b2f(0x1bd));let _0x5f43c9;return Uint8Array['of']((_0x5f43c9=parseInt(_0x3ad946[_0x378b2f(0x1f3)](0x0,0x8),0x10))>>>0x18,_0x5f43c9>>>0x10&0xff,_0x5f43c9>>>0x8&0xff,0xff&_0x5f43c9,(_0x5f43c9=parseInt(_0x3ad946[_0x378b2f(0x1f3)](0x9,0xd),0x10))>>>0x8,0xff&_0x5f43c9,(_0x5f43c9=parseInt(_0x3ad946['slice'](0xe,0x12),0x10))>>>0x8,0xff&_0x5f43c9,(_0x5f43c9=parseInt(_0x3ad946[_0x378b2f(0x1f3)](0x13,0x17),0x10))>>>0x8,0xff&_0x5f43c9,(_0x5f43c9=parseInt(_0x3ad946[_0x378b2f(0x1f3)](0x18,0x24),0x10))/0x10000000000&0xff,_0x5f43c9/0x100000000&0xff,_0x5f43c9>>>0x18&0xff,_0x5f43c9>>>0x10&0xff,_0x5f43c9>>>0x8&0xff,0xff&_0x5f43c9);};},0x33d:(_0x111579,_0x48d2d4)=>{const _0x2203fa=a0_0x40ae;function _0x5bd433(_0x6ab4af,_0x45ec92,_0x119b0d,_0x37f243){switch(_0x6ab4af){case 0x0:return _0x45ec92&_0x119b0d^~_0x45ec92&_0x37f243;case 0x1:case 0x3:return _0x45ec92^_0x119b0d^_0x37f243;case 0x2:return _0x45ec92&_0x119b0d^_0x45ec92&_0x37f243^_0x119b0d&_0x37f243;}}function _0x402ba0(_0x162da3,_0x1b5036){return _0x162da3<<_0x1b5036|_0x162da3>>>0x20-_0x1b5036;}Object[_0x2203fa(0x15c)](_0x48d2d4,_0x2203fa(0x19b),{'value':!0x0}),_0x48d2d4[_0x2203fa(0x1cb)]=function _0x204641(_0x3908e4){const _0xede3a8=_0x2203fa,_0x1202bf=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6],_0x4198b8=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],_0x790efa=new Uint8Array(_0x3908e4[_0xede3a8(0x1ef)]+0x1);_0x790efa[_0xede3a8(0x21a)](_0x3908e4),_0x790efa[_0x3908e4[_0xede3a8(0x1ef)]]=0x80;const _0x14a295=(_0x3908e4=_0x790efa)['length']/0x4+0x2,_0x4dc6a1=Math[_0xede3a8(0x156)](_0x14a295/0x10),_0x2c253a=new Array(_0x4dc6a1);for(let _0x4c4ed5=0x0;_0x4c4ed5<_0x4dc6a1;++_0x4c4ed5){const _0x34657a=new Uint32Array(0x10);for(let _0x598fae=0x0;_0x598fae<0x10;++_0x598fae)_0x34657a[_0x598fae]=_0x3908e4[0x40*_0x4c4ed5+0x4*_0x598fae]<<0x18|_0x3908e4[0x40*_0x4c4ed5+0x4*_0x598fae+0x1]<<0x10|_0x3908e4[0x40*_0x4c4ed5+0x4*_0x598fae+0x2]<<0x8|_0x3908e4[0x40*_0x4c4ed5+0x4*_0x598fae+0x3];_0x2c253a[_0x4c4ed5]=_0x34657a;}_0x2c253a[_0x4dc6a1-0x1][0xe]=0x8*(_0x3908e4[_0xede3a8(0x1ef)]-0x1)/Math[_0xede3a8(0x212)](0x2,0x20),_0x2c253a[_0x4dc6a1-0x1][0xe]=Math[_0xede3a8(0x1de)](_0x2c253a[_0x4dc6a1-0x1][0xe]),_0x2c253a[_0x4dc6a1-0x1][0xf]=0x8*(_0x3908e4['length']-0x1)&0xffffffff;for(let _0x2291d0=0x0;_0x2291d0<_0x4dc6a1;++_0x2291d0){const _0x2f6b1c=new Uint32Array(0x50);for(let _0x1d60ca=0x0;_0x1d60ca<0x10;++_0x1d60ca)_0x2f6b1c[_0x1d60ca]=_0x2c253a[_0x2291d0][_0x1d60ca];for(let _0x4879cd=0x10;_0x4879cd<0x50;++_0x4879cd)_0x2f6b1c[_0x4879cd]=_0x402ba0(_0x2f6b1c[_0x4879cd-0x3]^_0x2f6b1c[_0x4879cd-0x8]^_0x2f6b1c[_0x4879cd-0xe]^_0x2f6b1c[_0x4879cd-0x10],0x1);let _0x12b043=_0x4198b8[0x0],_0x35214a=_0x4198b8[0x1],_0x513da0=_0x4198b8[0x2],_0x1eae5c=_0x4198b8[0x3],_0x2ed0cf=_0x4198b8[0x4];for(let _0xafac4a=0x0;_0xafac4a<0x50;++_0xafac4a){const _0x29d15b=Math[_0xede3a8(0x1de)](_0xafac4a/0x14),_0x4884a2=_0x402ba0(_0x12b043,0x5)+_0x5bd433(_0x29d15b,_0x35214a,_0x513da0,_0x1eae5c)+_0x2ed0cf+_0x1202bf[_0x29d15b]+_0x2f6b1c[_0xafac4a]>>>0x0;_0x2ed0cf=_0x1eae5c,_0x1eae5c=_0x513da0,_0x513da0=_0x402ba0(_0x35214a,0x1e)>>>0x0,_0x35214a=_0x12b043,_0x12b043=_0x4884a2;}_0x4198b8[0x0]=_0x4198b8[0x0]+_0x12b043>>>0x0,_0x4198b8[0x1]=_0x4198b8[0x1]+_0x35214a>>>0x0,_0x4198b8[0x2]=_0x4198b8[0x2]+_0x513da0>>>0x0,_0x4198b8[0x3]=_0x4198b8[0x3]+_0x1eae5c>>>0x0,_0x4198b8[0x4]=_0x4198b8[0x4]+_0x2ed0cf>>>0x0;}return Uint8Array['of'](_0x4198b8[0x0]>>0x18,_0x4198b8[0x0]>>0x10,_0x4198b8[0x0]>>0x8,_0x4198b8[0x0],_0x4198b8[0x1]>>0x18,_0x4198b8[0x1]>>0x10,_0x4198b8[0x1]>>0x8,_0x4198b8[0x1],_0x4198b8[0x2]>>0x18,_0x4198b8[0x2]>>0x10,_0x4198b8[0x2]>>0x8,_0x4198b8[0x2],_0x4198b8[0x3]>>0x18,_0x4198b8[0x3]>>0x10,_0x4198b8[0x3]>>0x8,_0x4198b8[0x3],_0x4198b8[0x4]>>0x18,_0x4198b8[0x4]>>0x10,_0x4198b8[0x4]>>0x8,_0x4198b8[0x4]);};},0x3dc:(_0x562226,_0x56be9b,_0x52ddb9)=>{const _0x37e8bb=a0_0x40ae;Object[_0x37e8bb(0x15c)](_0x56be9b,_0x37e8bb(0x19b),{'value':!0x0}),_0x56be9b['URL']=_0x56be9b[_0x37e8bb(0x1dd)]=_0x56be9b[_0x37e8bb(0x161)]=void 0x0;const _0x59c93a=_0x52ddb9(0x31d),_0x265afe=_0x52ddb9(0xb);function _0x399f71(_0x169cdc){const _0xbd656f=_0x37e8bb;_0x169cdc=unescape(encodeURIComponent(_0x169cdc));const _0x1f75b2=new Uint8Array(_0x169cdc[_0xbd656f(0x1ef)]);for(let _0x558548=0x0;_0x558548<_0x169cdc[_0xbd656f(0x1ef)];++_0x558548)_0x1f75b2[_0x558548]=_0x169cdc[_0xbd656f(0x224)](_0x558548);return _0x1f75b2;}_0x56be9b[_0x37e8bb(0x161)]=_0x399f71,_0x56be9b['DNS']=_0x37e8bb(0x1a2),_0x56be9b[_0x37e8bb(0x191)]=_0x37e8bb(0x20e),_0x56be9b['default']=function _0x34e28a(_0x3a6f90,_0x347bb0,_0xb3acfd,_0x7d3380,_0x51d0b5,_0x22211a){const _0x54c14b=_0x37e8bb,_0x4f1b4b=_0x54c14b(0x148)==typeof _0xb3acfd?_0x399f71(_0xb3acfd):_0xb3acfd,_0x3998b3=_0x54c14b(0x148)==typeof _0x7d3380?(0x0,_0x59c93a[_0x54c14b(0x1cb)])(_0x7d3380):_0x7d3380;if('string'==typeof _0x7d3380&&(_0x7d3380=(0x0,_0x59c93a['default'])(_0x7d3380)),0x10!==_0x7d3380?.[_0x54c14b(0x1ef)])throw TypeError(_0x54c14b(0x147));let _0x172e43=new Uint8Array(0x10+_0x4f1b4b[_0x54c14b(0x1ef)]);if(_0x172e43[_0x54c14b(0x21a)](_0x3998b3),_0x172e43[_0x54c14b(0x21a)](_0x4f1b4b,_0x3998b3[_0x54c14b(0x1ef)]),_0x172e43=_0x347bb0(_0x172e43),_0x172e43[0x6]=0xf&_0x172e43[0x6]|_0x3a6f90,_0x172e43[0x8]=0x3f&_0x172e43[0x8]|0x80,_0x51d0b5){_0x22211a=_0x22211a||0x0;for(let _0x478b26=0x0;_0x478b26<0x10;++_0x478b26)_0x51d0b5[_0x22211a+_0x478b26]=_0x172e43[_0x478b26];return _0x51d0b5;}return(0x0,_0x265afe[_0x54c14b(0x227)])(_0x172e43);};}},_0x3e1a42={};function _0x2d2be0(_0x3068fb){const _0x1fe400=a0_0x40ae;var _0x3ee208=_0x3e1a42[_0x3068fb];if(void 0x0!==_0x3ee208)return _0x3ee208[_0x1fe400(0x15d)];var _0x4de24a=_0x3e1a42[_0x3068fb]={'exports':{}};return _0x50732d[_0x3068fb](_0x4de24a,_0x4de24a[_0x1fe400(0x15d)],_0x2d2be0),_0x4de24a['exports'];}var _0x2647d2={};return((()=>{const _0xf92f65=a0_0x40ae;var _0xcff2f4=_0x2647d2;Object[_0xf92f65(0x15c)](_0xcff2f4,_0xf92f65(0x19b),{'value':!0x0}),_0xcff2f4[_0xf92f65(0x1cd)]=void 0x0;var _0x13a31b=_0x2d2be0(0x1a7);Object[_0xf92f65(0x15c)](_0xcff2f4,'WebSDK',{'enumerable':!0x0,'get':function(){const _0x3627ba=_0xf92f65;return _0x13a31b[_0x3627ba(0x1cd)];}});})()),_0x2647d2;})())));
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface UserProfile {
|
|
2
|
+
id: string;
|
|
3
|
+
guestUserId?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface EventOptions {
|
|
6
|
+
timestamp?: string;
|
|
7
|
+
requestId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SDKConfig {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
endpoint: string;
|
|
12
|
+
debug?: boolean;
|
|
13
|
+
batchSize?: number;
|
|
14
|
+
batchInterval?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PurchasePayload {
|
|
17
|
+
externalId: string;
|
|
18
|
+
itemId: string;
|
|
19
|
+
itemName: string;
|
|
20
|
+
unitPrice: number;
|
|
21
|
+
quantity: number;
|
|
22
|
+
source: string;
|
|
23
|
+
channel: string;
|
|
24
|
+
itemCategory?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DeviceDetails {
|
|
27
|
+
deviceId: string;
|
|
28
|
+
platform: string;
|
|
29
|
+
pushToken?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ButtonProperties {
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
borderColor: string;
|
|
34
|
+
textColor: string;
|
|
35
|
+
androidOnClickValue?: string;
|
|
36
|
+
androidOnClickAction?: string;
|
|
37
|
+
iOSOnClickValue?: string;
|
|
38
|
+
iOSOnClickAction?: string;
|
|
39
|
+
type?: string;
|
|
40
|
+
[key: string]: any;
|
|
41
|
+
}
|
|
42
|
+
export interface ModalConfig {
|
|
43
|
+
button1: ButtonProperties;
|
|
44
|
+
button2: ButtonProperties;
|
|
45
|
+
dismissMessageAutomatically: boolean;
|
|
46
|
+
dismissMessageInSeconds: string;
|
|
47
|
+
headerColor: string;
|
|
48
|
+
messageColor: string;
|
|
49
|
+
closeColor: string;
|
|
50
|
+
}
|
|
51
|
+
export interface MediaConfig {
|
|
52
|
+
inAppImage: string;
|
|
53
|
+
}
|
|
54
|
+
export interface InAppMessageData {
|
|
55
|
+
header: string;
|
|
56
|
+
message: string;
|
|
57
|
+
modal: ModalConfig;
|
|
58
|
+
mediaConfig: MediaConfig;
|
|
59
|
+
}
|
|
60
|
+
export interface ShowInAppMessageOptions {
|
|
61
|
+
context?: any;
|
|
62
|
+
title: string;
|
|
63
|
+
body: string;
|
|
64
|
+
primaryButtonText: string;
|
|
65
|
+
secondaryButtonText?: string;
|
|
66
|
+
imageUrl: string;
|
|
67
|
+
onClose?: () => void;
|
|
68
|
+
buttonPropertiesPrimary: ButtonProperties;
|
|
69
|
+
buttonPropertiesSecondary: ButtonProperties;
|
|
70
|
+
dismissMessageAutomatically: boolean;
|
|
71
|
+
dismissMessageInSeconds: string;
|
|
72
|
+
headerColor: string;
|
|
73
|
+
messageColor: string;
|
|
74
|
+
closeColor: string;
|
|
75
|
+
campaignId: string;
|
|
76
|
+
}
|
|
77
|
+
export interface CampaignPayload {
|
|
78
|
+
campaignId: string;
|
|
79
|
+
opened: boolean;
|
|
80
|
+
clicked: boolean;
|
|
81
|
+
deviceId: string;
|
|
82
|
+
timestamp: number;
|
|
83
|
+
dismissed?: boolean;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const log: (debug: boolean, message: string, ...args: any[]) => void;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SDKConfig, EventOptions, UserProfile } from "./types";
|
|
2
|
+
export declare class WebSDK {
|
|
3
|
+
private readonly apiKey;
|
|
4
|
+
private readonly endpoint;
|
|
5
|
+
private readonly debug;
|
|
6
|
+
private readonly maxBatchSize;
|
|
7
|
+
private readonly batchInterval;
|
|
8
|
+
private readonly sdkVersion;
|
|
9
|
+
private deviceId;
|
|
10
|
+
private guestUserId;
|
|
11
|
+
private deviceDetails?;
|
|
12
|
+
private currentUser?;
|
|
13
|
+
private eventQueue;
|
|
14
|
+
private purchaseBatch;
|
|
15
|
+
private attributeQueue;
|
|
16
|
+
private isProcessingQueue;
|
|
17
|
+
private batchProcessingInterval?;
|
|
18
|
+
constructor(config: SDKConfig);
|
|
19
|
+
private initialize;
|
|
20
|
+
identify(userId: string): void;
|
|
21
|
+
clearUserData(): void;
|
|
22
|
+
trackEvent(eventName: string, properties?: Record<string, any>, options?: EventOptions): void;
|
|
23
|
+
setToken(token: string): void;
|
|
24
|
+
trackCustomAttribute(attributeName: string, attributeValue: any): void;
|
|
25
|
+
logProductPurchase(orderId: string, itemId: string, itemName: string, unitPrice: number, quantity: number, source: string, channel: string, itemCategory?: string): void;
|
|
26
|
+
getUserProfile(): UserProfile | undefined;
|
|
27
|
+
forceSend(): Promise<void>;
|
|
28
|
+
dispose(): void;
|
|
29
|
+
private getStoredDeviceId;
|
|
30
|
+
private getStoredUserProfile;
|
|
31
|
+
private storeDeviceId;
|
|
32
|
+
private storeUserProfile;
|
|
33
|
+
private storeCustomAttributes;
|
|
34
|
+
private loadCustomAttributes;
|
|
35
|
+
private getGuestUserId;
|
|
36
|
+
private buildPurchasePayload;
|
|
37
|
+
private initializeDeviceDetails;
|
|
38
|
+
private startBatchProcessing;
|
|
39
|
+
private queueEvent;
|
|
40
|
+
private processBatch;
|
|
41
|
+
private sendBatchToServer;
|
|
42
|
+
displayInAppMessage(inAppMessageData: string, campaignId: string, context?: any): void;
|
|
43
|
+
private hexToColor;
|
|
44
|
+
private openWebUrl;
|
|
45
|
+
private showInAppMessage;
|
|
46
|
+
private logInAppMessageClick;
|
|
47
|
+
logClick(campaignId: string): Promise<void>;
|
|
48
|
+
private processCampaignClick;
|
|
49
|
+
private buildCampaignPayload;
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ordersune/crm-web-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"publishConfig": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"build:bundle": "webpack --config webpack.config.js",
|
|
12
12
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
13
13
|
"prepare": "npm run build && husky",
|
|
14
|
-
"release": "GIT_AUTHOR_NAME=\"$(git config user.name)\" GIT_AUTHOR_EMAIL=\"$(git config user.email)\" GIT_COMMITTER_NAME=\"$(git config user.name)\" GIT_COMMITTER_EMAIL=\"$(git config user.email)\" semantic-release --no-ci",
|
|
14
|
+
"release": "bash -c 'read -p \"Enter OTP from authenticator: \" OTP && GIT_AUTHOR_NAME=\"$(git config user.name)\" GIT_AUTHOR_EMAIL=\"$(git config user.email)\" GIT_COMMITTER_NAME=\"$(git config user.name)\" GIT_COMMITTER_EMAIL=\"$(git config user.email)\" NPM_CONFIG_OTP=$OTP semantic-release --no-ci'",
|
|
15
15
|
"lint:commit": "commitlint --edit"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|