@hackler/react-sdk 11.42.0 → 11.44.0
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/lib/client.d.ts +20 -16
- package/lib/client.d.ts.map +1 -1
- package/lib/index.es.js +118 -16
- package/lib/index.js +118 -16
- package/lib/index.umd.js +1 -1
- package/package.json +2 -2
package/lib/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={})}(this,function(n){"use strict";var D,L=new Uint8Array(16);var F=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var V=[],j=0;j<256;++j)V.push((j+256).toString(16).substr(1));function B(e,t){var t=1<arguments.length&&void 0!==t?t:0,e=(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase();if("string"==typeof(t=e)&&F.test(t))return e;throw TypeError("Stringified UUID is invalid")}function H(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(D=D||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))return D(L);throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return B(n)}var e="3.7.5",z="function"==typeof atob,t="function"==typeof btoa,r="function"==typeof Buffer;const K="function"==typeof TextDecoder?new TextDecoder:void 0,G="function"==typeof TextEncoder?new TextEncoder:void 0;const J=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Y=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(J),W=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,q=String.fromCharCode.bind(String),$="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),X=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Z=e=>e.replace(/[^A-Za-z0-9\+\/]/g,"");var i=t=>{let r,n,i,o,s="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(n=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(o=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=n<<16|i<<8|o,s+=J[r>>18&63]+J[r>>12&63]+J[r>>6&63]+J[63&r]}return e?s.slice(0,e-3)+"===".substring(e):s};const Q=t?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):i,ee=r?e=>Buffer.from(e).toString("base64"):r=>{let n=[];for(let e=0,t=r.length;e<t;e+=4096)n.push(q.apply(null,r.subarray(e,e+4096)));return Q(n.join(""))},te=(e,t=!1)=>t?X(ee(e)):ee(e),re=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?q(192|t>>>6)+q(128|63&t):q(224|t>>>12&15)+q(128|t>>>6&63)+q(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),q(240|t>>>18&7)+q(128|t>>>12&63)+q(128|t>>>6&63)+q(128|63&t))},ne=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ie=e=>e.replace(ne,re),oe=r?e=>Buffer.from(e,"utf8").toString("base64"):G?e=>ee(G.encode(e)):e=>Q(ie(e)),se=(e,t=!1)=>t?X(oe(e)):oe(e);t=e=>se(e,!0);const ae=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ue=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return q(55296+(t>>>10))+q(56320+(1023&t));case 3:return q((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return q((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},ce=e=>e.replace(ae,ue);var o=t=>{if(t=t.replace(/\s+/g,""),!W.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,n="",i,o;for(let e=0;e<t.length;)r=Y[t.charAt(e++)]<<18|Y[t.charAt(e++)]<<12|(i=Y[t.charAt(e++)])<<6|(o=Y[t.charAt(e++)]),n+=64===i?q(r>>16&255):64===o?q(r>>16&255,r>>8&255):q(r>>16&255,r>>8&255,255&r);return n};const le=z?e=>atob(Z(e)):r?e=>Buffer.from(e,"base64").toString("binary"):o,pe=r?e=>$(Buffer.from(e,"base64")):e=>$(le(e).split("").map(e=>e.charCodeAt(0))),fe=e=>pe(de(e)),he=r?e=>Buffer.from(e,"base64").toString("utf8"):K?e=>K.decode(pe(e)):e=>ce(le(e)),de=e=>Z(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),ye=e=>he(de(e));function ve(){var e=(e,t)=>Object.defineProperty(String.prototype,e,me(t));e("fromBase64",function(){return ye(this)}),e("toBase64",function(e){return se(this,e)}),e("toBase64URI",function(){return se(this,!0)}),e("toBase64URL",function(){return se(this,!0)}),e("toUint8Array",function(){return fe(this)})}function ge(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,me(t));e("toBase64",function(e){return te(this,e)}),e("toBase64URI",function(){return te(this,!0)}),e("toBase64URL",function(){return te(this,!0)})}const me=e=>({value:e,enumerable:!1,writable:!0,configurable:!0});const Ee={version:e,VERSION:"3.7.5",atob:le,atobPolyfill:o,btoa:Q,btoaPolyfill:i,fromBase64:ye,toBase64:se,encode:se,encodeURI:t,encodeURL:t,utob:ie,btou:ce,decode:ye,isValid:e=>{if("string"!=typeof e)return!1;e=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:te,toUint8Array:fe,extendString:ve,extendUint8Array:ge,extendBuiltins:()=>{ve(),ge()}};we.isNotNullOrUndefined=function(e){return null!=e},we.isNullOrUndefined=function(e){return null==e},we.requiredNotNullOrUndefined=function(e,t){if(void 0===t&&(t=function(){return"Required value is null or undefined"}),this.isNullOrUndefined(e))throw new Error(t());return e},we.fromMap=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r};var u=we;function we(){}be.mapNotNullOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);u.isNotNullOrUndefined(o)&&r.push(o)}return r},be.mapOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);if(u.isNullOrUndefined(o))return;r.push(o)}return r},be.associateTo=function(e,t,r){for(var n=0,i=e;n<i.length;n++){var o=r(i[n]);t.set(o[0],o[1])}return t},be.associate=function(e,t){return this.associateTo(e,new Map,t)},be.associateBy=function(e,t){return this.associate(e,function(e){return[t(e),e]})},be.associateRecord=function(e,t){for(var r={},n=0,i=e;n<i.length;n++){var o=t(i[n]),s=o[0],o=o[1];r[s]=o}return r},be.chunked=function(e,t){for(var r=[],n=e.slice();n.length;)r.push(n.splice(0,t));return r},be.sum=function(e,r){return e.reduce(function(e,t){return e+r(t)},0)};var f=be;function be(){}var Te={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},s=(_e.setLogLevel=function(e){this.logLevel=e=void 0===e?Te.INFO:e},_e.initCounter=function(t){this.counters=f.associate(Object.keys(Te),function(e){return[e,t(e)]})},_e._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}if(t instanceof Error)Oe.log(e,r,t.message,t);else try{Oe.log(e,r,t)}catch(e){}},_e.increment=function(e){var t;null!=(t=null==(t=_e.counters)?void 0:t.get(e))&&t.increment()},_e.logLevel=Te.INFO,_e.log={error:function(e){Te.ERROR<=_e.logLevel&&(_e._log("ERROR",e),_e.increment("ERROR"))},warn:function(e){Te.WARN<=_e.logLevel&&(_e._log("WARN",e),_e.increment("WARN"))},info:function(e){Te.INFO<=_e.logLevel&&(_e._log("INFO",e),_e.increment("INFO"))},debug:function(e){Te.DEBUG<=_e.logLevel&&(_e._log("DEBUG",e),_e.increment("DEBUG"))}},_e);function _e(){}Ie.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Oe=Ie;function Ie(){}var Ne=function(e,t){return(Ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Ae(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ne(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function l(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function Se(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||((n=n||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var Re=s.log,Me=(Ce.isEqual=function(e,t){return e.type===t.type&&e.value===t.value},Ce.isEquals=function(t,r){if(null==r)return!1;var e=Object.keys(t);return e.length===Object.keys(r).length&&e.every(function(e){return t[e]===r[e]})},Ce.sanitize=function(e){var t={};if(u.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],i=i[1];this.isValidType(o)?(i=this.sanitizeValue(i),u.isNullOrUndefined(i)?Re.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Re.debug("Invalid identifier type. The identifier type must be a string of 128 characters or less. [".concat(o,"]"))}return t},Ce.isValidType=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_TYPE_LENGTH)},Ce.sanitizeValue=function(e){return"string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_VALUE_LENGTH?e:"number"==typeof e?e.toString():null},Ce.MAX_IDENTIFIER_TYPE_LENGTH=128,Ce.MAX_IDENTIFIER_VALUE_LENGTH=512,Ce);function Ce(){}var xe=s.log,Pe=(Ue.sanitize=function(e){var t={};if(u.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i,o=n[r],s=o[0],o=o[1];if(Object.keys(t).length>=this.MAX_PROPERTIES_COUNT){xe.debug("The number of properties cannot exceed 128. Drops excess properties. [".concat(s,", ").concat(o,"]"));break}this.isValidKey(s)?(i=this.sanitizeValue(s,o),u.isNullOrUndefined(i)?xe.debug("Invalid property value. The property value mus be 'string(..1024)', 'number', 'boolean', or 'array' type. [".concat(o,"]")):t[s]=i):xe.debug("Invalid property key. The property key must be a string of 128 characters or less. [".concat(s,"]"))}return t},Ue.isValidProperty=function(e,t){return this.isValidKey(e)&&this.isValidValue(t)},Ue.isValidKey=function(e){return u.isNotNullOrUndefined(e)&&"string"==typeof e&&0<e.length&&e.length<=this.MAX_PROPERTY_KEY_LENGTH},Ue.sanitizeValue=function(e,t){var r=this;return"string"==typeof e&&e.startsWith(this.SYSTEM_PROPERTY_KEY_PREFIX)?t:this.isValidValue(t)?Array.isArray(t)?t.filter(function(e){return r.isValidElement(e)}):t:null},Ue.isValidValue=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e?e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e?!isNaN(e)&&isFinite(e):"boolean"==typeof e||Array.isArray(e))},Ue.isValidElement=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e?0<e.length&&e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e)},Ue.truncateStringValue=function(e){return"string"==typeof e&&e.length>this.MAX_PROPERTY_VALUE_LENGTH?e.slice(0,this.MAX_PROPERTY_VALUE_LENGTH):e},Ue.SYSTEM_PROPERTY_KEY_PREFIX="$",Ue.MAX_PROPERTIES_COUNT=128,Ue.MAX_PROPERTY_KEY_LENGTH=128,Ue.MAX_PROPERTY_VALUE_LENGTH=1024,Ue);function Ue(){}var ke=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"],De=(p.nanosToUnit=function(e,t){switch(t){case"nanoseconds":return e;case"microseconds":return e/(p.C1/p.C0);case"milliseconds":return e/(p.C2/p.C0);case"seconds":return e/(p.C3/p.C0);case"minutes":return e/(p.C4/p.C0);case"hours":return e/(p.C5/p.C0);case"days":return e/(p.C6/p.C0)}},p.microsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C1/p.C0);case"milliseconds":return e/(p.C2/p.C1);case"microseconds":return e;case"seconds":return e/(p.C3/p.C1);case"minutes":return e/(p.C4/p.C1);case"hours":return e/(p.C5/p.C1);case"days":return e/(p.C6/p.C1)}},p.millisToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C2/p.C0);case"microseconds":return e*(p.C2/p.C1);case"milliseconds":return e;case"seconds":return e/(p.C3/p.C2);case"minutes":return e/(p.C4/p.C2);case"hours":return e/(p.C5/p.C2);case"days":return e/(p.C6/p.C2)}},p.secondsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C3/p.C0);case"microseconds":return e*(p.C3/p.C1);case"milliseconds":return e*(p.C3/p.C2);case"seconds":return e;case"minutes":return e/(p.C4/p.C3);case"hours":return e/(p.C5/p.C3);case"days":return e/(p.C6/p.C3)}},p.minutesToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C4/p.C0);case"microseconds":return e*(p.C4/p.C1);case"milliseconds":return e*(p.C4/p.C2);case"seconds":return e*(p.C4/p.C3);case"minutes":return e;case"hours":return e/(p.C5/p.C4);case"days":return e/(p.C6/p.C4)}},p.hoursToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C5/p.C0);case"microseconds":return e*(p.C5/p.C1);case"milliseconds":return e*(p.C5/p.C2);case"seconds":return e*(p.C5/p.C3);case"minutes":return e*(p.C5/p.C4);case"hours":return e;case"days":return e/(p.C6/p.C5)}},p.daysToUnit=function(e,t){switch(t){case"nanoseconds":return e*(p.C6/p.C0);case"microseconds":return e*(p.C6/p.C1);case"milliseconds":return e*(p.C6/p.C2);case"seconds":return e*(p.C6/p.C3);case"minutes":return e*(p.C6/p.C4);case"hours":return e*(p.C6/p.C5);case"days":return e}},p.C6=24*(p.C5=60*(p.C4=60*(p.C3=1e3*(p.C2=1e3*(p.C1=1e3*(p.C0=1)))))),p.converter={nanoseconds:p.nanosToUnit,microseconds:p.microsToUnit,milliseconds:p.millisToUnit,seconds:p.secondsToUnit,minutes:p.minutesToUnit,hours:p.hoursToUnit,days:p.daysToUnit},p);function p(){}Fe.prototype.tick=function(){return 1e3*Date.now()},Fe.prototype.currentMillis=function(){return Date.now()},Fe.instance=new Fe;var Le=Fe;function Fe(){}je.prototype.get=function(e,t){return t};var Ve=je;function je(){this.parameters={}}He.prototype.get=function(e,t){e=this.parameters[e];return!u.isNullOrUndefined(e)&&(u.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var Be=He;function He(e){this.parameters=e}var ze="X-HACKLE-SDK-KEY",Ke="X-HACKLE-SDK-NAME",Ge="X-HACKLE-SDK-VERSION",Je="X-HACKLE-SDK-TIME",Ye=100,We=6e4,qe=500,$e=3650,Xe="_hackle_hid",Ze="_hackle_id",Qe="hackle-repository-storage",et="_hackle_session_id",tt="_hackle_last_event_ts",rt="_hackle_uid",nt="_hackle_did",it="_hackle_mkt",ot="hackle-manual-override_ab",st="hackle-manual-override_ff",at="hackle-iam-hide",ut="hackle-iam-impression",ct="hackle-split-url-redirected",lt=1/86400*3,pt="hackle-workspace-config",ft=6e4,ht=1e3,dt=s.log;function yt(e,t){e=e.find(function(e){return e===t||e.toLowerCase()===t.toLowerCase()});return e||dt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e}function vt(e,t){if(!u.isNullOrUndefined(t)){for(var r=new Array,n=0,i=t;n<i.length;n++){var o=yt(e,i[n]);if(u.isNullOrUndefined(o))return;r.push(o)}return r}}mt.of=function(e,t){return new mt(e,t)};var gt=mt;function mt(e,t){this.value=e,this.reason=t}wt.prototype.isShow=function(){return u.isNotNullOrUndefined(this.inAppMessage)&&u.isNotNullOrUndefined(this.message)},wt.of=function(e,t,r,n){return new wt(t,r,e,n=void 0===n?{}:n)};var Et=wt;function wt(e,t,r,n){this.inAppMessage=e,this.message=t,this.reason=r,this.properties=n}Tt.of=function(e,t,r,n){return new Tt(e,t,r=void 0===r?new Ve:r,n=void 0===n?void 0:n)},Object.defineProperty(Tt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Tt.prototype.get=function(e,t){return this.config.get(e,t)};var bt=Tt;function Tt(e,t,r,n){this.variation=e,this.reason=t,this.config=r,this.experiment=n}Ot.on=function(e,t,r){return new Ot(!0,e,t=void 0===t?new Ve:t,r=void 0===r?void 0:r)},Ot.off=function(e,t,r){return new Ot(!1,e,t=void 0===t?new Ve:t,r=void 0===r?void 0:r)},Object.defineProperty(Ot.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Ot.prototype.get=function(e,t){return this.config.get(e,t)};var _t=Ot;function Ot(e,t,r,n){this.isOn=e,this.reason=t,this.config=r,this.experiment=n}Nt.prototype.get=function(e,t){return t};var It=Nt;function Nt(){}Object.defineProperty(St.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),St.fromJson=function(e){return new St(e.id,new Be(f.associateRecord(e.parameters,function(e){return[e.key,e.value]})))},St.prototype.get=function(e,t){switch(typeof t){case"string":case"number":case"boolean":return this.config.get(e,t);default:return t}};var At=St;function St(e,t){this.id=e,this.config=t}d.SDK_NOT_READY="SDK_NOT_READY",d.EXCEPTION="EXCEPTION",d.INVALID_INPUT="INVALID_INPUT",d.UNSUPPORTED_PLATFORM="UNSUPPORTED_PLATFORM",d.TYPE_MISMATCH="TYPE_MISMATCH",d.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",d.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",d.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",d.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",d.OVERRIDDEN="OVERRIDDEN",d.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",d.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT="NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT",d.IDENTIFIER_NOT_FOUND="IDENTIFIER_NOT_FOUND",d.VARIATION_DROPPED="VARIATION_DROPPED",d.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",d.TRAFFIC_ALLOCATED_BY_TARGETING="TRAFFIC_ALLOCATED_BY_TARGETING",d.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",d.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",d.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",d.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",d.TARGET_RULE_MATCH="TARGET_RULE_MATCH",d.DEFAULT_RULE="DEFAULT_RULE",d.REMOTE_CONFIG_PARAMETER_NOT_FOUND="REMOTE_CONFIG_PARAMETER_NOT_FOUND",d.IN_APP_MESSAGE_NOT_FOUND="IN_APP_MESSAGE_NOT_FOUND",d.IN_APP_MESSAGE_DRAFT="IN_APP_MESSAGE_DRAFT",d.IN_APP_MESSAGE_PAUSED="IN_APP_MESSAGE_PAUSED",d.IN_APP_MESSAGE_HIDDEN="IN_APP_MESSAGE_HIDDEN",d.IN_APP_MESSAGE_TARGET="IN_APP_MESSAGE_TARGET",d.NOT_IN_IN_APP_MESSAGE_PERIOD="NOT_IN_IN_APP_MESSAGE_PERIOD",d.NOT_IN_IN_APP_MESSAGE_TARGET="NOT_IN_IN_APP_MESSAGE_TARGET";var h=d;function d(){}var Rt=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Mt=(Ct.fromJson=function(e,t,r){var n=Ct.experimentStatusOrNull(t.execution.status),i=t.variations.map(function(t){return new xt(t.id,t.key,"DROPPED"===t.status,r.find(function(e){return e.id===t.parameterConfigurationId}))}),o=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),s=f.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return rr.fromJson(e,Sr.IDENTIFIER)}),a=f.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),u=Ln.fromJson(t.execution.targetUrls),c=yt(Rt,t.implementationType),l=f.mapNotNullOrUndefined(t.execution.targetRules,function(e){return rr.fromJson(e,Sr.PROPERTY)}),p=er.fromJson(t.execution.defaultRule);return n&&c&&p&&new Ct(t.id,t.key,e,t.identifierType,n,t.version,t.execution.version,i,o,s,a,u,l,p,t.containerId,c,t.winnerVariationId)},Ct.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void dt.debug("Unsupported status [".concat(e,"]"))}},Ct.prototype._winnerVariationOrNull=function(){if(this.winnerVariationId)return this._getVariationByIdOrNull(this.winnerVariationId)},Ct.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},Ct.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},Ct);function Ct(e,t,r,n,i,o,s,a,u,c,l,p,f,h,d,y,v){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=i,this.version=o,this.executionVersion=s,this.variations=a,this.userOverrides=u,this.segmentOverrides=c,this.targetAudiences=l,this.splitUrlTargets=p,this.targetRules=f,this.defaultRule=h,this.containerId=d,this.implementationType=y,this.winnerVariationId=v}Object.defineProperty(Pt.prototype,"parameters",{get:function(){var e;return null!=(e=null==(e=this.config)?void 0:e.parameters)?e:{}},enumerable:!1,configurable:!0});var xt=Pt;function Pt(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.config=n}kt.fromJson=function(e){return new kt(e.id,e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Dt(t,r,e)}))};var Ut=kt;function kt(e,t,r,n){this.id=e,this.seed=t,this.slotSize=r,this.slots=n}Lt.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive};var Dt=Lt;function Lt(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}Vt.fromJson=function(e){return new Vt(e.id,e.key)};var Ft=Vt;function Vt(e,t){this.id=e,this.key=t}Bt.ID="$id",Bt.USER="$userId",Bt.DEVICE="$deviceId",Bt.SESSION="$sessionId",Bt.HACKLE_DEVICE="$hackleDeviceId";var jt=Bt;function Bt(){}function Ht(e){var t=new zt;return t.addIdentifiers(e.identifiers||{}),t.add(jt.ID,e.id),t.add(jt.DEVICE,e.deviceId),u.isNotNullOrUndefined(e.userId)&&t.add(jt.USER,e.userId),t.build()}Kt.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},Kt.prototype.add=function(e,t){var r=Me.sanitizeValue(t);return Me.isValidType(e)&&r?this.identifiers[e]=t:dt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},Kt.prototype.build=function(){return this.identifiers};var zt=Kt;function Kt(){this.identifiers={}}function Gt(e){var t,r={};return r.id=null!=(t=Me.sanitizeValue(e.id))?t:void 0,r.userId=null!=(t=Me.sanitizeValue(e.userId))?t:void 0,r.deviceId=null!=(t=Me.sanitizeValue(e.deviceId))?t:void 0,"object"==typeof e.properties&&(r.properties=Pe.sanitize(e.properties)),"object"==typeof e.identifiers&&(r.identifiers=Me.sanitize(e.identifiers)),t=r,Boolean(t.id||t.userId||t.deviceId||t.identifiers&&0<Object.keys(t.identifiers).length)?r:null}Yt.fromJson=function(e,t){return new Yt(f.mapNotNullOrUndefined(e.conditions,function(e){return Wt.fromJson(e,t)}))},Yt.prototype.toJson=function(){return{conditions:this.conditions.map(function(e){return e.toJson()})}};var Jt=Yt;function Yt(e){this.conditions=e}qt.fromJson=function(e,t){var r=$t.fromJson(e.key);if(r&&t.supports(r.type))return(t=Zt.fromJson(e.match))&&new qt(r,t)},qt.prototype.toJson=function(){return{key:this.key.toJson(),match:this.match.toJson()}};var Wt=qt;function qt(e,t){this.key=e,this.match=t}Xt.fromJson=function(e){var t=yt(Nr,e.type);return t&&new Xt(t,e.name)},Xt.prototype.toJson=function(){return{type:this.type,name:this.name}};var $t=Xt;function Xt(e,t){this.type=e,this.name=t}Qt.fromJson=function(e){var t=yt(Tr,e.type),r=yt(Or,e.operator),n=yt(_r,e.valueType);return t&&r&&n&&new Qt(t,r,n,e.values)},Qt.prototype.toJson=function(){return{operator:this.operator,type:this.type,valueType:this.valueType,values:this.values}};var Zt=Qt;function Qt(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n}tr.fromJson=function(e){var t=yt(Ir,e.type);return t&&new tr(t,e.variationId,e.bucketId)};var er=tr;function tr(e,t,r){this.type=e,this.variationId=t,this.bucketId=r}nr.fromJson=function(e,t){t=Jt.fromJson(e.target,t),e=er.fromJson(e.action);return t&&e&&new nr(t,e)};var rr=nr;function nr(e,t){this.target=e,this.action=t}or.fromJson=function(e){var t=yt(Ar,e.type);return t&&new or(e.id,e.key,t,f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Sr.SEGMENT)}))};var ir=or;function or(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n}ar.fromJson=function(e){return new ar(e.id,e.bucketId,e.groups.map(function(e){return ur.fromJson(e)}))},ar.prototype.getGroupOrNull=function(t){return this.groups.find(function(e){return e.id===t})};var sr=ar;function ar(e,t,r){this.id=e,this.bucketId=t,this.groups=r}cr.fromJson=function(e){return new cr(e.id,e.experiments)};var ur=cr;function cr(e,t){this.id=e,this.experiments=t}pr.fromJson=function(e){var t=yt(_r,e.type),r=f.mapNotNullOrUndefined(e.targetRules,function(e){return fr.fromJson(e,Sr.PROPERTY)}),n=dr.fromJson(e.defaultValue);return t&&new pr(e.id,e.key,t,e.identifierType,r,n)};var lr=pr;function pr(e,t,r,n,i,o){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.targetRules=i,this.defaultValue=o}hr.fromJson=function(e,t){t=Jt.fromJson(e.target,t);return t&&new hr(e.key,e.name,t,e.bucketId,dr.fromJson(e.value))};var fr=hr;function hr(e,t,r,n,i){this.key=e,this.name=t,this.target=r,this.bucketId=n,this.value=i}yr.fromJson=function(e){return new yr(e.id,e.value)};var dr=yr;function yr(e,t){this.id=e,this.rawValue=t}gr.tryParse=function(e){if(e instanceof gr)return e;var t,r,n,i,e=gr.regExp.exec(e);if(e)return e[0],t=e[1],r=e[2],r=void 0===r?"0":r,n=e[3],n=void 0===n?"0":n,i=e[4],e=e[5],new gr(new mr(parseInt(t,10),parseInt(r,10),parseInt(n,10)),wr.parse(i),wr.parse(e))},gr.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},gr.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},gr.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},gr.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},gr.prototype.isLessThan=function(e){return this.compareTo(e)<0},gr.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},gr.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;var vr=gr;function gr(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}Er.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch};var mr=Er;function Er(e,t,r){this.major=e,this.minor=t,this.patch=r}br.parse=function(e){return e?new br(e.split(".")):br.EMPTY},br.prototype.isEmpty=function(){return 0===this.identifiers.length},br.prototype.isNotEmpty=function(){return!this.isEmpty()},br.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},br.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=br.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},br.compareIdentifiers=function(e,t){return br.numericIdentifierRegExp.test(e)&&br.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},br.EMPTY=new br([]),br.numericIdentifierRegExp=/^(0|[1-9]\d*)$/;var wr=br;function br(e){this.identifiers=e}var Tr=["MATCH","NOT_MATCH"],_r=["STRING","NUMBER","BOOLEAN","VERSION","JSON","URL","NULL","UNKNOWN"],Or=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE","EXISTS"],Ir=["VARIATION","BUCKET"],Nr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"],Ar=["USER_ID","USER_PROPERTY"],Sr=(Rr.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},Rr.IDENTIFIER=new Rr("SEGMENT"),Rr.PROPERTY=new Rr("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Rr.SEGMENT=new Rr("USER_ID","USER_PROPERTY","HACKLE_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Rr);function Rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}var Mr=["ACTIVE","DRAFT","PAUSE"],Cr=["WEB","ANDROID","IOS"],xr=["IMMEDIATE","CUSTOM"],Pr=["MODAL","BANNER","BOTTOM_SHEET","NONE"],Ur=["IMAGE_TEXT","IMAGE_ONLY","TEXT_ONLY","IMAGE","NONE"],kr=["VERTICAL","HORIZONTAL"],Dr=["CLICK"],Lr=["CLOSE","WEB_LINK","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"],Fr=["TOP","MIDDLE","BOTTOM"],Vr=["LEFT","CENTER","RIGHT"],jr=(Br.fromJson=function(e){var t,r=yt(Mr,e.status);if(!u.isNullOrUndefined(r)){switch(yt(xr,e.timeUnit)){case"IMMEDIATE":t=new Hr;break;case"CUSTOM":if(u.isNullOrUndefined(e.startEpochTimeMillis))return;if(u.isNullOrUndefined(e.endEpochTimeMillis))return;t=new Kr(e.startEpochTimeMillis,e.endEpochTimeMillis);break;default:return}var n,i,o=sn.fromJson(e.messageContext);if(!u.isNullOrUndefined(o))return n=e.eventTriggerRules.map(Yr.fromJson),i=qr.fromJson(e.eventFrequencyCap),new Br(e.id,e.key,r,t,new Jr(n,i),tn.fromJson(e.targetContext),o)}},Br.prototype.supports=function(e){return this.messageContext.platformTypes.includes(e)},Br);function Br(e,t,r,n,i,o,s){this.id=e,this.key=t,this.status=r,this.period=n,this.eventTrigger=i,this.targetContext=o,this.messageContext=s}zr.prototype.within=function(e){return!0};var Hr=zr;function zr(){this.type="IMMEDIATE"}Gr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var Kr=Gr;function Gr(e,t){this.startMillisInclusive=e,this.endMillisExclusive=t,this.type="CUSTOM"}var Jr=function(e,t){this.rules=e,this.frequencyCap=t},Yr=(Wr.fromJson=function(e){return new Wr(e.eventKey,f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Sr.PROPERTY)}))},Wr);function Wr(e,t){this.eventKey=e,this.targets=t}$r.fromJson=function(e){return e?new $r(e.identifiers.map(Xr.fromJson),Qr.fromJson(e.duration)):null};var qr=$r;function $r(e,t){this.identifierCaps=e,this.durationCap=t}Zr.fromJson=function(e){return new Zr(e.identifierType,e.countPerIdentifier)};var Xr=Zr;function Zr(e,t){this.identifierType=e,this.count=t}en.fromJson=function(e){if(!e)return null;var t=yt(ke,e.durationUnit.timeUnit);return t?new en(De.converter[t](e.durationUnit.amount,"milliseconds"),e.countPerDuration):null};var Qr=en;function en(e,t){this.durationMillis=e,this.count=t}rn.fromJson=function(e){return new rn(e.overrides.map(nn.fromJson),f.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Sr.PROPERTY)}))};var tn=rn;function rn(e,t){this.overrides=e,this.targets=t}on.fromJson=function(e){return new on(e.identifierType,e.identifiers)};var nn=on;function on(e,t){this.identifierType=e,this.identifiers=t}an.fromJson=function(e){var t=null,r=("AB_TEST"===e.exposure.type&&null!==e.exposure.key&&(t=new un(e.exposure.key)),vt(Cr,e.platformTypes));if(!u.isNullOrUndefined(r)){var n=vt(kr,e.orientations);if(!u.isNullOrUndefined(n)){var i=f.mapOrUndefined(e.messages,cn.fromJson);if(!u.isNullOrUndefined(i))return new an(e.defaultLang,t,r,n,i)}}};var sn=an;function an(e,t,r,n,i){this.defaultLang=e,this.experimentContext=t,this.platformTypes=r,this.orientations=n,this.messages=i}var un=function(e){this.key=e},cn=(ln.fromJson=function(e){var t=pn.fromJson(e.layout);if(!u.isNullOrUndefined(t)){var r=f.mapOrUndefined(e.images,yn.fromJson);if(!u.isNullOrUndefined(r)){var n=void 0;if(!u.isNotNullOrUndefined(e.imageAutoScroll)||(n=gn.fromJson(e.imageAutoScroll),!u.isNullOrUndefined(n))){var i=f.mapOrUndefined(e.buttons,On.fromJson);if(!u.isNullOrUndefined(i)){var o=void 0;if(!u.isNotNullOrUndefined(e.closeButton)||(o=On.fromJson2(e.closeButton),!u.isNullOrUndefined(o))){var s=f.mapOrUndefined(e.outerButtons,Nn.fromJson),a=f.mapOrUndefined(e.innerButtons,Nn.fromJson);if(!u.isNullOrUndefined(s)&&!u.isNullOrUndefined(a))return new ln(e.variationKey,e.lang,t,r,n,e.text?En.fromJson(e.text):void 0,i,o,new Rn(e.background.color),e.action?Mn.fromJson(e.action):void 0,s,a)}}}}}},ln.prototype.toJson=function(){var e;return{variationKey:this.variationKey,lang:this.lang,layout:{layoutType:this.layout.layoutType,alignment:null!=(e=null==(e=this.layout.alignment)?void 0:e.toJson())?e:null,displayType:this.layout.displayType},images:this.images.map(function(e){return e.toJson()}),imageAutoScroll:null!=(e=null==(e=this.imageAutoScroll)?void 0:e.toJson())?e:null,text:null!=(e=null==(e=this.text)?void 0:e.toJson())?e:null,closeButton:null!=(e=null==(e=this.closeButton)?void 0:e.toCloseButtonJson())?e:null,buttons:this.buttons.map(function(e){return e.toJson()}),background:{color:this.background.color},action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null,outerButtons:this.outerButtons.map(function(e){return e.toJson()}),innerButtons:this.innerButtons.map(function(e){return e.toJson()})}},ln);function ln(e,t,r,n,i,o,s,a,u,c,l,p){this.variationKey=e,this.lang=t,this.layout=r,this.images=n,this.imageAutoScroll=i,this.text=o,this.buttons=s,this.closeButton=a,this.background=u,this.action=c,this.outerButtons=l,this.innerButtons=p}fn.fromJson=function(e){var t=yt(Ur,e.layoutType),r=yt(Pr,e.displayType);if(!u.isNullOrUndefined(r)&&!u.isNullOrUndefined(t))return new fn(r,t,e.alignment?hn.fromJson(e.alignment):void 0)};var pn=fn;function fn(e,t,r){this.displayType=e,this.layoutType=t,this.alignment=r}dn.fromJson=function(e){var t=yt(Vr,e.horizontal);if(!u.isNullOrUndefined(t)){e=yt(Fr,e.vertical);if(!u.isNullOrUndefined(e))return new dn(t,e)}},dn.prototype.toJson=function(){return{horizontal:this.horizontal,vertical:this.vertical}};var hn=dn;function dn(e,t){this.horizontal=e,this.vertical=t}vn.fromJson=function(e){var t=yt(kr,e.orientation);if(!u.isNullOrUndefined(t)){var r=void 0;if(!u.isNotNullOrUndefined(e.action)||(r=Mn.fromJson(e.action),!u.isNullOrUndefined(r)))return new vn(t,e.imagePath,r)}},vn.prototype.toJson=function(){var e;return{orientation:this.orientation,imagePath:this.imagePath,action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null}};var yn=vn;function vn(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}mn.fromJson=function(e){var t=yt(ke,e.interval.timeUnit);if(t)return new mn(De.converter[t](e.interval.amount,"milliseconds"))},mn.prototype.toJson=function(){return{interval:{timeUnit:"milliseconds",amount:this.intervalMillis}}};var gn=mn;function mn(e){this.intervalMillis=e}wn.fromJson=function(e){return new wn(bn.fromJson(e.title),bn.fromJson(e.body))},wn.prototype.toJson=function(){return{title:{text:this.title.text,style:{textColor:this.title.style.color}},body:{text:this.body.text,style:{textColor:this.body.style.color}}}};var En=wn;function wn(e,t){this.title=e,this.body=t}Tn.fromJson=function(e){return new Tn(e.text,new _n(e.style.textColor))};var bn=Tn;function Tn(e,t){this.text=e,this.style=t}var _n=function(e){this.color=e},On=(In.fromJson=function(e){var t=Mn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new In(e.text,new Sn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},In.fromJson2=function(e){var t=Mn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new In("✕",new Sn(e.style.color,"#FFFFFF","#FFFFFF"),t)},In.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},In.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},In);function In(e,t,r){this.text=e,this.style=t,this.action=r}An.fromJson=function(e){var t=On.fromJson(e.button);if(!u.isNullOrUndefined(t)){e=hn.fromJson(e.alignment);if(!u.isNullOrUndefined(e))return new An(t,e)}},An.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var Nn=An;function An(e,t){this.button=e,this.alignment=t}var Sn=function(e,t,r){this.textColor=e,this.backgroundColor=t,this.borderColor=r},Rn=function(e){this.color=e},Mn=(Cn.fromJson=function(e){var t=yt(Dr,e.behavior);if(!u.isNullOrUndefined(t)){var r=yt(Lr,e.type);if(!u.isNullOrUndefined(r))return new Cn(t,r,null!=(t=e.value)?t:void 0)}},Cn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},Cn);function Cn(e,t,r){this.behavior=e,this.type=t,this.value=r}Pn.fromJson=function(e){var t=e.type,e=e.value,r=this.linkActionTypes.some(function(e){return e===t}),n=this.closeActionTypes.some(function(e){return e===t}),i=this.tabTargetActionsTypes.some(function(e){return e===t}),o=this.windowTargetActionsTypes.some(function(e){return e===t});return new Pn(r?"LINK":"CLOSE",n?{hideDurationMillis:"HIDDEN"===t?864e5:null}:void 0,r?{url:null!=e?e:"",target:o?"NEW_WINDOW":i?"NEW_TAB":"CURRENT",shouldCloseAfterLink:n}:void 0)},Pn.fromInteraction=function(e){return"CLOSE"===e.type?new Pn(e.type,{hideDurationMillis:null}):Pn.fromJson(e.action)},Pn.fromAction=function(e){return Pn.fromJson(e.toJson())},Pn.linkActionTypes=["LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE","WEB_LINK"],Pn.closeActionTypes=["CLOSE","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW_AND_CLOSE"],Pn.tabTargetActionsTypes=["LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE"],Pn.windowTargetActionsTypes=["LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"];var xn=Pn;function Pn(e,t,r){this.type=e,this.close=t,this.link=r}var Un=function(e){this.id=e},kn=(n.SplitUrlRedirectType=void 0,(n.SplitUrlRedirectType||(n.SplitUrlRedirectType={})).MANUAL="MANUAL",Dn.fromDto=function(e){var t,r=e.needRedirect;return t=e.properties.type,new Dn(r,Object.values(n.SplitUrlRedirectType).includes(t)?e.properties.type:null,e.properties.value)},Dn);function Dn(e,t,r){this.needRedirect=e,this.redirectType=t,this.redirectUrl=r}Fn.fromJson=function(e){if(null!==e)return new Fn(f.mapNotNullOrUndefined(e.match,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),f.mapNotNullOrUndefined(e.notMatch,function(e){return Jt.fromJson(e,Sr.PROPERTY)}))};var Ln=Fn;function Fn(e,t){this.includeTargets=e,this.excludeTargets=t}jn.fromJson=function(e){return new jn(e.eventKey,e.property,e.stats)},jn.prototype.countWithinDays=function(t){return f.sum(this.stats.filter(function(e){return e.date>=t}),function(e){return e.count})};var Vn=jn;function jn(e,t,r){this.eventKey=e,this.property=t,this.stats=r}Hn.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},Hn.prototype.tag=function(e,t){return this._tags[e]=t,this},Hn.prototype.register=function(e){return e.registerTimer({name:this.name,tags:this._tags,type:"TIMER"})};var Bn=Hn;function Hn(e){this.name=e,this._tags={},this.name=e}Kn.start=function(e){return new Kn(e=void 0===e?Kn.defaultClock:e)},Kn.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},Kn.defaultClock=new Le;var zn=Kn;function Kn(e){this._clock=e,this.startTime=this._clock.tick()}Jn.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},Jn.prototype.tag=function(e,t){return this._tags[e]=t,this},Jn.prototype.register=function(e){return e.registerCounter({name:this.name,tags:this._tags,type:"COUNTER"})};var Gn=Jn;function Jn(e){this.name=e,this._tags={}}Wn.prototype.values=function(){return Array.from(this.data.values())},Wn.prototype.keys=function(){return Array.from(this.data.keys())},Wn.prototype.get=function(t){var r=this,e=this.keys().find(function(e){return r.compareFn(e,t)});return e?this.data.get(e):void 0},Wn.prototype.has=function(e){return void 0!==this.get(e)},Wn.prototype.add=function(e,t){t=(t=t)||e;return this.data.set(e,t),this},Wn.prototype.delete=function(e){var t;if(this.has(e))return t=this.get(e),this.data.delete(e),t},Wn.prototype.forEach=function(e){this.data.forEach(e)},Wn.prototype.filter=function(e){for(var t=new Wn(this.compareFn),r=0,n=this.entries();r<n.length;r++){var i=n[r];e(i[0],i[1])&&t.add(i[0],i[1])}return t},Wn.prototype.entries=function(){return Array.from(this.data.entries())};var Yn=Wn;function Wn(e){this.compareFn=e,this.data=new Map,this.compareFn=e,this.data=new Map}Object.defineProperty($n.prototype,"value",{get:function(){return this.valueSupplier()},enumerable:!1,configurable:!0});var qn=$n;function $n(e,t){this.valueSupplier=t,this.field=e}function Xn(e,t){return e.name===t.name&&Me.isEquals(e.tags,t.tags)}Object.defineProperty(Zn.prototype,"metrics",{get:function(){return Array.from(this._metrics.values())},enumerable:!1,configurable:!0}),Zn.prototype.registerCounter=function(e){return this.registerMetricIfNecessary(e,this.createCounter.bind(this))},Zn.prototype.registerTimer=function(e){return this.registerMetricIfNecessary(e,this.createTimer.bind(this))},Zn.prototype.counter=function(e,t){return void 0===t&&(t={}),new Gn(e).tags(t).register(this)},Zn.prototype.timer=function(e,t){return void 0===t&&(t={}),new Bn(e).tags(t).register(this)},Zn.prototype.registerMetricIfNecessary=function(e,t){return this.getOrCreateMetric(e,t)},Zn.prototype.getOrCreateMetric=function(e,t){var r,n=this._metrics.get(e);return n?r=n:(r=t(e),this._metrics.add(e,r)),r},Zn.prototype.close=function(){};z=Zn;function Zn(){this.id=H(),this.name="MetricRegistry",this._metrics=new Yn(Xn)}Ae(ei,Qn=z),ei.prototype.start=function(){var e=this;null===this.publishingJob&&(this.publishingJob=this.scheduler.schedulePeriodically(this.pushIntervalMillis,this.pushIntervalMillis,function(){return e.publish(!1)}),s.log.debug("PushMetricRegistry started. Publish metrics every ".concat(this.pushIntervalMillis,"ms.")))},ei.prototype.stop=function(){var e;null!=(e=this.publishingJob)&&e.cancel(),this.publishingJob=null,this.publish(!0),s.log.debug("PushMetricRegistry stopped.")},ei.prototype.close=function(){this.stop()};var Qn,r=ei;function ei(e,t){var r=Qn.call(this)||this;return r.scheduler=e,r.pushIntervalMillis=t,r.publishingJob=null,r}ri.prototype.count=function(){return this.counterValue},ri.prototype.increment=function(e){this.counterValue+=null!=e?e:1},ri.prototype.measure=function(){return[new qn("count",this.count.bind(this))]};var ti=ri;function ri(e){this.counterValue=0,this.id=e}ii.prototype.flush=function(){var e=this.currentCounter;return this.currentCounter=new ti(this.id),e},ii.prototype.count=function(){return this.currentCounter.count()},ii.prototype.increment=function(e){this.currentCounter.increment(e)},ii.prototype.measure=function(){return[new qn("count",this.count.bind(this))]};var ni=ii;function ii(e){this.id=e,this.currentCounter=new ti(e)}si.prototype.count=function(){return this._count},si.prototype.totalTime=function(e){return De.nanosToUnit(this._total,e)},si.prototype.max=function(e){return De.nanosToUnit(this._max,e)},si.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},si.prototype.record=function(e,t){e<0||(t=De.converter[t](e,"nanoseconds"),this._count=this.count()+1,this._total+=t,this._max=Math.max(t,this._max))},si.prototype.measure=function(){var e=this;return[new qn("count",this.count.bind(this)),new qn("total",function(){return e.totalTime("milliseconds")}),new qn("max",function(){return e.max("milliseconds")}),new qn("mean",function(){return e.mean("milliseconds")})]};var oi=si;function si(e){this._count=0,this._total=0,this._max=0,this.id=e}ui.prototype.flush=function(){var e=this.currentTimer;return this.currentTimer=new oi(this.id),e},ui.prototype.count=function(){return this.currentTimer.count()},ui.prototype.totalTime=function(e){return this.currentTimer.totalTime(e)},ui.prototype.max=function(e){return this.currentTimer.max(e)},ui.prototype.record=function(e,t){this.currentTimer.record(e,t)},ui.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},ui.prototype.measure=function(){var e=this;return[new qn("count",this.count.bind(this)),new qn("total",function(){return e.totalTime("milliseconds")}),new qn("max",function(){return e.max("milliseconds")}),new qn("mean",function(){return e.mean("milliseconds")})]};var ai=ui;function ui(e){this.id=e,this.currentTimer=new oi(e)}Ae(li,ci=r),li.prototype.createCounter=function(e){return new ni(e)},li.prototype.createTimer=function(e){return new ai(e)},li.prototype.publish=function(e){void 0===e&&(e=!1);var t=this.metrics.reduce(function(e,t){return void 0===(r=t).flush||"function"!=typeof r.flush?e:e.concat(t.flush());var r},[]);this.flushMetrics(t,e)};var ci,e=li;function li(e,t){return ci.call(this,e,t)||this}fi.prototype.count=function(){return 0},fi.prototype.increment=function(e){},fi.prototype.measure=function(){return[new qn("count",this.count.bind(this))]};var pi=fi;function fi(e){this.id=e}Object.defineProperty(di.prototype,"counters",{get:function(){return Array.from(this._counters.values())},enumerable:!1,configurable:!0}),di.prototype.add=function(e){this._counters.add(e,e.registerCounter(this.id))},di.prototype.count=function(){return(this.counters[0]||this.noopCounter).count()},di.prototype.increment=function(t){this.counters.forEach(function(e){e.increment(t)})},di.prototype.measure=function(){return[new qn("count",this.count.bind(this))]};var hi=di;function di(e){this._counters=new Yn(function(e,t){return e.id===t.id}),this.id=e,this.noopCounter=new pi(e)}vi.prototype.measure=function(){var e=this;return[new qn("count",this.count.bind(this)),new qn("total",function(){return e.totalTime("milliseconds")}),new qn("max",function(){return e.max("milliseconds")}),new qn("mean",function(){return e.mean("milliseconds")})]},vi.prototype.count=function(){return 0},vi.prototype.totalTime=function(e){return 0},vi.prototype.max=function(e){return 0},vi.prototype.mean=function(e){return 0},vi.prototype.record=function(e,t){};var yi=vi;function vi(e){this.id=e}Object.defineProperty(mi.prototype,"firstTimer",{get:function(){return this.timers[0]||this.noopTimer},enumerable:!1,configurable:!0}),mi.prototype.totalTime=function(e){return this.firstTimer.totalTime(e)},mi.prototype.max=function(e){return this.firstTimer.max(e)},mi.prototype.mean=function(e){return this.firstTimer.mean(e)},mi.prototype.record=function(t,r){this.timers.forEach(function(e){e.record(t,r)})},Object.defineProperty(mi.prototype,"timers",{get:function(){return Array.from(this._timers.values())},enumerable:!1,configurable:!0}),mi.prototype.add=function(e){this._timers.add(e,e.registerTimer(this.id))},mi.prototype.count=function(){return this.firstTimer.count()},mi.prototype.measure=function(){var e=this;return[new qn("count",this.count.bind(this)),new qn("total",function(){return e.totalTime("milliseconds")}),new qn("max",function(){return e.max("milliseconds")}),new qn("mean",function(){return e.mean("milliseconds")})]};var gi=mi;function mi(e){this._timers=new Yn(function(e,t){return e.id===t.id}),this.id=e,this.noopTimer=new yi(e)}Ae(wi,Ei=z),wi.prototype.createCounter=function(e){e=new hi(e);return this.addRegistry(e),e},wi.prototype.createTimer=function(e){e=new gi(e);return this.addRegistry(e),e},wi.prototype.addRegistry=function(t){this.registries.forEach(function(e){return t.add(e)})},wi.prototype.add=function(r){r instanceof wi||this.registries.has(r)||(this.registries.add(r),this.metrics.forEach(function(e){var t;void 0!==(t=e).add&&"function"==typeof t.add&&e.add(r)}))},wi.prototype.close=function(){this.registries.forEach(function(e){e.close()})};var Ei,o=wi;function wi(){var e=null!==Ei&&Ei.apply(this,arguments)||this;return e.registries=new Yn(function(e,t){return e.id===t.id}),e}Ti.counter=function(e,t){return Ti.globalRegistry.counter(e,t)},Ti.timer=function(e,t){return Ti.globalRegistry.timer(e,t)},Ti.addRegistry=function(e){Ti.globalRegistry.add(e),s.log.debug("MetricRegistry added ".concat(e.name))},Ti.globalRegistry=new o;var bi=Ti;function Ti(){}Oi.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},Oi.isNotEmptyString=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var _i=Oi;function Oi(){}Ni.builder=function(){return new Ai},Ni.get=function(e){return Ni.builder().url(e).build()},Ni.prototype.toBuilder=function(){return new Ai(this)};var Ii=Ni;function Ni(e,t,r,n,i){this.url=e,this.method=t,this.body=r,this.headers=n,this.options=i}Si.prototype.url=function(e){return this._url=e,this},Si.prototype.method=function(e){return this._method=e,this},Si.prototype.body=function(e){return this._body=e,this},Si.prototype.addHeader=function(e,t){return this._headers.add(e,t),this},Si.prototype.timeoutMillis=function(e){return this._timeoutMillis=e,this},Si.prototype.build=function(){if(null===this._url)throw new Error("url is null");var e={timeoutMillis:this._timeoutMillis};return new Ii(this._url,this._method,this._body,this._headers.build(),e)};var Ai=Si;function Si(e){var t;this._url=null!=(t=null==e?void 0:e.url)?t:null,this._method=null!=(t=null==e?void 0:e.method)?t:"GET",this._body=null!=(t=null==e?void 0:e.body)?t:null,this._headers=null!=(t=null==(t=null==e?void 0:e.headers)?void 0:t.toBuilder())?t:Ci.builder(),this._timeoutMillis=null!=(e=null==(t=null==e?void 0:e.options)?void 0:t.timeoutMillis)?e:null}Mi.ok=function(e,t){return Mi.of(200,e,t)},Mi.of=function(e,t,r){return new Mi(e,null!=t?t:null,null!=r?r:Ci.empty())},Mi.prototype.isSuccessful=function(){return 200<=this.statusCode&&this.statusCode<300},Mi.prototype.isClientError=function(){return 400<=this.statusCode&&this.statusCode<500},Mi.prototype.isNotModified=function(){return 304===this.statusCode};var Ri=Mi;function Mi(e,t,r){this.statusCode=e,this.body=t,this.headers=r}xi.empty=function(){return new xi(new Map)},xi.builder=function(){return new Pi(new Map)},xi.prototype.get=function(e){for(var t=0,r=Array.from(this.headers.entries());t<r.length;t++){var n=r[t],i=n[0],n=n[1];if(_i.equalsIgnoreCase(i,e))return n}return null},xi.prototype.getOrDefault=function(e,t){return null!=(e=this.get(e))?e:t},xi.prototype.raw=function(){return Array.from(this.headers.entries()).reduce(function(e,t){var r=t[0],t=t[1];return e[r]=t,e},{})},xi.prototype.toBuilder=function(){return new Pi(this.headers)},xi.IF_MODIFIED_SINCE="If-Modified-Since",xi.LAST_MODIFIED="Last-Modified";var Ci=xi;function xi(e){this.headers=e}Ui.prototype.add=function(e,t){return this.headers.set(e,t),this},Ui.prototype.build=function(){return new Ci(this.headers)};var Pi=Ui;function Ui(e){this.headers=e}Ae(Li,ki=e),Li.prototype.flushMetrics=function(e,t){var r=this;f.chunked(e.filter(this.isDispatchTarget.bind(this)),Ye).forEach(function(e){r.dispatch(e,t)})},Li.prototype.isDispatchTarget=function(e){return("COUNTER"===e.id.type||"TIMER"===e.id.type)&&0<e.count()},Li.prototype.dispatch=function(e,t){e=this.createRequest(e);this.execute(e,t).catch(function(e){return s.log.debug("Failed to flushing metrics: ".concat(e))})},Li.prototype.createRequest=function(e){return Ii.builder().url(this.url).method("POST").body(JSON.stringify(this.batch(e))).addHeader("Content-Type","application/json").build()},Li.prototype.execute=function(e,t){return(t?this.synchronousTransport:this.transport).send(e)},Li.prototype.batch=function(e){return{metrics:e.map(function(e){return{name:e.id.name,type:e.id.type,tags:e.id.tags,measurements:u.fromMap(f.associate(e.measure(),function(e){return[e.field,e.value]}))}})}},Li.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.publish(!0);case"visible":case"pageshow":case"blur":case"locationChange":case"focus":return}};var ki,Di=Li;function Li(e,t,r,n,i){n=ki.call(this,n,i)||this;return n.url=e,n.transport=t,n.synchronousTransport=r,n.start(),n}Vi.experiment=function(e,t,r){t=bi.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},Vi.featureFlag=function(e,t,r){t=bi.timer("feature.flag.decision",{key:String(t),on:String(r.isOn),reason:String(r.reason)});e.stop(t)},Vi.remoteConfig=function(e,t,r){t=bi.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)},Vi.inAppMessage=function(e,t,r){t=bi.timer("iam.decision",{key:String(t),show:String(r.isShow()),reason:String(r.reason)});e.stop(t)};var Fi=Vi;function Vi(){}Bi.record=function(e,t,r){e=bi.timer("api.call",{operation:e,success:Bi.success(r)});t.stop(e)},Bi.success=function(e){return null===e?"false":String(e.isSuccessful()||e.isNotModified())};var ji=Bi;function Bi(){}zi.decide=function(e,t,r,n){if(u.isNullOrUndefined(r))return this.decision(e,t,"NULL",r,n);switch(typeof r){case"string":return this.decision(e,t,"STRING",r,n);case"number":return this.decision(e,t,"NUMBER",r,n);case"boolean":return this.decision(e,t,"BOOLEAN",r,n);default:return this.decision(e,t,"UNKNOWN",r,n)}},zi.decision=function(e,t,r,n,i){return u.isNullOrUndefined(t)?gt.of(n,h.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var Hi=zi;function zi(){}var Ki=s.log,Gi=(Ji.prototype.get=function(t,r){var n,e=zn.start();try{n=this.decide(t,r)}catch(e){Ki.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=gt.of(r,h.EXCEPTION)}return Fi.remoteConfig(e,t,n),n.value},Ji.prototype.decide=function(e,t){var r=this.userManager.resolve(this.user);return Hi.decide(this.core,e,t,r)},Ji);function Ji(e,t,r){this.core=e,this.userManager=t,this.user=r}qi.prototype.contains=function(e){return this._properties.has(e)},qi.prototype.remove=function(e){var r=this;return e instanceof Map&&e.forEach(function(e,t){r.remove(t)}),"string"==typeof e&&this._properties.delete(e),this},qi.prototype.compute=function(e,t){var r=this._properties.get(e),t=t(r);null!==t?this.add(e,t):null===r&&!this.contains(e)||this.remove(e)},qi.prototype.add=function(e,t,r){if((r=void 0===r?!1:r)&&this.contains(e))return this;if(this._properties.size>=this.MAX_PROPERTIES_COUNT)return this;if("string"==typeof e&&e.length>this.MAX_PROPERTY_KEY_LENGTH)return this;r=Pe.sanitizeValue(e,t);return u.isNullOrUndefined(r)||this._properties.set(e,r),this},qi.prototype.addProperties=function(e,r){var n=this;return void 0===r&&(r=!1),e.forEach(function(e,t){n.add(t,e,r)}),this},qi.prototype.build=function(){return this._properties};var Yi,Wi=qi;function qi(){this._properties=new Map,this.MAX_PROPERTIES_COUNT=128,this.MAX_PROPERTY_KEY_LENGTH=128}(i=Yi=Yi||{}).SET="$set",i.SET_ONCE="$setOnce",i.UNSET="$unset",i.INCREMENT="$increment",i.APPEND="$append",i.APPEND_ONCE="$appendOnce",i.PREPEND="$prepend",i.PREPEND_ONCE="$prependOnce",i.REMOVE="$remove",i.CLEAR_ALL="$clearAll";Xi.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Wi).addProperties(e).addProperties(t).build()};var $i=Xi;function Xi(){}Qi.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Wi).addProperties(e).addProperties(t,!0).build()};var Zi=Qi;function Qi(){}to.prototype.operate=function(e,t){return 0===e.size?new Map:0===t.size?e:(new Wi).addProperties(e).remove(t).build()};var eo=to;function to(){}no.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Wi;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.increment(e,t)})}),n.build()},no.prototype.increment=function(e,t){return"number"!=typeof t?e:"number"!=typeof e?null==e?t:e:e+t};var ro=no;function no(){}io.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Wi;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.compute(e,t)})}),n.build()},io.prototype.compute=function(e,t){e=this.toArray(e),t=this.toArray(t);return this.operateArray(e,t)},io.prototype.toArray=function(e){return null==e?[]:Array.isArray(e)?e:[e]},io.prototype.contains=function(e,t){return e.includes(t)},io.prototype.prepend=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(t,e)?t:Se([e],t,!0)},io.prototype.append=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(e,t)?e:Se(Se([],e,!0),[t],!1)};t=io;function io(){}Ae(ao,oo=t),ao.prototype.operateArray=function(e,t){var r=this;return t.reduce(function(e,t){return r.append.bind(r)(e,t)},e)};var oo,so=ao;function ao(){return null!==oo&&oo.apply(this,arguments)||this}Ae(lo,uo=t),lo.prototype.operateArray=function(e,t){return t.reduce(this.appendOnce.bind(this),e)},lo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)};var uo,co=lo;function lo(){return null!==uo&&uo.apply(this,arguments)||this}Ae(ho,po=t),ho.prototype.operateArray=function(e,t){var r=this;return t.reduceRight(function(e,t){return r.prepend.bind(r)(t,e)},e)};var po,fo=ho;function ho(){return null!==po&&po.apply(this,arguments)||this}Ae(go,yo=t),go.prototype.operateArray=function(e,t){var r=this;return t.reduce(this.appendOnce.bind(this),[]).reduceRight(function(e,t){return r.prependOnce.bind(r)(t,e)},e)},go.prototype.appendOnce=function(e,t){return this.append(e,t,!0)},go.prototype.prependOnce=function(e,t){return this.prepend(e,t,!0)};var yo,vo=go;function go(){return null!==yo&&yo.apply(this,arguments)||this}Ae(wo,mo=t),wo.prototype.operateArray=function(e,t){return t.reduce(this.remove.bind(this),e)},wo.prototype.remove=function(e,t){return e.filter(function(e){return e!==t})};var mo,Eo=wo;function wo(){return null!==mo&&mo.apply(this,arguments)||this}To.prototype.operate=function(e,t){return new Map};var bo=To;function To(){}Oo.get=function(e){switch(e){case Yi.SET:return new $i;case Yi.SET_ONCE:return new Zi;case Yi.UNSET:return new eo;case Yi.INCREMENT:return new ro;case Yi.APPEND:return new so;case Yi.APPEND_ONCE:return new co;case Yi.PREPEND:return new fo;case Yi.PREPEND_ONCE:return new vo;case Yi.CLEAR_ALL:return new bo;case Yi.REMOVE:return new Eo}};var _o=Oo;function Oo(){}No.prototype.set=function(e,t){return this.add(Yi.SET,e,t)},No.prototype.setOnce=function(e,t){return this.add(Yi.SET_ONCE,e,t)},No.prototype.unset=function(e){return this.add(Yi.UNSET,e,"-")},No.prototype.increment=function(e,t){return this.add(Yi.INCREMENT,e,t)},No.prototype.append=function(e,t){return this.add(Yi.APPEND,e,t)},No.prototype.appendOnce=function(e,t){return this.add(Yi.APPEND_ONCE,e,t)},No.prototype.prepend=function(e,t){return this.add(Yi.PREPEND,e,t)},No.prototype.prependOnce=function(e,t){return this.add(Yi.PREPEND_ONCE,e,t)},No.prototype.remove=function(e,t){return this.add(Yi.REMOVE,e,t)},No.prototype.clearAll=function(){return this.add(Yi.CLEAR_ALL,"clearAll","-")},No.prototype.build=function(){var e=Array.from(this.operations.entries()).map(function(e){return[e[0],e[1].build()]});return new Ao(new Map(e))},No.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},No.prototype.add=function(e,t,r){if(this.containsKey(t))return this;this.operations.has(e)||this.operations.set(e,new Wi);e=this.operations.get(e);return null!=e&&e.add(t,r),this};var Io=No;function No(){this.operations=new Map}So.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=_o.get(t).operate(r,e)}),r},So.prototype.toEvent=function(){var i={key:"$properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),Pe.sanitize(u.fromMap(e))),r))}),i},So.prototype.toSecuredEvent=function(){var i={key:"$secured_properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),Pe.sanitize(u.fromMap(e))),r))}),i},So.prototype.toRecord=function(){var n={};return this.operations.forEach(function(e,t){var r={};e.forEach(function(e,t){r[t]=e}),n[t]=r}),n};var Ao=So;function So(e){this.operations=null!=e?e:new Map}Mo.timeout=function(r,n){return new Promise(function(e,t){setTimeout(function(){return t(new Error("timeout (".concat(n,"ms)")))},n),r.then(e,t)})};var Ro=Mo;function Mo(){}xo.prototype.isEquals=function(e){return this.url===e.url},Object.defineProperty(xo.prototype,"pageTitle",{get:function(){return"undefined"==typeof window||"undefined"==typeof document?"":window.document.title},enumerable:!1,configurable:!0}),xo.createWithCurrentPage=function(){return"undefined"==typeof window||"undefined"==typeof document?new xo:new xo(window.location.pathname,window.location.host,window.location.hostname,window.location.href,window.document.referrer,window.location.search,window.location.protocol)},xo.prototype.toProperties=function(){return{pagePath:this.pagePath,pageTitle:this.pageTitle,host:this.host,url:this.url,referrer:this.referrer,queryParameter:this.queryParameter,protocol:this.protocol.replace(":","")}};var Co=xo;function xo(e,t,r,n,i,o,s){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===s&&(s=""),this.pagePath=e=void 0===e?"":e,this.host=t,this.hostname=r,this.url=n,this.referrer=i,this.queryParameter=o,this.protocol=s}Uo.create=function(e){return new Uo(e)},Uo.prototype.getValue=function(){return this.value};var Po=Uo;function Uo(e){this.value=e}var ko=s.log,Do=(Lo.prototype.initialize=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),ko.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),ko.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),ko.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},Lo.prototype.getSessionId=function(){return this.sessionManager.sessionId},Lo.prototype.getUser=function(){return this.userManager.currentUser},Lo.prototype.setUser=function(e){try{var t=Gt(e);if(!t)return ko.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return ko.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},Lo.prototype.setUserId=function(e){try{var t=void 0;if(void 0===e)t=this.userManager.setUserId(void 0);else{var r=Me.sanitizeValue(e);if(!r)return ko.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return ko.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},Lo.prototype.setDeviceId=function(e){try{var t=Me.sanitizeValue(e);if(!t)return ko.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return ko.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},Lo.prototype.setUserProperty=function(e,t){e=(new Io).set(e,t).build();return this.updateUserProperties(e)},Lo.prototype.setUserProperties=function(e){try{var t=Pe.sanitize(e),r=new Io;return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){return ko.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},Lo.prototype.updateUserProperties=function(e){try{var t=e.toEvent();return this.track(t),this.userManager.updateUserProperties(e),this.core.flush(!1),Promise.resolve()}catch(e){return ko.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},Lo.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new Io).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return ko.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},Lo.prototype.setPhoneNumber=function(e){try{if("string"!=typeof e)return ko.error("Invalid value ".concat(e,": phoneNumber value type must be string.")),Promise.resolve();var t=Po.create(e),r=Le.instance.currentMillis();return this.piiEventManager.setPhoneNumber(t,r),this.core.flush(!1),Promise.resolve()}catch(e){return ko.error("Unexpected exception occurred while setting phone number: ".concat(e)),Promise.resolve()}},Lo.prototype.unsetPhoneNumber=function(){try{var e=Le.instance.currentMillis();return this.piiEventManager.unsetPhoneNumber(e),this.core.flush(!1),Promise.resolve()}catch(e){return ko.error("Unexpected exception occurred while unsetting phone number: ".concat(e)),Promise.resolve()}},Lo.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},Lo.prototype.variationDetail=function(r,n,e){var i=e||"A",e=zn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.experiment(r,t,i)}catch(e){return ko.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),bt.of(i,h.EXCEPTION)}}(this);return Fi.experiment(e,r,t),t},Lo.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},Lo.prototype.featureFlagDetail=function(r,n){var e=zn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.featureFlag(r,t)}catch(e){return ko.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),_t.off(h.EXCEPTION)}}(this);return Fi.featureFlag(e,r,t),t},Lo.prototype.track=function(e,t){try{ko.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){ko.error("Unexpected exception while tracking event: ".concat(e))}},Lo.prototype.trackPageView=function(e){var t=Co.createWithCurrentPage();this.pageEventTracker.track(t)},Lo.prototype.remoteConfig=function(e){return new Gi(this.core,this.userManager,e)},Lo.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},Lo.prototype.getExperiment=function(t){try{return this.core.getExperiment(t)}catch(e){return void ko.error('"Unexpected exception while get experiment['.concat(t,"]"))}},Lo.prototype.onInitialized=function(r){var n;return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:if(this.initialized)return[2,{success:!0}];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Ro.timeout(this.initialization,null!=(n=null==r?void 0:r.timeout)?n:3e3)];case 2:return e.sent(),[2,{success:!0}];case 3:return t=e.sent(),ko.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},Lo.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},Lo.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(ko.debug("UserExplorer opened."),bi.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):ko.error("UserExplorer is not provided")},Lo.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():ko.warn("There is no active HackleDevtools.")},Lo.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},Lo.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},Lo.prototype.close=function(){ko.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},Lo);function Lo(e,t,r,n,i,o,s,a,u){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.piiEventManager=i,this.fetchThrottler=o,this.pageEventTracker=s,this.inAppMessageUi=a,this.devTools=u,this.initialized=!1,this.initialize=this.initialize.bind(this),this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.initialization=this.initialize()}var Fo=s.log,Vo=(jo.prototype.get=function(t,r){var e=typeof r;try{var n={command:"remoteConfig",parameters:{defaultValue:r,key:t,valueType:e,user:this.user}},i=this.invocationProcessor.process(n);if(!i)throw new Error("invoke result data not exists");switch(e){case"number":return Number(i);case"boolean":return Boolean(i);default:return i}}catch(e){return Fo.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},jo);function jo(e,t){this.invocationProcessor=e,this.user=t}Ho.tryParse=function(e){try{return new URL(e)}catch(e){return}},Ho.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:Ho.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},Ho.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},Ho.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},Ho.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},Ho.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var Bo=Ho;function Ho(){}Ko.extractDomain=function(e){var t=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i),e.match(t));return r?r[0]:""},Ko.prototype.getItem=function(e){for(var t,r=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return null!=(t=Bo.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},Ko.prototype.getAllItem=function(e){var t=document.cookie.split("; ").map(function(e){return e.split("=")}),r=null==e?void 0:e.keyPrefix;return r?t.filter(function(e){var t=e[0];return e[1],t.startsWith(r)}):t},Ko.prototype.setItem=function(e,t,r){var r=c(c({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=Ko.extractDomain(document.location.hostname))?"; domain=."+a:""),r.days&&((a=new Date).setTime(a.getTime()+24*r.days*60*60*1e3),i="; expires="+a.toUTCString()),r.sameSite&&(s="; SameSite=".concat(r.sameSite)),r.isSecure&&(o+="; secure"),e+"="+encodeURIComponent(t)+i+"; path=/"+n+s+o);return document.cookie=a},Ko.prototype.removeItem=function(e,t){this.setItem(e,"",c(c({},t),{days:-1}))},Ko.prototype.getOptions=function(){return this.options},Ko.getInstance=function(e){return void 0===e&&(e={days:$e,isCrossSubdomain:!0}),Ko.storage=Ko.storage?Ko.storage:new Ko(e)};var zo=Ko;function Ko(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}Jo.prototype.initialize=function(){zo.getInstance().getItem(Xe)||qo()},Jo.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return Wo();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var Go=Jo;function Jo(){}function Yo(){var e=zo.getInstance(),t=e.getItem(Ze);if(t)return t;t=e.getItem(Xe);return t||qo()}function Wo(){zo.getInstance().removeItem(Ze)}function qo(){var e=H();return zo.getInstance().setItem(Xe,e),e}var $o,Xo=s.log;(r=$o=$o||{}).native="native",r.web_view_wrapper="web_view_wrapper";y.prototype.getSessionId=function(){try{var e=this.invocationProcessor.process({command:"getSessionId"});return null!=e?e:Yo()}catch(e){return Xo.error("Unexpected exception while get sessionId: ".concat(e)),Yo()}},y.prototype.getUser=function(){var e;try{var t=this.invocationProcessor.process({command:"getUser"});return null!=(e=Gt(t))?e:this.defaultUser()}catch(e){return Xo.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},y.prototype.setUser=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Gt(n)))return Xo.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set user: ".concat(e))}return[2]})})},y.prototype.setUserId=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Me.sanitizeValue(n)))return Xo.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},y.prototype.setDeviceId=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Me.sanitizeValue(n)))return Xo.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},y.prototype.setUserProperty=function(r,n){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"setUserProperty",parameters:{key:r,value:n}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},y.prototype.setUserProperties=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{t=Pe.sanitize(n),r=new Io,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){Xo.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},y.prototype.updateUserProperties=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"updateUserProperties",parameters:{operations:r.toRecord()}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},y.prototype.resetUser=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"resetUser"},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},y.prototype.setPhoneNumber=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{if("string"!=typeof r)return Xo.error("Invalid type ".concat(r,": phoneNumber value must be string.")),[2,Promise.resolve()];t={command:"setPhoneNumber",parameters:{phoneNumber:r}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception occurred while setting phone number: ".concat(e))}return[2]})})},y.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"unsetPhoneNumber"},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception occurred while unsetting phone number: ".concat(e))}return[2]})})},y.prototype.variation=function(t,e,r){void 0===r&&(r="A");try{var n={command:"variation",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)}},i=this.invocationProcessor.process(n);if(i)return i;throw new Error("invoke result data not exists")}catch(e){return Xo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},y.prototype.variationDetail=function(t,e,r){var n;void 0===r&&(r="A");try{var i={command:"variationDetail",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)}},o=this.invocationProcessor.process(i);if(null===o)throw new Error("invoke result data not exists");return bt.of(o.variation,o.reason,new Be(null!=(n=o.config.parameters)?n:{}))}catch(e){return Xo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),bt.of(r,h.EXCEPTION)}},y.prototype.isFeatureOn=function(t,e){try{var r={command:"isFeatureOn",parameters:{featureKey:t,user:this.convertUser(e)}},n=this.invocationProcessor.process(r);if(null===n)throw new Error("invoke result data not exists");return Boolean(n)}catch(e){return Xo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},y.prototype.featureFlagDetail=function(t,e){var r;try{var n={command:"featureFlagDetail",parameters:{featureKey:t,user:this.convertUser(e)}},i=this.invocationProcessor.process(n);if(null===i)throw new Error("invoke result data not exists");return new _t(i.isOn,i.reason,new Be(null!=(r=i.config.parameters)?r:{}),void 0)}catch(e){return Xo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),_t.off(h.EXCEPTION)}},y.prototype.track=function(e,t){try{var r={command:"track",parameters:{event:this.convertEvent(e),user:this.convertUser(t)}};this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while tracking event: ".concat(e))}},y.prototype.trackPageView=function(e){Xo.info("Web to app integration feature is not support 'trackPageView' method")},y.prototype.remoteConfig=function(e){return new Vo(this.invocationProcessor,this.convertUser(e))},y.prototype.onReady=function(e,t){e()},y.prototype.showUserExplorer=function(){try{this.invocationProcessor.process({command:"showUserExplorer"})}catch(e){Xo.error("Unexpected exception while show userExplorer: ".concat(e))}},y.prototype.hideUserExplorer=function(){Xo.info("Web to app integration feature is not support 'hideUserExplorer' method")},y.prototype.setInAppMessageListener=function(e){Xo.info("Web to app integration feature is not support 'setInAppMessageListener' method")},y.prototype.fetch=function(){return Promise.resolve()},y.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},y.prototype.close=function(){Xo.info("Web to app integration feature is not support 'close' method")},y.prototype.getExperiment=function(e){Xo.info("Web to app integration feature is not support 'getExperiment' method")},y.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},y.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=Gt(e))?e:void 0},y.prototype.defaultUser=function(){return{deviceId:Yo()}};var Zo=y;function y(e){this.invocationProcessor=e,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this)}es.prototype.getSessionId=function(){return this.browser.getSessionId()},es.prototype.getUser=function(){return this.browser.getUser()},es.prototype.syncUser=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.browser.getUser(),[4,this.app.setUser(t)];case 1:return e.sent(),[2]}})})},es.prototype.setUser=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUser(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserId=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setDeviceId=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setDeviceId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserProperty=function(t,r){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperty(t,r)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserProperties=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.updateUserProperties=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.updateUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.resetUser=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.resetUser()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setPhoneNumber=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setPhoneNumber(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.unsetPhoneNumber()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},es.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},es.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},es.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},es.prototype.track=function(e,t){return this.browser.track(e,t)},es.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},es.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},es.prototype.onReady=function(e,t){this.browser.onReady(e,t)},es.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},es.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},es.prototype.fetch=function(){return this.browser.fetch()},es.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},es.prototype.close=function(){this.browser.close()},es.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)},es.prototype.getExperiment=function(e){return this.browser.getExperiment(e)};var Qo=es;function es(e,t){this.browser=e,this.app=t,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this)}function ts(e){return e&&e.Math==Math&&e}function rs(e){try{return!!e()}catch(e){return!0}}function ns(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function is(e){return zs(Hs(e),8,-1)}function os(e){if(null==e)throw Ys("Can't call method on "+e);return e}function ss(e){return Ws(qs(e))}function as(e){return"function"==typeof e}function us(e){return"object"==typeof e?null!==e:$s(e)}function cs(e,t){return arguments.length<2?(r=Xs[e],Zs(r)?r:void 0):Xs[e]&&Xs[e][t];var r}function ls(e){try{return ua(e)}catch(e){return"Object"}}function ps(e){if(ca(e))return e;throw pa(la(e)+" is not a function")}function fs(e,t){return null==(e=e[t])?void 0:fa(e)}function hs(t,r){try{ma(ga,t,{value:r,configurable:!0,writable:!0})}catch(e){ga[t]=r}return r}function ds(e){return _a(Ta(e))}function ys(e){return"Symbol("+(void 0===e?"":e)+")_"+Ra(++Aa+Sa,36)}function vs(e){var t;return Ma(Ua,e)&&(xa||"string"==typeof Ua[e])||(t="Symbol."+e,xa&&Ma(ka,e)?Ua[e]=ka[e]:Ua[e]=(Pa&&Da?Da:La)(t)),Ua[e]}function gs(e){return e=Ga(e,"string"),Ja(e)?e:e+""}function ms(e){return Wa?Ya.createElement(e):{}}function Es(e){if(iu(e))return e;throw su(ou(e)+" is not an object")}function ws(e){return wu[e]||(wu[e]=Eu(e))}function bs(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(Vu(r)&&Bu(r,o,n),n.global)i?e[t]=r:Hu(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:ju.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function Ts(e){return(e=+e)!=e||0==e?0:Gu(e)}function _s(e,t){return(e=Ju(e))<0?Yu(e+t,0):Wu(e,t)}function Os(e){return Xu(e.length)}function Is(a){return function(e,t,r){var n,i=Zu(e),o=ec(i),s=Qu(r,o);if(a&&t!=t){for(;s<o;)if((n=i[s++])!=n)return!0}else for(;s<o;s++)if((a||s in i)&&i[s]===t)return a||s||0;return!a&&-1}}function Ns(e,t){var r,n=rc(e),i=0,o=[];for(r in n)!tc(ic,r)&&tc(n,r)&&oc(o,r);for(;t.length>i;)!tc(n,r=t[i++])||~nc(o,r)||oc(o,r);return o}function As(e,t,r){for(var n=hc(t),i=yc.f,o=dc.f,s=0;s<n.length;s++){var a=n[s];fc(e,a)||r&&fc(r,a)||i(e,a,o(t,a))}}function Ss(e,t){return(e=wc[Ec(e)])==Tc||e!=bc&&(gc(t)?vc(t):!!t)}function v(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?_c:a?_c[o]||Ac(o,{}):(_c[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=Oc(u,r))&&i.value:u[r],!Rc(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Sc(n,i)}(e.sham||i&&i.sham)&&Ic(n,"sham",!0),Nc(u,r,n,e)}}var Rs,Ms,Cs,xs,Ps,Us,ks,Ds,z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o=ts("object"==typeof globalThis&&globalThis)||ts("object"==typeof window&&window)||ts("object"==typeof self&&self)||ts("object"==typeof z&&z)||function(){return this}()||Function("return this")(),e={},i=!rs(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),t=!rs(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),Ls=Function.prototype.call,r=t?Ls.bind(Ls):function(){return Ls.apply(Ls,arguments)},z={},g={}.propertyIsEnumerable,Fs=Object.getOwnPropertyDescriptor,m=Fs&&!g.call({1:2},1),m=(z.f=m?function(e){e=Fs(this,e);return!!e&&e.enumerable}:g,t),g=Function.prototype,Vs=g.bind,js=g.call,Bs=m&&Vs.bind(js,js),g=m?function(e){return e&&Bs(e)}:function(e){return e&&function(){return js.apply(e,arguments)}},Vs=g,Hs=Vs({}.toString),zs=Vs("".slice),m=rs,Ks=is,Gs=Object,Js=g("".split),Vs=m(function(){return!Gs("z").propertyIsEnumerable(0)})?function(e){return"String"==Ks(e)?Js(e,""):Gs(e)}:Gs,Ys=TypeError,Ws=Vs,qs=os,$s=as,Xs=o,Zs=as,m=g({}.isPrototypeOf),Qs=cs("navigator","userAgent")||"",ea=Qs,ta=o.process,ra=o.Deno,ta=ta&&ta.versions||ra&&ra.version,ra=ta&&ta.v8,ta=w=!(w=ra?0<(E=ra.split("."))[0]&&E[0]<4?1:+(E[0]+E[1]):w)&&ea&&(!(E=ea.match(/Edge\/(\d+)/))||74<=E[1])&&(E=ea.match(/Chrome\/(\d+)/))?+E[1]:w,na=ta,ra=rs,ea=!!Object.getOwnPropertySymbols&&!ra(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&na&&na<41}),E=ea&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ia=cs,oa=as,sa=m,aa=Object,w=E?function(e){return"symbol"==typeof e}:function(e){var t=ia("Symbol");return oa(t)&&sa(t.prototype,aa(e))},ua=String,ca=as,la=ls,pa=TypeError,fa=ps,ha=r,da=as,ya=us,va=TypeError,ra={exports:{}},ga=o,ma=Object.defineProperty,Ea=hs,wa="__core-js_shared__",Ea=o[wa]||Ea(wa,{}),ba=Ea,Ta=((ra.exports=function(e,t){return ba[e]||(ba[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),os),_a=Object,Oa=ds,Ia=g({}.hasOwnProperty),wa=Object.hasOwn||function(e,t){return Ia(Oa(e),t)},Na=g,Aa=0,Sa=Math.random(),Ra=Na(1..toString),Na=o,b=ra.exports,Ma=wa,Ca=ys,xa=ea,Pa=E,Ua=b("wks"),ka=Na.Symbol,Da=ka&&ka.for,La=Pa?ka:ka&&ka.withoutSetter||Ca,Fa=r,Va=us,ja=w,Ba=fs,Ha=function(e,t){var r,n;if("string"===t&&da(r=e.toString)&&!ya(n=ha(r,e)))return n;if(da(r=e.valueOf)&&!ya(n=ha(r,e)))return n;if("string"!==t&&da(r=e.toString)&&!ya(n=ha(r,e)))return n;throw va("Can't convert object to primitive value")},za=TypeError,Ka=vs("toPrimitive"),Ga=function(e,t){if(!Va(e)||ja(e))return e;var r=Ba(e,Ka);if(r){if(r=Fa(r,e,t=void 0===t?"default":t),!Va(r)||ja(r))return r;throw za("Can't convert object to primitive value")}return Ha(e,t=void 0===t?"number":t)},Ja=w,ea=us,Ya=o.document,Wa=ea(Ya)&&ea(Ya.createElement),qa=ms,E=!i&&!rs(function(){return 7!=Object.defineProperty(qa("div"),"a",{get:function(){return 7}}).a}),$a=r,Xa=z,Za=ns,Qa=ss,eu=gs,tu=wa,ru=E,nu=Object.getOwnPropertyDescriptor,b=(e.f=i?nu:function(e,t){if(e=Qa(e),t=eu(t),ru)try{return nu(e,t)}catch(e){}if(tu(e,t))return Za(!$a(Xa.f,e,t),e[t])},{}),Na=i&&rs(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),iu=us,ou=String,su=TypeError,au=E,uu=Es,cu=gs,lu=TypeError,pu=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,hu="enumerable",du="configurable",yu="writable",Ca=(b.f=i?Na?function(e,t,r){var n;return uu(e),t=cu(t),uu(r),"function"==typeof e&&"prototype"===t&&"value"in r&&yu in r&&!r[yu]&&((n=fu(e,t))&&n[yu]&&(e[t]=r.value,r={configurable:(du in r?r:n)[du],enumerable:(hu in r?r:n)[hu],writable:!1})),pu(e,t,r)}:pu:function(e,t,r){if(uu(e),t=cu(t),uu(r),au)try{return pu(e,t,r)}catch(e){}if("get"in r||"set"in r)throw lu("Accessors not supported");return"value"in r&&(e[t]=r.value),e},i),vu=b,gu=ns,w=Ca?function(e,t,r){return vu.f(e,t,gu(1,r))}:function(e,t,r){return e[t]=r,e},ea={exports:{}},z=i,E=wa,Ca=Function.prototype,T=z&&Object.getOwnPropertyDescriptor,E=E(Ca,"name"),E={EXISTS:E,PROPER:E&&"something"===function(){}.name,CONFIGURABLE:E&&(!z||T(Ca,"name").configurable)},z=as,T=Ea,mu=g(Function.toString),Ca=(z(T.inspectSource)||(T.inspectSource=function(e){return mu(e)}),T.inspectSource),z=as,T=Ca,_=o.WeakMap,z=z(_)&&/native code/.test(T(_)),T=ra.exports,Eu=ys,wu=T("keys"),_={},ra=g,bu=us,Tu=w,_u=wa,T=Ea,Ou=ws,Iu=_,Nu="Object already initialized",Au=o.TypeError,Su=o.WeakMap,z=(ks=z||T.state?(Rs=T.state||(T.state=new Su),Ms=ra(Rs.get),Cs=ra(Rs.has),xs=ra(Rs.set),Ps=function(e,t){if(Cs(Rs,e))throw new Au(Nu);return t.facade=e,xs(Rs,e,t),t},Us=function(e){return Ms(Rs,e)||{}},function(e){return Cs(Rs,e)}):(Iu[Ds=Ou("state")]=!0,Ps=function(e,t){if(_u(e,Ds))throw new Au(Nu);return t.facade=e,Tu(e,Ds,t),t},Us=function(e){return _u(e,Ds)?e[Ds]:{}},function(e){return _u(e,Ds)}),{set:Ps,get:Us,has:ks,enforce:function(e){return ks(e)?Us(e):Ps(e,{})},getterFor:function(t){return function(e){if(bu(e)&&(e=Us(e)).type===t)return e;throw Au("Incompatible receiver, "+t+" required")}}}),T=rs,Ru=as,Mu=wa,Cu=i,xu=E.CONFIGURABLE,Pu=Ca,Uu=z.enforce,ku=z.get,Du=Object.defineProperty,Lu=Cu&&!T(function(){return 8!==Du(function(){},"length",{value:8}).length}),Fu=String(String).split("String"),Su=ea.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Mu(e,"name")||xu&&e.name!==t)&&(Cu?Du(e,"name",{value:t,configurable:!0}):e.name=t),Lu&&r&&Mu(r,"arity")&&e.length!==r.arity&&Du(e,"length",{value:r.arity});try{r&&Mu(r,"constructor")&&r.constructor?Cu&&Du(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=Uu(e);return Mu(r,"source")||(r.source=Fu.join("string"==typeof t?t:"")),e},Vu=(Function.prototype.toString=Su(function(){return Ru(this)&&ku(this).source||Pu(this)},"toString"),as),ju=b,Bu=ea.exports,Hu=hs,ra={},zu=Math.ceil,Ku=Math.floor,Gu=Math.trunc||function(e){e=+e;return(0<e?Ku:zu)(e)},Ju=Ts,Yu=Math.max,Wu=Math.min,qu=Ts,$u=Math.min,Xu=function(e){return 0<e?$u(qu(e),9007199254740991):0},Zu=ss,Qu=_s,ec=Os,Iu={includes:Is(!0),indexOf:Is(!1)},Ou=g,tc=wa,rc=ss,nc=Iu.indexOf,ic=_,oc=Ou([].push),T=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sc=Ns,ac=T.concat("length","prototype"),Su=(ra.f=Object.getOwnPropertyNames||function(e){return sc(e,ac)},{}),Ou=(Su.f=Object.getOwnPropertySymbols,cs),uc=ra,cc=Su,lc=Es,pc=g([].concat),Su=Ou("Reflect","ownKeys")||function(e){var t=uc.f(lc(e)),r=cc.f;return r?pc(t,r(e)):t},fc=wa,hc=Su,dc=e,yc=b,vc=rs,gc=as,mc=/#|\.prototype\./,Ec=Ss.normalize=function(e){return String(e).replace(mc,".").toLowerCase()},wc=Ss.data={},bc=Ss.NATIVE="N",Tc=Ss.POLYFILL="P",Ou=Ss,_c=o,Oc=e.f,Ic=w,Nc=bs,Ac=hs,Sc=As,Rc=Ou,Su=!rs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Mc=wa,Cc=as,xc=ds,Pc=ws("IE_PROTO"),Uc=Object,kc=Uc.prototype,Su=Su?Uc.getPrototypeOf:function(e){e=xc(e);if(Mc(e,Pc))return e[Pc];var t=e.constructor;return Cc(t)&&e instanceof t?t.prototype:e instanceof Uc?kc:null},Dc=as,Lc=String,Fc=TypeError,Vc=g,jc=Es,Bc=function(e){if("object"==typeof e||Dc(e))return e;throw Fc("Can't set "+Lc(e)+" as a prototype")},O=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=Vc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return jc(e),Bc(t),n?r(e,t):e.__proto__=t,e}}():void 0),Hc={},zc=Ns,Kc=T,I=Object.keys||function(e){return zc(e,Kc)},Gc=b,Jc=Es,Yc=ss,Wc=I;Hc.f=i&&!Na?Object.defineProperties:function(e,t){Jc(e);for(var r,n=Yc(t),i=Wc(t),o=i.length,s=0;s<o;)Gc.f(e,r=i[s++],n[r]);return e};function qc(){}function $c(e){e.write(gl("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Xc(e,t){return Il(e),void 0===t?e:Nl?Al(e,t):function(){return e.apply(t,arguments)}}function Zc(e){return void 0!==e&&(Sl.Array===e||Ml[Rl]===e)}function Qc(e){if(null!=e)return Ll(e,Vl)||Ll(e,"@@iterator")||Fl[Dl(e)]}function el(e,t){if(t=arguments.length<2?Kl(e):t,Bl(t))return Hl(jl(t,e));throw Gl(zl(e)+" is not iterable")}function tl(e,t,r){var n,i;Yl(e);try{if(!(n=Wl(e,"return"))){if("throw"===t)throw r;return r}n=Jl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Yl(n),r}function rl(e,t){this.stopped=e,this.result=t}function nl(e,t,r){function n(e){return o&&ip(o,"normal",e),new rl(!0,e)}function i(e){return f?(Xl(e),y?v(e[0],e[1],n):v(e[0],e[1])):y?v(e,n):v(e)}var o,s,a,u,c,l,p=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),y=!(!r||!r.INTERRUPTED),v=ql(t,p);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=np(e)))throw op(Zl(e)+" is not iterable");if(Ql(r)){for(s=0,a=ep(e);s<a;s++)if((u=i(e[s]))&&tp(sp,u))return u;return new rl(!1)}o=rp(e,r)}for(c=(h?e:o).next;!(l=$l(c,o)).done;){try{u=i(l.value)}catch(e){ip(o,"throw",e)}if("object"==typeof u&&u&&tp(sp,u))return u}return new rl(!1)}function il(e){if("Symbol"===ap(e))throw TypeError("Cannot convert a Symbol value to a string");return up(e)}function ol(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=pp(Ip,this);return hp?r=hp(new _p,i?fp(this):Ip):(r=i?this:dp(Ip),yp(r,Tp,"Error")),void 0!==t&&yp(r,"message",wp(t)),bp&&yp(r,"stack",gp(r.stack,1)),mp(r,n),Ep(e,Op,{that:i=[]}),yp(r,"errors",i),r}function sl(e){Ap[Np][e]=!0}var al,ul,I=cs("document","documentElement"),cl=Es,ll=Hc,pl=T,Na=_,fl=I,hl=ms,dl="prototype",yl="script",vl=ws("IE_PROTO"),gl=function(e){return"<"+yl+">"+e+"</"+yl+">"},ml=function(){try{al=new ActiveXObject("htmlfile")}catch(e){}ml="undefined"==typeof document||document.domain&&al?$c(al):(e=hl("iframe"),t="java"+yl+":",e.style.display="none",fl.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(gl("document.F=Object")),t.close(),t.F);for(var e,t,r=pl.length;r--;)delete ml[dl][pl[r]];return ml()},Hc=(Na[vl]=!0,Object.create||function(e,t){var r;return null!==e?(qc[dl]=cl(e),r=new qc,qc[dl]=null,r[vl]=e):r=ml(),void 0===t?r:ll.f(r,t)}),El=Error,wl=g("".replace),T=String(El("zxcasd").stack),bl=/\n\s*at [^:]*:[^\n]*/,Tl=bl.test(T),_l=us,Ol=w,Il=ps,Nl=t,Al=g(g.bind),Na={},Sl=Na,Rl=vs("iterator"),Ml=Array.prototype,T={},T=(T[vs("toStringTag")]="z","[object z]"===String(T)),N=T,Cl=as,xl=is,Pl=vs("toStringTag"),Ul=Object,kl="Arguments"==xl(function(){return arguments}()),N=N?xl:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=Ul(e),Pl))?t:kl?xl(e):"Object"==(t=xl(e))&&Cl(e.callee)?"Arguments":t},Dl=N,Ll=fs,Fl=Na,Vl=vs("iterator"),jl=r,Bl=ps,Hl=Es,zl=ls,Kl=Qc,Gl=TypeError,Jl=r,Yl=Es,Wl=fs,ql=Xc,$l=r,Xl=Es,Zl=ls,Ql=Zc,ep=Os,tp=m,rp=el,np=Qc,ip=tl,op=TypeError,sp=rl.prototype,ap=N,up=String,cp=il,lp=ns,A=!rs(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",lp(1,7)),7!==e.stack)}),S=v,pp=m,fp=Su,hp=O,R=As,dp=Hc,yp=w,vp=ns,gp=function(e,t){if(Tl&&"string"==typeof e&&!El.prepareStackTrace)for(;t--;)e=wl(e,bl,"");return e},mp=function(e,t){_l(t)&&"cause"in t&&Ol(e,"cause",t.cause)},Ep=nl,wp=function(e,t){return void 0===e?arguments.length<2?"":t:cp(e)},bp=A,Tp=vs("toStringTag"),_p=Error,Op=[].push,Ip=(hp?hp(ol,_p):R(ol,_p,{name:!0}),ol.prototype=dp(_p.prototype,{constructor:vp(1,ol),message:vp(1,""),name:vp(1,"AggregateError")})),A=(S({global:!0,constructor:!0,arity:2},{AggregateError:ol}),vs),R=Hc,vp=b.f,Np=A("unscopables"),Ap=Array.prototype,S=(null==Ap[Np]&&vp(Ap,Np,{configurable:!0,value:R(null)}),rs),A=as,vp=Su,R=bs,Sp=vs("iterator"),Rp=!1;[].keys&&("next"in(Up=[].keys())?(vp=vp(vp(Up)))!==Object.prototype&&(ul=vp):Rp=!0);function Mp(e,t,r){(e=e&&!r?e.prototype:e)&&!Dp(e,Lp)&&kp(e,Lp,{configurable:!0,value:t})}function Cp(){return this}function xp(){return this}function Pp(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!rf&&e in p)return p[e];switch(e){case"keys":case of:case sf:return function(){return new r(this,e)}}return function(){return new r(this)}}Jp(r,t,n);var u,c,n=t+" Iterator",l=!1,p=e.prototype,f=p[nf]||p["@@iterator"]||i&&p[i],h=!rf&&f||a(i),d="Array"==t&&p.entries||f;if(d&&(d=Yp(d.call(new e)))!==Object.prototype&&d.next&&(Yp(d)!==tf&&(Wp?Wp(d,tf):Gp(d[nf])||Xp(d,nf,xp)),qp(d,n,!0)),Qp&&i==of&&f&&f.name!==of&&(ef?$p(p,"name",of):(l=!0,h=function(){return Kp(f,this)})),i)if(u={values:a(of),keys:o?h:a("keys"),entries:a(sf)},s)for(c in u)!rf&&!l&&c in p||Xp(p,c,u[c]);else zp({target:t,proto:!0,forced:rf||l},u);return p[nf]!==h&&Xp(p,nf,h,{name:i}),Zp[t]=h,u}A((ul=null==ul||S(function(){var e={};return ul[Sp].call(e)!==e})?{}:ul)[Sp])||R(ul,Sp,function(){return this});var Up={IteratorPrototype:ul,BUGGY_SAFARI_ITERATORS:Rp},kp=b.f,Dp=wa,Lp=vs("toStringTag"),Fp=Up.IteratorPrototype,Vp=Hc,jp=ns,Bp=Mp,Hp=Na,zp=v,Kp=r,Gp=as,Jp=function(e,t,r,n){t+=" Iterator";return e.prototype=Vp(Fp,{next:jp(+!n,r)}),Bp(e,t,!1),Hp[t]=Cp,e},Yp=Su,Wp=O,qp=Mp,$p=w,Xp=bs,vp=vs,Zp=Na,Qp=E.PROPER,ef=E.CONFIGURABLE,tf=Up.IteratorPrototype,rf=Up.BUGGY_SAFARI_ITERATORS,nf=vp("iterator"),of="values",sf="entries",af=ss,A=sl,S=Na,R=z,Rp=b.f,E=Pp,Up=i,uf="Array Iterator",cf=R.set,lf=R.getterFor(uf),vp=E(Array,"Array",function(e,t){cf(this,{type:uf,target:af(e),index:0,kind:t})},function(){var e=lf(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),Na=S.Arguments=S.Array;if(A("keys"),A("values"),A("entries"),Up&&"values"!==Na.name)try{Rp(Na,"name",{value:"values"})}catch(e){}var pf=N;T||bs(Object.prototype,"toString",T?{}.toString:function(){return"[object "+pf(this)+"]"},{unsafe:!0});function ff(e){var e=wf(e),t=bf.f;Tf&&e&&!e[_f]&&t(e,_f,{configurable:!0,get:function(){return this}})}function hf(e,t){if(Of(t,e))return e;throw If("Incorrect invocation")}function df(){}function yf(e){if(!Nf(e))return!1;try{return Mf(df,Rf,e),!0}catch(e){return!1}}function vf(e){if(!Nf(e))return!1;switch(Af(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Pf||!!xf(Cf,Sf(e))}catch(e){return!0}}function gf(e,t){return void 0===(e=Lf(e).constructor)||null==(e=Lf(e)[Vf])?t:Ff(e)}var mf,Ef,R="process"==is(o.process),wf=cs,bf=b,Tf=i,_f=vs("species"),Of=m,If=TypeError,E=g,S=rs,Nf=as,Af=N,Sf=Ca,Rf=[],Mf=cs("Reflect","construct"),Cf=/^\s*(?:class|function)\b/,xf=E(Cf.exec),Pf=!Cf.exec(df),A=(vf.sham=!0,!Mf||S(function(){var e;return yf(yf.call)||!yf(Object)||!yf(function(){e=!0})||e})?vf:yf),Uf=A,kf=ls,Df=TypeError,Lf=Es,Ff=function(e){if(Uf(e))return e;throw Df(kf(e)+" is not a constructor")},Vf=vs("species"),Up=Function.prototype,jf=Up.apply,Bf=Up.call,Rp="object"==typeof Reflect&&Reflect.apply||(t?Bf.bind(jf):function(){return Bf.apply(jf,arguments)}),Na=g([].slice),Hf=TypeError,T=/(?:ipad|iphone|ipod).*applewebkit/i.test(Qs),zf=o,Kf=Rp,m=Xc,Gf=as,Jf=wa,N=rs,Yf=I,Wf=Na,qf=ms,$f=function(e,t){if(e<t)throw Hf("Not enough arguments");return e},E=T,S=R,Up=zf.setImmediate,t=zf.clearImmediate,Xf=zf.process,Zf=zf.Dispatch,Qf=zf.Function,I=zf.MessageChannel,eh=zf.String,th=0,rh={},nh="onreadystatechange";try{mf=zf.location}catch(e){}function ih(e){return function(){bh(e)}}function oh(e){bh(e.data)}function sh(e){zf.postMessage(eh(e),mf.protocol+"//"+mf.host)}function ah(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function uh(){this.head=null,this.tail=null}function ch(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=Uh(r),this.reject=Uh(n)}function lh(e,t){var r,n,i,o,s=t.value,a=t.state==ud,u=a?e.ok:e.fail,c=e.resolve,l=e.reject,p=e.domain;try{u?(a||(t.rejection===pd&&(o=t,Lh(zh,Dh,function(){var e=o.facade;kh?rd.emit("rejectionHandled",e):dd(ad,e,o.value)})),t.rejection=ld),!0===u?r=s:(p&&p.enter(),r=u(s),p&&(p.exit(),i=!0)),r===e.promise?l(ed("Promise-chain cycle")):(n=fd(r))?Lh(n,r,c,l):c(r)):l(s)}catch(e){p&&!i&&p.exit(),l(e)}}var ph,fh,hh,dh,yh,vh,gh,mh,Eh,wh,bh=function(e){var t;Jf(rh,e)&&(t=rh[e],delete rh[e],t())},I=(Up&&t||(Up=function(e){$f(arguments.length,1);var t=Gf(e)?e:Qf(e),r=Wf(arguments,1);return rh[++th]=function(){Kf(t,void 0,r)},Ef(th),th},t=function(e){delete rh[e]},S?Ef=function(e){Xf.nextTick(ih(e))}:Zf&&Zf.now?Ef=function(e){Zf.now(ih(e))}:I&&!E?(E=(S=new I).port2,S.port1.onmessage=oh,Ef=m(E.postMessage,E)):zf.addEventListener&&Gf(zf.postMessage)&&!zf.importScripts&&mf&&"file:"!==mf.protocol&&!N(sh)?(Ef=sh,zf.addEventListener("message",oh,!1)):Ef=nh in qf("script")?function(e){Yf.appendChild(qf("script"))[nh]=function(){Yf.removeChild(this),bh(e)}}:function(e){setTimeout(ih(e),0)}),{set:Up,clear:t}),S=o,m=/ipad|iphone|ipod/i.test(Qs)&&void 0!==S.Pebble,E=/web0s(?!.*chrome)/i.test(Qs),N=o,Up=Xc,t=e.f,Th=I.set,S=T,e=m,T=E,_h=R,m=N.MutationObserver||N.WebKitMutationObserver,E=N.document,Oh=N.process,M=N.Promise,t=t(N,"queueMicrotask"),t=t&&t.value,T=(t||(ph=function(){var e,t;for(_h&&(e=Oh.domain)&&e.exit();fh;){t=fh.fn,fh=fh.next;try{t()}catch(e){throw fh?dh():hh=void 0,e}}hh=void 0,e&&e.enter()},dh=S||_h||T||!m||!E?!e&&M&&M.resolve?((S=M.resolve(void 0)).constructor=M,gh=Up(S.then,S),function(){gh(ph)}):_h?function(){Oh.nextTick(ph)}:(Th=Up(Th,N),function(){Th(ph)}):(yh=!0,vh=E.createTextNode(""),new m(ph).observe(vh,{characterData:!0}),function(){vh.data=yh=!yh})),t||function(e){e={fn:e,next:void 0};hh&&(hh.next=e),fh||(fh=e,dh()),hh=e}),Ih=o,e=(uh.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},uh),M=o.Promise,S="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Up=!S&&!R&&"object"==typeof window&&"object"==typeof document,N=o,Nh=M,E=as,m=Ou,Ah=Ca,t=vs,Sh=Up,Rh=S,Mh=ta,Ch=(Nh&&Nh.prototype,t("species")),xh=!1,Ph=E(N.PromiseRejectionEvent),Ca={CONSTRUCTOR:m("Promise",function(){var e=Ah(Nh),t=e!==String(Nh);if(!t&&66===Mh)return!0;if(!Mh||Mh<51||!/native code/.test(e)){var e=new Nh(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[Ch]=r,!(xh=e.then(function(){})instanceof r))return!0}return!t&&(Sh||Rh)&&!Ph}),REJECTION_EVENT:Ph,SUBCLASSING:xh},Up={},Uh=ps,S=(Up.f=function(e){return new ch(e)},v),kh=R,Dh=o,Lh=r,t=bs,E=O,N=Mp,m=ff,Fh=ps,Vh=as,jh=us,Bh=hf,Hh=gf,zh=I.set,Kh=T,Gh=function(e,t){var r=Ih.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Jh=ah,Yh=e,I=z,T=M,e=Up,Wh="Promise",C=Ca.CONSTRUCTOR,qh=Ca.REJECTION_EVENT,x=Ca.SUBCLASSING,$h=I.getterFor(Wh),Xh=I.set,I=T&&T.prototype,Zh=T,Qh=I,ed=Dh.TypeError,td=Dh.document,rd=Dh.process,nd=e.f,id=nd,od=!!(td&&td.createEvent&&Dh.dispatchEvent),sd="unhandledrejection",ad="rejectionhandled",ud=1,cd=2,ld=1,pd=2,fd=function(e){var t;return!(!jh(e)||!Vh(t=e.then))&&t},hd=function(r,i){r.notified||(r.notified=!0,Kh(function(){for(var e,n,t=r.reactions;e=t.get();)lh(e,r);r.notified=!1,i&&!r.rejection&&(n=r,Lh(zh,Dh,function(){var e=n.facade,t=n.value,r=yd(n);if(r&&(r=Jh(function(){kh?rd.emit("unhandledRejection",t,e):dd(sd,e,t)}),n.rejection=kh||yd(n)?pd:ld,r.error))throw r.value}))}))},dd=function(e,t,r){var n;od?((n=td.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Dh.dispatchEvent(n)):n={promise:t,reason:r},!qh&&(t=Dh["on"+e])?t(n):e===sd&&Gh("Unhandled promise rejection",r)},yd=function(e){return e.rejection!==ld&&!e.parent},vd=function(t,r,n){return function(e){t(r,e,n)}},gd=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=cd,hd(e,!0))},md=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw ed("Promise can't be resolved itself");var n=fd(e);n?Kh(function(){var t={done:!1};try{Lh(n,e,vd(md,t,r),vd(gd,t,r))}catch(e){gd(t,e,r)}}):(r.value=e,r.state=ud,hd(r,!1))}catch(e){gd({done:!1},e,r)}}};if(C&&(Qh=(Zh=function(e){Bh(this,Qh),Fh(e),Lh(mh,this);var t=$h(this);try{e(vd(md,t),vd(gd,t))}catch(e){gd(t,e)}}).prototype,(mh=function(e){Xh(this,{type:Wh,done:!1,notified:!1,parent:!1,reactions:new Yh,rejection:!1,state:0,value:void 0})}).prototype=t(Qh,"then",function(e,t){var r=$h(this),n=nd(Hh(this,Zh));return r.parent=!0,n.ok=!Vh(e)||e,n.fail=Vh(t)&&t,n.domain=kh?rd.domain:void 0,0==r.state?r.reactions.add(n):Kh(function(){lh(n,r)}),n.promise}),Eh=function(){var e=new mh,t=$h(e);this.promise=e,this.resolve=vd(md,t),this.reject=vd(gd,t)},e.f=nd=function(e){return e===Zh||void 0===e?new Eh:id(e)},Vh(T)&&I!==Object.prototype)){wh=I.then,x||t(I,"then",function(e,t){var r=this;return new Zh(function(e,t){Lh(wh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete I.constructor}catch(e){}E&&E(I,Qh)}S({global:!0,constructor:!0,wrap:!0,forced:C},{Promise:Zh}),N(Zh,Wh,!1),m(Wh);var Ed=vs("iterator"),wd=!1;try{var bd=0,Td={next:function(){return{done:!!bd++}},return:function(){wd=!0}};Td[Ed]=function(){return this},Array.from(Td,function(){throw 2})}catch(e){}function _d(e,t){if(!t&&!wd)return!1;var r=!1;try{var n={};n[Ed]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var Od=M,e=_d,T=Ca.CONSTRUCTOR||!e(function(e){Od.all(e).then(void 0,function(){})}),Id=r,Nd=ps,Ad=Up,Sd=ah,Rd=nl,x=(v({target:"Promise",stat:!0,forced:T},{all:function(e){var a=this,t=Ad.f(a),u=t.resolve,c=t.reject,r=Sd(function(){var n=Nd(a.resolve),i=[],o=0,s=1;Rd(e,function(e){var t=o++,r=!1;s++,Id(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s||u(i))},c)}),--s||u(i)});return r.error&&c(r.value),t.promise}}),v),t=M,E=cs,I=as,S=bs,C=t&&t.prototype;x({target:"Promise",proto:!0,forced:Ca.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),I(t)&&(N=E("Promise").prototype.catch,C.catch!==N&&S(C,"catch",N,{unsafe:!0}));var Md=r,Cd=ps,xd=Up,Pd=ah,Ud=nl;v({target:"Promise",stat:!0,forced:T},{race:function(e){var r=this,n=xd.f(r),i=n.reject,t=Pd(function(){var t=Cd(r.resolve);Ud(e,function(e){Md(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function kd(e,t){return Fd(e),Vd(t)&&t.constructor===e?t:((0,(e=jd.f(e)).resolve)(t),e.promise)}var Dd=r,Ld=Up,Fd=(v({target:"Promise",stat:!0,forced:Ca.CONSTRUCTOR},{reject:function(e){var t=Ld.f(this);return Dd(t.reject,void 0,e),t.promise}}),Es),Vd=us,jd=Up,m=v,Td=cs,e=Ca.CONSTRUCTOR,Bd=kd;Td("Promise"),m({target:"Promise",stat:!0,forced:e},{resolve:function(e){return Bd(this,e)}});var Hd=r,zd=ps,Kd=Up,Gd=ah,Jd=nl;v({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=Kd.f(a),u=t.resolve,r=t.reject,n=Gd(function(){var n=zd(a.resolve),i=[],o=0,s=1;Jd(e,function(e){var t=o++,r=!1;s++,Hd(n,a,e).then(function(e){r||(r=!0,i[t]={status:"fulfilled",value:e},--s||u(i))},function(e){r||(r=!0,i[t]={status:"rejected",reason:e},--s||u(i))})}),--s||u(i)});return n.error&&r(n.value),t.promise}});function Yd(i){return function(e,t){var r,e=ay(uy(e)),t=sy(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=ly(e,t))<55296||56319<r||t+1===n||(n=ly(e,t+1))<56320||57343<n?i?cy(e,t):r:i?py(e,t,t+2):n-56320+(r-55296<<10)+65536}}var Wd=r,qd=ps,$d=cs,Xd=Up,Zd=ah,Qd=nl,ey="No one promise resolved",x=(v({target:"Promise",stat:!0},{any:function(e){var u=this,c=$d("AggregateError"),t=Xd.f(u),l=t.resolve,p=t.reject,r=Zd(function(){var n=qd(u.resolve),i=[],o=0,s=1,a=!1;Qd(e,function(e){var t=o++,r=!1;s++,Wd(n,u,e).then(function(e){r||a||(a=!0,l(e))},function(e){r||a||(r=!0,i[t]=e,--s||p(new c(i,ey)))})}),--s||p(new c(i,ey))});return r.error&&p(r.value),t.promise}}),v),I=M,t=rs,ty=cs,ry=as,ny=gf,iy=kd,E=bs,oy=I&&I.prototype,C=(x({target:"Promise",proto:!0,real:!0,forced:!!I&&t(function(){oy.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=ny(this,ty("Promise")),e=ry(t);return this.then(e?function(e){return iy(r,t()).then(function(){return e})}:t,e?function(e){return iy(r,t()).then(function(){throw e})}:t)}}),ry(I)&&(S=ty("Promise").prototype.finally,oy.finally!==S&&E(oy,"finally",S,{unsafe:!0})),g),sy=Ts,ay=il,uy=os,cy=C("".charAt),ly=C("".charCodeAt),py=C("".slice),fy={codeAt:Yd(!1),charAt:Yd(!0)}.charAt,hy=il,N=z,T=Pp,dy="String Iterator",yy=N.set,vy=N.getterFor(dy);T(String,"String",function(e){yy(this,{type:dy,string:hy(e),index:0})},function(){var e=vy(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=fy(t,r),e.index+=t.length,{value:t,done:!1})});function gy(t,e){if(t){if(t[_y]!==Iy)try{Ty(t,_y,Iy)}catch(e){t[_y]=Iy}if(t[Oy]||Ty(t,Oy,e),wy[e])for(var r in by)if(t[r]!==by[r])try{Ty(t,r,by[r])}catch(e){t[r]=by[r]}}}var my,Ca=o,Td=Ca.Promise,m=ms("span").classList,e=m&&m.constructor&&m.constructor.prototype,M=e===Object.prototype?void 0:e,Ey=o,wy={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},x=M,by=vp,Ty=w,t=vs,_y=t("iterator"),Oy=t("toStringTag"),Iy=by.values;for(my in wy)gy(Ey[my]&&Ey[my].prototype,my);gy(x,"DOMTokenList");var I,E,S=E=I=Td,C,Ny=Up,Ay=ah,Sy=((C=v)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Ny.f(this),e=Ay(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),Es),Ry=tl,My=gs,Cy=b,xy=ns,N,Py=Xc,Uy=r,ky=ds,Dy=function(t,e,r,n){try{return n?e(Sy(r)[0],r[1]):e(r)}catch(e){Ry(t,"throw",e)}},Ly=Zc,Fy=A,Vy=Os,jy=N=function(e,t,r){t=My(t);t in e?Cy.f(e,t,xy(0,r)):e[t]=r},By=el,Hy=Qc,zy=Array,T=v,m=function(e){var t,r,n,i,o,s,a=ky(e),e=Fy(this),u=arguments.length,c=1<u?arguments[1]:void 0,l=void 0!==c,u=(l&&(c=Py(c,2<u?arguments[2]:void 0)),Hy(a)),p=0;if(!u||this===zy&&Ly(u))for(t=Vy(a),r=e?new this(t):zy(t);p<t;p++)s=l?c(a[p],p):a[p],jy(r,p,s);else for(o=(i=By(a,u)).next,r=e?new this:[];!(n=Uy(o,i)).done;p++)s=l?Dy(i,c,[n.value,p],!0):n.value,jy(r,p,s);return r.length=p,r},e,M=!(e=_d)(function(e){Array.from(e)}),Ky=(T({target:"Array",stat:!0,forced:M},{from:m}),is),vp=Array.isArray||function(e){return"Array"==Ky(e)},w,t,x=((w=v)({target:"Array",stat:!0},{isArray:t=vp}),v),Td=rs,Gy=A,Jy=N,Yy=Array,I=Td(function(){function e(){}return!(Yy.of.call(e)instanceof e)}),Wy=(x({target:"Array",stat:!0,forced:I},{of:function(){for(var e=0,t=arguments.length,r=new(Gy(this)?this:Yy)(t);e<t;)Jy(r,e,arguments[e++]);return r.length=t,r}}),ds),qy=Os,$y=Ts,E=sl,Xy=(v({target:"Array",proto:!0},{at:function(e){var t=Wy(this),r=qy(t),e=$y(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),E("at"),TypeError),S=function(e){if(9007199254740991<e)throw Xy("Maximum allowed index exceeded");return e},Zy=vp,Qy=A,ev=us,tv=vs("species"),rv=Array,nv=function(e){var t;return Zy(e)&&(t=e.constructor,(Qy(t)&&(t===rv||Zy(t.prototype))||ev(t)&&null===(t=t[tv]))&&(t=void 0)),void 0===t?rv:t},Up=function(e,t){return new(nv(e))(0===t?0:t)},iv=rs,ov=ta,sv=vs("species"),C,e=v,T=rs,av=vp,uv=us,cv=ds,lv=Os,pv=S,fv=N,hv=Up,M=C=function(t){return 51<=ov||!iv(function(){var e=[];return(e.constructor={})[sv]=function(){return{foo:1}},1!==e[t](Boolean).foo})},m=ta,dv=vs("isConcatSpreadable"),w=51<=m||!T(function(){var e=[];return e[dv]=!1,e.concat()[0]!==e}),t=M("concat"),yv=(e({target:"Array",proto:!0,arity:1,forced:!w||!t},{concat:function(e){for(var t,r,n,i=cv(this),o=hv(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!uv(e))return!1;var t=e[dv];return void 0!==t?!!t:av(e)}(n=-1===a?i:arguments[a]))for(r=lv(n),pv(s+r),t=0;t<r;t++,s++)t in n&&fv(o,s,n[t]);else pv(s+1),fv(o,s++,n);return o.length=s,o}}),ls),vv=TypeError,Td,gv=ds,mv=_s,Ev=Os,wv=Td=function(e,t){if(!delete e[t])throw vv("Cannot delete property "+yv(t)+" of "+yv(e))},bv=Math.min,x=sl,Tv=(v({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=gv(this),n=Ev(r),i=mv(e,n),o=mv(t,n),e=2<arguments.length?arguments[2]:void 0,s=bv((void 0===e?n:mv(e,n))-o,n-i),a=1;for(o<i&&i<o+s&&(a=-1,o+=s-1,i+=s-1);0<s--;)o in r?r[i]=r[o]:wv(r,i),i+=a,o+=a;return r}}),x("copyWithin"),Xc),_v=Vs,Ov=ds,Iv=Os,Nv=Up,Av=g([].push),I,E={forEach:(I=function(f){var h=1==f,d=2==f,y=3==f,v=4==f,g=6==f,m=7==f,E=5==f||g;return function(e,t,r,n){for(var i,o,s=Ov(e),a=_v(s),u=Tv(t,r),c=Iv(a),l=0,t=n||Nv,p=h?t(e,c):d||m?t(e,0):void 0;l<c;l++)if((E||l in a)&&(o=u(i=a[l],l,s),f))if(h)p[l]=o;else if(o)switch(f){case 3:return!0;case 5:return i;case 6:return l;case 2:Av(p,i)}else switch(f){case 4:return!1;case 7:Av(p,i)}return g?-1:y||v?v:p}})(0),map:I(1),filter:I(2),some:I(3),every:I(4),find:I(5),findIndex:I(6),filterReject:I(7)},Sv=rs,m=function(e,t){var r=[][e];return!!r&&Sv(function(){r.call(null,t||function(){return 1},1)})},T=v,Rv=E.every,Mv=(T({target:"Array",proto:!0,forced:!m("every")},{every:function(e){return Rv(this,e,1<arguments.length?arguments[1]:void 0)}}),ds),Cv=_s,xv=Os,M=sl,e=(v({target:"Array",proto:!0},{fill:function(e){for(var t=Mv(this),r=xv(t),n=arguments.length,i=Cv(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:Cv(n,r);i<o;)t[i++]=e;return t}}),M("fill"),v),Pv=E.filter,w=(e({target:"Array",proto:!0,forced:!C("filter")},{filter:function(e){return Pv(this,e,1<arguments.length?arguments[1]:void 0)}}),v),Uv=E.find,t=sl,x,kv=!0,I=((x="find")in[]&&Array(1)[x](function(){kv=!1}),w({target:"Array",proto:!0,forced:kv},{find:function(e){return Uv(this,e,1<arguments.length?arguments[1]:void 0)}}),t(x),v),Dv=E.findIndex,T=sl,M,Lv=!0,Fv=((M="findIndex")in[]&&Array(1)[M](function(){Lv=!1}),I({target:"Array",proto:!0,forced:Lv},{findIndex:function(e){return Dv(this,e,1<arguments.length?arguments[1]:void 0)}}),T(M),Xc),Vv=Vs,jv=ds,Bv=Os,e,w={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=jv(e),o=Vv(i),s=Fv(t,r),a=Bv(o);0<a--;)if(s(n=o[a],a,i))switch(u){case 0:return n;case 1:return a}return c?-1:void 0}})(0),findLastIndex:e(1)},t=v,Hv=w.findLast,x=sl,I=(t({target:"Array",proto:!0},{findLast:function(e){return Hv(this,e,1<arguments.length?arguments[1]:void 0)}}),x("findLast"),v),zv=w.findLastIndex,T=sl,Kv=(I({target:"Array",proto:!0},{findLastIndex:function(e){return zv(this,e,1<arguments.length?arguments[1]:void 0)}}),T("findLastIndex"),vp),Gv=Os,Jv=S,Yv=Xc,Wv=function(e,t,r,n,i,o,s,a){for(var u,c,l=i,p=0,f=!!s&&Yv(s,a);p<n;)p in r&&(u=f?f(r[p],p,t):r[p],0<o&&Kv(u)?(c=Gv(u),l=Wv(e,t,u,c,l,o-1)-1):(Jv(l+1),e[l]=u),l++),p++;return l},M,qv=M=Wv,$v=ds,Xv=Os,Zv=Ts,Qv=Up;v({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=$v(this),r=Xv(t),n=Qv(t,0);return n.length=qv(n,t,t,r,0,void 0===e?1:Zv(e)),n}});function eg(c){return function(e,t,r,n){Ng(t);var i=Ag(e),o=Sg(i),s=Rg(i),a=c?s-1:0,u=c?-1:1;if(r<2)for(;;){if(a in o){n=o[a],a+=u;break}if(a+=u,c?a<0:s<=a)throw Mg("Reduce of empty array with no initial value")}for(;c?0<=a:a<s;a+=u)a in o&&(n=t(n,o[a],a,i));return n}}function tg(e,t,r){for(var n=Wg(e),i=Yg(t,n),o=Yg(void 0===r?n:r,n),s=$g(Xg(o-i,0)),a=0;i<o;i++,a++)qg(s,a,e[i]);return s.length=a,s}function rg(e,t){var r=e.length,n=Qg(r/2);if(r<8){for(var i,o,s=e,a=t,u=s.length,c=1;c<u;){for(i=s[o=c];o&&0<a(s[o-1],i);)s[o]=s[--o];o!==c++&&(s[o]=i)}return s}for(var l=e,p=rg(Zg(e,0,n),t),f=rg(Zg(e,n),t),h=t,d=p.length,y=f.length,v=0,g=0;v<d||g<y;)l[v+g]=v<d&&g<y?h(p[v],f[g])<=0?p[v++]:f[g++]:v<d?p[v++]:f[g++];return l}var ng=M,ig=ps,og=ds,sg=Os,ag=Up,ug=(v({target:"Array",proto:!0},{flatMap:function(e){var t,r=og(this),n=sg(r);return ig(e),(t=ag(r,0)).length=ng(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),E.forEach),e=m("forEach")?[].forEach:function(e){return ug(this,e,1<arguments.length?arguments[1]:void 0)},t=(v({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),v),cg=Iu.includes,x=sl,w=(t({target:"Array",proto:!0,forced:rs(function(){return!Array(1).includes()})},{includes:function(e){return cg(this,e,1<arguments.length?arguments[1]:void 0)}}),x("includes"),v),I=g,lg=Iu.indexOf,T=m,pg=I([].indexOf),fg=!!pg&&1/pg([1],1,-0)<0,M=T("indexOf"),e=(w({target:"Array",proto:!0,forced:fg||!M},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return fg?pg(this,e,t)||0:lg(this,e,t)}}),v),t=Vs,hg=ss,x=m,dg=g([].join),Iu=t!=Object,I=x("join",","),yg=(e({target:"Array",proto:!0,forced:Iu||!I},{join:function(e){return dg(hg(this),void 0===e?",":e)}}),Rp),vg=ss,gg=Ts,mg=Os,T=m,Eg=Math.min,wg=[].lastIndexOf,bg=!!wg&&1/[1].lastIndexOf(1,-0)<0,w=T("lastIndexOf"),M=bg||!w?function(e){if(bg)return yg(wg,this,arguments)||0;var t=vg(this),r=mg(t),n=r-1;for((n=1<arguments.length?Eg(n,gg(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:wg,t=(v({target:"Array",proto:!0,forced:M!==[].lastIndexOf},{lastIndexOf:M}),v),Tg=E.map,x=(t({target:"Array",proto:!0,forced:!C("map")},{map:function(e){return Tg(this,e,1<arguments.length?arguments[1]:void 0)}}),v),_g=ds,Og=Os,Ig=S,e=rs(function(){return 4294967297!==[].push.call({length:4294967296},1)}),Iu=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),Ng=(x({target:"Array",proto:!0,arity:1,forced:e||Iu},{push:function(e){var t=_g(this),r=Og(t),n=arguments.length;Ig(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),ps),Ag=ds,Sg=Vs,Rg=Os,Mg=TypeError,I={left:eg(!1),right:eg(!0)},Rp=v,Cg=I.left,T=ta,w=R,M=(Rp({target:"Array",proto:!0,forced:!m("reduce")||!w&&79<T&&T<83},{reduce:function(e){var t=arguments.length;return Cg(this,e,t,1<t?arguments[1]:void 0)}}),v),xg=I.right,t=ta,x=R,e=(M({target:"Array",proto:!0,forced:!m("reduceRight")||!x&&79<t&&t<83},{reduceRight:function(e){return xg(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),v),Pg=vp,Ug=g([].reverse),Iu=[1,2],Rp=(e({target:"Array",proto:!0,forced:String(Iu)===String(Iu.reverse())},{reverse:function(){return Pg(this)&&(this.length=this.length),Ug(this)}}),v),kg=vp,Dg=A,Lg=us,Fg=_s,Vg=Os,jg=ss,Bg=N,w=vs,Hg=Na,T=C("slice"),zg=w("species"),Kg=Array,Gg=Math.max,I=(Rp({target:"Array",proto:!0,forced:!T},{slice:function(e,t){var r,n,i,o=jg(this),s=Vg(o),a=Fg(e,s),u=Fg(void 0===t?s:t,s);if(kg(o)&&(r=o.constructor,(r=Dg(r)&&(r===Kg||kg(r.prototype))||Lg(r)&&null===(r=r[zg])?void 0:r)===Kg||void 0===r))return Hg(o,a,u);for(n=new(void 0===r?Kg:r)(Gg(u-a,0)),i=0;a<u;a++,i++)a in o&&Bg(n,i,o[a]);return n.length=i,n}}),v),Jg=E.some,Yg=(I({target:"Array",proto:!0,forced:!m("some")},{some:function(e){return Jg(this,e,1<arguments.length?arguments[1]:void 0)}}),_s),Wg=Os,qg=N,$g=Array,Xg=Math.max,Zg=tg,Qg=Math.floor,R=rg,M=Qs.match(/firefox\/(\d+)/i),x=!!M&&+M[1],t=/MSIE|Trident/.test(Qs),e=Qs.match(/AppleWebKit\/(\d+)\./),Iu=!!e&&+e[1],Na=v,w=g,em=ps,tm=ds,rm=Os,nm=Td,im=il,Rp=rs,om=R,T=m,sm=x,am=t,um=ta,cm=Iu,lm=[],pm=w(lm.sort),fm=w(lm.push),I=Rp(function(){lm.sort(void 0)}),M=Rp(function(){lm.sort(null)}),Qs=T("sort"),hm=!Rp(function(){if(um)return um<70;if(!(sm&&3<sm)){if(am)return!0;if(cm)return cm<603;for(var e,t,r,n="",i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(r=0;r<47;r++)lm.push({k:e+r,v:t})}for(lm.sort(function(e,t){return t.v-e.v}),r=0;r<lm.length;r++)e=lm[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});Na({target:"Array",proto:!0,forced:I||!M||!Qs||!hm},{sort:function(e){void 0!==e&&em(e);var t=tm(this);if(hm)return void 0===e?pm(t):pm(t,e);for(var r,n,i=[],o=rm(t),s=0;s<o;s++)s in t&&fm(i,t[s]);for(om(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:im(e)>im(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)nm(t,s++);return t}});ff("Array");var e=v,dm=ds,ym=_s,vm=Ts,gm=Os,mm=S,Em=Up,wm=N,bm=Td,R=C("splice"),Tm=Math.max,_m=Math.min;e({target:"Array",proto:!0,forced:!R},{splice:function(e,t){var r,n,i,o,s,a,u=dm(this),c=gm(u),l=ym(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-l):(r=e-2,_m(Tm(vm(t),0),c-l)),mm(c+r-n),i=Em(u,n),o=0;o<n;o++)(s=l+o)in u&&wm(i,o,u[s]);if(r<(i.length=n)){for(o=l;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:bm(u,a);for(o=c;c-n+r<o;o--)bm(u,o-1)}else if(n<r)for(o=c-n;l<o;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:bm(u,a);for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}}),sl("flat");sl("flatMap");var x=v,Om=ds,Im=Os,Nm=Td,Am=S,t=1!==[].unshift(0),ta=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();x({target:"Array",proto:!0,arity:1,forced:t||ta},{unshift:function(e){var t=Om(this),r=Im(t),n=arguments.length;if(n){Am(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:Nm(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});Ca.Array;var Iu={exports:{}},w={},Sm=is,Rm=ss,Mm=ra.f,Cm=tg,xm="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];w.f=function(e){if(!xm||"Window"!=Sm(e))return Mm(Rm(e));try{return Mm(e)}catch(e){return Cm(xm)}};function Pm(e){Gm(e,Xm,{value:{objectID:"O"+Zm++,weakData:{}}})}function Um(e,t,r){for(var n in t)gE(e,n,t[n],r);return e}function km(e,t){for(var r=0,n=ME(t),i=new e(n);r<n;)i[r]=t[r++];return i}function Dm(e,t,r,n){for(var i,o,s,a=PE(e),u=xE(a),c=CE(t,r),l=DE(null),p=kE(u),f=0;f<p;f++)s=u[f],(o=UE(c(s,f,a)))in l?VE(l[o],s):l[o]=[s];if(n&&(i=n(a))!==FE)for(o in l)l[o]=LE(i,l[o]);return l}var T=rs(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),Rp=rs,Lm=us,Fm=is,Vm=T,jm=Object.isExtensible,Na=Rp(function(){jm(1)})||Vm?function(e){return!!Lm(e)&&((!Vm||"ArrayBuffer"!=Fm(e))&&(!jm||jm(e)))}:jm,I=!rs(function(){return Object.isExtensible(Object.preventExtensions({}))}),Bm=v,Hm=g,M=_,zm=us,Km=wa,Gm=b.f,Jm=ra,Ym=w,Wm=Na,qm=I,$m=!1,Xm=ys("meta"),Zm=0,Qm=Iu.exports={enable:function(){Qm.enable=function(){},$m=!0;var i=Jm.f,o=Hm([].splice),e={};e[Xm]=1,i(e).length&&(Jm.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===Xm){o(t,r,1);break}return t},Bm({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ym.f}))},fastKey:function(e,t){if(!zm(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Km(e,Xm)){if(!Wm(e))return"F";if(!t)return"E";Pm(e)}return e[Xm].objectID},getWeakData:function(e,t){if(!Km(e,Xm)){if(!Wm(e))return!0;if(!t)return!1;Pm(e)}return e[Xm].weakData},onFreeze:function(e){return qm&&$m&&Wm(e)&&!Km(e,Xm)&&Pm(e),e}},eE=(M[Xm]=!0,as),tE=us,rE=O,nE=v,iE=o,oE=g,sE=Ou,aE=bs,uE=Iu.exports,cE=nl,lE=hf,pE=as,fE=us,hE=rs,dE=_d,yE=Mp,vE=function(e,t,r){return rE&&eE(t=t.constructor)&&t!==r&&tE(t=t.prototype)&&t!==r.prototype&&rE(e,t),e},gE=bs,mE=b.f,EE=Hc,wE=Um,bE=Xc,TE=hf,_E=nl,OE=Pp,IE=ff,NE=i,AE=Iu.exports.fastKey,SE=z.set,RE=z.getterFor,ME=(function(e,t,r){function n(e){var r=oE(h[e]);aE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(l&&!fE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return l&&!fE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(l&&!fE(e))&&r(this,0===e?0:e)}:function(e,t){return r(this,0===e?0:e,t),this})}var i,o,s,a,u,c=-1!==e.indexOf("Map"),l=-1!==e.indexOf("Weak"),p=c?"set":"add",f=iE[e],h=f&&f.prototype,d=f,y={};return sE(e,!pE(f)||!(l||h.forEach&&!hE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,p),uE.enable()):sE(e,!0)&&(o=(i=new d)[p](l?{}:-0,1)!=i,s=hE(function(){i.has(1)}),a=dE(function(e){new f(e)}),u=!l&&hE(function(){for(var e=new f,t=5;t--;)e[p](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){lE(e,h);e=vE(new f,e,d);return null!=t&&cE(t,e[p],{that:e,AS_ENTRIES:c}),e})).prototype=h).constructor=d),(s||u)&&(n("delete"),n("has"),c&&n("get")),(u||o)&&n(p),l&&h.clear&&delete h.clear),y[e]=d,nE({global:!0,constructor:!0,forced:d!=f},y),yE(d,e),l||r.setStrong(d,e,c),d}("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},{getConstructor:function(e,r,n,i){function o(e,t,r){var n,i=u(e),o=s(e,t);return o?o.value=r:(i.last=o={index:n=AE(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),NE?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=AE(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var e=e(function(e,t){TE(e,a),SE(e,{type:r,index:EE(null),first:void 0,last:void 0,size:0}),NE||(e.size=0),null!=t&&_E(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=RE(r);return wE(a,{clear:function(){for(var e=u(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,NE?e.size=0:this.size=0},delete:function(e){var t,r,n=u(this),e=s(this,e);return e&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),NE?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=bE(e,1<arguments.length?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),wE(a,n?{get:function(e){e=s(this,e);return e&&e.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),NE&&mE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=RE(t),o=RE(n);OE(e,t,function(e,t){SE(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),IE(t)}}),Os),CE=Xc,xE=Vs,PE=ds,UE=gs,kE=Os,DE=Hc,LE=km,FE=Array,VE=g([].push),jE=Dm,Qs=sl;v({target:"Array",proto:!0},{group:function(e){return jE(this,e,1<arguments.length?arguments[1]:void 0)}}),Qs("group");var BE=Dm,N=sl;v({target:"Array",proto:!0,forced:!m("groupBy")},{groupBy:function(e){return BE(this,e,1<arguments.length?arguments[1]:void 0)}}),N("groupBy");function HE(e){for(var t,r,n=GE(this),i=KE(n),o=zE(e,1<arguments.length?arguments[1]:void 0),s=new YE,a=JE(i),u=0;u<a;u++)t=o(r=i[u],u,n),qE(s,t)?XE(WE(s,t),r):$E(s,t,[r]);return s}var zE=Xc,C=g,KE=Vs,GE=ds,JE=Os,YE=cs("Map"),e=YE.prototype,WE=C(e.get),qE=C(e.has),$E=C(e.set),XE=C([].push),R=sl,Td=HE;v({target:"Array",proto:!0,name:"groupToMap",forced:!m("groupByToMap")},{groupByToMap:Td}),R("groupByToMap");function ZE(e){return nw[e].prototype}var x=sl,QE=(v({target:"Array",proto:!0},{groupToMap:HE}),x("groupToMap"),Os),ew=function(e,t){for(var r=QE(e),n=new t(r),i=0;i<r;i++)n[i]=e[r-i-1];return n},tw=ss,t=sl,rw=Array,nw=(v({target:"Array",proto:!0},{toReversed:function(){return ew(tw(this),rw)}}),t("toReversed"),o),ta=v,iw=ps,ow=ss,sw=km,Ca=sl,aw=Array,uw=g(ZE("Array").sort),T=(ta({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&iw(e);var t=ow(this),t=sw(aw,t);return uw(t,e)}}),Ca("toSorted"),v),Rp=sl,cw=S,lw=Os,pw=_s,fw=ss,hw=Ts,dw=Array,yw=Math.max,vw=Math.min,gw=(T({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=fw(this),a=lw(s),u=pw(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,vw(yw(hw(t),0),a-u)),i=cw(a+r-n),o=dw(i);c<u;c++)o[c]=s[c];for(;c<u+r;c++)o[c]=arguments[c-u+2];for(;c<i;c++)o[c]=s[c+n-r];return o}}),Rp("toSpliced"),Os),mw=Ts,Ew=RangeError,ww=function(e,t,r,n){var i=gw(e),r=mw(r),o=r<0?i+r:r;if(i<=o||o<0)throw Ew("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},bw=ss,Tw=Array;v({target:"Array",proto:!0},{with:function(e,t){return ww(bw(this),Tw,e,t)}});_=o,wa=Ea,ra=as,w=Su,Na=bs,I="USE_FUNCTION_CONSTRUCTOR",M=vs("asyncIterator"),O=_.AsyncIterator,Ou=wa.AsyncIteratorPrototype;if(Ou)Bb=Ou;else if(ra(O))Bb=O.prototype;else if(wa[I]||_[I])try{xb=w(w(w(Function("return async function*(){}()")()))),w(xb)===Object.prototype&&(Bb=xb)}catch(e){}ra((Bb=Bb||{})[M])||Na(Bb,M,function(){return this});function _w(e,t,r){var n=e.done;Cw.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function Ow(e){Pw(this,{type:xw,iterator:Rw(e),next:e.next})}function Iw(e){var f=0==e,h=1==e,d=2==e,y=3==e;return function(e,s,a){var e=Xw(e),u=$w("Promise"),c=e.iterator,t=e.next,l=0,p=void 0!==s;return!p&&f||Yw(s),new u(function(r,n){var i=function(e){Zw(c,n,e,n)},o=function(){try{if(f&&p)try{qw(l)}catch(e){i(e)}u.resolve(Ww(Jw(t,c))).then(function(e){try{if(Ww(e).done)f?(a.length=l,r(a)):r(!y&&(d||void 0));else{var t=e.value;try{p?u.resolve(f?s(t,l):s(t)).then(function(e){if(h)o();else if(d)e?o():Zw(c,r,!1,n);else if(f)try{a[l++]=e,o()}catch(e){i(e)}else e?Zw(c,r,y||t,n):o()},i):(a[l++]=t,o())}catch(e){i(e)}}}catch(e){n(e)}},n)}catch(e){n(e)}};o()})}}function Nw(e,t){if(!d0||!h0(e)||!d0(e))return!1;for(var r,n=0,i=e.length;n<i;)if(!("string"==typeof(r=e[n++])||t&&void 0===r))return!1;return 0!==i}function Aw(e,t,r){return r.get&&y0(r.get,t,{getter:!0}),r.set&&y0(r.set,t,{setter:!0}),v0.f(e,t,r)}var Sw=r,Rw=Es,Iu=Hc,Mw=fs,Qs=Um,N=z,Vs=Bb,Cw=cs("Promise"),xw="AsyncFromSyncIterator",Pw=N.set,Uw=N.getterFor(xw),e=(Ow.prototype=Qs(Iu(Vs),{next:function(){var n=Uw(this);return new Cw(function(e,t){var r=Rw(Sw(n.next,n.iterator));_w(r,e,t)})},return:function(){var n=Uw(this).iterator;return new Cw(function(e,t){var r=Mw(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=Rw(Sw(r,n));_w(r,e,t)})}}),Ow),kw=r,Dw=e,Lw=Es,Fw=el,Vw=fs,jw=vs("asyncIterator"),Bw=ps,Hw=Es,zw=r,Kw=cs,Gw=fs,Jw=r,Yw=ps,Ww=Es,qw=S,$w=cs,Xw=function(e){return{iterator:e,next:Bw(Hw(e).next)}},Zw=function(e,t,r,n){try{var i=Gw(e,"return");if(i)return Kw("Promise").resolve(zw(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},C={toArray:Iw(0),forEach:Iw(1),every:Iw(2),some:Iw(3),find:Iw(4)},Qw=Xc,e0=ds,t0=A,r0=function(e,t){t=arguments.length<2?Vw(e,jw):t;return t?Lw(kw(t,e)):new Dw(Fw(e))},n0=el,i0=Qc,o0=fs,m=ZE,s0=cs,Td=vs,a0=e,u0=C.toArray,c0=Td("asyncIterator"),l0=m("Array").values,R=(v({target:"Array",stat:!0,forced:!0},{fromAsync:function(o){var s=this,e=arguments.length,a=1<e?arguments[1]:void 0,u=2<e?arguments[2]:void 0;return new(s0("Promise"))(function(e){var t=e0(o),r=(void 0!==a&&(a=Qw(a,u)),o0(t,c0)),n=r?void 0:i0(t)||l0,i=t0(s)?new s:[],r=r?r0(t,r):new a0(n0(t,n));e(u0(r,a,i))})}}),v),p0=E.filterReject,x=sl,t=(R({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return p0(this,e,1<arguments.length?arguments[1]:void 0)}}),x("filterOut"),v),f0=E.filterReject,ta=sl,Ca=(t({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return f0(this,e,1<arguments.length?arguments[1]:void 0)}}),ta("filterReject"),v),h0=vp,d0=Object.isFrozen,y0=(Ca({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!Nw(e,!0))return!1;var t=e.raw;return t.length===e.length&&Nw(t,!1)}}),ea.exports),v0=b,T=sl,g0=ds,m0=Os;i&&(Aw(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=g0(this),t=m0(e);return 0==t?void 0:e[t-1]},set:function(e){var t=g0(this),r=m0(t);return t[0==r?0:r-1]=e}}),T("lastItem"));var Rp=sl,E0=ds,w0=Os;i&&(Aw(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=E0(this),e=w0(e);return 0==e?0:e-1}}),Rp("lastIndex"));var o=g,b0=ps,T0=Os,_0=ds,O0=Up,I0=cs("Map"),Ea=I0.prototype,N0=o(Ea.forEach),A0=o(Ea.has),S0=o(Ea.set),R0=o([].push),Su=sl;v({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=_0(this),i=T0(n),o=O0(n,0),s=new I0,a=null!=e?b0(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),A0(s,r)||S0(s,r,t);return N0(s,function(e){R0(o,e)}),o}}),Su("uniqueBy");C0.exposure=function(e,t,r,n){return new P0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},C0.track=function(e,t,r,n){return new D0(n,r,e,t)},C0.remoteConfig=function(e,t,r,n){return new V0(n,e,t.parameter,t.valueId,t.reason,r)},C0.isExposureEvent=function(e){return void 0!==e.experiment},C0.isTrackEvent=function(e){return void 0!==e.eventType},C0.isRemoteConfigEvent=function(e){return void 0!==e.parameter},C0.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},C0.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},C0.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},C0.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[jt.ID],identifiers:this.user.identifiers,userProperties:Pe.sanitize(this.user.properties),hackleProperties:Pe.sanitize(this.user.hackleProperties)}};var M0=C0;function C0(e,t,r){void 0===r&&(r=H()),this.timestamp=e,this.user=t,this.insertId=r}Ae(U0,x0=M0),U0.prototype.copyWithUser=function(e){return new U0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},U0.prototype.toDto=function(){return c(c({},x0.prototype.toDto.call(this)),{experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,experimentVersion:this.experiment.version,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),properties:this.properties})};var x0,P0=U0;function U0(e,t,r,n,i,o,s,a){e=x0.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}Ae(L0,k0=M0),L0.prototype.copyWithUser=function(e){return new L0(this.timestamp,e,this.eventType,this.event,this.insertId)},L0.prototype.toDto=function(){return c(c({},k0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Pe.sanitize(this.event.properties)})};var k0,D0=L0;function L0(e,t,r,n,i){e=k0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}Ae(j0,F0=M0),j0.prototype.copyWithUser=function(e){return new j0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},j0.prototype.toDto=function(){return c(c({},F0.prototype.toDto.call(this)),{parameterId:this.parameter.id,parameterKey:this.parameter.key,parameterType:this.parameter.type,valueId:this.valueId,decisionReason:this.decisionReason.toString(),properties:Pe.sanitize(this.properties)})};var F0,V0=j0;function j0(e,t,r,n,i,o,s){e=F0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}H0.isSessionEvent=function(e){return!!M0.isTrackEvent(e)&&(e.event.key===H0.SESSION_START_EVENT_NAME||e.event.key===H0.SESSION_END_EVENT_NAME)},H0.prototype.onSessionStarted=function(e,t,r){this.track(H0.SESSION_START_EVENT_NAME,e,t,r)},H0.prototype.onSessionEnded=function(e,t,r){this.track(H0.SESSION_END_EVENT_NAME,e,t,r)},H0.prototype.track=function(e,t,r,n){e={key:e},r=this.userManager.toHackleUser(r),r=this.decorateSession(r,t);this.core.track(e,r,n)},H0.prototype.decorateSession=function(e,t){t=(new zt).add(jt.SESSION,t).addIdentifiers(e.identifiers).build();return c(c({},e),{identifiers:t})},H0.SESSION_START_EVENT_NAME="$session_start",H0.SESSION_END_EVENT_NAME="$session_end";var B0=H0;function H0(e,t){this.userManager=e,this.core=t}K0.prototype.process=function(e){var t;B0.isSessionEvent(e)||this.sessionManager.startNewSessionIfNeeded(this.userManager.currentUser,e.timestamp),this.eventDedupDeterminer.isDedupTarget(e)||(e=e.copyWithUser(e.user),t=null===(t=this.sessionManager).currentSessionId||e.user.identifiers[jt.SESSION]?e:e.copyWithUser(c(c({},e.user),{identifiers:c(c({},e.user.identifiers),((e={})[jt.SESSION]=t.sessionId,e))})),this.delegate.process(t))},K0.prototype.flush=function(e){this.delegate.flush(e)},K0.prototype.close=function(){this.delegate.close()},K0.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.flush(!0);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var z0=K0;function K0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n}J0.toEvent=function(e){var t;return{key:J0.EVENT_KEY,properties:{level:J0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:J0._stacktrace(e)}}},J0._stacktrace=function(e){return u.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,J0.STACK_TRACK_LIMIT).join("\n")},J0.EVENT_KEY="$trace",J0.LEVEL_ERROR="error",J0.STACK_TRACK_LIMIT=30;var G0=J0;function J0(){}Y0.prototype.evaluate=function(e,t){if(!this.supports(e))throw new Error("Unsupported EvaluatorRequest ".concat(e.toString()));var r;if(t.contains(e))throw r=t.stack.map(function(e){return e.toString()}).join(" - "),new Error("Circular evaluation has occurred [".concat(r," - ").concat(e.toString(),"]"));t.addRequest(e);try{return this.evaluateInternal(e,t)}finally{t.removeRequest(e)}};Ou=Y0;function Y0(){}q0.prototype.with=function(e){return new q0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},q0.of=function(e,t,r,n){return new q0(n,t.targetEvaluations,e.experiment,r.id,r.key,r.config)},q0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return u.isNotNullOrUndefined(n)?this.of(e,t,n,r):new q0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)};var W0=q0;function q0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.experiment=r,this.variationId=n,this.variationKey=i,this.config=o}Ae(Z0,$0=Ou),Z0.prototype.supports=function(e){return void 0!==e.experiment},Z0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:W0.ofDefault(e,t,h.TRAFFIC_NOT_ALLOCATED)};var $0,X0=Z0;function Z0(e){var t=$0.call(this)||this;return t.evaluationFlowFactory=e,t}eb.of=function(e,t,r,n,i,o){return o.returnValue=Pe.truncateStringValue(n),new eb(i,t.targetEvaluations,e.parameter,r,n,o)},eb.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var Q0=eb;function eb(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.parameter=r,this.valueId=n,this.value=i,this.properties=o}Ae(nb,tb=Ou),nb.prototype.supports=function(e){return void 0!==e.parameter},nb.prototype.evaluateInternal=function(e,t){var r={};if(r.requestValueType=e.requiredType,r.requestDefaultValue=Pe.truncateStringValue(e.defaultValue),u.isNullOrUndefined(e.user.identifiers[e.parameter.identifierType]))return Q0.ofDefault(e,t,h.IDENTIFIER_NOT_FOUND,r);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);return u.isNotNullOrUndefined(n)?(r.targetRuleKey=n.key,r.targetRuleName=n.name,this.evaluation(e,t,n.value,h.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,h.DEFAULT_RULE,r)},nb.prototype.evaluation=function(e,t,r,n,i){return"UNKNOWN"===e.requiredType||"NULL"!==e.requiredType&&typeof e.defaultValue!=typeof r.rawValue?Q0.ofDefault(e,t,h.TYPE_MISMATCH,i):Q0.of(e,t,r.id,r.rawValue,n,i)};var tb,rb=nb;function nb(e){var t=tb.call(this)||this;return t.targetRuleDeterminer=e,t}ob.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var ib=ob;function ob(e,t){this.type=e,this.id=t}ab.create=function(){return new ab},Object.defineProperty(ab.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(ab.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(ab.prototype,"properties",{get:function(){return Pe.sanitize(this._properties)},enumerable:!1,configurable:!0}),ab.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},ab.prototype.addRequest=function(e){this._stack.push(e)},ab.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},ab.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof W0&&e.experiment.id===t.id})},ab.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},ab.prototype.setProperty=function(e,t){this._properties[e]=t};var sb=ab;function ab(){this._stack=[],this._targetEvaluations=[],this._properties={}}cb.of=function(e,t,r,n){return new cb(e,t,r,n)},cb.by=function(e,t){return new cb(e.workspace,e.user,t,"A")},cb.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var ub=cb;function cb(e,t,r,n){this.key=new ib("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}pb.of=function(e,t,r,n,i){return new pb(e,t,r,n,i)},pb.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var lb=pb;function pb(e,t,r,n,i){this.key=new ib("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}fb.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();case"boolean":return e?"true":"false";default:return}},fb.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},fb.asBoolean=function(e){switch(typeof e){case"boolean":return e;case"string":switch(e){case"true":return!0;case"false":return!1;default:return}default:return}},fb.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var P=fb;function fb(){}db.prototype.getVariation=function(e,t){if(0!==this.storages.length)for(var r=0,n=this.storages;r<n.length;r++){var i=n[r].getVariation(e,t);if(void 0!==i)return i}};var hb=db;function db(e){this.storages=e}vb.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},vb.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return P.asNumber(e)},vb.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=P.asNumber(t),e=P.asNumber(e);u.isNullOrUndefined(t)||t<0||u.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},vb.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},vb.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},vb.prototype.clear=function(){this.listStorage.clear()};var yb=vb;function vb(e){this.listStorage=e}mb.prototype.add=function(e){this.evaluators.push(e)},mb.prototype.evaluate=function(t,e){var r=this.evaluators.find(function(e){return e.supports(t)});if(u.isNullOrUndefined(r))throw new Error("Unsupported EvaluatorRequest [".concat(t.toString(),"]"));return r.evaluate(t,e)};var gb=mb;function mb(){this.evaluators=new Array}wb.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},wb.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},wb.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var Eb=wb;function wb(e){this.conditionMatcherFactory=e}Tb.prototype.decorate=function(e){return e};var bb=Tb;function Tb(){}Ob.prototype.decorate=function(e){return"string"==typeof e?Bo.decodeURIOrOriginal(e):e};var _b=Ob;function Ob(){}Nb.prototype.matches=function(e,t,r){void 0===r&&(r=new bb);var n=this.valueMatcherFactory.getMatcher(t.valueType),i=this.operatorMatcherFactory.getMatcher(t.operator),e=this.userValueMatches(e,t,n,i,r);return this.typeMatches(t.type,e)},Nb.prototype.userValueMatches=function(e,t,r,n,i){return Array.isArray(e)?this.arrayMatches(e,t,r,n,i):this.singleMatches(e,t,r,n,i)},Nb.prototype.singleMatches=function(e,t,r,n,i){e=i.decorate(e),t=t.values.map(i.decorate);return n.matches(r,e,t)},Nb.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},Nb.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var Ib=Nb;function Nb(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}Ab.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.inMatches(r,e)})};O=Ab;function Ab(){}Sb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.containsMatches(r,e)})};wa=Sb;function Sb(){}Rb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.startsWithMatches(r,e)})};_=Rb;function Rb(){}Mb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.endsWithMatches(r,e)})};I=Mb;function Mb(){}Cb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanMatches(r,e)})};w=Cb;function Cb(){}Pb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanOrEqualMatches(r,e)})};var xb=Pb;function Pb(){}Ub.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanMatches(r,e)})};ra=Ub;function Ub(){}kb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanOrEqualMatches(r,e)})};Na=kb;function kb(){}Db.prototype.matches=function(e,t,r){return!u.isNullOrUndefined(t)};M=Db;function Db(){}Fb.prototype.getMatcher=function(e){switch(e){case"IN":return Fb.IN_MATCHER;case"CONTAINS":return Fb.CONTAINS_MATCHER;case"STARTS_WITH":return Fb.STARTS_WITH_MATCHER;case"ENDS_WITH":return Fb.ENDS_WITH_MATCHER;case"GT":return Fb.GT_MATCHER;case"GTE":return Fb.GTE_MATCHER;case"LT":return Fb.LT_MATCHER;case"LTE":return Fb.LTE_MATCHER;case"EXISTS":return Fb.EXISTS_MATCHER}},Fb.IN_MATCHER=new O,Fb.CONTAINS_MATCHER=new wa,Fb.STARTS_WITH_MATCHER=new _,Fb.ENDS_WITH_MATCHER=new I,Fb.GT_MATCHER=new w,Fb.GTE_MATCHER=new xb,Fb.LT_MATCHER=new ra,Fb.LTE_MATCHER=new Na,Fb.EXISTS_MATCHER=new M;var Lb=Fb;function Fb(){}Vb.prototype.inMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},Vb.prototype.containsMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.includes(t)},Vb.prototype.startsWithMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.startsWith(t)},Vb.prototype.endsWithMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.endsWith(t)},Vb.prototype.greaterThanMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<e},Vb.prototype.greaterThanOrEqualMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<=e},Vb.prototype.lessThanMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<t},Vb.prototype.lessThanOrEqualMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<=t};Hc=Vb;function Vb(){}jb.prototype.inMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},jb.prototype.containsMatches=function(e,t){return!1},jb.prototype.startsWithMatches=function(e,t){return!1},jb.prototype.endsWithMatches=function(e,t){return!1},jb.prototype.greaterThanMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<e},jb.prototype.greaterThanOrEqualMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<=e},jb.prototype.lessThanMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<t},jb.prototype.lessThanOrEqualMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<=t};z=jb;function jb(){}Hb.prototype.inMatches=function(e,t){e=P.asBoolean(e),t=P.asBoolean(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},Hb.prototype.containsMatches=function(e,t){return!1},Hb.prototype.startsWithMatches=function(e,t){return!1},Hb.prototype.endsWithMatches=function(e,t){return!1},Hb.prototype.greaterThanMatches=function(e,t){return!1},Hb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},Hb.prototype.lessThanMatches=function(e,t){return!1},Hb.prototype.lessThanOrEqualMatches=function(e,t){return!1};var Bb=Hb;function Hb(){}zb.prototype.inMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isEqualTo(t)},zb.prototype.containsMatches=function(e,t){return!1},zb.prototype.startsWithMatches=function(e,t){return!1},zb.prototype.endsWithMatches=function(e,t){return!1},zb.prototype.greaterThanMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isGreaterThan(t)},zb.prototype.greaterThanOrEqualMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isGreaterThanOrEqualTo(t)},zb.prototype.lessThanMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isLessThan(t)},zb.prototype.lessThanOrEqualMatches=function(e,t){e=vr.tryParse(e),t=vr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isLessThanOrEqualTo(t)};N=zb;function zb(){}Kb.prototype.inMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&Bo.decodeURIOrOriginal(Bo.removePathnameTrailingSlash(e))===Bo.decodeURIOrOriginal(Bo.removePathnameTrailingSlash(t))},Kb.prototype.containsMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);if(u.isNullOrUndefined(e)||u.isNullOrUndefined(t))return!1;e=Bo.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))},Kb.prototype.startsWithMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);if(u.isNullOrUndefined(e)||u.isNullOrUndefined(t))return!1;e=Bo.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))},Kb.prototype.endsWithMatches=function(e,t){return!1},Kb.prototype.greaterThanMatches=function(e,t){return!1},Kb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},Kb.prototype.lessThanMatches=function(e,t){return!1},Kb.prototype.lessThanOrEqualMatches=function(e,t){return!1};Qs=Kb;function Kb(){}Gb.prototype.inMatches=function(e,t){return!1},Gb.prototype.containsMatches=function(e,t){return!1},Gb.prototype.startsWithMatches=function(e,t){return!1},Gb.prototype.endsWithMatches=function(e,t){return!1},Gb.prototype.greaterThanMatches=function(e,t){return!1},Gb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},Gb.prototype.lessThanMatches=function(e,t){return!1},Gb.prototype.lessThanOrEqualMatches=function(e,t){return!1};Iu=Gb;function Gb(){}Yb.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return Yb.STRING_MATCHER;case"NUMBER":return Yb.NUMBER_MATCHER;case"BOOLEAN":return Yb.BOOLEAN_MATCHER;case"VERSION":return Yb.VERSION_MATCHER;case"URL":return Yb.URL_MATCHER;case"NULL":case"UNKNOWN":return Yb.NULL_MATCHER}},Yb.STRING_MATCHER=new Hc,Yb.NUMBER_MATCHER=new z,Yb.BOOLEAN_MATCHER=new Bb,Yb.VERSION_MATCHER=new N,Yb.URL_MATCHER=new Qs,Yb.NULL_MATCHER=new Iu;var Jb=Yb;function Yb(){}qb.prototype.matches=function(e,t,r){var e=this.userValueResolver.resolveOrNull(e.user,r.key),n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},qb.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?_b:bb)};var Wb=qb;function qb(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}Xb.prototype.resolveOrNull=function(e,t){switch(t.type){case"USER_ID":return e.identifiers[t.name];case"USER_PROPERTY":return e.properties[t.name];case"HACKLE_PROPERTY":return e.hackleProperties[t.name];default:throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}};var $b=Xb;function Xb(){}Qb.prototype.matches=function(t,r,e){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return n._matches(t,r,e)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},Qb.prototype._matches=function(e,t,r){if("string"!=typeof r)throw new Error("SegmentKey[".concat(r,"]"));var n=e.workspace.getSegmentOrNull(r);if(n)return this.segmentMatcher.matches(e,t,n);throw new Error("Segment[".concat(r,"]"))};var Zb=Qb;function Qb(e){this.segmentMatcher=e}tT.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},tT.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var eT=tT;function tT(e){this.userConditionMatcher=e}nT.prototype.matches=function(e,t,r){switch(r.key.type){case"AB_TEST":return this.abTestMatcher.matches(e,t,r);case"FEATURE_FLAG":return this.featureFlagMatcher.matches(e,t,r);default:throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"))}};var rT=nT;function nT(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}iT.prototype.matches=function(e,t,r){var n=u.requiredNotNullOrUndefined(P.asNumber(r.key.name),function(){return"Invalid key [".concat(r.key.type,", ").concat(r.key.name,"]")}),n=this.experiment(e,n);if(u.isNullOrUndefined(n))return!1;var i=null!=(i=t.getEvaluation(n))?i:this.evaluate(e,t,n);return this.evaluationMatches(i,r)},iT.prototype.evaluate=function(e,t,r){r=ub.by(e,r),r=this.evaluator.evaluate(r,t),e=this.resolve(e,r);return t.addEvaluation(e),e};Vs=iT;function iT(e,t){this.evaluator=e,this.valueOperatorMatcher=t}Ae(aT,oT=Vs),aT.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},aT.prototype.resolve=function(e,t){return e instanceof ub&&t.reason===h.TRAFFIC_ALLOCATED?t.with(h.TRAFFIC_ALLOCATED_BY_TARGETING):t},aT.prototype.evaluationMatches=function(e,t){return!!aT.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},aT.AB_TEST_MATCHED_REASONS=[h.OVERRIDDEN,h.TRAFFIC_ALLOCATED,h.EXPERIMENT_COMPLETED,h.TRAFFIC_ALLOCATED_BY_TARGETING];var oT,sT=aT;function aT(e,t){return oT.call(this,e,t)||this}Ae(lT,uT=Vs),lT.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},lT.prototype.resolve=function(e,t){return t},lT.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var uT,cT=lT;function lT(e,t){return uT.call(this,e,t)||this}fT.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return this.valueOperatorMatcher.matches(e,r.match)},fT.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var pT=fT;function fT(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}dT.prototype.resolveOrNull=function(e,t){var r;switch(t.type){case"EVENT_PROPERTY":return null==(r=this.properties(e))?void 0:r[t.name];case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":case"SEGMENT":case"AB_TEST":case"FEATURE_FLAG":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},dT.prototype.properties=function(e){return M0.isTrackEvent(e)?e.event.properties:M0.isExposureEvent(e)||M0.isRemoteConfigEvent(e)?e.properties:void 0};var hT=dT;function dT(){}vT.prototype.matches=function(e,t,r){if("COHORT"!==r.key.type)throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"));e=null!=(e=null==(e=e.user.cohorts)?void 0:e.map(function(e){return e.id}))?e:[];return this.valueOperatorMatcher.matches(e,r.match)};var yT=vT;function vT(e){this.valueOperatorMatcher=e}mT.prototype.supports=function(e){return"NUMBER_OF_EVENTS_IN_DAYS"===e||"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"===e},mT.prototype.matches=function(e,t,r){var n,i=r.key.type;if(!this.supports(i))throw new Error("Unsupported TargetKeyType [".concat(i,"]"));var o=null!=(n=e.user.targetEvents)?n:[];switch(i){case"NUMBER_OF_EVENTS_IN_DAYS":return new bT(this.valueOperatorMatcher,this.clock).matches(e,o,r);case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return new OT(this.valueOperatorMatcher,this.clock).matches(e,o,r);default:return i}};var gT=mT;function mT(e,t){this.valueOperatorMatcher=e,this.clock=t}function ET(){}Ae(TT,wT=ET),TT.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-De.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},TT.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&null===e.property},TT.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var wT,bT=TT;function TT(e,t){var r=wT.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}Ae(IT,_T=ET),IT.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-De.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},IT.prototype.propertyMatch=function(e,t){return(null==e?void 0:e.type)===t.key.type&&e.key===t.key.name&&this.valueOperatorMatcher.matches(e.value,t.match)},IT.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&this.propertyMatch(e.property,t.propertyFilter)},IT.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var _T,OT=IT;function IT(e,t){var r=_T.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}AT.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return this.userConditionMatcher;case"EVENT_PROPERTY":return this.eventConditionMatcher;case"SEGMENT":return this.segmentConditionMatcher;case"AB_TEST":case"FEATURE_FLAG":return this.experimentConditionMatcher;case"COHORT":return this.cohortConditionMatcher;case"NUMBER_OF_EVENTS_IN_DAYS":case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return this.userTargetConditionMatcher;default:return e}};var NT=AT;function AT(e,t){var r=new Ib(new Jb,new Lb);this.userConditionMatcher=new Wb(new $b,r),this.eventConditionMatcher=new pT(new hT,r),this.segmentConditionMatcher=new Zb(new eT(this.userConditionMatcher)),this.experimentConditionMatcher=new rT(new sT(e,r),new cT(e,r)),this.cohortConditionMatcher=new yT(r),this.userTargetConditionMatcher=new gT(r,t)}RT.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},RT.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},RT.prototype.resolveBucket=function(e,t){var t=e.workspace.getBucketOrNull(t.bucketId),r=e.user.identifiers[e.experiment.identifierType];if(r){t=this.bucketer.bucketing(t,r);if(t)return e.experiment._getVariationByIdOrNull(t.variationId)}};var ST=RT;function RT(e){this.bucketer=e}var MT={murmurhash3_x86_32:function(e,t,r,n){for(var i,o=-4&(n=void 0===n?e.length:n),s=t,a=0;a<o;a+=4)i=255&e.charCodeAt(a)|(255&e.charCodeAt(a+1))<<8|(255&e.charCodeAt(a+2))<<16|(255&e.charCodeAt(a+3))<<24,i=this.mul32(i,3432918353),s=5*(s=(524287&(s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)))<<13|s>>>19)+3864292196|0;switch(i=0,n%4){case 3:i=(255&e.charCodeAt(2+o))<<16;case 2:i|=(255&e.charCodeAt(1+o))<<8;case 1:i|=255&e.charCodeAt(o),i=this.mul32(i,3432918353),s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)}return s=this.mul32(s=(s^=n)^s>>>16,2246822507),s=this.mul32(s^=s>>>13,3266489909),s^=s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},CT=(xT.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},xT.prototype.calculateSlotNumber=function(e,t,r){r=MT.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},xT);function xT(){}UT.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},UT.end=function(){return new UT(void 0,void 0)},UT.decision=function(e,t){return new UT(e,t)},UT.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this.end(),n=0,i=e.reverse();n<i.length;n++)var o=i[n],r=this.decision(o,r);return r};var PT=UT;function UT(e,t){this.flowEvaluator=e,this.nextFlow=t}DT.prototype.evaluate=function(e,t,r){var n=this.overrideResolver.resolveOrNull(e,t);if(!n)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return W0.of(e,t,n,h.OVERRIDDEN);case"FEATURE_FLAG":return W0.of(e,t,n,h.INDIVIDUAL_TARGET_MATCH)}};var kT=DT;function DT(e){this.overrideResolver=e}FT.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?W0.ofDefault(e,t,h.EXPERIMENT_DRAFT):r.evaluate(e,t)};var LT=FT;function FT(){}jT.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return W0.ofDefault(e,t,h.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return W0.ofDefault(e,t,h.FEATURE_FLAG_INACTIVE)}};var VT=jT;function jT(){}HT.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return W0.of(e,t,r,h.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var BT=HT;function HT(){}KT.prototype.evaluate=function(e,t,r){if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t)?r.evaluate(e,t):W0.ofDefault(e,t,h.NOT_IN_EXPERIMENT_TARGET)};var zT=KT;function KT(e){this.experimentTargetDeterminer=e}JT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);return n?n.isDropped?W0.ofDefault(e,t,h.VARIATION_DROPPED):W0.of(e,t,n,h.TRAFFIC_ALLOCATED):W0.ofDefault(e,t,h.TRAFFIC_NOT_ALLOCATED)};var GT=JT;function JT(e){this.actionResolver=e}WT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return r.evaluate(e,t);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);if(!n)return r.evaluate(e,t);r=this.actionResolver.resolveOrNull(e,t,n.action);if(r)return W0.of(e,t,r,h.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var YT=WT;function WT(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}$T.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return W0.ofDefault(e,t,h.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return W0.of(e,t,n,h.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var qT=$T;function $T(e){this.actionResolver=e}ZT.prototype.evaluate=function(e,t,r){var n=e.experiment.containerId;if(!n)return r.evaluate(e,t);var i=e.workspace.getContainerOrNull(n);if(i)return this.containerResolver.isUserInContainerGroup(e,t,i)?r.evaluate(e,t):W0.ofDefault(e,t,h.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var XT=ZT;function ZT(e){this.containerResolver=e}e_.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):W0.ofDefault(e,t,h.IDENTIFIER_NOT_FOUND)};var QT=e_;function e_(){}r_.prototype.isUserInExperimentTarget=function(t,r){var n=this;return 0===t.experiment.targetAudiences.length||t.experiment.targetAudiences.some(function(e){return n.targetMatcher.matches(t,r,e)})};var t_=r_;function r_(e){this.targetMatcher=e}i_.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var n_=i_;function i_(e){this.targetMatcher=e}s_.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},s_.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},s_.prototype._resolveUserOverride=function(e){var t=e.experiment,e=e.user.identifiers[t.identifierType];if(e){e=t.userOverrides.get(e);if(e)return t._getVariationByIdOrNull(e)}},s_.prototype._resolveSegmentOverride=function(t,r){var n=this,e=t.experiment.segmentOverrides.find(function(e){return n.targetMatcher.matches(t,r,e.target)});if(e)return this.actionResolver.resolveOrNull(t,r,e.action)};var o_=s_;function s_(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}u_.prototype.isUserInContainerGroup=function(e,t,r){var n=e.user.identifiers[e.experiment.identifierType];if(u.isNullOrUndefined(n))return!1;var i=e.workspace.getBucketOrNull(r.bucketId);if(u.isNullOrUndefined(i))throw new Error("Bucket[".concat(r.bucketId,"]"));i=this.bucketer.bucketing(i,n);if(u.isNullOrUndefined(i))return!1;n=r.getGroupOrNull(i.variationId);if(u.isNullOrUndefined(n))throw new Error("ContainerGroup[".concat(i.variationId,"]"));return n.experiments.includes(e.experiment.id)};var a_=u_;function u_(e){this.bucketer=e}l_.of=function(e,t,r,n){return new l_(r,t.targetEvaluations,e.inAppMessage,n,t.properties)};var c_=l_;function l_(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.message=n,this.properties=i}f_.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):c_.of(e,t,h.UNSUPPORTED_PLATFORM)};var p_=f_;function f_(){}d_.prototype.evaluate=function(e,t,r){var n;return this.userOverrideMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),c_.of(e,t,h.OVERRIDDEN,n)):r.evaluate(e,t)};var h_=d_;function d_(e,t){this.userOverrideMatcher=e,this.inAppMessageResolver=t}v_.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?c_.of(e,t,h.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var y_=v_;function v_(){}m_.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?c_.of(e,t,h.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var g_=m_;function m_(){}w_.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):c_.of(e,t,h.NOT_IN_IN_APP_MESSAGE_PERIOD)};var E_=w_;function w_(){}T_.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?c_.of(e,t,h.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var b_=T_;function T_(e){this.hiddenMatcher=e}O_.prototype.evaluate=function(e,t,r){var n;return this.targetMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),c_.of(e,t,h.IN_APP_MESSAGE_TARGET,n)):c_.of(e,t,h.NOT_IN_IN_APP_MESSAGE_TARGET)};var __=O_;function O_(e,t){this.targetMatcher=e,this.inAppMessageResolver=t}N_.prototype.resolve=function(e,t){return null!=(t=this.resolveExperiment(e,t))?t:this.resolveDefault(e)},N_.prototype.resolveExperiment=function(e,t){var r=e.inAppMessage.messageContext.experimentContext;if(!r)return null;var n=u.requiredNotNullOrUndefined(e.workspace.getExperimentOrNull(r.key),function(){return"Experiment[".concat(r.key,"]")}),n=ub.by(e,n),i=this.evaluator.evaluate(n,t),o=(this.addExperimentContext(i,t),e.inAppMessage.messageContext.defaultLang);return this.resolveMessage(e,function(e){return e.lang===o&&i.variationKey===e.variationKey})},N_.prototype.addExperimentContext=function(e,t){t.addEvaluation(e),t.setProperty("experiment_id",e.experiment.id),t.setProperty("experiment_key",e.experiment.key),t.setProperty("variation_id",e.variationId),t.setProperty("variation_key",e.variationKey),t.setProperty("experiment_decision_reason",e.reason)},N_.prototype.resolveDefault=function(e){var t=e.inAppMessage.messageContext.defaultLang;return this.resolveMessage(e,function(e){return e.lang===t})},N_.prototype.resolveMessage=function(e,t){t=e.inAppMessage.messageContext.messages.find(t);return u.requiredNotNullOrUndefined(t,function(){return"InAppMessage must be decided [".concat(e.inAppMessage.id,"]")})};var I_=N_;function N_(e){this.evaluator=e}S_.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},S_.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!u.isNullOrUndefined(e)&&t.identifiers.includes(e)};var A_=S_;function S_(){}M_.prototype.matches=function(t,r){var n=this,e=t.inAppMessage.targetContext.targets;return 0===e.length||e.some(function(e){return n.targetMatcher.matches(t,r,e)})};var R_=M_;function M_(e){this.targetMatcher=e}x_.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var C_=x_;function x_(e){this.storage=e}U_.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},U_.prototype.matches=function(e,t,r){if(!this.targetMatcher.matches(e,t,r.target))return!1;t=e.user.identifiers[e.parameter.identifierType];if(u.isNullOrUndefined(t))return!1;e=e.workspace.getBucketOrNull(r.bucketId);if(u.isNullOrUndefined(e))throw new Error("bucket[".concat(r.bucketId,"]"));return u.isNotNullOrUndefined(this.bucketer.bucketing(e,t))};var P_=U_;function U_(e,t){this.targetMatcher=e,this.bucketer=t}D_.get=function(e){return u.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},D_.getOrNull=function(e){return D_.instances.get(e)},D_.register=function(e,t){return D_.instances.set(e,t),t},D_.instances=new Map;var k_=D_;function D_(){}F_.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},F_.prototype.getInAppMessageFlow=function(){return this.inAppMessageFlow};var L_=F_;function F_(e,t,r,n){var i=new CT,n=k_.register("targetMatcher",new Eb(new NT(e,n))),o=new ST(i),t=new o_(t,n,o),s=new a_(i),s=(this.abTestFlow=PT.of(new kT(t),new QT,new XT(s),new zT(new t_(n)),new LT,new VT,new BT,new GT(o)),this.featureFlagFlow=PT.of(new LT,new VT,new BT,new kT(t),new QT,new YT(new n_(n),o),new qT(o)),new I_(e));this.inAppMessageFlow=PT.of(new p_,new h_(new A_,s),new y_,new g_,new E_,new b_(new C_(r)),new __(new R_(n),s)),this.remoteConfigParameterTargetRuleDeterminer=new P_(n,i)}j_.prototype.create=function(r,e){var n=this,i=this.clock.currentMillis(),o=new Array,t=this.createEvent(r,e,i,{});return t&&o.push(t),e.targetEvaluations.forEach(function(e){var t;(t={})[j_.ROOT_TYPE]=r.key.type,t[j_.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},j_.prototype.createEvent=function(e,t,r,n){var i;if(t instanceof W0)return n[j_.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[j_.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[j_.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,M0.exposure(e.user,t,n,r);if(t instanceof Q0)return M0.remoteConfig(e.user,t,c(c({},n),t.properties),r);if(t instanceof c_)return null;throw new Error("Unsupported Evaluation [".concat(typeof t,"]"))},j_.ROOT_TYPE="$targetingRootType",j_.ROOT_ID="$targetingRootId",j_.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",j_.EXPERIMENT_VERSION_KEY="$experiment_version",j_.EXECUTION_VERSION_KEY="$execution_version";var V_=j_;function j_(e){this.clock=e}Ae(z_,B_=Ou),z_.prototype.supports=function(e){return void 0!==e.inAppMessage},z_.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getInAppMessageFlow().evaluate(e,t))?r:c_.of(e,t,h.NOT_IN_IN_APP_MESSAGE_TARGET)};var B_,H_=z_;function z_(e){var t=B_.call(this)||this;return t.evaluationFlowFactory=e,t}G_.of=function(e,t,r,n){return new G_(e,t,r,n)},G_.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var K_=G_;function G_(e,t,r,n){this.key=new ib("IN_APP_MESSAGE",r.id),this.workspace=e,this.user=t,this.inAppMessage=r,this.timestamp=n}var J_=s.log,Y_=(W_.create=function(e,t,r,n){var i=Le.instance,o=new gb,r=new hb(r),r=new L_(o,r,n,i),n=new X0(r),s=new rb(r.remoteConfigParameterTargetRuleDeterminer),r=new H_(r);return o.add(n),o.add(s),new W_(n,s,r,e,new V_(i),t,new q_,i)},W_.prototype.getExperiment=function(e){if(e){var t=this.workspaceFetcher.get();if(t)return t.getExperimentOrNull(e)}else J_.error("experimentKey must not be empty")},W_.prototype.experiment=function(e,t,r){var n=this;if(!e)return J_.error("experimentKey must not be empty"),bt.of(r,h.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return J_.warn("SDK not ready."),bt.of(r,h.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return J_.warn("Experiment does not exist."),bt.of(r,h.EXPERIMENT_NOT_FOUND);i=ub.of(i,t,e,r),t=this.experimentInternal(i),e=t[0],r=t[1];return this.eventFactory.create(i,e).forEach(function(e){return n.eventProcessor.process(e)}),r},W_.prototype.experiments=function(r){var n=this,i=new Yn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getExperiments().forEach(function(e){var t=ub.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},W_.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,sb.create()),t=null!=(t=e.config)?t:new Ve;return[e,bt.of(e.variationKey,e.reason,t,e.experiment)]},W_.prototype.featureFlag=function(e,t){var r=this;if(!e)return J_.error("featureKey must not be empty"),_t.off(h.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return J_.warn("SDK not ready."),_t.off(h.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return J_.warn("FeatureFlag does not exist."),_t.off(h.FEATURE_FLAG_NOT_FOUND);n=ub.of(n,t,e,"A"),t=this.featureFlagInternal(n),e=t[0],t=t[1];return this.eventFactory.create(n,e).forEach(function(e){return r.eventProcessor.process(e)}),t},W_.prototype.featureFlags=function(r){var n=this,i=new Yn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getFeatureFlags().forEach(function(e){var t=ub.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},W_.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,sb.create()),t=null!=(t=e.config)?t:new Ve;return[e,"A"===e.variationKey?_t.off(e.reason,t,e.experiment):_t.on(e.reason,t,e.experiment)]},W_.prototype.inAppMessage=function(e,t){var r=this,n=this.workspaceFetcher.get();if(!n)return J_.warn("SDK not ready."),Et.of(h.SDK_NOT_READY);e=n.getInAppMessageOrNull(e);if(!e)return J_.warn("In app message does not exist."),Et.of(h.IN_APP_MESSAGE_NOT_FOUND);n=K_.of(n,t,e,this.clock.currentMillis()),t=this.inAppMessageEvaluator.evaluate(n,sb.create());return this.eventFactory.create(n,t).forEach(function(e){return r.eventProcessor.process(e)}),Et.of(t.reason,t.inAppMessage,t.message,t.properties)},W_.prototype.tryInAppMessage=function(t,e){var r,n=zn.start();try{r=this.inAppMessage(t,e)}catch(e){J_.error("Unexpected error while deciding in app message [".concat(t,"]: ").concat(e)),r=Et.of(h.EXCEPTION)}return Fi.inAppMessage(n,t,r),r},W_.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?J_.warn("Event must be event type."):"object"!=typeof e||e.key&&"string"==typeof e.key?(n=(null==(n=this.workspaceFetcher.get())?void 0:n.getEventTypeOrNull(e.key))||new Ft(0,e.key),this.eventProcessor.process(M0.track(n,e,t,r))):J_.warn("Event key must be not null. or event key must be string type."):J_.warn("event must not be null.")},W_.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=G0.toEvent(e),this.flush(),this.track(e,t),this.flush())},W_.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},W_.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(u.isNullOrUndefined(o))return J_.warn("SDK not ready."),gt.of(n,h.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(u.isNullOrUndefined(e))return J_.warn("Remote config parameter does not exist."),gt.of(n,h.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=lb.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,sb.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),gt.of(t.value,t.reason)},W_.prototype.close=function(){this.eventProcessor.close()},W_);function W_(e,t,r,n,i,o,s,a){this.experimentEvaluator=e,this.remoteConfigEvaluator=t,this.inAppMessageEvaluator=r,this.workspaceFetcher=n,this.eventFactory=i,this.eventProcessor=o,this.errorDedupDeterminer=s,this.clock=a}$_.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},$_.prototype._isSameError=function(e,t){return!u.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var q_=$_;function $_(){}Z_.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},Z_.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var X_=Z_;function Z_(){this._installed=[],this._installations={onerror:tO,onunhandledrejection:rO}}var Q_,eO=null;function tO(o,s){eO=window.onerror,window.onerror=function(e,t,r,n,i){u.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),eO&&eO.apply(this,arguments)}}function rO(r,n){Q_=window.onunhandledrejection,window.onunhandledrejection=function(e){var t;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}t instanceof Error&&r.trackException(t,n.resolve()),Q_&&Q_.apply(this,arguments)}}iO.prototype.read=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){return(t=this.storage.getItem(this.storageKey))?[2,JSON.parse(t)]:[2,[]]})})},iO.prototype.save=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){return 0===r.length?[2,this.clear()]:(t=JSON.stringify(r.slice(-this.maxSize)),this.storage.setItem(this.storageKey,t),[2])})})},iO.prototype.add=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),[4,this.save(t.concat(r).slice(-this.maxSize))];case 2:return e.sent(),[2]}})})},iO.prototype.delete=function(n){return a(this,void 0,void 0,function(){var t,r=this;return l(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),t=t.filter(function(e){return!r.isDeleteTarget(e,n)}),[4,this.save(t)];case 2:return e.sent(),[2]}})})},iO.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},iO.prototype.clear=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var nO=iO;function iO(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}var oO=function(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)},sO=(aO.builder=function(){return new uO},aO.empty=function(){return aO.builder().build()},aO.from=function(e){return new aO(e)},aO.fromDto=function(e){for(var t=aO.builder(),r=0,n=e.cohorts;r<n.length;r++){var i=n[r];t.put({identifier:i.identifier,cohorts:i.cohorts.map(function(e){return new Un(e)})})}return t.build()},Object.defineProperty(aO.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),aO.prototype.get=function(e){return this.cohorts.get(e)},aO.prototype.filterBy=function(e){var r=Ht(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return aO.from(e)},aO.prototype.asArray=function(){return this.cohorts.values()},aO.prototype.asComparable=function(){return this.cohorts},aO.prototype.toBuilder=function(){return new uO(this)},aO);function aO(e){this.cohorts=e}cO.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},cO.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},cO.prototype.build=function(){return new sO(this.cohorts)};var uO=cO;function cO(e){this.cohorts=new Yn(Me.isEqual),e&&this.putAll(e)}var r="model",S="name",A="type",e="vendor",C="version",Td="architecture",m="console",R="mobile",x="tablet",E="smarttv",t="wearable",lO=(U.parse=function(e){return{browser:U.getBrowser(e),cpu:U.getCPU(e),device:U.getDevice(e),engine:U.getEngine(e),os:U.getOS(e)}},U.getBrowser=function(e){var t={name:void 0,version:void 0,major:void 0};return U.mapper.rgx.call(t,e,U.regexes.browser),t.major=U.util.major(t.version),t},U.getCPU=function(e){var t={architecture:void 0};return U.mapper.rgx.call(t,e,U.regexes.cpu),t},U.getDevice=function(e){var t={model:void 0,type:void 0,vendor:void 0};return U.mapper.rgx.call(t,e,U.regexes.device),t},U.getEngine=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.getOS=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.util={extend:function(e,t){var r,n={};for(r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},U.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[S,C],[/(opios)[\/\s]+([\w\.]+)/i],[[S,"Opera Mini"],C],[/\s(opr)\/([\w\.]+)/i],[[S,"Opera"],C],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[S,C],[/(konqueror)\/([\w\.]+)/i],[[S,"Konqueror"],C],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[S,"IE"],C],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[S,"Edge"],C],[/(yabrowser)\/([\w\.]+)/i],[[S,"Yandex"],C],[/(Avast)\/([\w\.]+)/i],[[S,"Avast Secure Browser"],C],[/(AVG)\/([\w\.]+)/i],[[S,"AVG Secure Browser"],C],[/(puffin)\/([\w\.]+)/i],[[S,"Puffin"],C],[/(focus)\/([\w\.]+)/i],[[S,"Firefox Focus"],C],[/(opt)\/([\w\.]+)/i],[[S,"Opera Touch"],C],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[S,"UCBrowser"],C],[/(comodo_dragon)\/([\w\.]+)/i],[[S,/_/g," "],C],[/(windowswechat qbcore)\/([\w\.]+)/i],[[S,"WeChat(Win) Desktop"],C],[/(micromessenger)\/([\w\.]+)/i],[[S,"WeChat"],C],[/(brave)\/([\w\.]+)/i],[[S,"Brave"],C],[/(whale)\/([\w\.]+)/i],[[S,"Whale"],C],[/(qqbrowserlite)\/([\w\.]+)/i],[S,C],[/(QQ)\/([\d\.]+)/i],[S,C],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[S,C],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[S,C],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[S,C],[/(MetaSr)[\/\s]?([\w\.]+)/i],[S],[/(LBBROWSER)/i],[S],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[C,[S,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[C,[S,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[S,C],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[C,[S,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[S,/(.+)/,"$1 WebView"],C],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[S,/(.+(?:g|us))(.+)/,"$1 $2"],C],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[S,"Chrome Mobile"],C],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[C,[S,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[S,"Sailfish Browser"],C],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[S,C],[/(dolfin)\/([\w\.]+)/i],[[S,"Dolphin"],C],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[S,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[S,"Opera Coast"],C],[/fxios\/([\w\.-]+)/i],[C,[S,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[C,[S,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[C,S],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[S,"GSA"],C],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[S,[C,(U.mapper={rgx:function(e,t){for(var r,n,i,o,s,a=0;a<t.length&&!o;){for(var u=t[a],c=t[a+1],l=r=0;l<u.length&&!o;)if(o=u[l++].exec(e))for(n=0;n<c.length;n++)s=o[++r],"object"==typeof(i=c[n])&&0<i.length?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;a+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&0<t[r].length){for(var n=0;n<t[r].length;n++)if(U.util.has(t[r][n],e))return"?"===r?void 0:r}else if(U.util.has(t[r],e))return"?"===r?void 0:r;return e}}).str,(U.maps={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}}).browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[S,C],[/(navigator|netscape)\/([\w\.-]+)/i],[[S,"Netscape"],C],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[S,C]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[Td,"amd64"]],[/(ia32(?=;))/i],[[Td,U.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[Td,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[Td,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[Td,/ower/,"",U.util.lowerize]],[/(sun4\w)[;\)]/i],[[Td,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[Td,U.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[r,e,[A,x]],[/applecoremedia\/[\w\.]+ \((ipad)/],[r,[e,"Apple"],[A,x]],[/(apple\s{0,1}tv)/i],[[r,"Apple TV"],[e,"Apple"],[A,E]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[e,r,[A,x]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[r,[e,"Amazon"],[A,x]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[r,U.mapper.str,U.maps.device.amazon.model],[e,"Amazon"],[A,R]],[/android.+aft([bms])\sbuild/i],[r,[e,"Amazon"],[A,E]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[r,e,[A,R]],[/\((ip[honed|\s\w*]+);/i],[r,[e,"Apple"],[A,R]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[e,r,[A,R]],[/\(bb10;\s(\w+)/i],[r,[e,"BlackBerry"],[A,R]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[r,[e,"Asus"],[A,x]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[e,"Sony"],[r,"Xperia Tablet"],[A,x]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[r,[e,"Sony"],[A,R]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[e,r,[A,m]],[/android.+;\s(shield)\sbuild/i],[r,[e,"Nvidia"],[A,m]],[/(playstation\s[34portablevi]+)/i],[r,[e,"Sony"],[A,m]],[/(sprint\s(\w+))/i],[[e,U.mapper.str,U.maps.device.sprint.vendor],[r,U.mapper.str,U.maps.device.sprint.model],[A,R]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[e,[r,/_/g," "],[A,R]],[/(nexus\s9)/i],[r,[e,"HTC"],[A,x]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[r,[e,"Huawei"],[A,R]],[/android.+(bah2?-a?[lw]\d{2})/i],[r,[e,"Huawei"],[A,x]],[/(microsoft);\s(lumia[\s\w]+)/i],[e,r,[A,R]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[r,[e,"Microsoft"],[A,m]],[/(kin\.[onetw]{3})/i],[[r,/\./g," "],[e,"Microsoft"],[A,R]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[r,[e,"Motorola"],[A,R]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[r,[e,"Motorola"],[A,x]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[e,U.util.trim],[r,U.util.trim],[A,E]],[/hbbtv.+maple;(\d+)/i],[[r,/^/,"SmartTV"],[e,"Samsung"],[A,E]],[/\(dtv[\);].+(aquos)/i],[r,[e,"Sharp"],[A,E]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[e,"Samsung"],r,[A,x]],[/smart-tv.+(samsung)/i],[e,[A,E],r],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[e,"Samsung"],r,[A,R]],[/sie-(\w*)/i],[r,[e,"Siemens"],[A,R]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[e,"Nokia"],r,[A,R]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[r,[e,"Acer"],[A,x]],[/android.+([vl]k\-?\d{3})\s+build/i],[r,[e,"LG"],[A,x]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[e,"LG"],r,[A,x]],[/(lg) netcast\.tv/i],[e,r,[A,E]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[r,[e,"LG"],[A,R]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[e,r,[A,x]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[r,[e,"Lenovo"],[A,x]],[/(lenovo)[_\s-]?([\w-]+)/i],[e,r,[A,R]],[/linux;.+((jolla));/i],[e,r,[A,R]],[/((pebble))app\/[\d\.]+\s/i],[e,r,[A,t]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[e,r,[A,R]],[/crkey/i],[[r,"Chromecast"],[e,"Google"],[A,E]],[/android.+;\s(glass)\s\d/i],[r,[e,"Google"],[A,t]],[/android.+;\s(pixel c)[\s)]/i],[r,[e,"Google"],[A,x]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[r,[e,"Google"],[A,R]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[r,/_/g," "],[e,"Xiaomi"],[A,R]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[r,/_/g," "],[e,"Xiaomi"],[A,x]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[r,[e,"Meizu"],[A,R]],[/(mz)-([\w-]{2,})/i],[[e,"Meizu"],r,[A,R]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[r,[e,"OnePlus"],[A,R]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[r,[e,"RCA"],[A,x]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[r,[e,"Dell"],[A,x]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[r,[e,"Verizon"],[A,x]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[e,"Barnes & Noble"],r,[A,x]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[r,[e,"NuVision"],[A,x]],[/android.+;\s(k88)\sbuild/i],[r,[e,"ZTE"],[A,x]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[r,[e,"Swiss"],[A,R]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[r,[e,"Swiss"],[A,x]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[r,[e,"Zeki"],[A,x]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[e,"Dragon Touch"],r,[A,x]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[r,[e,"Insignia"],[A,x]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[r,[e,"NextBook"],[A,x]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[e,"Voice"],r,[A,R]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[e,"LvTel"],r,[A,R]],[/android.+;\s(PH-1)\s/i],[r,[e,"Essential"],[A,R]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[r,[e,"Envizen"],[A,x]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[e,r,[A,x]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[r,[e,"MachSpeed"],[A,x]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[e,r,[A,x]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[r,[e,"Rotor"],[A,x]],[/android.+(KS(.+))\s+build/i],[r,[e,"Amazon"],[A,x]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[e,r,[A,x]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[A,U.util.lowerize],e,r],[/[\s\/\(](smart-?tv)[;\)]/i],[[A,E]],[/(android[\w\.\s\-]{0,9});.+build/i],[r,[e,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[C,[S,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[C,[S,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[S,C],[/rv\:([\w\.]{1,9}).+(gecko)/i],[C,S]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[S,C],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[S,U.mapper.str,U.maps.os.windows],[C,U.mapper.str,U.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[S,"Windows"],[C,U.mapper.str,U.maps.os.windows.version]],[/\((bb)(10);/i],[[S,"BlackBerry"],C],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[S,C],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[S,"Symbian"],C],[/\((series40);/i],[S],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[S,"Firefox OS"],C],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[[S,"Linux"],C],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[S,"Chromium OS"],C],[/(sunos)\s?([\w\.\d]*)/i],[[S,"Solaris"],C],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[S,"Linux"],C],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[S,"iOS"],[C,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[S,"iOS"],[C,/_/g,"."]],[/(haiku)\s(\w+)/i],[S,C],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[C,/_/g,"."],[S,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[S,"Mac"],[C,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[S,C]]},U);function U(){}fO.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=lO.parse(e.navigator.userAgent),s=o.browser,a=o.os,o=o.device,u=e.screen,c=(null==(c=e.navigator.languages)?void 0:c[0])||"",l=c.split("-")[0],p=(null!=(p=o.type)?p:"pc").replace(/\b(mobile|smarttv)\b/g,function(e,t){return"mobile"===t?"phone":"smarttv"===t?"tv":e}),f=a.name||"",h="",d="";try{f=null!=(r=null==(t=f.match(/\b(Mac|Windows|Linux|Android|iOS)\b/))?void 0:t[0])?r:f,h=null!=(i=null==(n=u.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:n[0])?i:"",d=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{platform:"Web",browserName:s.name||"",browserMajorVersion:s.major||"",browserVersion:s.version||"",osName:f,osVersion:a.version||"",deviceModel:o.model||"",deviceType:p,deviceVendor:o.vendor||"",deviceBrand:o.vendor||"",locale:c,language:l,orientation:h,userAgent:e.navigator.userAgent||"",screenWidth:u.width||"",screenHeight:u.height||"",timeZone:d}};var pO=fO;function fO(){}dO.prototype.map=function(e){return new dO(e(this.previous),e(this.current))};var hO=dO;function dO(e,t){this.previous=e,this.current=t}vO.empty=function(){return this.from([])},vO.from=function(e){return new vO(e)},vO.fromDto=function(e){return this.from(e.events.map(function(e){return Vn.fromJson(e)}))},Object.defineProperty(vO.prototype,"rawEvents",{get:function(){return this.events},enumerable:!1,configurable:!0});var yO=vO;function vO(e){this.events=e}mO.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return bO.of(_O(e,this.hackleDeviceId),sO.empty(),yO.empty())},mO.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(mO.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),mO.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},mO.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},mO.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},mO.prototype.hackleUser=function(e){var t=(new zt).addIdentifiers(e.user.identifiers||{}).add(jt.ID,e.user.id||this.hackleDeviceId).add(jt.DEVICE,e.user.deviceId||this.hackleDeviceId).add(jt.HACKLE_DEVICE,this.hackleDeviceId),t=(u.isNotNullOrUndefined(e.user.userId)&&t.add(jt.USER,e.user.userId),t.build()),r=this.campaignParser.parse();return{identifiers:t,properties:c(c({},r),e.user.properties),hackleProperties:this.hackleProperties(),cohorts:e.cohorts.rawCohorts,targetEvents:e.targetEvents.rawEvents}},mO.prototype.hackleProperties=function(){var e;return(e="undefined"!=typeof window?c(c({},pO.generate(window)),this.pageManager.currentPage.toProperties()):e)||{}},mO.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},mO.prototype.setUserId=function(e){e=c(c({},this.context.user),{userId:e});return this.setUser(e)},mO.prototype.setDeviceId=function(e){e=c(c({},this.context.user),{deviceId:e});return this.setUser(e)},mO.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},mO.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},mO.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},mO.prototype.saveUser=function(e){this.storage.saveUser(e)},mO.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,oO(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new hO(t,n)},mO.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=_O(r,n.hackleDeviceId),oO(e,t)?c(c({},t),{properties:c(c({},e.properties),t.properties)}):t;var t})},mO.prototype.operateProperties=function(r){return this.updateContext(function(e){var t=null!=(t=e.properties)?t:{},t=r.operate(new Map(Object.entries(t)));return c(c({},e),{properties:u.fromMap(t)})})},mO.prototype.sync=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.syncCohort(),this.syncUserTarget()])];case 1:return e.sent(),[2]}})})},mO.prototype.syncIfNeeded=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return this.hasNewIdentifiers(t.previous,t.current)?[4,this.syncCohort()]:[3,2];case 1:e.sent(),e.label=2;case 2:return oO(t.previous,t.current)?[3,4]:[4,this.syncUserTarget()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},mO.prototype.syncCohort=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userCohortFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(t,this.context.targetEvents),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync cohorts: ".concat(t)),[3,3];case 3:return[2]}})})},mO.prototype.syncUserTarget=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userTargetFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(this.context.cohorts,t),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync userTargets: ".concat(t)),[3,3];case 3:return[2]}})})},mO.prototype.hasNewIdentifiers=function(e,t){var r=Ht(e),e=Ht(t);return Object.entries(e).some(function(e){var t=e[0],e=e[1];return r[t]!==e})},mO.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var gO=mO;function mO(e,t,r,n,i,o,s,a,u){this.hackleDeviceId=e,this.storage=t,this.userTargetFetcher=r,this.userCohortFetcher=n,this.campaignParser=i,this.pageManager=o,this.clock=s,this.userListeners=[],this.defaultUser={id:this.hackleDeviceId,deviceId:this.hackleDeviceId},this.context=this.initContext(a,u),this.storage.saveUser(this.context.user)}wO.prototype.getUser=function(){var e=this.deviceId||void 0,t=this.userId||void 0;return void 0!==e||void 0!==t?{deviceId:e,userId:t}:null},wO.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(wO.prototype,"deviceId",{get:function(){return this.storage.getItem(nt)},enumerable:!1,configurable:!0}),Object.defineProperty(wO.prototype,"userId",{get:function(){return this.storage.getItem(rt)},enumerable:!1,configurable:!0}),wO.prototype.setDeviceId=function(e){this.setId(nt,e)},wO.prototype.setUserId=function(e){this.setId(rt,e)},wO.prototype.setId=function(e,t){u.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var EO=wO;function wO(e){this.storage=e}TO.of=function(e,t,r){return new TO(e,t.filterBy(e),r)},TO.prototype.with=function(e){return TO.of(e,this.cohorts.filterBy(e),this.targetEvents)},TO.prototype.update=function(e,t){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return TO.of(this.user,e,t)};var bO=TO;function TO(e,t,r){this.user=e,this.cohorts=t,this.targetEvents=r}var _O=function(e,t){return c(c({},e),{id:e.id||t,deviceId:e.deviceId||t})},OO=(Object.defineProperty(IO.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(IO.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:IO.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(IO.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),IO.prototype.addListener=function(e){this.sessionListeners.push(e)},IO.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},IO.prototype.startNewSessionIfNeeded=function(e,t){var r=this._lastEventTime;return null!==r&&null!==this._currentSessionId&&t-r<this.sessionTimeoutMillis?(this.updateLastEventTime(t),this._currentSessionId):this.startNewSession(e,e,t)},IO.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(tt,"".concat(e))},IO.prototype.endSession=function(t){var r=this._currentSessionId,n=this._lastEventTime;null!==r&&null!==n&&this.sessionListeners.forEach(function(e){return e.onSessionEnded(r,t,n)})},IO.prototype.newSession=function(t,r){var n="".concat(r,".").concat(H().slice(0,8));return this.saveSession(n),this.updateLastEventTime(r),this.sessionListeners.forEach(function(e){e.onSessionStarted(n,t,r)}),n},IO.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(et,e)},IO.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(et)},IO.prototype.loadLastEventTime=function(){var e=this.storage.getItem(tt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},IO.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},IO.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.updateLastEventTime(t);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}},IO.EMPTY_SESSION_ID="0.ffffffff",IO);function IO(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}AO.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},AO.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},AO.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},AO.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var NO=AO;function AO(){this.storage=window.localStorage}RO.postfix=function(e,t){return new RO(e,function(e){return"".concat(e).concat(t)})},RO.prefix=function(e,t){return new RO(e,function(e){return"".concat(t).concat(e)})},RO.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},RO.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},RO.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var SO=RO;function RO(e,t){this.delegate=e,this.transform=t}CO.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},CO.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},CO.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},CO.prototype.getVictimIndex=function(e){var t=this.getRemainListSize();try{var r=JSON.stringify(e),n=this.getList(),i=0;return n.findIndex(function(e){return(i+=JSON.stringify(e).length)+t>=r.length})}catch(e){return-1}},CO.prototype.getList=function(){try{var e=this.delegate.getItem(this.listKey);if(!e)return[];var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},CO.prototype.entries=function(){return this.getList().flatMap(Object.entries)},CO.prototype.setItem=function(e,t){var r;try{this.removeItem(e);var n=this.getList(),i=((r={})[e]=t,r);if(!this.isAddableItem(i)){var o=this.getVictimIndex(i);if(o<0)return;n=n.slice(o+1)}var s=JSON.stringify(n.concat(i));this.delegate.setItem(this.listKey,s)}catch(e){}},CO.prototype.getItem=function(t){var r=this,e=this.getList().find(function(e){return r.isEqualItem(e,t)});if(e&&e[t])return e[t]},CO.prototype.removeItem=function(t){var r=this,e=this.getList();try{var n=e.filter(function(e){return!r.isEqualItem(e,t)}),i=JSON.stringify(n);this.delegate.setItem(this.listKey,i)}catch(e){}},CO.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var MO=CO;function CO(e,t,r){void 0===r&&(r=4096);var n=this;this.delegate=e,this.listKey=t,this.encodedListCharLen=6,this.resolveMaxLength=function(e){e-=n.encodedListCharLen;return e<0?0:e},this.maxLength=this.resolveMaxLength(r)}PO.prototype.currentUser=function(){return this.userManager.resolve()},PO.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},PO.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},PO.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},PO.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},PO.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},PO.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},PO.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},PO.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},PO.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},PO.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},PO.prototype.increment=function(e,t){bi.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var xO=PO;function PO(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}kO.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},kO.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},kO.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},kO.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},kO.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},kO.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},kO.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},kO.monitoring=function(e){return"".concat(e,"/metrics")},kO.userTargets=function(e){return"".concat(e,"/api/v1/user-targets")};var UO=kO;function kO(){}LO.prototype.exist=function(e,t){var e=this.key(e),r=this.storage.getItem(e);if(u.isNullOrUndefined(r))return!1;r=Number.parseInt(r,10);return!Number.isNaN(r)&&t<=r||(this.storage.removeItem(e),!1)},LO.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},LO.prototype.key=function(e){return"".concat(e.key)};var DO=LO;function LO(e){this.storage=e}VO.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var FO=VO;function VO(e){this.handlers=e}BO.prototype.handle=function(e,t){e.close()},BO.prototype.supports=function(e){return"CLOSE"===e.type};var jO=BO;function BO(){}zO.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},zO.prototype.supports=function(e){return"WEB_LINK"===e.type};var HO=zO;function zO(e){this.urlHandler=e}GO.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},GO.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var KO=GO;function GO(e){this.urlHandler=e}YO.prototype.handle=function(e,t){var r=this.clock.currentMillis()+864e5;this.storage.put(e.context.inAppMessage,r),e.close()},YO.prototype.supports=function(e){return"HIDDEN"===e.type};var JO=YO;function YO(e,t){this.storage=e,this.clock=t}qO.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},qO.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var WO=qO;function qO(e){this.urlHandler=e}XO.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},XO.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var $O=XO;function XO(e){this.urlHandler=e}QO.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},QO.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var ZO=QO;function QO(e){this.urlHandler=e}tI.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},tI.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var eI=tI;function tI(e){this.urlHandler=e}nI.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},nI.prototype.createTrackEvent=function(e,t){switch(e.type){case"IMPRESSION":return{key:"$in_app_impression",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,title_text:null==(r=null==(r=t.message.text)?void 0:r.title)?void 0:r.text,body_text:null==(r=null==(r=t.message.text)?void 0:r.body)?void 0:r.text,button_text:t.message.buttons.map(function(e){return e.text}),image_url:t.message.images.map(function(e){return e.imagePath})})};case"CLOSE":return{key:"$in_app_close",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType})};case"ACTION":var r=e;return{key:"$in_app_action",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,action_type:r.action.type,action_area:r.area,action_value:r.action.value,button_text:r.buttonText,image_url:r.imageUrl,image_order:r.imageOrder})};case"IMAGE_IMPRESSION":r=e;return{key:"$in_app_image_impression",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,image_url:r.imageUrl,image_order:r.imageOrder})}}};var rI=nI;function nI(e){this.core=e}oI.prototype.setListener=function(e){this.inAppMessageListener=e},oI.prototype.present=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:if(this.currentMessageView)return[2];if(this.opening)return[2];this.opening=!0,t=null,e.label=1;case 1:return(e.trys.push([1,3,4,5]),null===(t=this.messageViewFactory.create(r,this)))?[2]:[4,(this.currentMessageView=t).open()];case 2:return e.sent(),[3,5];case 3:return e.sent(),null!=t&&t.close(),[3,5];case 4:return this.opening=!1,[7];case 5:return[2]}})})};var iI=oI;function oI(e,t,r,n){void 0===n&&(n=null),this.messageViewFactory=e,this.eventHandler=t,this.interactionHandlerFactory=r,this.inAppMessageListener=n,this.currentMessageView=null,this.opening=!1}aI.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},aI.prototype.destroy=function(){this.userEventEmitter.off("event",this.onEvent)};var sI=aI;function aI(e,t,r){var n=this;this.userEventEmitter=e,this.determiner=t,this.presenter=r,this.onEvent=function(e){e=n.determiner.determineOrNull(e);e&&n.presenter.present(e)},this.initialize()}var uI=function(e,t,r,n){this.inAppMessage=e,this.message=t,this.user=r,this.properties=n},cI=(lI.prototype.determineOrNull=function(e){var t=this.workspaceFetcher.get();if(t)for(var r=0,n=t.getInAppMessages();r<n.length;r++){var i=n[r];if(this.eventMatcher.matches(t,i,e)){i=this.context(i,e);if(i)return i}}},lI.prototype.context=function(e,t){var r,e=this.core.tryInAppMessage(e.key,t.user);if(e.inAppMessage&&e.message)return r=c(c({},e.properties),{decision_reason:e.reason}),new uI(e.inAppMessage,e.message,t.user,Pe.sanitize(r))},lI);function lI(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.core=r}fI.prototype.open=function(){var i,o;return a(this,void 0,void 0,function(){var t,r,n=this;return l(this,function(e){switch(e.label){case 0:if(!this.status.canOpen())return s.log.debug("InAppMessage is already opened. (key=".concat(this.context.inAppMessage.key,")")),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),null!=(o=null==(i=this.ui.inAppMessageListener)?void 0:i.beforeInAppMessageOpen)&&o.call(i,this.context.inAppMessage),this.status.current="OPENING",window.addEventListener(fI.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(fI.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),[4,this.scriptLoader.load()];case 2:return e.sent(),(t=this.addContainer()).style.display="none",t.classList.add("".concat(fI.CONTAINER_CLASS_NAME,"--loading")),r=window.HackleInAppMessageRenderer,this.renderer=new r.HackleInAppMessageRenderer(t),r=this.renderTypeResolver.resolve(this.context),[4,this.renderer.render({messageId:this.context.inAppMessage.id,message:this.context.message.toJson(),renderType:r})];case 3:return e.sent(),t.classList.remove("".concat(fI.CONTAINER_CLASS_NAME,"--loading")),t.style.display="block",this.handleInAppMessageLifecycle("OPEN",function(){var e,t;n.handleEvent({type:"IMPRESSION"}),n.status.current="OPENED",null!=(t=null==(e=n.ui.inAppMessageListener)?void 0:e.afterInAppMessageOpen)&&t.call(e,n.context.inAppMessage)},function(){s.log.warn("Failed to open inAppMessage with [Timeout expired.]"),n.destroy()}),[3,5];case 4:return e.sent(),this.destroy(),[3,5];case 5:return[2]}})})},fI.prototype.close=function(){var e,t,r=this;this.status.canClose()?(null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.beforeInAppMessageClose)&&t.call(e,this.context.inAppMessage),this.status.current="CLOSING",this.handleInAppMessageLifecycle("CLOSE",function(){var e,t;r.handleEvent({type:"CLOSE"}),r.destroy(),null!=(t=null==(e=r.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r.context.inAppMessage)},function(){var e,t;s.log.warn("Failed to close inAppMessage with [Timeout expired.]"),r.destroy(),null!=(t=null==(e=r.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r.context.inAppMessage)})):s.log.debug("InAppMessage is already closed. (key=".concat(this.context.inAppMessage.key,")"))},fI.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(fI.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},fI.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},fI.prototype.destroy=function(){var e;window.removeEventListener(fI.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(fI.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),null!=(e=this.renderer)&&e.destroy(),this.renderer=null,this.removeContainer(),this.ui.currentMessageView=null,this.status.current="CLOSED"},fI.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(fI.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},fI.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},fI.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},fI.prototype.handleEvent=function(e){this.ui.eventHandler.handle(this,e)},fI.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",fI.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",fI.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",fI.CONTAINER_CLASS_NAME="hackle-iam",fI.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var pI=fI;function fI(e,t,r,n,i,o){var s=this;this.scriptLoader=e,this.context=t,this.ui=r,this.renderTypeResolver=n,this.status=i,this.lifecycleRegistry=o,this.container=null,this.renderer=null,this.resolveLifecycleEnd=function(e){var t;e instanceof CustomEvent&&("string"==typeof(t=e).detail.id&&["OPEN","CLOSE"].includes(t.detail.type))&&(e=(t=e.detail).id,t=t.type,null!=(t=s.lifecycleRegistry.getAndRemove(t,e))&&t())},this.handleInAppMessageInteraction=function(e){e instanceof CustomEvent&&e.type===fI.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))}}dI.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},dI.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},dI.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var hI=dI;function dI(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}vI.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},vI.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var yI=vI;function vI(e){this.current=e=void 0===e?"CLOSED":e}mI.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},mI.prototype.register=function(e,t){var r=H(),e=this.resolveKey(e,r);return this.record[e]=t,r},mI.prototype.getAndRemove=function(e,t){var e=this.resolveKey(e,t),t=this.record,r=t[e],t=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}(t,["symbol"==typeof e?e:e+""]);return this.record=t,r};var gI=mI;function mI(){this.record={}}wI.create=function(e){return new wI(e)},wI.prototype.create=function(e,t){var r=new hI,n=new yI,i=new gI;switch(e.message.layout.displayType){case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new pI(this.scriptLoader,e,t,r,n,i);case"NONE":return null}};var EI=wI;function wI(e){this.scriptLoader=e}TI.prototype.load=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return window.HackleInAppMessageRenderer?[2]:(t=this.createScript(),document.head.appendChild(t),[4,this.waitForLoad(t)]);case 1:return[2,e.sent()]}})})},TI.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},TI.prototype.waitForLoad=function(o){return new Promise(function(e,t){function r(){o.removeEventListener("error",i),o.removeEventListener("load",n)}var n=function(){r(),e(o)},i=function(e){r(),t(e.message)};o.addEventListener("load",n),o.addEventListener("error",i)})};var bI=TI;function TI(e){this.scriptUrl=e}OI.prototype.isTriggerTarget=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},OI.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=II.of(e,t,r);return this.targetMatcher.anyMatches(e,sb.create(),n.targets)};var _I=OI;function OI(e){this.targetMatcher=e}NI.of=function(e,t,r){return new NI(new ib("IN_APP_MESSAGE",r.id),e,t.user,t)};var II=NI;function NI(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}SI.prototype.isTriggerTarget=function(e,t,r){if(!t.eventTrigger.frequencyCap)return!0;var n=this.createMatchContexts(t.eventTrigger.frequencyCap);if(0===n.length)return!0;for(var i=0,o=this.storage.get(t);i<o.length;i++)for(var s=o[i],a=0,u=n;a<u.length;a++)if(u[a].matches(r,s))return!1;return!0},SI.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new RI(new CI(i)))}return e.durationCap&&t.push(new RI(new PI(e.durationCap))),t};var AI=SI;function SI(e){this.storage=e}MI.prototype.matches=function(e,t){return this.predicate.matches(e,t)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var RI=MI;function MI(e){this.matchCount=0,this.predicate=e}Object.defineProperty(xI.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),xI.prototype.matches=function(e,t){e=e.user.identifiers[this.identifierCap.identifierType];if(u.isNullOrUndefined(e))return!1;t=t.identifiers[this.identifierCap.identifierType];return!u.isNullOrUndefined(t)&&e===t};var CI=xI;function xI(e){this.identifierCap=e}Object.defineProperty(UI.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),UI.prototype.matches=function(e,t){return e.timestamp-t.timestamp<=this.durationCap.durationMillis};var PI=UI;function UI(e){this.durationCap=e}DI.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return u.isNullOrUndefined(e)?[]:JSON.parse(e)},DI.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var kI=DI;function DI(e){this.storage=e}FI.prototype.get=function(t){return this.processors.find(function(e){return e.supports(t)})};var LI=FI;function FI(e){this.processors=e}jI.prototype.process=function(e,t,r){this.saveImpression(e.context.inAppMessage,e.context.user,r)},jI.prototype.saveImpression=function(e,t,r){var n=this.impressionStorage.get(e),t={identifiers:t.identifiers,timestamp:r};n.push(t),n.length>jI.IMPRESSION_MAX_SIZE&&n.splice(0,n.length-jI.IMPRESSION_MAX_SIZE),this.impressionStorage.set(e,n)},jI.prototype.supports=function(e){return"IMPRESSION"===e.type},jI.IMPRESSION_MAX_SIZE=100;var VI=jI;function jI(e){this.impressionStorage=e}HI.prototype.process=function(e,t,r){},HI.prototype.supports=function(e){return"CLOSE"===e.type};var BI=HI;function HI(){}KI.prototype.process=function(e,t,r){var n,i,o=this.actionHandlerFactory.get(t.action);!(null==(i=null==(n=e.ui.inAppMessageListener)?void 0:n.onInAppMessageClick)?void 0:i.call(n,e.context.inAppMessage,e,xn.fromAction(t.action)))&&e.status.canClose()&&null!=o&&o.handle(e,t.action)},KI.prototype.supports=function(e){return"ACTION"===e.type};var zI=KI;function KI(e){this.actionHandlerFactory=e}JI.prototype.handle=function(e,t){var r=this.clock.currentMillis(),n=(this.eventTracker.track(e.context,t,r),this.eventProcessorFactory.get(t));n&&n.process(e,t,r)};var GI=JI;function JI(e,t,r){this.clock=e,this.eventTracker=t,this.eventProcessorFactory=r}WI.prototype.matches=function(e,t,r){return!!M0.isTrackEvent(r)&&(!!this.ruleDeterminer.isTriggerTarget(e,t,r)&&this.frequencyCapDeterminer.isTriggerTarget(e,t,r))};var YI=WI;function WI(e,t){this.ruleDeterminer=e,this.frequencyCapDeterminer=t}$I.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var qI=$I;function $I(e){this.handlers=e}ZI.prototype.handle=function(e,t){e.close()},ZI.prototype.supports=function(e){return"CLOSE"===e.type};var XI=ZI;function ZI(){}eN.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.eventHandler.handle(e,t)},eN.prototype.eventOrNull=function(e){var t=Mn.fromJson(e.action);return t?{type:"ACTION",action:t,area:e.area,buttonText:e.buttonText,imageUrl:e.imageUrl,imageOrder:e.imageOrder}:null},eN.prototype.supports=function(e){return"ACTION"===e.type};var QI=eN;function eN(e){this.eventHandler=e}rN.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.eventHandler.handle(e,t)},rN.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var tN=rN;function rN(e){this.eventHandler=e}iN.prototype.open=function(e){window.location.href=e.href};var nN=iN;function iN(){}sN.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var oN=sN;function sN(){}uN.prototype.open=function(e){window.open(e.href)};var aN=uN;function uN(){}lN.prototype.open=function(e){window.location.replace(e)};var cN=lN;function lN(){}function pN(e,t,r){return null===e||(!dN(t,fN)||r.current!==r.referrer)&&!dN(e,t)}var fN={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,gclid:void 0,fbclid:void 0},hN={current:void 0,referrer:void 0},dN=function(t,r){return Object.keys(fN).every(function(e){return t[e]===r[e]})},yN=(vN.prototype.startNewCampaign=function(e,t,r){for(var t=c(c({},fN),t),n=new Io,i=0,o=Object.entries(t);i<o.length;i++){var s=o[i],a=s[0],s=s[1];s?n.set(a,s):n.unset(a)}var t=n.build(),u=t.toEvent(),e=this.userManager.toHackleUser(e);this.core.track(u,e,r),this.userManager.updateUserProperties(t)},vN.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();pN(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},vN.prototype.onSessionEnded=function(e,t,r){},vN.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},vN);function vN(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}mN.prototype.get=function(){var e=this.storage.getItem(it);return e?JSON.parse(e):null},mN.prototype.set=function(e){this.storage.setItem(it,JSON.stringify(e))};var gN=mN;function mN(e){this.storage=e}wN.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},wN.prototype.getQueryParams=function(e){for(var t={},r=0,n=this.search.substring(1).split("&");r<n.length;r++){var i=n[r].split("="),o=i[0],i=i[1];e&&!e(o,i)||(i=Bo.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var EN=wN;function wN(e){this.search=e}TN.extractDomain=function(e){var t=this.DOMAIN_MATCH_REGEX,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=this.SIMPLE_DOMAIN_MATCH_REGEX),e.match(t));return r?r[0]:e},TN.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,TN.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var bN=TN;function TN(){}ON.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},ON.prototype.params=function(e){e=u.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new EN(e).getQueryParams(ON.CAMPAIGN_QUERY_CONDITION)},ON.prototype.resolve=function(e){return{utm_campaign:e[IN],utm_content:e[NN],utm_id:e[AN],utm_medium:e[SN],utm_source:e[RN],utm_term:e[MN],gclid:e[CN],fbclid:e[xN]}},ON.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return hN;return{current:bN.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,bN.extractDomain(e)}()}},ON.CAMPAIGN_QUERY_CONDITION=function(e,t){return _i.isNotEmptyString(t)};var _N=ON;function ON(e){this.pageManager=e}var IN="utm_campaign",NN="utm_content",AN="utm_id",SN="utm_medium",RN="utm_source",MN="utm_term",CN="gclid",xN="fbclid",PN=(UN.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},UN.prototype.send=function(e){var t=e.experiment.key,r=e.variationKey,t="HACKLE-EXPERIMENT_".concat(t,"_V").concat(e.experiment.version,"-").concat(r);try{window.gtag("event","experience_impression",{exp_variant_string:t})}catch(e){s.log.error("Unexpected exception while sending an event to Google Analytics with gtag: ".concat(e))}},UN);function UN(e,t){var r=this;this.userEventEmitter=e,this.determiner=t,this.onEvent=function(e){e=r.determiner.determineTargetExposureOrNull(e);e&&r.send(e)},this.initialize()}DN.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!M0.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==h.TRAFFIC_ALLOCATED?null:e};var kN=DN;function DN(e){this.workspaceFetcher=e}var LN={user:void 0,debug:!1,log_disabled:!1,automaticPageTracking:!0,pollingIntervalMillis:-1,exposureEventDedupIntervalMillis:6e4,sessionTimeoutMillis:18e5,autoOpenDevTool:!1,sdkUrl:"https://client-sdk.hackle.io",eventUrl:"https://event.hackle.io",monitoringUrl:"https://monitoring.hackle.io",cdnUrl:"https://static.hackle.io",sameSiteCookie:"LAX",secureCookie:!1,SDK_NAME_HEADER:"javascript-sdk_browser",SDK_VERSION_HEADER:"11.42.0",IAM_RENDERER_VERSION_HEADER:"0.0.9"},FN=(VN.config=function(e){return c(c(c({},LN),e),{automaticPageTracking:VN.resolveAutomaticPageTracking(e)})},VN.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?LN.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},VN.logging=function(e){s.initCounter(function(e){return bi.counter("log",{level:e})}),s.setLogLevel(Te.INFO),e.log_disabled?s.setLogLevel(Te.DISABLE):e.debug&&s.setLogLevel(Te.DEBUG)},VN.sdk=function(e,t){return s.log.debug("SDK key: ".concat(e)),e||s.log.error("invalid sdk key: '".concat(e,"' (expected: not null, not undefined and not empty string)")),{key:e,name:t.SDK_NAME_HEADER,version:t.SDK_VERSION_HEADER}},VN.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&s.log.debug("support sendBeacon API"),e},VN.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,6e4)},VN.dedupIntervalMillis=function(e){return void 0===e.exposureEventDedupIntervalMillis||"number"!=typeof e.exposureEventDedupIntervalMillis?6e4:e.exposureEventDedupIntervalMillis<1e3||36e5<e.exposureEventDedupIntervalMillis?(s.log.warn("Exposure event dedup interval is outside allowed range[1_000ms..3_600_000ms]. Setting to default value[1m]."),6e4):e.exposureEventDedupIntervalMillis},VN);function VN(){}BN.prototype.add=function(e){this.synchronizers.push(e)},BN.prototype.sync=function(){return a(this,void 0,void 0,function(){var t=this;return l(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.sync())}))];case 1:return e.sent(),[2]}})})},BN.prototype.close=function(){return a(this,void 0,void 0,function(){var t=this;return l(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.close())}))];case 1:return e.sent(),[2]}})})},BN.prototype.safe=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})};var jN=BN;function BN(){this.synchronizers=[]}zN.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.delegate.sync()];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})},zN.prototype.start=function(){var e=this;-1!==this.intervalMillis&&null===this.pollingJob&&(this.pollingJob=this.scheduler.schedulePeriodically(this.intervalMillis,this.intervalMillis,function(){return e.sync()}))},zN.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},zN.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return this.stop(),[4,this.delegate.close()];case 1:return e.sent(),[2]}})})};var HN=zN;function zN(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}GN.prototype.schedule=function(e,t){e=new JN(e,t);return e.start(),e},GN.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new WN(e,t,r);break;case"setInterval":n=new $N(e,t,r)}return n.start(),n};var KN=GN;function GN(e){this.scheduleType=e}YN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.task()},this.delayMillis)},YN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var JN=YN;function YN(e,t){this.delayMillis=e,this.task=t,this.timeout=null}qN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},qN.prototype.run=function(){var e=this;try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}this.timeout=setTimeout(function(){return e.run()},this.intervalMillis)},qN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var WN=qN;function qN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}XN.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},XN.prototype.run=function(){try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}},XN.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var $N=XN;function XN(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}QN.prototype.fetchIfModified=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},QN.prototype.createRequest=function(e){var t=Ii.builder().url(this.url).method("GET");return null!==e&&t.addHeader(Ci.IF_MODIFIED_SINCE,e),t.build()},QN.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),ji.record("get.workspace",t,r),[2,r];case 3:throw r=e.sent(),ji.record("get.workspace",t,null),r;case 4:return[2]}})})},QN.prototype.handleResponse=function(e){if(e.isNotModified())return null;if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is empty");return{config:JSON.parse(e.body),lastModified:e.headers.get(Ci.LAST_MODIFIED)}};var ZN=QN;function QN(e,t){this.url=e,this.transport=t}tA.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},tA.prototype.createRequest=function(e){e={identifiers:Ht(e)},e=Ee.encodeURL(JSON.stringify(e));return Ii.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},tA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),ji.record("get.cohorts",t,r),[2,r];case 3:throw r=e.sent(),ji.record("get.cohorts",t,null),r;case 4:return[2]}})})},tA.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return sO.fromDto(e)};var eA=tA;function tA(e,t){this.url=e,this.transport=t}nA.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},nA.prototype.createRequest=function(e){e={identifiers:Ht(e)},e=Ee.encodeURL(JSON.stringify(e));return Ii.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},nA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),ji.record("get.user-targets",t,r),[2,r];case 3:throw r=e.sent(),ji.record("get.user-targets",t,null),r;case 4:return[2]}})})},nA.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return yO.fromDto(e)};var rA=nA;function nA(e,t){this.url=e,this.transport=t}oA.prototype.getExperiments=function(){return Array.from(this.experiments.values())},oA.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},oA.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},oA.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},oA.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},oA.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},oA.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},oA.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},oA.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},oA.prototype.getContainerOrNull=function(e){return this.containers.get(e)},oA.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},oA.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},oA.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},oA.prototype.getAttributes=function(){return this.attributes},oA.from=function(e){var t=e.parameterConfigurations.map(At.fromJson),r=f.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e,t)}),n=f.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e,t)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),i=f.mapNotNullOrUndefined(e.featureFlags,function(e){return Mt.fromJson("FEATURE_FLAG",e,t)}),o=e.buckets.map(Ut.fromJson),s=e.events.map(Ft.fromJson),a=f.mapNotNullOrUndefined(e.segments,ir.fromJson),u=e.containers.map(sr.fromJson),c=f.mapNotNullOrUndefined(e.remoteConfigParameters,lr.fromJson),l=f.mapNotNullOrUndefined(e.inAppMessages,jr.fromJson),e=e.workspace.attributes;return new oA(r,n,i,o,s,a,u,t,c,l,e)};var iA=oA;function oA(e,t,r,n,i,o,s,a,u,c,l){this.experiments=f.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=f.associateBy(t,function(e){return e.key}),this.featureFlags=f.associateBy(r,function(e){return e.key}),this.buckets=f.associateBy(n,function(e){return e.id}),this.eventTypes=f.associateBy(i,function(e){return e.key}),this.segments=f.associateBy(o,function(e){return e.key}),this.containers=f.associateBy(s,function(e){return e.id}),this.parameterConfigurations=f.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=f.associateBy(u,function(e){return e.key}),this.inAppMessages=f.associateBy(c,function(e){return e.key}),this.attributes=l}aA.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},aA.prototype.setWorkspace=function(e){try{this.workspace=iA.from(e.config)}catch(e){s.log.error("Failed to set workspace: ".concat(e))}},aA.prototype.get=function(){return this.workspace},aA.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.workspaceFetcher.fetchIfModified(this.lastModified)];case 1:return(t=e.sent())&&(this.setConfig(t),this.workspaceConfigStorage.set(t)),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync workspace: ".concat(t)),[3,3];case 3:return[2]}})})},aA.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var sA=aA;function aA(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}cA.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},cA.prototype.dispatchEventsSynchronously=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.retryManager.add(r)];case 1:return e.sent(),[4,this.synchronousTransport.send(r)];case 2:return(t=e.sent()).isSuccessful()||t.isClientError()?[4,this.retryManager.delete(r)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},cA.prototype.dispatchEvents=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.transport.send(r)];case 1:return(t=e.sent()).isSuccessful()||t.isClientError()?[2]:[4,this.retryManager.add(r)];case 2:return e.sent(),[2]}})})};var uA=cA;function cA(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}pA.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},pA.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof M0?M0.isExposureEvent(e)?t.push(e.toDto()):M0.isTrackEvent(e)?r.push(e.toDto()):M0.isRemoteConfigEvent(e)&&n.push(e.toDto()):M0.isExposureEventDto(e)?t.push(e):M0.isTrackEventDto(e)?r.push(e):M0.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return Ii.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},pA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),ji.record("post.events",t,r),[2,r];case 3:throw r=e.sent(),ji.record("post.events",t,null),r;case 4:return[2]}})})};var lA=pA;function pA(e,t){this.url=e,this.transport=t}hA.prototype.add=function(e){return this.repository.add(e)},hA.prototype.delete=function(e){return this.repository.delete(e)},hA.prototype.flush=function(){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:return[4,this.repository.read()];case 1:return 0===(t=e.sent()).length?[2]:[4,this.transport.send(t)];case 2:return(r=e.sent()).isSuccessful()||r.isClientError()?[4,this.delete(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},hA.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"pageshow":return void this.flush().catch(function(e){return s.log.warn("Failed to flush retry events: ".concat(e))});case"blur":case"focus":case"hidden":case"locationChange":case"pagehide":return}};var fA=hA;function hA(e,t){this.repository=e,this.transport=t}function dA(){this.listeners={}}dA.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},dA.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},dA.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Ae(vA,yA=dA);var yA,ta=vA;function vA(){return null!==yA&&yA.apply(this,arguments)||this}Ae(EA,gA=ta),EA.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},EA.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},EA.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},EA.prototype.flush=function(e){var t;void 0===e&&(e=!1),null!=(t=this.flushingJob)&&t.cancel(),0!==this.queue.length&&(this.eventDispatcher.dispatch(this.queue,e).catch(function(e){return s.log.warn("Failed to dispatch events: ".concat(e))}),this.queue=[])},EA.prototype.close=function(){this.flush(!0)};var gA,mA=EA;function EA(e,t,r,n){var i=gA.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}bA.prototype.send=function(e){e=e.toBuilder().addHeader(ze,this.sdk.key).addHeader(Ke,this.sdk.name).addHeader(Ge,this.sdk.version).addHeader(Je,this.clock.currentMillis().toString()).build();return this.delegate.send(e)};var wA=bA;function bA(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}_A.intercept=function(e,t){return t instanceof wA?t:new wA(e,Le.instance,t)};var TA=_A;function _A(){}IA.create=function(){return new IA},IA.prototype.send=function(s){return new Promise(function(t,r){var e,n=new XMLHttpRequest,i=(s.options.timeoutMillis&&(n.timeout=s.options.timeoutMillis),n.open(s.method,s.url),n.onreadystatechange=function(){var e;n.readyState===n.DONE&&(0===n.status?r(new Error("Request Error")):(e=new Ri(n.status,n.responseText,function(e){var t=Ci.builder(),e=e.getAllResponseHeaders();if(!e)return t.build();for(var r=0,n=e.split("\r\n");r<n.length;r++){var i,o=n[r],s=o.indexOf(": ");0<s&&(i=o.slice(0,s),o=o.slice(s+2),t.add(i,o))}return t.build()}(n)),t(e)))},n),o=s.headers.raw();for(e in o)o.hasOwnProperty(e)&&i.setRequestHeader(e,o[e]);n.send(s.body)})};var OA=IA;function IA(){}AA.create=function(){return new AA},AA.prototype.send=function(n){var i=this;return new Promise(function(e,t){var r=!1;if(!(r="undefined"!=typeof window?window&&window.navigator&&!!window.navigator.sendBeacon&&!0:r))throw new Error("BeaconTransport not supported.");r=i.createBody(n);if(!window.navigator.sendBeacon(n.url,r))throw Error("Failed to sendBeacon");e(Ri.ok())})},AA.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(ze),r=(r&&t.append("sdkKey",r),t.append("sdkName",e.headers.getOrDefault(Ke,"unknown")),t.append("sdkVersion",e.headers.getOrDefault(Ge,"unknown")),e.headers.get(Je));return r&&t.append("sdkTime",r),e.body&&t.append("data",e.body),t};var NA=AA;function AA(){}RA.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var SA=RA;function RA(e){this.invocationResponseResolver=e}xA.prototype.invoke=function(e){if(null==(t=window._hackleApp)||!t.invoke)throw new Error("window._hackleApp.invoke is not implemented");var t=window._hackleApp.invoke(JSON.stringify(e));return this.invocationResponseResolver.resolve(t)};var MA,CA=xA;function xA(e){this.invocationResponseResolver=e}(vp=MA=MA||{}).prompt="prompt",vp.function="function";UA.prototype.getInvocator=function(e,t){return e===MA.prompt?new SA(t):e===MA.function?new CA(t):null};var PA=UA;function UA(){}DA.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},DA.prototype.onPageEnded=function(e,t){};var kA=DA;function DA(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var LA=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},FA=(VA.prototype.determineOrNull=function(e){if(this.splitUrlRedirectedCookieStorage.alreadyRedirected())return this.splitUrlRedirectedCookieStorage.clear(),null;var t=this.workspaceFetcher.get();if(!t)return null;for(var r=0,n=t.getSplitUrlExperiments();r<n.length;r++){var i,o=n[r];if(this.splitUrlMatcher.matches(t,o,e))return i=this.core.experiment(o.key,e,"A"),new LA(t,o,i,e)}return null},VA);function VA(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}BA.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=HA.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,sb.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,sb.create(),t.includeTargets))};var jA=BA;function BA(e){this.targetMatcher=e}zA.of=function(e,t){return new zA(new ib("SPLIT_URL",H()),t,e)};var HA=zA;function zA(e,t,r){this.key=e,this.user=t,this.workspace=r}GA.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var KA=GA;function GA(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}YA.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(YA.SPLIT_URL_CONFIG_KEY,"")),r=kn.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},YA.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},YA.prototype.resolveManualRedirectUrl=function(e,t){e=Bo.tryParse(e);return e?this.decorateCampaign(e,t):null},YA.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(_i.isNotEmptyString(t)){for(var t=this.campaignParser.parse(t),r=e,n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],o=o[1];_i.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},YA.SPLIT_URL_CONFIG_KEY="redirectUrl";var JA=YA;function YA(e){this.campaignParser=e}qA.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return u.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},qA.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},qA.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var WA=qA;function qA(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}XA.prototype.setNeedDispatch=function(e){this.needDispatch=e},XA.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(XA.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},XA.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var $A=XA;function XA(){this.needDispatch=!0}QA.prototype.get=function(){var e=this.storage.getItem(pt);if(u.isNullOrUndefined(e))return null;try{var t=JSON.parse(e);return this.sdk.version!==t.version?(this.clear(),null):t}catch(e){return this.clear(),null}},QA.prototype.set=function(e){e=c(c({},e),{version:this.sdk.version});this.storage.setItem(pt,JSON.stringify(e))},QA.prototype.clear=function(){this.storage.removeItem(pt)};var ZA=QA;function QA(e,t){this.sdk=e,this.storage=t}var eS=s.log,tS=(rS.prototype.install=function(e){void 0===e&&(e=null);try{var t=this.changeLifecycle.bind(this);window.addEventListener("pageshow",function(){return t("pageshow")}),window.addEventListener("pagehide",function(){return t("pagehide")}),document.addEventListener("visibilitychange",function(){return t(document.visibilityState)}),window.addEventListener("blur",function(){return t("blur")}),window.addEventListener("focus",function(){return t("focus")}),rS.isSafariBrowser(e)&&window.addEventListener("beforeunload",function(){return t("hidden")}),history.pushState=(n=history.pushState,function(){try{var e=n.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&eS.error(e)}}),history.replaceState=(r=history.replaceState,function(){try{var e=r.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&eS.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&eS.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&eS.error(e)}var r,n},rS.prototype.addListener=function(e){this.listeners.push(e)},rS.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},rS.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},rS.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},rS.isSafariBrowser=function(e){return!u.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},rS);function rS(e){void 0===e&&(e=Le.instance),this.clock=e,this.listeners=[],this._initialized=!1}iS.create=function(e,t,r){return void 0===r&&(r=Le.instance),new iS(new oS(r,e,t))},iS.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var nS=iS;function iS(e){this.limiter=e}sS.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},sS.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new aS(e+this.intervalMillis,this.limit)),this.currentScope};var oS=sS;function sS(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}uS.prototype.isExpired=function(e){return this.expirationTime<e},uS.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var aS=uS;function uS(e,t){this.expirationTime=e,this.token=t}lS.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var cS=lS;function lS(e){this.determiners=e}pS.prototype.isDedupTarget=function(e){if(-1===this.dedupIntervalMillis)return!1;Me.isEquals(e.user.identifiers,null==(t=this.currentUser)?void 0:t.identifiers)||(this.currentUser=e.user,this.cache={});var t=this.cacheKey(e),e=this.clock.currentMillis(),r=this.cache[t];return void 0!==r&&e-r<=this.dedupIntervalMillis||(this.cache[t]=e,!1)};Ca=pS;function pS(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}Ae(dS,fS=Ca),dS.prototype.supports=function(e){return M0.isRemoteConfigEvent(e)},dS.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var fS,hS=dS;function dS(e,t){return void 0===t&&(t=Le.instance),fS.call(this,e,t)||this}Ae(gS,yS=Ca),gS.prototype.supports=function(e){return M0.isExposureEvent(e)},gS.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var yS,vS=gS;function gS(e,t){return void 0===t&&(t=Le.instance),yS.call(this,e,t)||this}ES.prototype.isInvocatorResponse=function(e){return"object"==typeof e&&null!==e&&"success"in e&&"boolean"==typeof e.success&&"message"in e&&"string"==typeof e.message},ES.prototype.resolve=function(e){e=JSON.parse(null!=e?e:"");if(!this.isInvocatorResponse(e))throw new Error("invalid invocator response data");if(e.success)return{message:e.message,success:e.success,data:e.data};throw new Error("failed response")};var mS=ES;function ES(){}bS.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters}}},bS.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var wS=bS;function bS(e){this.invocator=e}var TS=s.log,_S=(OS.prototype.onPageStarted=function(e,t){this.track(e,t)},OS.prototype.onPageEnded=function(e,t){},OS.prototype.track=function(e,t){TS.debug("tracking page view");var r,e={key:OS.PAGE_VIEW_EVENT_KEY,properties:((r={})[OS.PAGE_NAME_PROPERTY_KEY]=e.pageTitle,r)};this.core.track(e,this.userManager.resolve(),t)},OS.PAGE_VIEW_EVENT_KEY="$page_view",OS.PAGE_NAME_PROPERTY_KEY="$page_name",OS);function OS(e,t){this.core=e,this.userManager=t}Object.defineProperty(NS.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:Co.createWithCurrentPage()},enumerable:!1,configurable:!0}),NS.prototype.updatePage=function(e,t){var r=this._currentPage;r&&e.isEquals(r)||(r&&this.publishEnd(r,t),this._currentPage=e,this.publishStart(e,t))},NS.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},NS.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},NS.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=Co.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},NS.prototype.addListener=function(e){this.listeners.push(e)};var IS=NS;function NS(){this.listeners=[],this._currentPage=null}var AS=s.log,SS=(Object.defineProperty(RS.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),RS.prototype.startEngagement=function(e){AS.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},RS.prototype.endEngagement=function(e,t){var r;u.isNullOrUndefined(this._lastEngagementTime)||(r=this._lastEngagementTime,(r=(this._lastEngagementTime=t)-r)<this.minimumEngagementDurationMillis||this.publish({page:e,durationMillis:r},this.userManager.resolve(),t))},RS.prototype.publish=function(e,t,r){AS.debug("onEngagement timestamp:".concat(r,", page:").concat(this.pageManager.currentPage.url));for(var n=0,i=this.listeners;n<i.length;n++)i[n].onEngagement(e,t,r)},RS.prototype.onPageStarted=function(e,t){this.startEngagement(t)},RS.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},RS.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"focus":return this.startEngagement(t);case"pagehide":case"hidden":case"blur":return this.endEngagement(this.pageManager.currentPage,t);case"pageshow":case"locationChange":return}},RS.prototype.addListener=function(e){this.listeners.push(e)},RS);function RS(e,t,r){this.userManager=e,this.pageManager=t,this.minimumEngagementDurationMillis=r,this.listeners=[],this._lastEngagementTime=null}CS.prototype.onEngagement=function(e,t,r){var n,e={key:CS.ENGAGEMENT_EVENT_KEY,properties:((n={})[_S.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,n[CS.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,n)};this.core.track(e,t,r)},CS.ENGAGEMENT_EVENT_KEY="$engagement",CS.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var MS=CS;function CS(e){this.core=e}PS.prototype.setPhoneNumber=function(e,t){e=(new Io).set(PS.PHONE_NUMBER_PROPERTY_KEY,e.getValue()).build().toSecuredEvent();this.track(e,t)},PS.prototype.unsetPhoneNumber=function(e){var t=(new Io).unset(PS.PHONE_NUMBER_PROPERTY_KEY).build().toSecuredEvent();this.track(t,e)},PS.prototype.track=function(e,t){var r=this.userManager.resolve();this.core.track(e,r,t)},PS.PHONE_NUMBER_PROPERTY_KEY="$phone_number";var xS=PS;function PS(e,t){this.core=e,this.userManager=t}var US=s.log,kS=null;function DS(e,t){var r,t=FN.config(t);FN.logging(t);try{if((r=window)&&"_hackleApp"in r&&null!==r._hackleApp&&"object"==typeof r._hackleApp&&("getAppSdkKey"in r._hackleApp&&"function"==typeof r._hackleApp.getAppSdkKey&&("getInvocationType"in r._hackleApp&&"function"==typeof r._hackleApp.getInvocationType))&&e===window._hackleApp.getAppSdkKey()){var n=e,i=t,o=window._hackleApp,s=(new PA).getInvocator(o.getInvocationType(),new mS);if(null===s)throw new Error("Failed to get invocator with invocationType:".concat(o.getInvocationType()));if(s=new wS(s),s=new Zo(s),!o.getAppMode)return s;if((o=o.getAppMode().toLowerCase())===$o.native)return s;if(o!==$o.web_view_wrapper)throw new Error("Unsupported HackleAppMode: ".concat(o));return o=LS(n,i),(n=new Qo(o,s)).syncUser(),n}}catch(e){US.error("Unexpected exception while check WebApp client: ".concat(e))}return LS(e,t)}function LS(e,t){var r=FN.sdk(e,t);if(kS)return US.debug("use already exists hackleClient"),kS;var n=new Go,i=(n.initialize(),new NO),o=zo.getInstance({days:$e,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),s=FN.isBeaconSupported(),a=TA.intercept(r,OA.create()),u=TA.intercept(r,NA.create()),c=a,l=(s&&(c=u),new jN),p=new HN(l,new KN("setTimeout"),FN.pollingIntervalMillis(t)),f=new ZA(r,SO.postfix(i,"_".concat(e.slice(0,8)))),h=new ZN(UO.clientFetch(t.sdkUrl,r.key),a),f=new sA(f,h),h=(l.add(f),new IS),d=new rA(UO.userTargets(t.sdkUrl),a),y=new eA(UO.userCohorts(t.sdkUrl),a),v=new _N(h),g=new EO(SO.postfix(o,"_".concat(e))),m=g.getUser(),E=t.user||null,g=new gO(Yo(),g,d,y,v,h,Le.instance,m,E),d=(l.add(g),new OO(t.sessionTimeoutMillis,SO.postfix(o,"_".concat(e.slice(8))))),y=(g.addListener(d),new nO(i,"".concat(Qe,"_").concat(e),Ye)),E=new lA(UO.clientDispatch(t.eventUrl),a),l=E,s=(s&&(l=new lA(UO.beaconDispatch(t.eventUrl,r.key),u)),new fA(y,E)),r=new uA(E,l,s),u=new cS([new hS(FN.dedupIntervalMillis(t)),new vS(FN.dedupIntervalMillis(t))]),y=new mA(r,Ye,new KN("setTimeout"),qe),E=new z0(y,u,d,g),w=new $A,l=new yb(new MO(o,"".concat(ot,"_").concat(e.slice(0,8)))),r=new yb(new MO(o,"".concat(st,"_").concat(e.slice(0,8)))),u=new DO(SO.prefix(i,"".concat(at,"_").concat(e.slice(0,8),"_"))),i=new kI(SO.prefix(i,"".concat(ut,"_").concat(e.slice(0,8),"_"))),b=Y_.create(f,E,[l,r],u),T=new xS(b,g),e=new yN(new gN(SO.postfix(o,"_".concat(e.slice(0,8)))),v,b,g),_=new B0(g,b),_=(d.addListener(e),d.addListener(_),new rI(b)),u=new FO([new jO,new HO(new nN),new KO(new nN),new JO(u,Le.instance),new WO(new oN),new $O(new oN),new ZO(new aN),new eI(new aN)]),u=new LI([new VI(i),new zI(u),new BI]),_=new GI(Le.instance,_,u),u=new qI([new XI,new QI(_),new tN(_)]),O=new bI(UO.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),O=new iI(EI.create(O),_,u),_=new YI(new _I(k_.get("targetMatcher")),new AI(i)),u=new cI(f,_,b),i=(new sI(y,u,O),new kN(f)),_=(new PN(y,i),new SS(g,h,ht)),u=(h.addListener(_),new MS(b)),y=(_.addListener(u),new _S(b,g)),i=(t.automaticPageTracking&&h.addListener(y),new jA(k_.get("targetMatcher"))),u=new WA(o,ct,{days:lt}),o=new FA(f,i,u,b),f=new KA(new JA(v),new cN,u,w),i=new kA(o,f,g,b),v=(h.addListener(i),new xO(b,g,l,r)),f=(null==(u=t.devTool)?void 0:u.userExplorer)&&"function"==typeof(null==(o=t.devTool)?void 0:o.userExplorer),i=t.devTool&&f?{manager:t.devTool,userExplorer:v}:void 0,l=new Di(UO.monitoring(t.monitoringUrl),a,c,new KN("setTimeout"),We),I=(bi.addRegistry(l),new tS),r=(I.addListener(h),I.addListener(_),I.addListener(d),I.addListener(n),I.addListener(s),I.addListener(E),I.addListener(l),p.start(),nS.create(ft,1)),N=new Do(b,p,d,g,T,r,y,O,i),u=(kS=N,(new X_).install(b,g),g.resolve().hackleProperties.browserName);return I.install("string"==typeof u?u:null),o=Date.now(),f=g.currentUser,v=d.currentSessionId,(oO(m,f)?d.startNewSessionIfNeeded(f,o):d.startNewSession(m,f,o))===v&&e.startNewCampaignIfNeeded(f,o),N.onReady(function(){t.autoOpenDevTool&&(t.devTool?N.showUserExplorer():US.error("DevTool is not provided")),I.initialize(),w.dispatchDoneEventIfNeeded()}),N}var FS=function(e,t){return(FS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var VS=function(){return(VS=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function jS(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}BS.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},BS.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},BS.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};ea=BS;function BS(){this.listeners={}}zS.arePropertiesEqual=function(e,t){var r=zS.coerceUnknownToProperties(e),n=zS.coerceUnknownToProperties(t),e=Object.keys(r),t=Object.keys(n);return e.length===t.length&&e.every(function(e){return e in n&&r[e]===n[e]})},zS.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var HS=zS;function zS(){}GS.isUserEqual=function(e,t){return(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(null==e?void 0:e.deviceId)===(null==t?void 0:t.deviceId)&&(null==e?void 0:e.userId)===(null==t?void 0:t.userId)&&HS.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&HS.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var KS=GS;function GS(){}var JS=function(n){var e=i,t=n;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}function i(e,t){var r=n.call(this)||this;return r._currentUser=null,r.client=DS(e,VS(VS({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.42.0"})),r.getUser=r.getUser.bind(r),r.setUser=r.setUser.bind(r),r.setUserId=r.setUserId.bind(r),r.setDeviceId=r.setDeviceId.bind(r),r.setUserProperty=r.setUserProperty.bind(r),r.updateUserProperties=r.updateUserProperties.bind(r),r.resetUser=r.resetUser.bind(r),r.variation=r.variation.bind(r),r.variationDetail=r.variationDetail.bind(r),r.isFeatureOn=r.isFeatureOn.bind(r),r.featureFlagDetail=r.featureFlagDetail.bind(r),r.track=r.track.bind(r),r.trackPageView=r.trackPageView.bind(r),r.remoteConfig=r.remoteConfig.bind(r),r.onReady=r.onReady.bind(r),r.onInitialized=r.onInitialized.bind(r),r.emitUpdatedUser=r.emitUpdatedUser.bind(r),r.showUserExplorer=r.showUserExplorer.bind(r),r.hideUserExplorer=r.hideUserExplorer.bind(r),r.fetch=r.fetch.bind(r),r.setInAppMessageListener=r.setInAppMessageListener.bind(r),null!=t&&t.devTool&&null!=t&&t.autoOpenDevTool&&"undefined"!=typeof window&&r.showUserExplorer(),r}return FS(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r),i.prototype.getUser=function(){return this.client.getUser()},i.prototype.setUser=function(e){this.client.setUser(e),this.emitUpdatedUser(this.getUser())},i.prototype.setUserId=function(e){this.client.setUserId(e),this.emitUpdatedUser(this.getUser())},i.prototype.setDeviceId=function(e){this.client.setDeviceId(e),this.emitUpdatedUser(this.getUser())},i.prototype.setUserProperty=function(e,t){this.client.setUserProperty(e,t),this.emitUpdatedUser(this.getUser())},i.prototype.updateUserProperties=function(e){this.client.updateUserProperties(e),this.emitUpdatedUser(this.getUser())},i.prototype.resetUser=function(){this.client.resetUser(),this.emitUpdatedUser(this.getUser())},i.prototype.variation=function(e,t,r){return this.client.variation(e,t||void 0,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t||void 0,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t||void 0)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t||void 0)},i.prototype.track=function(e,t){this.client.track(e,t||void 0)},i.prototype.trackPageView=function(e){this.client.trackPageView(VS(VS({},e),{user:(null==e?void 0:e.user)||void 0}))},i.prototype.remoteConfig=function(e){return this.client.remoteConfig(e||void 0)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i.prototype.emitUpdatedUser=function(e){KS.isUserEqual(this._currentUser,e)||this.emit("user-updated",e),this._currentUser=e},i.prototype.showUserExplorer=function(){this.client.showUserExplorer()},i.prototype.hideUserExplorer=function(){this.client.hideUserExplorer()},i.prototype.fetch=function(){return this.client.fetch()},i.prototype.setInAppMessageListener=function(e){this.client.setInAppMessageListener(e)},i.prototype.setPhoneNumber=function(e){this.client.setPhoneNumber(e)},i.prototype.unsetPhoneNumber=function(){this.client.unsetPhoneNumber()},i}(ea);var k={exports:{}},b={},YS=Object.getOwnPropertySymbols,WS=Object.prototype.hasOwnProperty,qS=Object.prototype.propertyIsEnumerable;var T=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))WS.call(r,o)&&(n[o]=r[o]);if(YS)for(var s=YS(r),a=0;a<s.length;a++)qS.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},$S=T,i="function"==typeof Symbol&&Symbol.for,XS=i?Symbol.for("react.element"):60103,ZS=i?Symbol.for("react.portal"):60106,Rp=i?Symbol.for("react.fragment"):60107,g=i?Symbol.for("react.strict_mode"):60108,Up=i?Symbol.for("react.profiler"):60114,QS=i?Symbol.for("react.provider"):60109,eR=i?Symbol.for("react.context"):60110,tR=i?Symbol.for("react.forward_ref"):60112,Ea=i?Symbol.for("react.suspense"):60113,rR=i?Symbol.for("react.memo"):60115,nR=i?Symbol.for("react.lazy"):60116,iR="function"==typeof Symbol&&Symbol.iterator;function oR(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var sR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},aR={};function uR(e,t,r){this.props=e,this.context=t,this.refs=aR,this.updater=r||sR}function cR(){}function lR(e,t,r){this.props=e,this.context=t,this.refs=aR,this.updater=r||sR}uR.prototype.isReactComponent={},uR.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(oR(85));this.updater.enqueueSetState(this,e,t,"setState")},uR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},cR.prototype=uR.prototype;var o=lR.prototype=new cR,pR=(o.constructor=lR,$S(o,uR.prototype),o.isPureReactComponent=!0,{current:null}),fR=Object.prototype.hasOwnProperty,hR={key:!0,ref:!0,__self:!0,__source:!0};function dR(e,t,r){var n,i={},o=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)fR.call(t,n)&&!hR.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:XS,type:e,key:o,ref:s,props:i,_owner:pR.current}}function yR(e){return"object"==typeof e&&null!==e&&e.$$typeof===XS}var vR=/\/+/g,gR=[];function mR(e,t,r,n){var i;return gR.length?((i=gR.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function ER(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,gR.length<10&&gR.push(e)}function wR(e,t,r){return null==e?0:function e(t,r,n,i){var o=!1;if(null===(t="undefined"!=(a=typeof t)&&"boolean"!==a?t:null))o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case XS:case ZS:o=!0}}if(o)return n(i,t,""===r?"."+bR(t,0):r),1;if(o=0,r=""===r?".":r+":",Array.isArray(t))for(var s=0;s<t.length;s++){var a,u=r+bR(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=iR&&t[iR]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+bR(a,s++),n,i);else if("object"===a)throw n=""+t,Error(oR(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function bR(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function TR(e,t){e.func.call(e.context,t,e.count++)}function _R(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?OR(e,n,r,function(e){return e}):null!=e&&(yR(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(vR,"$&/")+"/")+r,e={$$typeof:XS,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function OR(e,t,r,n,i){var o="";wR(e,_R,t=mR(t,o=null!=r?(""+r).replace(vR,"$&/")+"/":o,n,i)),ER(t)}var IR={current:null};function NR(){var e=IR.current;if(null===e)throw Error(oR(321));return e}var AR,SR,RR,Su={ReactCurrentDispatcher:IR,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:pR,IsSomeRendererActing:{current:!1},assign:$S},O=(b.Children={map:function(e,t,r){if(null==e)return e;var n=[];return OR(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;wR(e,TR,t=mR(null,null,t,r)),ER(t)},count:function(e){return wR(e,function(){return null},null)},toArray:function(e){var t=[];return OR(e,t,null,function(e){return e}),t},only:function(e){if(yR(e))return e;throw Error(oR(143))}},b.Component=uR,b.Fragment=Rp,b.Profiler=Up,b.PureComponent=lR,b.StrictMode=g,b.Suspense=Ea,b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Su,b.cloneElement=function(e,t,r){if(null==e)throw Error(oR(267,e));var n=$S({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref,s=pR.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)fR.call(t,a)&&!hR.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==u?u:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];n.children=u}return{$$typeof:XS,type:e.type,key:i,ref:o,props:n,_owner:s}},b.createContext=function(e,t){return(e={$$typeof:eR,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:QS,_context:e},e.Consumer=e},b.createElement=dR,b.createFactory=function(e){var t=dR.bind(null,e);return t.type=e,t},b.createRef=function(){return{current:null}},b.forwardRef=function(e){return{$$typeof:tR,render:e}},b.isValidElement=yR,b.lazy=function(e){return{$$typeof:nR,_ctor:e,_status:-1,_result:null}},b.memo=function(e,t){return{$$typeof:rR,type:e,compare:void 0===t?null:t}},b.useCallback=function(e,t){return NR().useCallback(e,t)},b.useContext=function(e,t){return NR().useContext(e,t)},b.useDebugValue=function(){},b.useEffect=function(e,t){return NR().useEffect(e,t)},b.useImperativeHandle=function(e,t,r){return NR().useImperativeHandle(e,t,r)},b.useLayoutEffect=function(e,t){return NR().useLayoutEffect(e,t)},b.useMemo=function(e,t){return NR().useMemo(e,t)},b.useReducer=function(e,t,r){return NR().useReducer(e,t,r)},b.useRef=function(e){return NR().useRef(e)},b.useState=function(e){return NR().useState(e)},b.version="16.14.0",{}),wa=Function.call.bind(Object.prototype.hasOwnProperty),MR=function(){};function CR(e,t,r,n,i){if("production"!==production)for(var o in e)if(RR(e,o)){var s,a;try{if("function"!=typeof e[o])throw(a=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;s=e[o](t,o,n,r,null,AR)}catch(e){s=e}!s||s instanceof Error||MR((n||"React class")+": type specification of "+r+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in SR)&&(SR[s.message]=!0,o=i?i():"",MR("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(AR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",SR={},RR=wa,MR=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),CR.resetWarningCache=function(){"production"!==production&&(SR={})},"production"!==production){var xR=T,PR=CR,_="function"==typeof Symbol&&Symbol.for,UR=_?Symbol.for("react.element"):60103,kR=_?Symbol.for("react.portal"):60106,DR=_?Symbol.for("react.fragment"):60107,LR=_?Symbol.for("react.strict_mode"):60108,FR=_?Symbol.for("react.profiler"):60114,VR=_?Symbol.for("react.provider"):60109,jR=_?Symbol.for("react.context"):60110,BR=_?Symbol.for("react.concurrent_mode"):60111,HR=_?Symbol.for("react.forward_ref"):60112,zR=_?Symbol.for("react.suspense"):60113,KR=_?Symbol.for("react.suspense_list"):60120,GR=_?Symbol.for("react.memo"):60115,JR=_?Symbol.for("react.lazy"):60116,YR=_?Symbol.for("react.block"):60121,WR=_?Symbol.for("react.fundamental"):60117,qR=_?Symbol.for("react.responder"):60118,$R=_?Symbol.for("react.scope"):60119,XR="function"==typeof Symbol&&Symbol.iterator,ZR="@@iterator";function QR(e){if(null===e||"object"!=typeof e)return null;e=XR&&e[XR]||e[ZR];return"function"==typeof e?e:null}var eM={current:null},tM={current:null},rM=/^(.*)[\\\/]/,nM=1;function iM(e){if(null==e)return null;if("number"==typeof e.tag&&lM("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case DR:return"Fragment";case kR:return"Portal";case FR:return"Profiler";case LR:return"StrictMode";case zR:return"Suspense";case KR:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case jR:return"Context.Consumer";case VR:return"Context.Provider";case HR:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case GR:return iM(e.type);case YR:return iM(e.render);case JR:r=(t=e)._status===nM?t._result:null;if(r)return iM(r)}var t,r;return null}var oM={},sM=null;function aM(e){sM=e}oM.getCurrentStack=null,oM.getStackAddendum=function(){var e,t,r,n,i,o="",s=(sM&&(e=iM(sM.type),r=sM._owner,o+=(e=e,t=sM._source,r=r&&iM(r.type),i="",t?(n=(s=t.fileName).replace(rM,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match(rM))&&(s=s[1])?s.replace(rM,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),oM.getCurrentStack);return s&&(o+=s()||""),o};var uM={ReactCurrentDispatcher:eM,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:tM,IsSomeRendererActing:{current:!1},assign:xR};function cM(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];pM("warn",e,r)}function lM(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];pM("error",e,r)}function pM(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=uM.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var i=0,o="Warning: "+t.replace(/%s/g,function(){return r[i++]});throw new Error(o)}catch(e){}}xR(uM,{ReactDebugCurrentFrame:oM,ReactComponentTreeHook:{}});var fM={};function hM(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;fM[r]||(lM("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),fM[r]=!0)}var dM={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){hM(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){hM(e,"replaceState")},enqueueSetState:function(e,t,r,n){hM(e,"setState")}},yM={};function vM(e,t,r){this.props=e,this.context=t,this.refs=yM,this.updater=r||dM}Object.freeze(yM),vM.prototype.isReactComponent={},vM.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},vM.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var gM,mM={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(gM in mM)mM.hasOwnProperty(gM)&&!function(e,t){Object.defineProperty(vM.prototype,e,{get:function(){cM("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(gM,mM[gM]);function EM(){}function wM(e,t,r){this.props=e,this.context=t,this.refs=yM,this.updater=r||dM}EM.prototype=vM.prototype,(_=wM.prototype=new EM).constructor=wM,xR(_,vM.prototype),_.isPureReactComponent=!0;var bM,TM,_M=Object.prototype.hasOwnProperty,OM={key:!0,ref:!0,__self:!0,__source:!0};function IM(e){if(_M.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function NM(e){if(_M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var AM={},SM=function(e,t,r,n,i,o,s){e={$$typeof:UR,type:e,key:t,ref:r,props:s,_owner:o,_store:{}};return Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function RM(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in IM(t)&&(s=t.ref,"string"==typeof(c=t).ref&&tM.current&&c.__self&&tM.current.stateNode!==c.__self&&(p=iM(tM.current.type),AM[p]||(lM('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',iM(tM.current.type),c.ref),AM[p]=!0))),NM(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)_M.call(t,n)&&!OM.hasOwnProperty(n)&&(i[n]=t[n]);var c,l,p,f,h=arguments.length-2;if(1==h)i.children=r;else if(1<h){for(var d=Array(h),y=0;y<h;y++)d[y]=arguments[y+2];Object.freeze&&Object.freeze(d),i.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===i[n]&&(i[n]=v[n])}function g(){TM||(TM=!0,lM("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",l))}function m(){bM||(bM=!0,lM("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}return(o||s)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,o&&(p=i,f=c,m.isReactWarning=!0,Object.defineProperty(p,"key",{get:m,configurable:!0})),s&&(r=i,l=c,g.isReactWarning=!0,Object.defineProperty(r,"ref",{get:g,configurable:!0}))),SM(e,o,s,a,u,tM.current,i)}function MM(e){return"object"==typeof e&&null!==e&&e.$$typeof===UR}var CM=".",xM=":",PM=!1,UM=/\/+/g;function kM(e){return(""+e).replace(UM,"$&/")}var DM=10,LM=[];function FM(e,t,r,n){var i;return LM.length?((i=LM.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function VM(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,LM.length<DM&&LM.push(e)}function jM(e,t,r){return null==e?0:function e(t,r,n,i){var o,s=typeof t,a=!1;if(null===(t="undefined"!=s&&"boolean"!=s?t:null))a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case UR:case kR:a=!0}}if(a)return n(i,t,""===r?CM+BM(t,0):r),1;var u=0,c=""===r?CM:r+xM;if(Array.isArray(t))for(var l=0;l<t.length;l++)u+=e(o=t[l],c+BM(o,l),n,i);else if("function"==typeof(r=QR(t))){r===t.entries&&(PM||cM("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),PM=!0);for(var p,f=r.call(t),h=0;!(p=f.next()).done;)u+=e(o=p.value,c+BM(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+oM.getStackAddendum(),s=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==s?"object with keys {"+Object.keys(t).join(", ")+"}":s)+")."+r);return u}(e,"",t,r)}function BM(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function HM(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function zM(e,t,r){var n=e.result,i=e.keyPrefix,o=e.func,s=e.context,o=o.call(s,t,e.count++);Array.isArray(o)?KM(o,n,r,function(e){return e}):null!=o&&(MM(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":kM(o.key)+"/")+r,o=SM(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function KM(e,t,r,n,i){var o="",t=FM(t,o=null!=r?kM(r)+"/":o,n,i);jM(e,zM,t),VM(t)}function GM(e){return"string"==typeof e||"function"==typeof e||e===DR||e===BR||e===FR||e===LR||e===zR||e===KR||"object"==typeof e&&null!==e&&(e.$$typeof===JR||e.$$typeof===GR||e.$$typeof===VR||e.$$typeof===jR||e.$$typeof===HR||e.$$typeof===WR||e.$$typeof===qR||e.$$typeof===$R||e.$$typeof===YR)}function JM(){var e=eM.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function YM(){if(tM.current){var e=iM(tM.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var WM=!1,qM={};function $M(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=YM())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),qM[t=r]||(qM[t]=!0,r="",e&&e._owner&&e._owner!==tM.current&&(r=" It was passed a child from "+iM(e._owner.type)+"."),aM(e),lM('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',t,r),aM(null)))}function XM(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];MM(n)&&$M(n,t)}else if(MM(e))e._store&&(e._store.validated=!0);else if(e){var i=QR(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)MM(o.value)&&$M(o.value,t)}}function ZM(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=iM(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==HR&&t.$$typeof!==GR)return;r=t.propTypes}r?(aM(e),PR(r,e.props,"prop",n,oM.getStackAddendum),aM(null)):void 0===t.PropTypes||WM||(WM=!0,lM("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||lM("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function QM(e,t,r){var n,i=GM(e),t=(i||(n="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n+=(null!=(t=t)&&void 0!==(t=t.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"")||YM(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===UR?(s="<"+(iM(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,lM("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,n)),RM.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)XM(arguments[o],e);if(e===DR){var s=t;aM(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){lM("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&lM("Invalid attribute `ref` supplied to `React.Fragment`."),aM(null)}else ZM(t);return t}var eC=!1;try{var tC=Object.freeze({}),rC=new Map([[tC,null]]),nC=new Set([tC]);rC.set(0,0),nC.add(0)}catch(e){}function iC(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,i,o=xR({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,l=e._owner;if(null!=t)for(n in IM(t)&&(a=t.ref,l=tM.current),NM(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)_M.call(t,n)&&!OM.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==i?o[n]=i[n]:o[n]=t[n]);var p=arguments.length-2;if(1==p)o.children=r;else if(1<p){for(var f=Array(p),h=0;h<p;h++)f[h]=arguments[h+2];o.children=f}return SM(e.type,s,a,u,c,l,o)}.apply(this,arguments),i=2;i<arguments.length;i++)XM(arguments[i],n.type);return ZM(n),n}function oC(e){var t=QM.bind(null,e);return t.type=e,eC||(eC=!0,cM("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return cM("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}_=QM,O.Children={map:function(e,t,r){if(null==e)return e;var n=[];return KM(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=FM(null,null,t,r),jM(e,HM,t),VM(t)},count:function(e){return jM(e,function(){return null},null)},toArray:function(e){var t=[];return KM(e,t,null,function(e){return e}),t},only:function(e){if(MM(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},O.Component=vM,O.Fragment=DR,O.Profiler=FR,O.PureComponent=wM,O.StrictMode=LR,O.Suspense=zR,O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uM,O.cloneElement=iC,O.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&lM("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:jR,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:VR,_context:r}),i=!1,t={$$typeof:jR,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,lM("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,lM("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=t,r._currentRenderer=null,r._currentRenderer2=null,r},O.createElement=_,O.createFactory=oC,O.createRef=function(){var e={current:null};return Object.seal(e),e},O.forwardRef=function(e){return null!=e&&e.$$typeof===GR?lM("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?lM("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&lM("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||lM("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:HR,render:e}},O.isValidElement=MM,O.lazy=function(e){var t,r,n={$$typeof:JR,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){lM("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){lM("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},O.memo=function(e,t){return GM(e)||lM("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:GR,type:e,compare:void 0===t?null:t}},O.useCallback=function(e,t){return JM().useCallback(e,t)},O.useContext=function(e,t){var r,n=JM();return void 0!==t&&lM("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?lM("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&lM("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},O.useDebugValue=function(e,t){return JM().useDebugValue(e,t)},O.useEffect=function(e,t){return JM().useEffect(e,t)},O.useImperativeHandle=function(e,t,r){return JM().useImperativeHandle(e,t,r)},O.useLayoutEffect=function(e,t){return JM().useLayoutEffect(e,t)},O.useMemo=function(e,t){return JM().useMemo(e,t)},O.useReducer=function(e,t,r){return JM().useReducer(e,t,r)},O.useRef=function(e){return JM().useRef(e)},O.useState=function(e){return JM().useState(e)},O.version="16.14.0"}"production"===production?k.exports=b:k.exports=O;var sC=k.exports,aC=k.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),I=aC.Consumer,uC=aC.Provider;var cC=s.log;function lC(e,t){e=pC(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function pC(e,t){void 0===t&&(t="A");var r=k.exports.useContext(aC),n=r.hackle,i=r.userVersion,o=r.initialized,s=k.exports.useCallback(function(){return o?(null==n?void 0:n.variationDetail(e))||bt.of(t,h.EXCEPTION):bt.of(t,h.SDK_NOT_READY)},[t,e,n,o]),r=jS(k.exports.useState(function(){return n?s():(cC.error("HackleClient is not existed"),bt.of(t,h.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=jS(k.exports.useState(i),2),c=u[0],u=u[1];return dC(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function fC(e){e=hC(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function hC(e){var t=k.exports.useContext(aC),r=t.hackle,n=t.userVersion,i=t.initialized,o=k.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||_t.off(h.EXCEPTION):_t.off(h.SDK_NOT_READY)},[e,r,i]),t=jS(k.exports.useState(function(){return r?o():(cC.error("HackleClient is not existed"),_t.off(h.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=jS(k.exports.useState(n),2),u=a[0],a=a[1];return dC(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function dC(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function yC(e){var t,r=e.experimentKey,e=e.children,n=(r=lC(r)).isLoading,i=r.variation;return n?null:e&&"function"==typeof e?e(i):(k.exports.Children.forEach(e,function(e){k.exports.isValidElement(e)&&(e.props.variation?i===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?k.exports.cloneElement(t,{variation:i}):null)}function vC(e){return e.variation,e=e.children,k.exports.createElement(k.exports.Fragment,null,e)}function gC(e){var t=(r=fC(e.featureKey)).isLoading,r=r.isOn;return t?null:sC.createElement(sC.Fragment,null,e.children(r))}n.Bucket=Ut,n.Cohort=Un,n.Container=sr,n.ContainerGroup=ur,n.CoreVersion=mr,n.Decision=bt,n.DecisionReason=h,n.EXPERIMENT_IMPLEMENTATION_TYPE=Rt,n.EmptyHackleRemoteConfig=It,n.EmptyParameterConfig=Ve,n.EventType=Ft,n.Experiment=Mt,n.FeatureFlagDecision=_t,n.HackleContext=aC,n.HackleContextConsumer=I,n.HackleContextProvider=uC,n.HackleExperiment=yC,n.HackleFeature=gC,n.HackleInAppMessageActionImpl=xn,n.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(i=e.timeout)?3e3:i,i=void 0!==(i=e.supportSSR)&&i,e=e.children,o=jS(k.exports.useState({hackle:t,initialized:!1,userVersion:0}),2),s=o[0],a=o[1];return k.exports.useEffect(function(){null!=r&&t.setUser(r)},[r]),k.exports.useEffect(function(){function e(){a(function(e){return VS(VS({},e),{userVersion:e.userVersion+1})})}return t.on("user-updated",e),function(){t.off("user-updated",e)}},[t]),k.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(function(e){return VS(VS({},e),{initialized:!0})})},function(){a(function(e){return VS(VS({},e),{initialized:!0})})}).catch(function(){a(function(e){return VS(VS({},e),{initialized:!0})})})},[t]),i||s.initialized?sC.createElement(uC,{value:s},e):null},n.HackleVariation=vC,n.IAM_ACTION_AREA=["BUTTON","IMAGE","MESSAGE","X_BUTTON"],n.IAM_ACTION_TYPE=Lr,n.IAM_BEHAVIOR=Dr,n.IAM_DISPLAY_TYPE=Pr,n.IAM_HORIZONTAL_ALIGNMENT=Vr,n.IAM_LAYOUT_TYPE=Ur,n.IAM_ORIENTATION=kr,n.IAM_PLATFORM_TYPE=Cr,n.IAM_STATUS=Mr,n.IAM_TIMEUNIT=xr,n.IAM_VERTICAL_ALIGNMENT=Fr,n.IdentifierType=jt,n.IdentifiersBuilder=zt,n.InAppMessage=jr,n.InAppMessageAction=Mn,n.InAppMessageAlignment=hn,n.InAppMessageBackground=Rn,n.InAppMessageButton=On,n.InAppMessageButtonStyle=Sn,n.InAppMessageContext=sn,n.InAppMessageContextLayout=pn,n.InAppMessageContextMessage=cn,n.InAppMessageDecision=Et,n.InAppMessageDurationCap=Qr,n.InAppMessageEventFrequencyCap=qr,n.InAppMessageEventTrigger=Jr,n.InAppMessageEventTriggerRule=Yr,n.InAppMessageExperimentContext=un,n.InAppMessageIdentifierCap=Xr,n.InAppMessageImage=yn,n.InAppMessageImageAutoScroll=gn,n.InAppMessagePeriodAlways=Hr,n.InAppMessagePeriodCustom=Kr,n.InAppMessagePositionalButton=Nn,n.InAppMessageTargetContext=tn,n.InAppMessageText=En,n.InAppMessageTextAttribute=bn,n.InAppMessageTextStyle=_n,n.InAppMessageUserOverride=nn,n.Logger=s,n.MATCH_OPERATORS=Or,n.MATCH_TYPES=Tr,n.MATCH_VALUE_TYPES=_r,n.MetaVersion=wr,n.ParameterConfiguration=At,n.PropertyOperations=Ao,n.PropertyOperationsBuilder=Io,n.RemoteConfigDecision=gt,n.RemoteConfigParameter=lr,n.RemoteConfigParameterValue=dr,n.RemoteConfigTargetRule=fr,n.SEGMENT_TYPES=Ar,n.Segment=ir,n.Slot=Dt,n.SplitUrlConfig=kn,n.SplitUrlTargets=Ln,n.TARGET_ACTION_TYPES=Ir,n.TARGET_KEY_TYPES=Nr,n.Target=Jt,n.TargetAction=er,n.TargetCondition=Wt,n.TargetKey=$t,n.TargetMatch=Zt,n.TargetRule=rr,n.TargetingType=Sr,n.UserTargetEvent=Vn,n.Variation=xt,n.Version=vr,n.createInstance=function(e,t){return new JS(e,t)},n.getUserId=Yo,n.removeUserId=Wo,n.resolveIdentifiers=Ht,n.sanitizeUser=Gt,n.setUserId=function(e){zo.getInstance().setItem(Ze,e)},n.useFeature=function(e){var t=(n=k.exports.useContext(aC)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e))||!1},[e,t,n]),o=(s=jS(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&cC.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=jS(k.exports.useState(r),2))[0],n=n[1];return dC(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=k.exports.useContext(aC)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||_t.off(h.EXCEPTION)},[e,t,n]),o=(s=jS(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&cC.error("HackleClient is not existed"),_t.off(h.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=jS(k.exports.useState(r),2))[0],n=n[1];return dC(a,r)||(n(r),s(i())),o},n.useLoadableFeature=fC,n.useLoadableFeatureDetail=hC,n.useLoadableRemoteConfig=function(){var e=(o=k.exports.useContext(aC)).hackle,t=o.userVersion,r=o.initialized,n=k.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new It},[e,r]),i=(o=jS(k.exports.useState(function(){return e||cC.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=jS(k.exports.useState(t),2))[0],a=a[1];return dC(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=lC,n.useLoadableVariationDetail=pC,n.useRemoteConfig=function(){var e=(r=k.exports.useContext(aC)).hackle,t=r.userVersion,r=r.initialized,n=k.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new It},[e,r]),i=(o=jS(k.exports.useState(function(){return e||cC.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=jS(k.exports.useState(t),2))[0],r=r[1];return dC(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=k.exports.useContext(aC).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(cC.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=k.exports.useContext(aC)).hackle,n=a.userVersion,i=a.initialized,o=k.exports.useCallback(function(){return i&&(null==r?void 0:r.variation(e))||t},[t,e,r,i]),s=(a=jS(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&cC.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=jS(k.exports.useState(n),2))[0],c=c[1];return dC(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=k.exports.useContext(aC)).hackle,n=i.userVersion,i=i.initialized,o=k.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||bt.of(t,h.EXCEPTION)},[t,e,r,i]),s=(a=jS(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&cC.error("HackleClient is not existed"),bt.of(t,h.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=jS(k.exports.useState(n),2))[0],i=i[1];return dC(u,n)||(i(n),a(o())),s},Object.defineProperty(n,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={})}(this,function(n){"use strict";var D,L=new Uint8Array(16);var F=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var V=[],j=0;j<256;++j)V.push((j+256).toString(16).substr(1));function B(e,t){var t=1<arguments.length&&void 0!==t?t:0,e=(V[e[t+0]]+V[e[t+1]]+V[e[t+2]]+V[e[t+3]]+"-"+V[e[t+4]]+V[e[t+5]]+"-"+V[e[t+6]]+V[e[t+7]]+"-"+V[e[t+8]]+V[e[t+9]]+"-"+V[e[t+10]]+V[e[t+11]]+V[e[t+12]]+V[e[t+13]]+V[e[t+14]]+V[e[t+15]]).toLowerCase();if("string"==typeof(t=e)&&F.test(t))return e;throw TypeError("Stringified UUID is invalid")}function H(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(D=D||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))return D(L);throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return B(n)}var e="3.7.5",G="function"==typeof atob,t="function"==typeof btoa,r="function"==typeof Buffer;const z="function"==typeof TextDecoder?new TextDecoder:void 0,K="function"==typeof TextEncoder?new TextEncoder:void 0;const J=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Y=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(J),W=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,q=String.fromCharCode.bind(String),$="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),X=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Z=e=>e.replace(/[^A-Za-z0-9\+\/]/g,"");var Q=t=>{let r,n,i,o,s="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(n=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(o=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=n<<16|i<<8|o,s+=J[r>>18&63]+J[r>>12&63]+J[r>>6&63]+J[63&r]}return e?s.slice(0,e-3)+"===".substring(e):s};const ee=t?e=>btoa(e):r?e=>Buffer.from(e,"binary").toString("base64"):Q,te=r?e=>Buffer.from(e).toString("base64"):r=>{let n=[];for(let e=0,t=r.length;e<t;e+=4096)n.push(q.apply(null,r.subarray(e,e+4096)));return ee(n.join(""))},re=(e,t=!1)=>t?X(te(e)):te(e),ne=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?q(192|t>>>6)+q(128|63&t):q(224|t>>>12&15)+q(128|t>>>6&63)+q(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),q(240|t>>>18&7)+q(128|t>>>12&63)+q(128|t>>>6&63)+q(128|63&t))},ie=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,oe=e=>e.replace(ie,ne),se=r?e=>Buffer.from(e,"utf8").toString("base64"):K?e=>te(K.encode(e)):e=>ee(oe(e)),ae=(e,t=!1)=>t?X(se(e)):se(e);t=e=>ae(e,!0);const ue=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ce=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return q(55296+(t>>>10))+q(56320+(1023&t));case 3:return q((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return q((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},le=e=>e.replace(ue,ce);var i=t=>{if(t=t.replace(/\s+/g,""),!W.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,n="",i,o;for(let e=0;e<t.length;)r=Y[t.charAt(e++)]<<18|Y[t.charAt(e++)]<<12|(i=Y[t.charAt(e++)])<<6|(o=Y[t.charAt(e++)]),n+=64===i?q(r>>16&255):64===o?q(r>>16&255,r>>8&255):q(r>>16&255,r>>8&255,255&r);return n};const pe=G?e=>atob(Z(e)):r?e=>Buffer.from(e,"base64").toString("binary"):i,fe=r?e=>$(Buffer.from(e,"base64")):e=>$(pe(e).split("").map(e=>e.charCodeAt(0))),he=e=>fe(ve(e)),de=r?e=>Buffer.from(e,"base64").toString("utf8"):z?e=>z.decode(fe(e)):e=>le(pe(e)),ve=e=>Z(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),ye=e=>de(ve(e));function ge(){var e=(e,t)=>Object.defineProperty(String.prototype,e,Ee(t));e("fromBase64",function(){return ye(this)}),e("toBase64",function(e){return ae(this,e)}),e("toBase64URI",function(){return ae(this,!0)}),e("toBase64URL",function(){return ae(this,!0)}),e("toUint8Array",function(){return he(this)})}function me(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Ee(t));e("toBase64",function(e){return re(this,e)}),e("toBase64URI",function(){return re(this,!0)}),e("toBase64URL",function(){return re(this,!0)})}const Ee=e=>({value:e,enumerable:!1,writable:!0,configurable:!0});const we={version:e,VERSION:"3.7.5",atob:pe,atobPolyfill:i,btoa:ee,btoaPolyfill:Q,fromBase64:ye,toBase64:ae,encode:ae,encodeURI:t,encodeURL:t,utob:oe,btou:le,decode:ye,isValid:e=>{if("string"!=typeof e)return!1;e=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},fromUint8Array:re,toUint8Array:he,extendString:ge,extendUint8Array:me,extendBuiltins:()=>{ge(),me()}};be.isNotNullOrUndefined=function(e){return null!=e},be.isNullOrUndefined=function(e){return null==e},be.requiredNotNullOrUndefined=function(e,t){if(void 0===t&&(t=function(){return"Required value is null or undefined"}),this.isNullOrUndefined(e))throw new Error(t());return e},be.fromMap=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r};var u=be;function be(){}Te.mapNotNullOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);u.isNotNullOrUndefined(o)&&r.push(o)}return r},Te.mapOrUndefined=function(e,t){for(var r=Array(),n=0,i=e;n<i.length;n++){var o=t(i[n]);if(u.isNullOrUndefined(o))return;r.push(o)}return r},Te.associateTo=function(e,t,r){for(var n=0,i=e;n<i.length;n++){var o=r(i[n]);t.set(o[0],o[1])}return t},Te.associate=function(e,t){return this.associateTo(e,new Map,t)},Te.associateBy=function(e,t){return this.associate(e,function(e){return[t(e),e]})},Te.associateRecord=function(e,t){for(var r={},n=0,i=e;n<i.length;n++){var o=t(i[n]),s=o[0],o=o[1];r[s]=o}return r},Te.chunked=function(e,t){for(var r=[],n=e.slice();n.length;)r.push(n.splice(0,t));return r},Te.sum=function(e,r){return e.reduce(function(e,t){return e+r(t)},0)};var f=Te;function Te(){}var _e={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},s=(Oe.setLogLevel=function(e){this.logLevel=e=void 0===e?_e.INFO:e},Oe.initCounter=function(t){this.counters=f.associate(Object.keys(_e),function(e){return[e,t(e)]})},Oe._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}if(t instanceof Error)Ne.log(e,r,t.message,t);else try{Ne.log(e,r,t)}catch(e){}},Oe.increment=function(e){var t;null!=(t=null==(t=Oe.counters)?void 0:t.get(e))&&t.increment()},Oe.logLevel=_e.INFO,Oe.log={error:function(e){_e.ERROR<=Oe.logLevel&&(Oe._log("ERROR",e),Oe.increment("ERROR"))},warn:function(e){_e.WARN<=Oe.logLevel&&(Oe._log("WARN",e),Oe.increment("WARN"))},info:function(e){_e.INFO<=Oe.logLevel&&(Oe._log("INFO",e),Oe.increment("INFO"))},debug:function(e){_e.DEBUG<=Oe.logLevel&&(Oe._log("DEBUG",e),Oe.increment("DEBUG"))}},Oe);function Oe(){}Ie.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Ne=Ie;function Ie(){}var Ae=function(e,t){return(Ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function Se(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Ae(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function l(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function Re(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||((n=n||Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}var Me=s.log,Ce=(xe.isEqual=function(e,t){return e.type===t.type&&e.value===t.value},xe.isEquals=function(t,r){if(null==r)return!1;var e=Object.keys(t);return e.length===Object.keys(r).length&&e.every(function(e){return t[e]===r[e]})},xe.sanitize=function(e){var t={};if(u.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=n[r],o=i[0],i=i[1];this.isValidType(o)?(i=this.sanitizeValue(i),u.isNullOrUndefined(i)?Me.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Me.debug("Invalid identifier type. The identifier type must be a string of 128 characters or less. [".concat(o,"]"))}return t},xe.isValidType=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_TYPE_LENGTH)},xe.sanitizeValue=function(e){return"string"==typeof e&&0<e.length&&e.length<=this.MAX_IDENTIFIER_VALUE_LENGTH?e:"number"==typeof e?e.toString():null},xe.MAX_IDENTIFIER_TYPE_LENGTH=128,xe.MAX_IDENTIFIER_VALUE_LENGTH=512,xe);function xe(){}var Pe=s.log,Ue=(ke.sanitize=function(e){var t={};if(u.isNullOrUndefined(e))return t;for(var r=0,n=Object.entries(e);r<n.length;r++){var i,o=n[r],s=o[0],o=o[1];if(Object.keys(t).length>=this.MAX_PROPERTIES_COUNT){Pe.debug("The number of properties cannot exceed 128. Drops excess properties. [".concat(s,", ").concat(o,"]"));break}this.isValidKey(s)?(i=this.sanitizeValue(s,o),u.isNullOrUndefined(i)?Pe.debug("Invalid property value. The property value mus be 'string(..1024)', 'number', 'boolean', or 'array' type. [".concat(o,"]")):t[s]=i):Pe.debug("Invalid property key. The property key must be a string of 128 characters or less. [".concat(s,"]"))}return t},ke.isValidProperty=function(e,t){return this.isValidKey(e)&&this.isValidValue(t)},ke.isValidKey=function(e){return u.isNotNullOrUndefined(e)&&"string"==typeof e&&0<e.length&&e.length<=this.MAX_PROPERTY_KEY_LENGTH},ke.sanitizeValue=function(e,t){var r=this;return"string"==typeof e&&e.startsWith(this.SYSTEM_PROPERTY_KEY_PREFIX)?t:this.isValidValue(t)?Array.isArray(t)?t.filter(function(e){return r.isValidElement(e)}):t:null},ke.isValidValue=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e?e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e?!isNaN(e)&&isFinite(e):"boolean"==typeof e||Array.isArray(e))},ke.isValidElement=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e?0<e.length&&e.length<=this.MAX_PROPERTY_VALUE_LENGTH:"number"==typeof e)},ke.truncateStringValue=function(e){return"string"==typeof e&&e.length>this.MAX_PROPERTY_VALUE_LENGTH?e.slice(0,this.MAX_PROPERTY_VALUE_LENGTH):e},ke.SYSTEM_PROPERTY_KEY_PREFIX="$",ke.MAX_PROPERTIES_COUNT=128,ke.MAX_PROPERTY_KEY_LENGTH=128,ke.MAX_PROPERTY_VALUE_LENGTH=1024,ke);function ke(){}var De=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"],Le=(o.nanosToUnit=function(e,t){switch(t){case"nanoseconds":return e;case"microseconds":return e/(o.C1/o.C0);case"milliseconds":return e/(o.C2/o.C0);case"seconds":return e/(o.C3/o.C0);case"minutes":return e/(o.C4/o.C0);case"hours":return e/(o.C5/o.C0);case"days":return e/(o.C6/o.C0)}},o.microsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C1/o.C0);case"milliseconds":return e/(o.C2/o.C1);case"microseconds":return e;case"seconds":return e/(o.C3/o.C1);case"minutes":return e/(o.C4/o.C1);case"hours":return e/(o.C5/o.C1);case"days":return e/(o.C6/o.C1)}},o.millisToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C2/o.C0);case"microseconds":return e*(o.C2/o.C1);case"milliseconds":return e;case"seconds":return e/(o.C3/o.C2);case"minutes":return e/(o.C4/o.C2);case"hours":return e/(o.C5/o.C2);case"days":return e/(o.C6/o.C2)}},o.secondsToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C3/o.C0);case"microseconds":return e*(o.C3/o.C1);case"milliseconds":return e*(o.C3/o.C2);case"seconds":return e;case"minutes":return e/(o.C4/o.C3);case"hours":return e/(o.C5/o.C3);case"days":return e/(o.C6/o.C3)}},o.minutesToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C4/o.C0);case"microseconds":return e*(o.C4/o.C1);case"milliseconds":return e*(o.C4/o.C2);case"seconds":return e*(o.C4/o.C3);case"minutes":return e;case"hours":return e/(o.C5/o.C4);case"days":return e/(o.C6/o.C4)}},o.hoursToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C5/o.C0);case"microseconds":return e*(o.C5/o.C1);case"milliseconds":return e*(o.C5/o.C2);case"seconds":return e*(o.C5/o.C3);case"minutes":return e*(o.C5/o.C4);case"hours":return e;case"days":return e/(o.C6/o.C5)}},o.daysToUnit=function(e,t){switch(t){case"nanoseconds":return e*(o.C6/o.C0);case"microseconds":return e*(o.C6/o.C1);case"milliseconds":return e*(o.C6/o.C2);case"seconds":return e*(o.C6/o.C3);case"minutes":return e*(o.C6/o.C4);case"hours":return e*(o.C6/o.C5);case"days":return e}},o.C6=24*(o.C5=60*(o.C4=60*(o.C3=1e3*(o.C2=1e3*(o.C1=1e3*(o.C0=1)))))),o.converter={nanoseconds:o.nanosToUnit,microseconds:o.microsToUnit,milliseconds:o.millisToUnit,seconds:o.secondsToUnit,minutes:o.minutesToUnit,hours:o.hoursToUnit,days:o.daysToUnit},o);function o(){}Ve.prototype.tick=function(){return 1e3*Date.now()},Ve.prototype.currentMillis=function(){return Date.now()},Ve.instance=new Ve;var Fe=Ve;function Ve(){}Be.prototype.get=function(e,t){return t};var je=Be;function Be(){this.parameters={}}Ge.prototype.get=function(e,t){e=this.parameters[e];return!u.isNullOrUndefined(e)&&(u.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var He=Ge;function Ge(e){this.parameters=e}var ze="X-HACKLE-SDK-KEY",Ke="X-HACKLE-SDK-NAME",Je="X-HACKLE-SDK-VERSION",Ye="X-HACKLE-SDK-TIME",We=100,qe=6e4,$e=500,Xe=3650,Ze="_hackle_hid",Qe="_hackle_id",et="hackle-repository-storage",tt="_hackle_session_id",rt="_hackle_last_event_ts",nt="_hackle_uid",it="_hackle_did",ot="_hackle_mkt",st="hackle-manual-override_ab",at="hackle-manual-override_ff",ut="hackle-iam-hide",ct="hackle-iam-impression",lt="hackle-split-url-redirected",pt=1/86400*3,ft="hackle-workspace-config",ht=6e4,dt=1e3,vt=s.log;function yt(e,t){e=e.find(function(e){return e===t||e.toLowerCase()===t.toLowerCase()});return e||vt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e}function gt(e,t){if(!u.isNullOrUndefined(t)){for(var r=new Array,n=0,i=t;n<i.length;n++){var o=yt(e,i[n]);if(u.isNullOrUndefined(o))return;r.push(o)}return r}}Et.of=function(e,t){return new Et(e,t)};var mt=Et;function Et(e,t){this.value=e,this.reason=t}bt.prototype.isShow=function(){return u.isNotNullOrUndefined(this.inAppMessage)&&u.isNotNullOrUndefined(this.message)},bt.of=function(e,t,r,n){return new bt(t,r,e,n=void 0===n?{}:n)};var wt=bt;function bt(e,t,r,n){this.inAppMessage=e,this.message=t,this.reason=r,this.properties=n}_t.of=function(e,t,r,n){return new _t(e,t,r=void 0===r?new je:r,n=void 0===n?void 0:n)},Object.defineProperty(_t.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),_t.prototype.get=function(e,t){return this.config.get(e,t)};var Tt=_t;function _t(e,t,r,n){this.variation=e,this.reason=t,this.config=r,this.experiment=n}Nt.on=function(e,t,r){return new Nt(!0,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},Nt.off=function(e,t,r){return new Nt(!1,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},Object.defineProperty(Nt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Nt.prototype.get=function(e,t){return this.config.get(e,t)};var Ot=Nt;function Nt(e,t,r,n){this.isOn=e,this.reason=t,this.config=r,this.experiment=n}At.prototype.get=function(e,t){return t};var It=At;function At(){}Object.defineProperty(Rt.prototype,"parameters",{get:function(){return this.config.parameters},enumerable:!1,configurable:!0}),Rt.fromJson=function(e){return new Rt(e.id,new He(f.associateRecord(e.parameters,function(e){return[e.key,e.value]})))},Rt.prototype.get=function(e,t){switch(typeof t){case"string":case"number":case"boolean":return this.config.get(e,t);default:return t}};var St=Rt;function Rt(e,t){this.id=e,this.config=t}h.SDK_NOT_READY="SDK_NOT_READY",h.EXCEPTION="EXCEPTION",h.INVALID_INPUT="INVALID_INPUT",h.UNSUPPORTED_PLATFORM="UNSUPPORTED_PLATFORM",h.TYPE_MISMATCH="TYPE_MISMATCH",h.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",h.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",h.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",h.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",h.OVERRIDDEN="OVERRIDDEN",h.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",h.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT="NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT",h.IDENTIFIER_NOT_FOUND="IDENTIFIER_NOT_FOUND",h.VARIATION_DROPPED="VARIATION_DROPPED",h.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",h.TRAFFIC_ALLOCATED_BY_TARGETING="TRAFFIC_ALLOCATED_BY_TARGETING",h.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",h.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",h.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",h.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",h.TARGET_RULE_MATCH="TARGET_RULE_MATCH",h.DEFAULT_RULE="DEFAULT_RULE",h.REMOTE_CONFIG_PARAMETER_NOT_FOUND="REMOTE_CONFIG_PARAMETER_NOT_FOUND",h.IN_APP_MESSAGE_NOT_FOUND="IN_APP_MESSAGE_NOT_FOUND",h.IN_APP_MESSAGE_DRAFT="IN_APP_MESSAGE_DRAFT",h.IN_APP_MESSAGE_PAUSED="IN_APP_MESSAGE_PAUSED",h.IN_APP_MESSAGE_HIDDEN="IN_APP_MESSAGE_HIDDEN",h.IN_APP_MESSAGE_TARGET="IN_APP_MESSAGE_TARGET",h.NOT_IN_IN_APP_MESSAGE_PERIOD="NOT_IN_IN_APP_MESSAGE_PERIOD",h.NOT_IN_IN_APP_MESSAGE_TARGET="NOT_IN_IN_APP_MESSAGE_TARGET",h.IN_APP_MESSAGE_FREQUENCY_CAPPED="IN_APP_MESSAGE_FREQUENCY_CAPPED",h.EXPERIMENT_CONTROL_GROUP="EXPERIMENT_CONTROL_GROUP";var p=h;function h(){}var Mt=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Ct=(xt.fromJson=function(e,t,r){var n=xt.experimentStatusOrNull(t.execution.status),i=t.variations.map(function(t){return new Pt(t.id,t.key,"DROPPED"===t.status,r.find(function(e){return e.id===t.parameterConfigurationId}))}),o=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),s=f.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return nr.fromJson(e,Rr.IDENTIFIER)}),a=f.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Yt.fromJson(e,Rr.PROPERTY)}),u=Fn.fromJson(t.execution.targetUrls),c=yt(Mt,t.implementationType),l=f.mapNotNullOrUndefined(t.execution.targetRules,function(e){return nr.fromJson(e,Rr.PROPERTY)}),p=tr.fromJson(t.execution.defaultRule);return n&&c&&p&&new xt(t.id,t.key,e,t.identifierType,n,t.version,t.execution.version,i,o,s,a,u,l,p,t.containerId,c,t.winnerVariationId)},xt.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void vt.debug("Unsupported status [".concat(e,"]"))}},xt.prototype._winnerVariationOrNull=function(){if(this.winnerVariationId)return this._getVariationByIdOrNull(this.winnerVariationId)},xt.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},xt.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},xt);function xt(e,t,r,n,i,o,s,a,u,c,l,p,f,h,d,v,y){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=i,this.version=o,this.executionVersion=s,this.variations=a,this.userOverrides=u,this.segmentOverrides=c,this.targetAudiences=l,this.splitUrlTargets=p,this.targetRules=f,this.defaultRule=h,this.containerId=d,this.implementationType=v,this.winnerVariationId=y}Object.defineProperty(Ut.prototype,"parameters",{get:function(){var e;return null!=(e=null==(e=this.config)?void 0:e.parameters)?e:{}},enumerable:!1,configurable:!0});var Pt=Ut;function Ut(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.config=n}Dt.fromJson=function(e){return new Dt(e.id,e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Lt(t,r,e)}))};var kt=Dt;function Dt(e,t,r,n){this.id=e,this.seed=t,this.slotSize=r,this.slots=n}Ft.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive};var Lt=Ft;function Ft(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}jt.fromJson=function(e){return new jt(e.id,e.key)};var Vt=jt;function jt(e,t){this.id=e,this.key=t}Ht.ID="$id",Ht.USER="$userId",Ht.DEVICE="$deviceId",Ht.SESSION="$sessionId",Ht.HACKLE_DEVICE="$hackleDeviceId";var Bt=Ht;function Ht(){}function Gt(e){var t=new zt;return t.addIdentifiers(e.identifiers||{}),t.add(Bt.ID,e.id),t.add(Bt.DEVICE,e.deviceId),u.isNotNullOrUndefined(e.userId)&&t.add(Bt.USER,e.userId),t.build()}Kt.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},Kt.prototype.add=function(e,t){var r=Ce.sanitizeValue(t);return Ce.isValidType(e)&&r?this.identifiers[e]=t:vt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},Kt.prototype.build=function(){return this.identifiers};var zt=Kt;function Kt(){this.identifiers={}}function Jt(e){var t,r={};return r.id=null!=(t=Ce.sanitizeValue(e.id))?t:void 0,r.userId=null!=(t=Ce.sanitizeValue(e.userId))?t:void 0,r.deviceId=null!=(t=Ce.sanitizeValue(e.deviceId))?t:void 0,"object"==typeof e.properties&&(r.properties=Ue.sanitize(e.properties)),"object"==typeof e.identifiers&&(r.identifiers=Ce.sanitize(e.identifiers)),t=r,Boolean(t.id||t.userId||t.deviceId||t.identifiers&&0<Object.keys(t.identifiers).length)?r:null}Wt.fromJson=function(e,t){return new Wt(f.mapNotNullOrUndefined(e.conditions,function(e){return qt.fromJson(e,t)}))},Wt.prototype.toJson=function(){return{conditions:this.conditions.map(function(e){return e.toJson()})}};var Yt=Wt;function Wt(e){this.conditions=e}$t.fromJson=function(e,t){var r=Xt.fromJson(e.key);if(r&&t.supports(r.type))return(t=Qt.fromJson(e.match))&&new $t(r,t)},$t.prototype.toJson=function(){return{key:this.key.toJson(),match:this.match.toJson()}};var qt=$t;function $t(e,t){this.key=e,this.match=t}Zt.fromJson=function(e){var t=yt(Ar,e.type);return t&&new Zt(t,e.name)},Zt.prototype.toJson=function(){return{type:this.type,name:this.name}};var Xt=Zt;function Zt(e,t){this.type=e,this.name=t}er.fromJson=function(e){var t=yt(_r,e.type),r=yt(Nr,e.operator),n=yt(Or,e.valueType);return t&&r&&n&&new er(t,r,n,e.values)},er.prototype.toJson=function(){return{operator:this.operator,type:this.type,valueType:this.valueType,values:this.values}};var Qt=er;function er(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n}rr.fromJson=function(e){var t=yt(Ir,e.type);return t&&new rr(t,e.variationId,e.bucketId)};var tr=rr;function rr(e,t,r){this.type=e,this.variationId=t,this.bucketId=r}ir.fromJson=function(e,t){t=Yt.fromJson(e.target,t),e=tr.fromJson(e.action);return t&&e&&new ir(t,e)};var nr=ir;function ir(e,t){this.target=e,this.action=t}sr.fromJson=function(e){var t=yt(Sr,e.type);return t&&new sr(e.id,e.key,t,f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Rr.SEGMENT)}))};var or=sr;function sr(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n}ur.fromJson=function(e){return new ur(e.id,e.bucketId,e.groups.map(function(e){return cr.fromJson(e)}))},ur.prototype.getGroupOrNull=function(t){return this.groups.find(function(e){return e.id===t})};var ar=ur;function ur(e,t,r){this.id=e,this.bucketId=t,this.groups=r}lr.fromJson=function(e){return new lr(e.id,e.experiments)};var cr=lr;function lr(e,t){this.id=e,this.experiments=t}fr.fromJson=function(e){var t=yt(Or,e.type),r=f.mapNotNullOrUndefined(e.targetRules,function(e){return hr.fromJson(e,Rr.PROPERTY)}),n=vr.fromJson(e.defaultValue);return t&&new fr(e.id,e.key,t,e.identifierType,r,n)};var pr=fr;function fr(e,t,r,n,i,o){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.targetRules=i,this.defaultValue=o}dr.fromJson=function(e,t){t=Yt.fromJson(e.target,t);return t&&new dr(e.key,e.name,t,e.bucketId,vr.fromJson(e.value))};var hr=dr;function dr(e,t,r,n,i){this.key=e,this.name=t,this.target=r,this.bucketId=n,this.value=i}yr.fromJson=function(e){return new yr(e.id,e.value)};var vr=yr;function yr(e,t){this.id=e,this.rawValue=t}mr.tryParse=function(e){if(e instanceof mr)return e;var t,r,n,i,e=mr.regExp.exec(e);if(e)return e[0],t=e[1],r=e[2],r=void 0===r?"0":r,n=e[3],n=void 0===n?"0":n,i=e[4],e=e[5],new mr(new Er(parseInt(t,10),parseInt(r,10),parseInt(n,10)),br.parse(i),br.parse(e))},mr.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},mr.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},mr.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},mr.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},mr.prototype.isLessThan=function(e){return this.compareTo(e)<0},mr.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},mr.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;var gr=mr;function mr(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}wr.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch};var Er=wr;function wr(e,t,r){this.major=e,this.minor=t,this.patch=r}Tr.parse=function(e){return e?new Tr(e.split(".")):Tr.EMPTY},Tr.prototype.isEmpty=function(){return 0===this.identifiers.length},Tr.prototype.isNotEmpty=function(){return!this.isEmpty()},Tr.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},Tr.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=Tr.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},Tr.compareIdentifiers=function(e,t){return Tr.numericIdentifierRegExp.test(e)&&Tr.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},Tr.EMPTY=new Tr([]),Tr.numericIdentifierRegExp=/^(0|[1-9]\d*)$/;var br=Tr;function Tr(e){this.identifiers=e}var _r=["MATCH","NOT_MATCH"],Or=["STRING","NUMBER","BOOLEAN","VERSION","JSON","URL","NULL","UNKNOWN"],Nr=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE","EXISTS"],Ir=["VARIATION","BUCKET"],Ar=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"],Sr=["USER_ID","USER_PROPERTY"],Rr=(Mr.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},Mr.IDENTIFIER=new Mr("SEGMENT"),Mr.PROPERTY=new Mr("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Mr.SEGMENT=new Mr("USER_ID","USER_PROPERTY","HACKLE_PROPERTY","COHORT","NUMBER_OF_EVENTS_IN_DAYS","NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"),Mr);function Mr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}var Cr=["ACTIVE","DRAFT","PAUSE"],xr=["WEB","ANDROID","IOS"],Pr=["IMMEDIATE","CUSTOM"],Ur=["MODAL","BANNER","BOTTOM_SHEET","NONE"],kr=["IMAGE_TEXT","IMAGE_ONLY","TEXT_ONLY","IMAGE","NONE"],Dr=["VERTICAL","HORIZONTAL"],Lr=["CLICK"],Fr=["CLOSE","WEB_LINK","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"],Vr=["TOP","MIDDLE","BOTTOM"],jr=["LEFT","CENTER","RIGHT"],Br=(Hr.fromJson=function(e){var t,r=yt(Cr,e.status);if(!u.isNullOrUndefined(r)){switch(yt(Pr,e.timeUnit)){case"IMMEDIATE":t=new Gr;break;case"CUSTOM":if(u.isNullOrUndefined(e.startEpochTimeMillis))return;if(u.isNullOrUndefined(e.endEpochTimeMillis))return;t=new Kr(e.startEpochTimeMillis,e.endEpochTimeMillis);break;default:return}var n,i,o=an.fromJson(e.messageContext);if(!u.isNullOrUndefined(o))return n=e.eventTriggerRules.map(Wr.fromJson),i=$r.fromJson(e.eventFrequencyCap),new Hr(e.id,e.key,r,t,new Yr(n,i),rn.fromJson(e.targetContext),o)}},Hr.prototype.supports=function(e){return this.messageContext.platformTypes.includes(e)},Hr);function Hr(e,t,r,n,i,o,s){this.id=e,this.key=t,this.status=r,this.period=n,this.eventTrigger=i,this.targetContext=o,this.messageContext=s}zr.prototype.within=function(e){return!0};var Gr=zr;function zr(){this.type="IMMEDIATE"}Jr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var Kr=Jr;function Jr(e,t){this.startMillisInclusive=e,this.endMillisExclusive=t,this.type="CUSTOM"}var Yr=function(e,t){this.rules=e,this.frequencyCap=t},Wr=(qr.fromJson=function(e){return new qr(e.eventKey,f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Rr.PROPERTY)}))},qr);function qr(e,t){this.eventKey=e,this.targets=t}Xr.fromJson=function(e){return e?new Xr(e.identifiers.map(Zr.fromJson),en.fromJson(e.duration)):null};var $r=Xr;function Xr(e,t){this.identifierCaps=e,this.durationCap=t}Qr.fromJson=function(e){return new Qr(e.identifierType,e.countPerIdentifier)};var Zr=Qr;function Qr(e,t){this.identifierType=e,this.count=t}tn.fromJson=function(e){if(!e)return null;var t=yt(De,e.durationUnit.timeUnit);return t?new tn(Le.converter[t](e.durationUnit.amount,"milliseconds"),e.countPerDuration):null};var en=tn;function tn(e,t){this.durationMillis=e,this.count=t}nn.fromJson=function(e){return new nn(e.overrides.map(on.fromJson),f.mapNotNullOrUndefined(e.targets,function(e){return Yt.fromJson(e,Rr.PROPERTY)}))};var rn=nn;function nn(e,t){this.overrides=e,this.targets=t}sn.fromJson=function(e){return new sn(e.identifierType,e.identifiers)};var on=sn;function sn(e,t){this.identifierType=e,this.identifiers=t}un.fromJson=function(e){var t=null,r=("AB_TEST"===e.exposure.type&&null!==e.exposure.key&&(t=new cn(e.exposure.key)),gt(xr,e.platformTypes));if(!u.isNullOrUndefined(r)){var n=gt(Dr,e.orientations);if(!u.isNullOrUndefined(n)){var i=f.mapOrUndefined(e.messages,ln.fromJson);if(!u.isNullOrUndefined(i))return new un(e.defaultLang,t,r,n,i)}}};var an=un;function un(e,t,r,n,i){this.defaultLang=e,this.experimentContext=t,this.platformTypes=r,this.orientations=n,this.messages=i}var cn=function(e){this.key=e},ln=(pn.fromJson=function(e){var t=fn.fromJson(e.layout);if(!u.isNullOrUndefined(t)){var r=f.mapOrUndefined(e.images,yn.fromJson);if(!u.isNullOrUndefined(r)){var n=void 0;if(!u.isNotNullOrUndefined(e.imageAutoScroll)||(n=mn.fromJson(e.imageAutoScroll),!u.isNullOrUndefined(n))){var i=f.mapOrUndefined(e.buttons,Nn.fromJson);if(!u.isNullOrUndefined(i)){var o=void 0;if(!u.isNotNullOrUndefined(e.closeButton)||(o=Nn.fromJson2(e.closeButton),!u.isNullOrUndefined(o))){var s=f.mapOrUndefined(e.outerButtons,An.fromJson),a=f.mapOrUndefined(e.innerButtons,An.fromJson);if(!u.isNullOrUndefined(s)&&!u.isNullOrUndefined(a))return new pn(e.variationKey,e.lang,t,r,n,e.text?wn.fromJson(e.text):void 0,i,o,new Mn(e.background.color),e.action?Cn.fromJson(e.action):void 0,s,a)}}}}}},pn.prototype.toJson=function(){var e;return{variationKey:this.variationKey,lang:this.lang,layout:{layoutType:this.layout.layoutType,alignment:null!=(e=null==(e=this.layout.alignment)?void 0:e.toJson())?e:null,displayType:this.layout.displayType},images:this.images.map(function(e){return e.toJson()}),imageAutoScroll:null!=(e=null==(e=this.imageAutoScroll)?void 0:e.toJson())?e:null,text:null!=(e=null==(e=this.text)?void 0:e.toJson())?e:null,closeButton:null!=(e=null==(e=this.closeButton)?void 0:e.toCloseButtonJson())?e:null,buttons:this.buttons.map(function(e){return e.toJson()}),background:{color:this.background.color},action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null,outerButtons:this.outerButtons.map(function(e){return e.toJson()}),innerButtons:this.innerButtons.map(function(e){return e.toJson()})}},pn);function pn(e,t,r,n,i,o,s,a,u,c,l,p){this.variationKey=e,this.lang=t,this.layout=r,this.images=n,this.imageAutoScroll=i,this.text=o,this.buttons=s,this.closeButton=a,this.background=u,this.action=c,this.outerButtons=l,this.innerButtons=p}hn.fromJson=function(e){var t=yt(kr,e.layoutType),r=yt(Ur,e.displayType);if(!u.isNullOrUndefined(r)&&!u.isNullOrUndefined(t))return new hn(r,t,e.alignment?dn.fromJson(e.alignment):void 0)};var fn=hn;function hn(e,t,r){this.displayType=e,this.layoutType=t,this.alignment=r}vn.fromJson=function(e){var t=yt(jr,e.horizontal);if(!u.isNullOrUndefined(t)){e=yt(Vr,e.vertical);if(!u.isNullOrUndefined(e))return new vn(t,e)}},vn.prototype.toJson=function(){return{horizontal:this.horizontal,vertical:this.vertical}};var dn=vn;function vn(e,t){this.horizontal=e,this.vertical=t}gn.fromJson=function(e){var t=yt(Dr,e.orientation);if(!u.isNullOrUndefined(t)){var r=void 0;if(!u.isNotNullOrUndefined(e.action)||(r=Cn.fromJson(e.action),!u.isNullOrUndefined(r)))return new gn(t,e.imagePath,r)}},gn.prototype.toJson=function(){var e;return{orientation:this.orientation,imagePath:this.imagePath,action:null!=(e=null==(e=this.action)?void 0:e.toJson())?e:null}};var yn=gn;function gn(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}En.fromJson=function(e){var t=yt(De,e.interval.timeUnit);if(t)return new En(Le.converter[t](e.interval.amount,"milliseconds"))},En.prototype.toJson=function(){return{interval:{timeUnit:"milliseconds",amount:this.intervalMillis}}};var mn=En;function En(e){this.intervalMillis=e}bn.fromJson=function(e){return new bn(Tn.fromJson(e.title),Tn.fromJson(e.body))},bn.prototype.toJson=function(){return{title:{text:this.title.text,style:{textColor:this.title.style.color}},body:{text:this.body.text,style:{textColor:this.body.style.color}}}};var wn=bn;function bn(e,t){this.title=e,this.body=t}_n.fromJson=function(e){return new _n(e.text,new On(e.style.textColor))};var Tn=_n;function _n(e,t){this.text=e,this.style=t}var On=function(e){this.color=e},Nn=(In.fromJson=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new In(e.text,new Rn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},In.fromJson2=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new In("✕",new Rn(e.style.color,"#FFFFFF","#FFFFFF"),t)},In.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},In.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},In);function In(e,t,r){this.text=e,this.style=t,this.action=r}Sn.fromJson=function(e){var t=Nn.fromJson(e.button);if(!u.isNullOrUndefined(t)){e=dn.fromJson(e.alignment);if(!u.isNullOrUndefined(e))return new Sn(t,e)}},Sn.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var An=Sn;function Sn(e,t){this.button=e,this.alignment=t}var Rn=function(e,t,r){this.textColor=e,this.backgroundColor=t,this.borderColor=r},Mn=function(e){this.color=e},Cn=(xn.fromJson=function(e){var t=yt(Lr,e.behavior);if(!u.isNullOrUndefined(t)){var r=yt(Fr,e.type);if(!u.isNullOrUndefined(r))return new xn(t,r,null!=(t=e.value)?t:void 0)}},xn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},xn);function xn(e,t,r){this.behavior=e,this.type=t,this.value=r}Un.fromJson=function(e){var t=e.type,e=e.value,r=this.linkActionTypes.some(function(e){return e===t}),n=this.closeActionTypes.some(function(e){return e===t}),i=this.tabTargetActionsTypes.some(function(e){return e===t}),o=this.windowTargetActionsTypes.some(function(e){return e===t});return new Un(r?"LINK":"CLOSE",n?{hideDurationMillis:"HIDDEN"===t?864e5:null}:void 0,r?{url:null!=e?e:"",target:o?"NEW_WINDOW":i?"NEW_TAB":"CURRENT",shouldCloseAfterLink:n}:void 0)},Un.fromInteraction=function(e){return"CLOSE"===e.type?new Un(e.type,{hideDurationMillis:null}):Un.fromJson(e.action)},Un.fromAction=function(e){return Un.fromJson(e.toJson())},Un.linkActionTypes=["LINK_AND_CLOSE","LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE","WEB_LINK"],Un.closeActionTypes=["CLOSE","HIDDEN","LINK_AND_CLOSE","LINK_NEW_TAB_AND_CLOSE","LINK_NEW_WINDOW_AND_CLOSE"],Un.tabTargetActionsTypes=["LINK_NEW_TAB","LINK_NEW_TAB_AND_CLOSE"],Un.windowTargetActionsTypes=["LINK_NEW_WINDOW","LINK_NEW_WINDOW_AND_CLOSE"];var Pn=Un;function Un(e,t,r){this.type=e,this.close=t,this.link=r}var kn=function(e){this.id=e},Dn=(n.SplitUrlRedirectType=void 0,(n.SplitUrlRedirectType||(n.SplitUrlRedirectType={})).MANUAL="MANUAL",Ln.fromDto=function(e){var t,r=e.needRedirect;return t=e.properties.type,new Ln(r,Object.values(n.SplitUrlRedirectType).includes(t)?e.properties.type:null,e.properties.value)},Ln);function Ln(e,t,r){this.needRedirect=e,this.redirectType=t,this.redirectUrl=r}Vn.fromJson=function(e){if(null!==e)return new Vn(f.mapNotNullOrUndefined(e.match,function(e){return Yt.fromJson(e,Rr.PROPERTY)}),f.mapNotNullOrUndefined(e.notMatch,function(e){return Yt.fromJson(e,Rr.PROPERTY)}))};var Fn=Vn;function Vn(e,t){this.includeTargets=e,this.excludeTargets=t}Bn.fromJson=function(e){return new Bn(e.eventKey,e.property,e.stats)},Bn.prototype.countWithinDays=function(t){return f.sum(this.stats.filter(function(e){return e.date>=t}),function(e){return e.count})};var jn=Bn;function Bn(e,t,r){this.eventKey=e,this.property=t,this.stats=r}Gn.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},Gn.prototype.tag=function(e,t){return this._tags[e]=t,this},Gn.prototype.register=function(e){return e.registerTimer({name:this.name,tags:this._tags,type:"TIMER"})};var Hn=Gn;function Gn(e){this.name=e,this._tags={},this.name=e}Kn.start=function(e){return new Kn(e=void 0===e?Kn.defaultClock:e)},Kn.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},Kn.defaultClock=new Fe;var zn=Kn;function Kn(e){this._clock=e,this.startTime=this._clock.tick()}Yn.prototype.tags=function(e){var r=this;return Object.entries(e).forEach(function(e){var t=e[0],e=e[1];r._tags[t]=e}),this},Yn.prototype.tag=function(e,t){return this._tags[e]=t,this},Yn.prototype.register=function(e){return e.registerCounter({name:this.name,tags:this._tags,type:"COUNTER"})};var Jn=Yn;function Yn(e){this.name=e,this._tags={}}qn.prototype.values=function(){return Array.from(this.data.values())},qn.prototype.keys=function(){return Array.from(this.data.keys())},qn.prototype.get=function(t){var r=this,e=this.keys().find(function(e){return r.compareFn(e,t)});return e?this.data.get(e):void 0},qn.prototype.has=function(e){return void 0!==this.get(e)},qn.prototype.add=function(e,t){t=(t=t)||e;return this.data.set(e,t),this},qn.prototype.delete=function(e){var t;if(this.has(e))return t=this.get(e),this.data.delete(e),t},qn.prototype.forEach=function(e){this.data.forEach(e)},qn.prototype.filter=function(e){for(var t=new qn(this.compareFn),r=0,n=this.entries();r<n.length;r++){var i=n[r];e(i[0],i[1])&&t.add(i[0],i[1])}return t},qn.prototype.entries=function(){return Array.from(this.data.entries())};var Wn=qn;function qn(e){this.compareFn=e,this.data=new Map,this.compareFn=e,this.data=new Map}Object.defineProperty(Xn.prototype,"value",{get:function(){return this.valueSupplier()},enumerable:!1,configurable:!0});var $n=Xn;function Xn(e,t){this.valueSupplier=t,this.field=e}function Zn(e,t){return e.name===t.name&&Ce.isEquals(e.tags,t.tags)}Object.defineProperty(Qn.prototype,"metrics",{get:function(){return Array.from(this._metrics.values())},enumerable:!1,configurable:!0}),Qn.prototype.registerCounter=function(e){return this.registerMetricIfNecessary(e,this.createCounter.bind(this))},Qn.prototype.registerTimer=function(e){return this.registerMetricIfNecessary(e,this.createTimer.bind(this))},Qn.prototype.counter=function(e,t){return void 0===t&&(t={}),new Jn(e).tags(t).register(this)},Qn.prototype.timer=function(e,t){return void 0===t&&(t={}),new Hn(e).tags(t).register(this)},Qn.prototype.registerMetricIfNecessary=function(e,t){return this.getOrCreateMetric(e,t)},Qn.prototype.getOrCreateMetric=function(e,t){var r,n=this._metrics.get(e);return n?r=n:(r=t(e),this._metrics.add(e,r)),r},Qn.prototype.close=function(){};G=Qn;function Qn(){this.id=H(),this.name="MetricRegistry",this._metrics=new Wn(Zn)}Se(ti,ei=G),ti.prototype.start=function(){var e=this;null===this.publishingJob&&(this.publishingJob=this.scheduler.schedulePeriodically(this.pushIntervalMillis,this.pushIntervalMillis,function(){return e.publish(!1)}),s.log.debug("PushMetricRegistry started. Publish metrics every ".concat(this.pushIntervalMillis,"ms.")))},ti.prototype.stop=function(){var e;null!=(e=this.publishingJob)&&e.cancel(),this.publishingJob=null,this.publish(!0),s.log.debug("PushMetricRegistry stopped.")},ti.prototype.close=function(){this.stop()};var ei,r=ti;function ti(e,t){var r=ei.call(this)||this;return r.scheduler=e,r.pushIntervalMillis=t,r.publishingJob=null,r}ni.prototype.count=function(){return this.counterValue},ni.prototype.increment=function(e){this.counterValue+=null!=e?e:1},ni.prototype.measure=function(){return[new $n("count",this.count.bind(this))]};var ri=ni;function ni(e){this.counterValue=0,this.id=e}oi.prototype.flush=function(){var e=this.currentCounter;return this.currentCounter=new ri(this.id),e},oi.prototype.count=function(){return this.currentCounter.count()},oi.prototype.increment=function(e){this.currentCounter.increment(e)},oi.prototype.measure=function(){return[new $n("count",this.count.bind(this))]};var ii=oi;function oi(e){this.id=e,this.currentCounter=new ri(e)}ai.prototype.count=function(){return this._count},ai.prototype.totalTime=function(e){return Le.nanosToUnit(this._total,e)},ai.prototype.max=function(e){return Le.nanosToUnit(this._max,e)},ai.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},ai.prototype.record=function(e,t){e<0||(t=Le.converter[t](e,"nanoseconds"),this._count=this.count()+1,this._total+=t,this._max=Math.max(t,this._max))},ai.prototype.measure=function(){var e=this;return[new $n("count",this.count.bind(this)),new $n("total",function(){return e.totalTime("milliseconds")}),new $n("max",function(){return e.max("milliseconds")}),new $n("mean",function(){return e.mean("milliseconds")})]};var si=ai;function ai(e){this._count=0,this._total=0,this._max=0,this.id=e}ci.prototype.flush=function(){var e=this.currentTimer;return this.currentTimer=new si(this.id),e},ci.prototype.count=function(){return this.currentTimer.count()},ci.prototype.totalTime=function(e){return this.currentTimer.totalTime(e)},ci.prototype.max=function(e){return this.currentTimer.max(e)},ci.prototype.record=function(e,t){this.currentTimer.record(e,t)},ci.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},ci.prototype.measure=function(){var e=this;return[new $n("count",this.count.bind(this)),new $n("total",function(){return e.totalTime("milliseconds")}),new $n("max",function(){return e.max("milliseconds")}),new $n("mean",function(){return e.mean("milliseconds")})]};var ui=ci;function ci(e){this.id=e,this.currentTimer=new si(e)}Se(pi,li=r),pi.prototype.createCounter=function(e){return new ii(e)},pi.prototype.createTimer=function(e){return new ui(e)},pi.prototype.publish=function(e){void 0===e&&(e=!1);var t=this.metrics.reduce(function(e,t){return void 0===(r=t).flush||"function"!=typeof r.flush?e:e.concat(t.flush());var r},[]);this.flushMetrics(t,e)};var li,e=pi;function pi(e,t){return li.call(this,e,t)||this}hi.prototype.count=function(){return 0},hi.prototype.increment=function(e){},hi.prototype.measure=function(){return[new $n("count",this.count.bind(this))]};var fi=hi;function hi(e){this.id=e}Object.defineProperty(vi.prototype,"counters",{get:function(){return Array.from(this._counters.values())},enumerable:!1,configurable:!0}),vi.prototype.add=function(e){this._counters.add(e,e.registerCounter(this.id))},vi.prototype.count=function(){return(this.counters[0]||this.noopCounter).count()},vi.prototype.increment=function(t){this.counters.forEach(function(e){e.increment(t)})},vi.prototype.measure=function(){return[new $n("count",this.count.bind(this))]};var di=vi;function vi(e){this._counters=new Wn(function(e,t){return e.id===t.id}),this.id=e,this.noopCounter=new fi(e)}gi.prototype.measure=function(){var e=this;return[new $n("count",this.count.bind(this)),new $n("total",function(){return e.totalTime("milliseconds")}),new $n("max",function(){return e.max("milliseconds")}),new $n("mean",function(){return e.mean("milliseconds")})]},gi.prototype.count=function(){return 0},gi.prototype.totalTime=function(e){return 0},gi.prototype.max=function(e){return 0},gi.prototype.mean=function(e){return 0},gi.prototype.record=function(e,t){};var yi=gi;function gi(e){this.id=e}Object.defineProperty(Ei.prototype,"firstTimer",{get:function(){return this.timers[0]||this.noopTimer},enumerable:!1,configurable:!0}),Ei.prototype.totalTime=function(e){return this.firstTimer.totalTime(e)},Ei.prototype.max=function(e){return this.firstTimer.max(e)},Ei.prototype.mean=function(e){return this.firstTimer.mean(e)},Ei.prototype.record=function(t,r){this.timers.forEach(function(e){e.record(t,r)})},Object.defineProperty(Ei.prototype,"timers",{get:function(){return Array.from(this._timers.values())},enumerable:!1,configurable:!0}),Ei.prototype.add=function(e){this._timers.add(e,e.registerTimer(this.id))},Ei.prototype.count=function(){return this.firstTimer.count()},Ei.prototype.measure=function(){var e=this;return[new $n("count",this.count.bind(this)),new $n("total",function(){return e.totalTime("milliseconds")}),new $n("max",function(){return e.max("milliseconds")}),new $n("mean",function(){return e.mean("milliseconds")})]};var mi=Ei;function Ei(e){this._timers=new Wn(function(e,t){return e.id===t.id}),this.id=e,this.noopTimer=new yi(e)}Se(bi,wi=G),bi.prototype.createCounter=function(e){e=new di(e);return this.addRegistry(e),e},bi.prototype.createTimer=function(e){e=new mi(e);return this.addRegistry(e),e},bi.prototype.addRegistry=function(t){this.registries.forEach(function(e){return t.add(e)})},bi.prototype.add=function(r){r instanceof bi||this.registries.has(r)||(this.registries.add(r),this.metrics.forEach(function(e){var t;void 0!==(t=e).add&&"function"==typeof t.add&&e.add(r)}))},bi.prototype.close=function(){this.registries.forEach(function(e){e.close()})};var wi,i=bi;function bi(){var e=null!==wi&&wi.apply(this,arguments)||this;return e.registries=new Wn(function(e,t){return e.id===t.id}),e}_i.counter=function(e,t){return _i.globalRegistry.counter(e,t)},_i.timer=function(e,t){return _i.globalRegistry.timer(e,t)},_i.addRegistry=function(e){_i.globalRegistry.add(e),s.log.debug("MetricRegistry added ".concat(e.name))},_i.globalRegistry=new i;var Ti=_i;function _i(){}Ni.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},Ni.isNotEmptyString=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var Oi=Ni;function Ni(){}Ai.builder=function(){return new Si},Ai.get=function(e){return Ai.builder().url(e).build()},Ai.prototype.toBuilder=function(){return new Si(this)};var Ii=Ai;function Ai(e,t,r,n,i){this.url=e,this.method=t,this.body=r,this.headers=n,this.options=i}Ri.prototype.url=function(e){return this._url=e,this},Ri.prototype.method=function(e){return this._method=e,this},Ri.prototype.body=function(e){return this._body=e,this},Ri.prototype.addHeader=function(e,t){return this._headers.add(e,t),this},Ri.prototype.timeoutMillis=function(e){return this._timeoutMillis=e,this},Ri.prototype.build=function(){if(null===this._url)throw new Error("url is null");var e={timeoutMillis:this._timeoutMillis};return new Ii(this._url,this._method,this._body,this._headers.build(),e)};var Si=Ri;function Ri(e){var t;this._url=null!=(t=null==e?void 0:e.url)?t:null,this._method=null!=(t=null==e?void 0:e.method)?t:"GET",this._body=null!=(t=null==e?void 0:e.body)?t:null,this._headers=null!=(t=null==(t=null==e?void 0:e.headers)?void 0:t.toBuilder())?t:xi.builder(),this._timeoutMillis=null!=(e=null==(t=null==e?void 0:e.options)?void 0:t.timeoutMillis)?e:null}Ci.ok=function(e,t){return Ci.of(200,e,t)},Ci.of=function(e,t,r){return new Ci(e,null!=t?t:null,null!=r?r:xi.empty())},Ci.prototype.isSuccessful=function(){return 200<=this.statusCode&&this.statusCode<300},Ci.prototype.isClientError=function(){return 400<=this.statusCode&&this.statusCode<500},Ci.prototype.isNotModified=function(){return 304===this.statusCode};var Mi=Ci;function Ci(e,t,r){this.statusCode=e,this.body=t,this.headers=r}Pi.empty=function(){return new Pi(new Map)},Pi.builder=function(){return new Ui(new Map)},Pi.prototype.get=function(e){for(var t=0,r=Array.from(this.headers.entries());t<r.length;t++){var n=r[t],i=n[0],n=n[1];if(Oi.equalsIgnoreCase(i,e))return n}return null},Pi.prototype.getOrDefault=function(e,t){return null!=(e=this.get(e))?e:t},Pi.prototype.raw=function(){return Array.from(this.headers.entries()).reduce(function(e,t){var r=t[0],t=t[1];return e[r]=t,e},{})},Pi.prototype.toBuilder=function(){return new Ui(this.headers)},Pi.IF_MODIFIED_SINCE="If-Modified-Since",Pi.LAST_MODIFIED="Last-Modified",Pi.ACCEPT_ENCODING="Accept-Encoding";var xi=Pi;function Pi(e){this.headers=e}ki.prototype.add=function(e,t){return this.headers.set(e,t),this},ki.prototype.build=function(){return new xi(this.headers)};var Ui=ki;function ki(e){this.headers=e}Se(Fi,Di=e),Fi.prototype.flushMetrics=function(e,t){var r=this;f.chunked(e.filter(this.isDispatchTarget.bind(this)),We).forEach(function(e){r.dispatch(e,t)})},Fi.prototype.isDispatchTarget=function(e){return("COUNTER"===e.id.type||"TIMER"===e.id.type)&&0<e.count()},Fi.prototype.dispatch=function(e,t){e=this.createRequest(e);this.execute(e,t).catch(function(e){return s.log.debug("Failed to flushing metrics: ".concat(e))})},Fi.prototype.createRequest=function(e){return Ii.builder().url(this.url).method("POST").body(JSON.stringify(this.batch(e))).addHeader("Content-Type","application/json").build()},Fi.prototype.execute=function(e,t){return(t?this.synchronousTransport:this.transport).send(e)},Fi.prototype.batch=function(e){return{metrics:e.map(function(e){return{name:e.id.name,type:e.id.type,tags:e.id.tags,measurements:u.fromMap(f.associate(e.measure(),function(e){return[e.field,e.value]}))}})}},Fi.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.publish(!0);case"visible":case"pageshow":case"blur":case"locationChange":case"focus":return}};var Di,Li=Fi;function Fi(e,t,r,n,i){n=Di.call(this,n,i)||this;return n.url=e,n.transport=t,n.synchronousTransport=r,n.start(),n}ji.experiment=function(e,t,r){t=Ti.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},ji.featureFlag=function(e,t,r){t=Ti.timer("feature.flag.decision",{key:String(t),on:String(r.isOn),reason:String(r.reason)});e.stop(t)},ji.remoteConfig=function(e,t,r){t=Ti.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)},ji.inAppMessage=function(e,t,r){t=Ti.timer("iam.decision",{key:String(t),show:String(r.isShow()),reason:String(r.reason)});e.stop(t)};var Vi=ji;function ji(){}Hi.record=function(e,t,r){e=Ti.timer("api.call",{operation:e,success:Hi.success(r)});t.stop(e)},Hi.success=function(e){return null===e?"false":String(e.isSuccessful()||e.isNotModified())};var Bi=Hi;function Hi(){}zi.decide=function(e,t,r,n){if(u.isNullOrUndefined(r))return this.decision(e,t,"NULL",r,n);switch(typeof r){case"string":return this.decision(e,t,"STRING",r,n);case"number":return this.decision(e,t,"NUMBER",r,n);case"boolean":return this.decision(e,t,"BOOLEAN",r,n);default:return this.decision(e,t,"UNKNOWN",r,n)}},zi.decision=function(e,t,r,n,i){return u.isNullOrUndefined(t)?mt.of(n,p.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var Gi=zi;function zi(){}var Ki=s.log,Ji=(Yi.prototype.get=function(t,r){var n,e=zn.start();try{n=this.decide(t,r)}catch(e){Ki.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=mt.of(r,p.EXCEPTION)}return Vi.remoteConfig(e,t,n),n.value},Yi.prototype.decide=function(e,t){var r=this.userManager.resolve(this.user);return Gi.decide(this.core,e,t,r)},Yi);function Yi(e,t,r){this.core=e,this.userManager=t,this.user=r}$i.prototype.contains=function(e){return this._properties.has(e)},$i.prototype.remove=function(e){var r=this;return e instanceof Map&&e.forEach(function(e,t){r.remove(t)}),"string"==typeof e&&this._properties.delete(e),this},$i.prototype.compute=function(e,t){var r=this._properties.get(e),t=t(r);null!==t?this.add(e,t):null===r&&!this.contains(e)||this.remove(e)},$i.prototype.add=function(e,t,r){if((r=void 0===r?!1:r)&&this.contains(e))return this;if(this._properties.size>=this.MAX_PROPERTIES_COUNT)return this;if("string"==typeof e&&e.length>this.MAX_PROPERTY_KEY_LENGTH)return this;r=Ue.sanitizeValue(e,t);return u.isNullOrUndefined(r)||this._properties.set(e,r),this},$i.prototype.addProperties=function(e,r){var n=this;return void 0===r&&(r=!1),e.forEach(function(e,t){n.add(t,e,r)}),this},$i.prototype.build=function(){return this._properties};var Wi,qi=$i;function $i(){this._properties=new Map,this.MAX_PROPERTIES_COUNT=128,this.MAX_PROPERTY_KEY_LENGTH=128}(Q=Wi=Wi||{}).SET="$set",Q.SET_ONCE="$setOnce",Q.UNSET="$unset",Q.INCREMENT="$increment",Q.APPEND="$append",Q.APPEND_ONCE="$appendOnce",Q.PREPEND="$prepend",Q.PREPEND_ONCE="$prependOnce",Q.REMOVE="$remove",Q.CLEAR_ALL="$clearAll";Zi.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new qi).addProperties(e).addProperties(t).build()};var Xi=Zi;function Zi(){}eo.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new qi).addProperties(e).addProperties(t,!0).build()};var Qi=eo;function eo(){}ro.prototype.operate=function(e,t){return 0===e.size?new Map:0===t.size?e:(new qi).addProperties(e).remove(t).build()};var to=ro;function ro(){}io.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new qi;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.increment(e,t)})}),n.build()},io.prototype.increment=function(e,t){return"number"!=typeof t?e:"number"!=typeof e?null==e?t:e:e+t};var no=io;function io(){}oo.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new qi;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.compute(e,t)})}),n.build()},oo.prototype.compute=function(e,t){e=this.toArray(e),t=this.toArray(t);return this.operateArray(e,t)},oo.prototype.toArray=function(e){return null==e?[]:Array.isArray(e)?e:[e]},oo.prototype.contains=function(e,t){return e.includes(t)},oo.prototype.prepend=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(t,e)?t:Re([e],t,!0)},oo.prototype.append=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(e,t)?e:Re(Re([],e,!0),[t],!1)};t=oo;function oo(){}Se(uo,so=t),uo.prototype.operateArray=function(e,t){var r=this;return t.reduce(function(e,t){return r.append.bind(r)(e,t)},e)};var so,ao=uo;function uo(){return null!==so&&so.apply(this,arguments)||this}Se(po,co=t),po.prototype.operateArray=function(e,t){return t.reduce(this.appendOnce.bind(this),e)},po.prototype.appendOnce=function(e,t){return this.append(e,t,!0)};var co,lo=po;function po(){return null!==co&&co.apply(this,arguments)||this}Se(vo,fo=t),vo.prototype.operateArray=function(e,t){var r=this;return t.reduceRight(function(e,t){return r.prepend.bind(r)(t,e)},e)};var fo,ho=vo;function vo(){return null!==fo&&fo.apply(this,arguments)||this}Se(mo,yo=t),mo.prototype.operateArray=function(e,t){var r=this;return t.reduce(this.appendOnce.bind(this),[]).reduceRight(function(e,t){return r.prependOnce.bind(r)(t,e)},e)},mo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)},mo.prototype.prependOnce=function(e,t){return this.prepend(e,t,!0)};var yo,go=mo;function mo(){return null!==yo&&yo.apply(this,arguments)||this}Se(bo,Eo=t),bo.prototype.operateArray=function(e,t){return t.reduce(this.remove.bind(this),e)},bo.prototype.remove=function(e,t){return e.filter(function(e){return e!==t})};var Eo,wo=bo;function bo(){return null!==Eo&&Eo.apply(this,arguments)||this}_o.prototype.operate=function(e,t){return new Map};var To=_o;function _o(){}No.get=function(e){switch(e){case Wi.SET:return new Xi;case Wi.SET_ONCE:return new Qi;case Wi.UNSET:return new to;case Wi.INCREMENT:return new no;case Wi.APPEND:return new ao;case Wi.APPEND_ONCE:return new lo;case Wi.PREPEND:return new ho;case Wi.PREPEND_ONCE:return new go;case Wi.CLEAR_ALL:return new To;case Wi.REMOVE:return new wo}};var Oo=No;function No(){}Ao.prototype.set=function(e,t){return this.add(Wi.SET,e,t)},Ao.prototype.setOnce=function(e,t){return this.add(Wi.SET_ONCE,e,t)},Ao.prototype.unset=function(e){return this.add(Wi.UNSET,e,"-")},Ao.prototype.increment=function(e,t){return this.add(Wi.INCREMENT,e,t)},Ao.prototype.append=function(e,t){return this.add(Wi.APPEND,e,t)},Ao.prototype.appendOnce=function(e,t){return this.add(Wi.APPEND_ONCE,e,t)},Ao.prototype.prepend=function(e,t){return this.add(Wi.PREPEND,e,t)},Ao.prototype.prependOnce=function(e,t){return this.add(Wi.PREPEND_ONCE,e,t)},Ao.prototype.remove=function(e,t){return this.add(Wi.REMOVE,e,t)},Ao.prototype.clearAll=function(){return this.add(Wi.CLEAR_ALL,"clearAll","-")},Ao.prototype.build=function(){var e=Array.from(this.operations.entries()).map(function(e){return[e[0],e[1].build()]});return new So(new Map(e))},Ao.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},Ao.prototype.add=function(e,t,r){if(this.containsKey(t))return this;this.operations.has(e)||this.operations.set(e,new qi);e=this.operations.get(e);return null!=e&&e.add(t,r),this};var Io=Ao;function Ao(){this.operations=new Map}Ro.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=Oo.get(t).operate(r,e)}),r},Ro.prototype.toEvent=function(){var i={key:"$properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),Ue.sanitize(u.fromMap(e))),r))}),i},Ro.prototype.toSecuredEvent=function(){var i={key:"$secured_properties"};return this.operations.forEach(function(e,t){var r,n;i.properties=c(c({},i.properties),((r={})[t]=c(c({},null==(n=i.properties)?void 0:n[t]),Ue.sanitize(u.fromMap(e))),r))}),i},Ro.prototype.toRecord=function(){var n={};return this.operations.forEach(function(e,t){var r={};e.forEach(function(e,t){r[t]=e}),n[t]=r}),n};var So=Ro;function Ro(e){this.operations=null!=e?e:new Map}Co.timeout=function(r,n){return new Promise(function(e,t){setTimeout(function(){return t(new Error("timeout (".concat(n,"ms)")))},n),r.then(e,t)})};var Mo=Co;function Co(){}Po.prototype.isEquals=function(e){return this.url===e.url},Object.defineProperty(Po.prototype,"pageTitle",{get:function(){return"undefined"==typeof window||"undefined"==typeof document?"":window.document.title},enumerable:!1,configurable:!0}),Po.createWithCurrentPage=function(){return"undefined"==typeof window||"undefined"==typeof document?new Po:new Po(window.location.pathname,window.location.host,window.location.hostname,window.location.href,window.document.referrer,window.location.search,window.location.protocol)},Po.prototype.toProperties=function(){return{pagePath:this.pagePath,pageTitle:this.pageTitle,host:this.host,url:this.url,referrer:this.referrer,queryParameter:this.queryParameter,protocol:this.protocol.replace(":","")}};var xo=Po;function Po(e,t,r,n,i,o,s){void 0===t&&(t=""),void 0===r&&(r=""),void 0===n&&(n=""),void 0===i&&(i=""),void 0===o&&(o=""),void 0===s&&(s=""),this.pagePath=e=void 0===e?"":e,this.host=t,this.hostname=r,this.url=n,this.referrer=i,this.queryParameter=o,this.protocol=s}ko.create=function(e){return new ko(e)},ko.prototype.getValue=function(){return this.value};var Uo=ko;function ko(e){this.value=e}var Do=s.log,Lo=(d.prototype.initialize=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),Do.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),Do.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),Do.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},d.prototype.getSessionId=function(){return this.sessionManager.sessionId},d.prototype.getUser=function(){return this.userManager.currentUser},d.prototype.setUser=function(e){try{var t=Jt(e);if(!t)return Do.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Do.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},d.prototype.setUserId=function(e){try{var t=void 0;if(void 0===e)t=this.userManager.setUserId(void 0);else{var r=Ce.sanitizeValue(e);if(!r)return Do.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return Do.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},d.prototype.setDeviceId=function(e){try{var t=Ce.sanitizeValue(e);if(!t)return Do.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Do.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},d.prototype.setUserProperty=function(e,t){e=(new Io).set(e,t).build();return this.updateUserProperties(e)},d.prototype.setUserProperties=function(e){try{var t=Ue.sanitize(e),r=new Io;return Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){return Do.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},d.prototype.updateUserProperties=function(e){try{var t=e.toEvent();return this.track(t),this.userManager.updateUserProperties(e),this.core.flush(!1),Promise.resolve()}catch(e){return Do.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},d.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new Io).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return Do.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},d.prototype.setPhoneNumber=function(e){try{if("string"!=typeof e)return Do.error("Invalid value ".concat(e,": phoneNumber value type must be string.")),Promise.resolve();var t=Uo.create(e),r=Fe.instance.currentMillis();return this.piiEventManager.setPhoneNumber(t,r),this.core.flush(!1),Promise.resolve()}catch(e){return Do.error("Unexpected exception occurred while setting phone number: ".concat(e)),Promise.resolve()}},d.prototype.unsetPhoneNumber=function(){try{var e=Fe.instance.currentMillis();return this.piiEventManager.unsetPhoneNumber(e),this.core.flush(!1),Promise.resolve()}catch(e){return Do.error("Unexpected exception occurred while unsetting phone number: ".concat(e)),Promise.resolve()}},d.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},d.prototype.variationDetail=function(r,n,e){var i=e||"A",e=zn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.experiment(r,t,i)}catch(e){return Do.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),Tt.of(i,p.EXCEPTION)}}(this);return Vi.experiment(e,r,t),t},d.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},d.prototype.featureFlagDetail=function(r,n){var e=zn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.featureFlag(r,t)}catch(e){return Do.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),Ot.off(p.EXCEPTION)}}(this);return Vi.featureFlag(e,r,t),t},d.prototype.track=function(e,t){try{Do.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){Do.error("Unexpected exception while tracking event: ".concat(e))}},d.prototype.trackPageView=function(e){var t=xo.createWithCurrentPage();this.pageEventTracker.track(t)},d.prototype.remoteConfig=function(e){return new Ji(this.core,this.userManager,e)},d.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},d.prototype.getExperiment=function(t){try{return this.core.getExperiment(t)}catch(e){return void Do.error('"Unexpected exception while get experiment['.concat(t,"]"))}},d.prototype.onInitialized=function(r){var n;return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:if(this.initialized)return[2,{success:!0}];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,Mo.timeout(this.initialization,null!=(n=null==r?void 0:r.timeout)?n:3e3)];case 2:return e.sent(),[2,{success:!0}];case 3:return t=e.sent(),Do.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},d.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},d.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(Do.debug("UserExplorer opened."),Ti.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):Do.error("UserExplorer is not provided")},d.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():Do.warn("There is no active HackleDevtools.")},d.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},d.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},d.prototype.close=function(){Do.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},d);function d(e,t,r,n,i,o,s,a,u){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.piiEventManager=i,this.fetchThrottler=o,this.pageEventTracker=s,this.inAppMessageUi=a,this.devTools=u,this.initialized=!1,this.initialize=this.initialize.bind(this),this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this),this.initialization=this.initialize()}var Fo=s.log,Vo=(jo.prototype.get=function(t,r){var e=typeof r;try{var n={command:"remoteConfig",parameters:{defaultValue:r,key:t,valueType:e,user:this.user}},i=this.invocationProcessor.process(n);if(!i)throw new Error("invoke result data not exists");switch(e){case"number":return Number(i);case"boolean":return Boolean(i);default:return i}}catch(e){return Fo.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},jo);function jo(e,t){this.invocationProcessor=e,this.user=t}Ho.tryParse=function(e){try{return new URL(e)}catch(e){return}},Ho.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:Ho.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},Ho.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},Ho.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},Ho.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},Ho.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var Bo=Ho;function Ho(){}zo.extractDomain=function(e){var t=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i),e.match(t));return r?r[0]:""},zo.prototype.getItem=function(e){for(var t,r=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return null!=(t=Bo.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},zo.prototype.getAllItem=function(e){var t=document.cookie.split("; ").map(function(e){return e.split("=")}),r=null==e?void 0:e.keyPrefix;return r?t.filter(function(e){var t=e[0];return e[1],t.startsWith(r)}):t},zo.prototype.setItem=function(e,t,r){var r=c(c({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=zo.extractDomain(document.location.hostname))?"; domain=."+a:""),r.days&&((a=new Date).setTime(a.getTime()+24*r.days*60*60*1e3),i="; expires="+a.toUTCString()),r.sameSite&&(s="; SameSite=".concat(r.sameSite)),r.isSecure&&(o+="; secure"),e+"="+encodeURIComponent(t)+i+"; path=/"+n+s+o);return document.cookie=a},zo.prototype.removeItem=function(e,t){this.setItem(e,"",c(c({},t),{days:-1}))},zo.prototype.getOptions=function(){return this.options},zo.getInstance=function(e){return void 0===e&&(e={days:Xe,isCrossSubdomain:!0}),zo.storage=zo.storage?zo.storage:new zo(e)};var Go=zo;function zo(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}Jo.prototype.initialize=function(){Go.getInstance().getItem(Ze)||qo()},Jo.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return Wo();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var Ko=Jo;function Jo(){}function Yo(){var e=Go.getInstance(),t=e.getItem(Qe);if(t)return t;t=e.getItem(Ze);return t||qo()}function Wo(){Go.getInstance().removeItem(Qe)}function qo(){var e=H();return Go.getInstance().setItem(Ze,e),e}var $o,Xo=s.log;(r=$o=$o||{}).native="native",r.web_view_wrapper="web_view_wrapper";v.prototype.getSessionId=function(){try{var e=this.invocationProcessor.process({command:"getSessionId"});return null!=e?e:Yo()}catch(e){return Xo.error("Unexpected exception while get sessionId: ".concat(e)),Yo()}},v.prototype.getUser=function(){var e;try{var t=this.invocationProcessor.process({command:"getUser"});return null!=(e=Jt(t))?e:this.defaultUser()}catch(e){return Xo.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},v.prototype.setUser=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Jt(n)))return Xo.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set user: ".concat(e))}return[2]})})},v.prototype.setUserId=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Ce.sanitizeValue(n)))return Xo.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},v.prototype.setDeviceId=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Ce.sanitizeValue(n)))return Xo.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t}},this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},v.prototype.setUserProperty=function(r,n){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"setUserProperty",parameters:{key:r,value:n}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},v.prototype.setUserProperties=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{t=Ue.sanitize(n),r=new Io,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){Xo.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},v.prototype.updateUserProperties=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"updateUserProperties",parameters:{operations:r.toRecord()}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},v.prototype.resetUser=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"resetUser"},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},v.prototype.setPhoneNumber=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{if("string"!=typeof r)return Xo.error("Invalid type ".concat(r,": phoneNumber value must be string.")),[2,Promise.resolve()];t={command:"setPhoneNumber",parameters:{phoneNumber:r}},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception occurred while setting phone number: ".concat(e))}return[2]})})},v.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){try{t={command:"unsetPhoneNumber"},this.invocationProcessor.process(t)}catch(e){Xo.error("Unexpected exception occurred while unsetting phone number: ".concat(e))}return[2]})})},v.prototype.variation=function(t,e,r){void 0===r&&(r="A");try{var n={command:"variation",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)}},i=this.invocationProcessor.process(n);if(i)return i;throw new Error("invoke result data not exists")}catch(e){return Xo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},v.prototype.variationDetail=function(t,e,r){var n;void 0===r&&(r="A");try{var i={command:"variationDetail",parameters:{experimentKey:t,defaultVariation:r,user:this.convertUser(e)}},o=this.invocationProcessor.process(i);if(null===o)throw new Error("invoke result data not exists");return Tt.of(o.variation,o.reason,new He(null!=(n=o.config.parameters)?n:{}))}catch(e){return Xo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),Tt.of(r,p.EXCEPTION)}},v.prototype.isFeatureOn=function(t,e){try{var r={command:"isFeatureOn",parameters:{featureKey:t,user:this.convertUser(e)}},n=this.invocationProcessor.process(r);if(null===n)throw new Error("invoke result data not exists");return Boolean(n)}catch(e){return Xo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},v.prototype.featureFlagDetail=function(t,e){var r;try{var n={command:"featureFlagDetail",parameters:{featureKey:t,user:this.convertUser(e)}},i=this.invocationProcessor.process(n);if(null===i)throw new Error("invoke result data not exists");return new Ot(i.isOn,i.reason,new He(null!=(r=i.config.parameters)?r:{}),void 0)}catch(e){return Xo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),Ot.off(p.EXCEPTION)}},v.prototype.track=function(e,t){try{var r={command:"track",parameters:{event:this.convertEvent(e),user:this.convertUser(t)}};this.invocationProcessor.process(r)}catch(e){Xo.error("Unexpected exception while tracking event: ".concat(e))}},v.prototype.trackPageView=function(e){Xo.info("Web to app integration feature is not support 'trackPageView' method")},v.prototype.remoteConfig=function(e){return new Vo(this.invocationProcessor,this.convertUser(e))},v.prototype.onReady=function(e,t){e()},v.prototype.showUserExplorer=function(){try{this.invocationProcessor.process({command:"showUserExplorer"})}catch(e){Xo.error("Unexpected exception while show userExplorer: ".concat(e))}},v.prototype.hideUserExplorer=function(){Xo.info("Web to app integration feature is not support 'hideUserExplorer' method")},v.prototype.setInAppMessageListener=function(e){Xo.info("Web to app integration feature is not support 'setInAppMessageListener' method")},v.prototype.fetch=function(){return Promise.resolve()},v.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},v.prototype.close=function(){Xo.info("Web to app integration feature is not support 'close' method")},v.prototype.getExperiment=function(e){Xo.info("Web to app integration feature is not support 'getExperiment' method")},v.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},v.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=Jt(e))?e:void 0},v.prototype.defaultUser=function(){return{deviceId:Yo()}};var Zo=v;function v(e){this.invocationProcessor=e,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this)}es.prototype.getSessionId=function(){return this.browser.getSessionId()},es.prototype.getUser=function(){return this.browser.getUser()},es.prototype.syncUser=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.browser.getUser(),[4,this.app.setUser(t)];case 1:return e.sent(),[2]}})})},es.prototype.setUser=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUser(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserId=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setDeviceId=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setDeviceId(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserProperty=function(t,r){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperty(t,r)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setUserProperties=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.updateUserProperties=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.updateUserProperties(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.resetUser=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.resetUser()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.setPhoneNumber=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.setPhoneNumber(t)];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.unsetPhoneNumber=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,this.browser.unsetPhoneNumber()];case 1:return e.sent(),[4,this.syncUser()];case 2:return e.sent(),[2]}})})},es.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},es.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},es.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},es.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},es.prototype.track=function(e,t){return this.browser.track(e,t)},es.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},es.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},es.prototype.onReady=function(e,t){this.browser.onReady(e,t)},es.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},es.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},es.prototype.fetch=function(){return this.browser.fetch()},es.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},es.prototype.close=function(){this.browser.close()},es.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)},es.prototype.getExperiment=function(e){return this.browser.getExperiment(e)};var Qo=es;function es(e,t){this.browser=e,this.app=t,this.getSessionId=this.getSessionId.bind(this),this.getUser=this.getUser.bind(this),this.setUser=this.setUser.bind(this),this.setUserId=this.setUserId.bind(this),this.setDeviceId=this.setDeviceId.bind(this),this.setUserProperty=this.setUserProperty.bind(this),this.setUserProperties=this.setUserProperties.bind(this),this.updateUserProperties=this.updateUserProperties.bind(this),this.resetUser=this.resetUser.bind(this),this.variation=this.variation.bind(this),this.variationDetail=this.variationDetail.bind(this),this.isFeatureOn=this.isFeatureOn.bind(this),this.featureFlagDetail=this.featureFlagDetail.bind(this),this.track=this.track.bind(this),this.trackPageView=this.trackPageView.bind(this),this.remoteConfig=this.remoteConfig.bind(this),this.onReady=this.onReady.bind(this),this.onInitialized=this.onInitialized.bind(this),this.showUserExplorer=this.showUserExplorer.bind(this),this.hideUserExplorer=this.hideUserExplorer.bind(this),this.fetch=this.fetch.bind(this),this.close=this.close.bind(this),this.setInAppMessageListener=this.setInAppMessageListener.bind(this),this.getExperiment=this.getExperiment.bind(this),this.setPhoneNumber=this.setPhoneNumber.bind(this),this.unsetPhoneNumber=this.unsetPhoneNumber.bind(this)}function ts(e){return e&&e.Math==Math&&e}function rs(e){try{return!!e()}catch(e){return!0}}function ns(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function is(e){return Hs(Bs(e),8,-1)}function os(e){if(null==e)throw Js("Can't call method on "+e);return e}function ss(e){return Ys(Ws(e))}function as(e){return"function"==typeof e}function us(e){return"object"==typeof e?null!==e:qs(e)}function cs(e,t){return arguments.length<2?(r=$s[e],Xs(r)?r:void 0):$s[e]&&$s[e][t];var r}function ls(e){try{return aa(e)}catch(e){return"Object"}}function ps(e){if(ua(e))return e;throw la(ca(e)+" is not a function")}function fs(e,t){return null==(e=e[t])?void 0:pa(e)}function hs(t,r){try{ga(ya,t,{value:r,configurable:!0,writable:!0})}catch(e){ya[t]=r}return r}function ds(e){return ba(wa(e))}function vs(e){return"Symbol("+(void 0===e?"":e)+")_"+Aa(++Na+Ia,36)}function ys(e){var t;return Ra(Pa,e)&&(Ca||"string"==typeof Pa[e])||(t="Symbol."+e,Ca&&Ra(Ua,e)?Pa[e]=Ua[e]:Pa[e]=(xa&&ka?ka:Da)(t)),Pa[e]}function gs(e){return e=za(e,"string"),Ka(e)?e:e+""}function ms(e){return Ya?Ja.createElement(e):{}}function Es(e){if(nu(e))return e;throw ou(iu(e)+" is not an object")}function ws(e){return wu[e]||(wu[e]=Eu(e))}function bs(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(Vu(r)&&Bu(r,o,n),n.global)i?e[t]=r:Hu(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:ju.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function Ts(e){return(e=+e)!=e||0==e?0:Ku(e)}function _s(e,t){return(e=Ju(e))<0?Yu(e+t,0):Wu(e,t)}function y(e){return Xu(e.length)}function Os(a){return function(e,t,r){var n,i=Zu(e),o=ec(i),s=Qu(r,o);if(a&&t!=t){for(;s<o;)if((n=i[s++])!=n)return!0}else for(;s<o;s++)if((a||s in i)&&i[s]===t)return a||s||0;return!a&&-1}}function Ns(e,t){var r,n=rc(e),i=0,o=[];for(r in n)!tc(ic,r)&&tc(n,r)&&oc(o,r);for(;t.length>i;)!tc(n,r=t[i++])||~nc(o,r)||oc(o,r);return o}function Is(e,t,r){for(var n=hc(t),i=vc.f,o=dc.f,s=0;s<n.length;s++){var a=n[s];fc(e,a)||r&&fc(r,a)||i(e,a,o(t,a))}}function As(e,t){return(e=wc[Ec(e)])==Tc||e!=bc&&(gc(t)?yc(t):!!t)}function g(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?_c:a?_c[o]||Ac(o,{}):(_c[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=Oc(u,r))&&i.value:u[r],!Rc(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Sc(n,i)}(e.sham||i&&i.sham)&&Nc(n,"sham",!0),Ic(u,r,n,e)}}var Ss,Rs,Ms,Cs,xs,Ps,Us,ks,G="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=ts("object"==typeof globalThis&&globalThis)||ts("object"==typeof window&&window)||ts("object"==typeof self&&self)||ts("object"==typeof G&&G)||function(){return this}()||Function("return this")(),e={},Q=!rs(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),t=!rs(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),Ds=Function.prototype.call,r=t?Ds.bind(Ds):function(){return Ds.apply(Ds,arguments)},G={},m={}.propertyIsEnumerable,Ls=Object.getOwnPropertyDescriptor,E=Ls&&!m.call({1:2},1),E=(G.f=E?function(e){e=Ls(this,e);return!!e&&e.enumerable}:m,t),m=Function.prototype,Fs=m.bind,Vs=m.call,js=E&&Fs.bind(Vs,Vs),m=E?function(e){return e&&js(e)}:function(e){return e&&function(){return Vs.apply(e,arguments)}},Fs=m,Bs=Fs({}.toString),Hs=Fs("".slice),E=rs,Gs=is,zs=Object,Ks=m("".split),Fs=E(function(){return!zs("z").propertyIsEnumerable(0)})?function(e){return"String"==Gs(e)?Ks(e,""):zs(e)}:zs,Js=TypeError,Ys=Fs,Ws=os,qs=as,$s=i,Xs=as,E=m({}.isPrototypeOf),Zs=cs("navigator","userAgent")||"",Qs=Zs,ea=i.process,ta=i.Deno,ea=ea&&ea.versions||ta&&ta.version,ta=ea&&ea.v8,ea=b=!(b=ta?0<(w=ta.split("."))[0]&&w[0]<4?1:+(w[0]+w[1]):b)&&Qs&&(!(w=Qs.match(/Edge\/(\d+)/))||74<=w[1])&&(w=Qs.match(/Chrome\/(\d+)/))?+w[1]:b,ra=ea,ta=rs,Qs=!!Object.getOwnPropertySymbols&&!ta(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ra&&ra<41}),w=Qs&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,na=cs,ia=as,oa=E,sa=Object,b=w?function(e){return"symbol"==typeof e}:function(e){var t=na("Symbol");return ia(t)&&oa(t.prototype,sa(e))},aa=String,ua=as,ca=ls,la=TypeError,pa=ps,fa=r,ha=as,da=us,va=TypeError,ta={exports:{}},ya=i,ga=Object.defineProperty,ma=hs,T="__core-js_shared__",ma=i[T]||ma(T,{}),Ea=ma,wa=((ta.exports=function(e,t){return Ea[e]||(Ea[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),os),ba=Object,Ta=ds,_a=m({}.hasOwnProperty),T=Object.hasOwn||function(e,t){return _a(Ta(e),t)},Oa=m,Na=0,Ia=Math.random(),Aa=Oa(1..toString),Oa=i,Sa=ta.exports,Ra=T,Ma=vs,Ca=Qs,xa=w,Pa=Sa("wks"),Ua=Oa.Symbol,ka=Ua&&Ua.for,Da=xa?Ua:Ua&&Ua.withoutSetter||Ma,La=r,Fa=us,Va=b,ja=fs,Ba=function(e,t){var r,n;if("string"===t&&ha(r=e.toString)&&!da(n=fa(r,e)))return n;if(ha(r=e.valueOf)&&!da(n=fa(r,e)))return n;if("string"!==t&&ha(r=e.toString)&&!da(n=fa(r,e)))return n;throw va("Can't convert object to primitive value")},Ha=TypeError,Ga=ys("toPrimitive"),za=function(e,t){if(!Fa(e)||Va(e))return e;var r=ja(e,Ga);if(r){if(r=La(r,e,t=void 0===t?"default":t),!Fa(r)||Va(r))return r;throw Ha("Can't convert object to primitive value")}return Ba(e,t=void 0===t?"number":t)},Ka=b,Qs=us,Ja=i.document,Ya=Qs(Ja)&&Qs(Ja.createElement),Wa=ms,w=!Q&&!rs(function(){return 7!=Object.defineProperty(Wa("div"),"a",{get:function(){return 7}}).a}),qa=r,$a=G,Xa=ns,Za=ss,Qa=gs,eu=T,tu=w,ru=Object.getOwnPropertyDescriptor,Sa=(e.f=Q?ru:function(e,t){if(e=Za(e),t=Qa(t),tu)try{return ru(e,t)}catch(e){}if(eu(e,t))return Xa(!qa($a.f,e,t),e[t])},{}),Oa=Q&&rs(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),nu=us,iu=String,ou=TypeError,su=w,au=Es,uu=gs,cu=TypeError,lu=Object.defineProperty,pu=Object.getOwnPropertyDescriptor,fu="enumerable",hu="configurable",du="writable",Ma=(Sa.f=Q?Oa?function(e,t,r){var n;return au(e),t=uu(t),au(r),"function"==typeof e&&"prototype"===t&&"value"in r&&du in r&&!r[du]&&((n=pu(e,t))&&n[du]&&(e[t]=r.value,r={configurable:(hu in r?r:n)[hu],enumerable:(fu in r?r:n)[fu],writable:!1})),lu(e,t,r)}:lu:function(e,t,r){if(au(e),t=uu(t),au(r),su)try{return lu(e,t,r)}catch(e){}if("get"in r||"set"in r)throw cu("Accessors not supported");return"value"in r&&(e[t]=r.value),e},Q),vu=Sa,yu=ns,b=Ma?function(e,t,r){return vu.f(e,t,yu(1,r))}:function(e,t,r){return e[t]=r,e},Qs={exports:{}},G=Q,w=T,Ma=Function.prototype,_=G&&Object.getOwnPropertyDescriptor,w=w(Ma,"name"),w={EXISTS:w,PROPER:w&&"something"===function(){}.name,CONFIGURABLE:w&&(!G||_(Ma,"name").configurable)},G=as,_=ma,gu=m(Function.toString),Ma=(G(_.inspectSource)||(_.inspectSource=function(e){return gu(e)}),_.inspectSource),G=as,_=Ma,mu=i.WeakMap,G=G(mu)&&/native code/.test(_(mu)),_=ta.exports,Eu=vs,wu=_("keys"),mu={},ta=m,bu=us,Tu=b,_u=T,_=ma,Ou=ws,Nu=mu,Iu="Object already initialized",Au=i.TypeError,Su=i.WeakMap,G=(Us=G||_.state?(Ss=_.state||(_.state=new Su),Rs=ta(Ss.get),Ms=ta(Ss.has),Cs=ta(Ss.set),xs=function(e,t){if(Ms(Ss,e))throw new Au(Iu);return t.facade=e,Cs(Ss,e,t),t},Ps=function(e){return Rs(Ss,e)||{}},function(e){return Ms(Ss,e)}):(Nu[ks=Ou("state")]=!0,xs=function(e,t){if(_u(e,ks))throw new Au(Iu);return t.facade=e,Tu(e,ks,t),t},Ps=function(e){return _u(e,ks)?e[ks]:{}},function(e){return _u(e,ks)}),{set:xs,get:Ps,has:Us,enforce:function(e){return Us(e)?Ps(e):xs(e,{})},getterFor:function(t){return function(e){if(bu(e)&&(e=Ps(e)).type===t)return e;throw Au("Incompatible receiver, "+t+" required")}}}),_=rs,Ru=as,Mu=T,Cu=Q,xu=w.CONFIGURABLE,Pu=Ma,Uu=G.enforce,ku=G.get,Du=Object.defineProperty,Lu=Cu&&!_(function(){return 8!==Du(function(){},"length",{value:8}).length}),Fu=String(String).split("String"),Su=Qs.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Mu(e,"name")||xu&&e.name!==t)&&(Cu?Du(e,"name",{value:t,configurable:!0}):e.name=t),Lu&&r&&Mu(r,"arity")&&e.length!==r.arity&&Du(e,"length",{value:r.arity});try{r&&Mu(r,"constructor")&&r.constructor?Cu&&Du(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=Uu(e);return Mu(r,"source")||(r.source=Fu.join("string"==typeof t?t:"")),e},Vu=(Function.prototype.toString=Su(function(){return Ru(this)&&ku(this).source||Pu(this)},"toString"),as),ju=Sa,Bu=Qs.exports,Hu=hs,ta={},Gu=Math.ceil,zu=Math.floor,Ku=Math.trunc||function(e){e=+e;return(0<e?zu:Gu)(e)},Ju=Ts,Yu=Math.max,Wu=Math.min,qu=Ts,$u=Math.min,Xu=function(e){return 0<e?$u(qu(e),9007199254740991):0},Zu=ss,Qu=_s,ec=y,Nu={includes:Os(!0),indexOf:Os(!1)},Ou=m,tc=T,rc=ss,nc=Nu.indexOf,ic=mu,oc=Ou([].push),_=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],sc=Ns,ac=_.concat("length","prototype"),Su=(ta.f=Object.getOwnPropertyNames||function(e){return sc(e,ac)},{}),Ou=(Su.f=Object.getOwnPropertySymbols,cs),uc=ta,cc=Su,lc=Es,pc=m([].concat),Su=Ou("Reflect","ownKeys")||function(e){var t=uc.f(lc(e)),r=cc.f;return r?pc(t,r(e)):t},fc=T,hc=Su,dc=e,vc=Sa,yc=rs,gc=as,mc=/#|\.prototype\./,Ec=As.normalize=function(e){return String(e).replace(mc,".").toLowerCase()},wc=As.data={},bc=As.NATIVE="N",Tc=As.POLYFILL="P",Ou=As,_c=i,Oc=e.f,Nc=b,Ic=bs,Ac=hs,Sc=Is,Rc=Ou,Su=!rs(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Mc=T,Cc=as,xc=ds,Pc=ws("IE_PROTO"),Uc=Object,kc=Uc.prototype,Su=Su?Uc.getPrototypeOf:function(e){e=xc(e);if(Mc(e,Pc))return e[Pc];var t=e.constructor;return Cc(t)&&e instanceof t?t.prototype:e instanceof Uc?kc:null},Dc=as,Lc=String,Fc=TypeError,Vc=m,jc=Es,Bc=function(e){if("object"==typeof e||Dc(e))return e;throw Fc("Can't set "+Lc(e)+" as a prototype")},Hc=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=Vc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return jc(e),Bc(t),n?r(e,t):e.__proto__=t,e}}():void 0),Gc={},zc=Ns,Kc=_,O=Object.keys||function(e){return zc(e,Kc)},Jc=Sa,Yc=Es,Wc=ss,qc=O;Gc.f=Q&&!Oa?Object.defineProperties:function(e,t){Yc(e);for(var r,n=Wc(t),i=qc(t),o=i.length,s=0;s<o;)Jc.f(e,r=i[s++],n[r]);return e};function $c(){}function Xc(e){e.write(ml("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Zc(e,t){return Il(e),void 0===t?e:Al?Sl(e,t):function(){return e.apply(t,arguments)}}function Qc(e){return void 0!==e&&(Rl.Array===e||Cl[Ml]===e)}function el(e){if(null!=e)return Fl(e,jl)||Fl(e,"@@iterator")||Vl[Ll(e)]}function tl(e,t){if(t=arguments.length<2?Kl(e):t,Hl(t))return Gl(Bl(t,e));throw Jl(zl(e)+" is not iterable")}function rl(e,t,r){var n,i;Wl(e);try{if(!(n=ql(e,"return"))){if("throw"===t)throw r;return r}n=Yl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Wl(n),r}function nl(e,t){this.stopped=e,this.result=t}function il(e,t,r){function n(e){return o&&op(o,"normal",e),new nl(!0,e)}function i(e){return f?(Zl(e),v?y(e[0],e[1],n):y(e[0],e[1])):v?y(e,n):y(e)}var o,s,a,u,c,l,p=r&&r.that,f=!(!r||!r.AS_ENTRIES),h=!(!r||!r.IS_RECORD),d=!(!r||!r.IS_ITERATOR),v=!(!r||!r.INTERRUPTED),y=$l(t,p);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=ip(e)))throw sp(Ql(e)+" is not iterable");if(ep(r)){for(s=0,a=tp(e);s<a;s++)if((u=i(e[s]))&&rp(ap,u))return u;return new nl(!1)}o=np(e,r)}for(c=(h?e:o).next;!(l=Xl(c,o)).done;){try{u=i(l.value)}catch(e){op(o,"throw",e)}if("object"==typeof u&&u&&rp(ap,u))return u}return new nl(!1)}function ol(e){if("Symbol"===up(e))throw TypeError("Cannot convert a Symbol value to a string");return cp(e)}function sl(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=fp(Ap,this);return dp?r=dp(new Np,i?hp(this):Ap):(r=i?this:yp(Ap),gp(r,Op,"Error")),void 0!==t&&gp(r,"message",Tp(t)),_p&&gp(r,"stack",Ep(r.stack,1)),wp(r,n),bp(e,Ip,{that:i=[]}),gp(r,"errors",i),r}function al(e){Rp[Sp][e]=!0}var ul,cl,O=cs("document","documentElement"),ll=Es,pl=Gc,fl=_,Oa=mu,hl=O,dl=ms,vl="prototype",yl="script",gl=ws("IE_PROTO"),ml=function(e){return"<"+yl+">"+e+"</"+yl+">"},El=function(){try{ul=new ActiveXObject("htmlfile")}catch(e){}El="undefined"==typeof document||document.domain&&ul?Xc(ul):(e=dl("iframe"),t="java"+yl+":",e.style.display="none",hl.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(ml("document.F=Object")),t.close(),t.F);for(var e,t,r=fl.length;r--;)delete El[vl][fl[r]];return El()},Gc=(Oa[gl]=!0,Object.create||function(e,t){var r;return null!==e?($c[vl]=ll(e),r=new $c,$c[vl]=null,r[gl]=e):r=El(),void 0===t?r:pl.f(r,t)}),wl=Error,bl=m("".replace),_=String(wl("zxcasd").stack),Tl=/\n\s*at [^:]*:[^\n]*/,_l=Tl.test(_),Ol=us,Nl=b,Il=ps,Al=t,Sl=m(m.bind),Oa={},Rl=Oa,Ml=ys("iterator"),Cl=Array.prototype,_={},_=(_[ys("toStringTag")]="z","[object z]"===String(_)),N=_,xl=as,Pl=is,Ul=ys("toStringTag"),kl=Object,Dl="Arguments"==Pl(function(){return arguments}()),N=N?Pl:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,t){try{return e[t]}catch(e){}}(e=kl(e),Ul))?t:Dl?Pl(e):"Object"==(t=Pl(e))&&xl(e.callee)?"Arguments":t},Ll=N,Fl=fs,Vl=Oa,jl=ys("iterator"),Bl=r,Hl=ps,Gl=Es,zl=ls,Kl=el,Jl=TypeError,Yl=r,Wl=Es,ql=fs,$l=Zc,Xl=r,Zl=Es,Ql=ls,ep=Qc,tp=y,rp=E,np=tl,ip=el,op=rl,sp=TypeError,ap=nl.prototype,up=N,cp=String,lp=ol,pp=ns,I=!rs(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",pp(1,7)),7!==e.stack)}),A=g,fp=E,hp=Su,dp=Hc,vp=Is,yp=Gc,gp=b,mp=ns,Ep=function(e,t){if(_l&&"string"==typeof e&&!wl.prepareStackTrace)for(;t--;)e=bl(e,Tl,"");return e},wp=function(e,t){Ol(t)&&"cause"in t&&Nl(e,"cause",t.cause)},bp=il,Tp=function(e,t){return void 0===e?arguments.length<2?"":t:lp(e)},_p=I,Op=ys("toStringTag"),Np=Error,Ip=[].push,Ap=(dp?dp(sl,Np):vp(sl,Np,{name:!0}),sl.prototype=yp(Np.prototype,{constructor:mp(1,sl),message:mp(1,""),name:mp(1,"AggregateError")})),I=(A({global:!0,constructor:!0,arity:2},{AggregateError:sl}),ys),vp=Gc,mp=Sa.f,Sp=I("unscopables"),Rp=Array.prototype,A=(null==Rp[Sp]&&mp(Rp,Sp,{configurable:!0,value:vp(null)}),rs),I=as,mp=Su,vp=bs,Mp=ys("iterator"),Cp=!1;[].keys&&("next"in(S=[].keys())?(mp=mp(mp(S)))!==Object.prototype&&(cl=mp):Cp=!0);function xp(e,t,r){(e=e&&!r?e.prototype:e)&&!Lp(e,Fp)&&Dp(e,Fp,{configurable:!0,value:t})}function Pp(){return this}function Up(){return this}function kp(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!nf&&e in p)return p[e];switch(e){case"keys":case sf:case af:return function(){return new r(this,e)}}return function(){return new r(this)}}Yp(r,t,n);var u,c,n=t+" Iterator",l=!1,p=e.prototype,f=p[of]||p["@@iterator"]||i&&p[i],h=!nf&&f||a(i),d="Array"==t&&p.entries||f;if(d&&(d=Wp(d.call(new e)))!==Object.prototype&&d.next&&(Wp(d)!==rf&&(qp?qp(d,rf):Jp(d[of])||Zp(d,of,Up)),$p(d,n,!0)),ef&&i==sf&&f&&f.name!==sf&&(tf?Xp(p,"name",sf):(l=!0,h=function(){return Kp(f,this)})),i)if(u={values:a(sf),keys:o?h:a("keys"),entries:a(af)},s)for(c in u)!nf&&!l&&c in p||Zp(p,c,u[c]);else zp({target:t,proto:!0,forced:nf||l},u);return p[of]!==h&&Zp(p,of,h,{name:i}),Qp[t]=h,u}I((cl=null==cl||A(function(){var e={};return cl[Mp].call(e)!==e})?{}:cl)[Mp])||vp(cl,Mp,function(){return this});var S={IteratorPrototype:cl,BUGGY_SAFARI_ITERATORS:Cp},Dp=Sa.f,Lp=T,Fp=ys("toStringTag"),Vp=S.IteratorPrototype,jp=Gc,Bp=ns,Hp=xp,Gp=Oa,zp=g,Kp=r,Jp=as,Yp=function(e,t,r,n){t+=" Iterator";return e.prototype=jp(Vp,{next:Bp(+!n,r)}),Hp(e,t,!1),Gp[t]=Pp,e},Wp=Su,qp=Hc,$p=xp,Xp=b,Zp=bs,mp=ys,Qp=Oa,ef=w.PROPER,tf=w.CONFIGURABLE,rf=S.IteratorPrototype,nf=S.BUGGY_SAFARI_ITERATORS,of=mp("iterator"),sf="values",af="entries",uf=ss,I=al,A=Oa,vp=G,Cp=Sa.f,w=kp,S=Q,cf="Array Iterator",lf=vp.set,pf=vp.getterFor(cf),mp=w(Array,"Array",function(e,t){lf(this,{type:cf,target:uf(e),index:0,kind:t})},function(){var e=pf(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),Oa=A.Arguments=A.Array;if(I("keys"),I("values"),I("entries"),S&&"values"!==Oa.name)try{Cp(Oa,"name",{value:"values"})}catch(e){}var ff=N;_||bs(Object.prototype,"toString",_?{}.toString:function(){return"[object "+ff(this)+"]"},{unsafe:!0});function hf(e){var e=bf(e),t=Tf.f;_f&&e&&!e[Of]&&t(e,Of,{configurable:!0,get:function(){return this}})}function df(e,t){if(Nf(t,e))return e;throw If("Incorrect invocation")}function vf(){}function yf(e){if(!Af(e))return!1;try{return Cf(vf,Mf,e),!0}catch(e){return!1}}function gf(e){if(!Af(e))return!1;switch(Sf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Uf||!!Pf(xf,Rf(e))}catch(e){return!0}}function mf(e,t){return void 0===(e=Ff(e).constructor)||null==(e=Ff(e)[jf])?t:Vf(e)}var Ef,wf,vp="process"==is(i.process),bf=cs,Tf=Sa,_f=Q,Of=ys("species"),Nf=E,If=TypeError,w=m,A=rs,Af=as,Sf=N,Rf=Ma,Mf=[],Cf=cs("Reflect","construct"),xf=/^\s*(?:class|function)\b/,Pf=w(xf.exec),Uf=!xf.exec(vf),I=(gf.sham=!0,!Cf||A(function(){var e;return yf(yf.call)||!yf(Object)||!yf(function(){e=!0})||e})?gf:yf),kf=I,Df=ls,Lf=TypeError,Ff=Es,Vf=function(e){if(kf(e))return e;throw Lf(Df(e)+" is not a constructor")},jf=ys("species"),S=Function.prototype,Bf=S.apply,Hf=S.call,Cp="object"==typeof Reflect&&Reflect.apply||(t?Hf.bind(Bf):function(){return Hf.apply(Bf,arguments)}),Oa=m([].slice),Gf=TypeError,_=/(?:ipad|iphone|ipod).*applewebkit/i.test(Zs),zf=i,Kf=Cp,E=Zc,Jf=as,Yf=T,N=rs,Wf=O,qf=Oa,$f=ms,Xf=function(e,t){if(e<t)throw Gf("Not enough arguments");return e},w=_,A=vp,S=zf.setImmediate,t=zf.clearImmediate,Zf=zf.process,Qf=zf.Dispatch,eh=zf.Function,O=zf.MessageChannel,th=zf.String,rh=0,nh={},ih="onreadystatechange";try{Ef=zf.location}catch(e){}function oh(e){return function(){Th(e)}}function sh(e){Th(e.data)}function ah(e){zf.postMessage(th(e),Ef.protocol+"//"+Ef.host)}function uh(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function ch(){this.head=null,this.tail=null}function lh(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=kh(r),this.reject=kh(n)}function ph(e,t){var r,n,i,o,s=t.value,a=t.state==cd,u=a?e.ok:e.fail,c=e.resolve,l=e.reject,p=e.domain;try{u?(a||(t.rejection===fd&&(o=t,Fh(zh,Lh,function(){var e=o.facade;Dh?nd.emit("rejectionHandled",e):vd(ud,e,o.value)})),t.rejection=pd),!0===u?r=s:(p&&p.enter(),r=u(s),p&&(p.exit(),i=!0)),r===e.promise?l(td("Promise-chain cycle")):(n=hd(r))?Fh(n,r,c,l):c(r)):l(s)}catch(e){p&&!i&&p.exit(),l(e)}}var fh,hh,dh,vh,yh,gh,mh,Eh,wh,bh,Th=function(e){var t;Yf(nh,e)&&(t=nh[e],delete nh[e],t())},O=(S&&t||(S=function(e){Xf(arguments.length,1);var t=Jf(e)?e:eh(e),r=qf(arguments,1);return nh[++rh]=function(){Kf(t,void 0,r)},wf(rh),rh},t=function(e){delete nh[e]},A?wf=function(e){Zf.nextTick(oh(e))}:Qf&&Qf.now?wf=function(e){Qf.now(oh(e))}:O&&!w?(w=(A=new O).port2,A.port1.onmessage=sh,wf=E(w.postMessage,w)):zf.addEventListener&&Jf(zf.postMessage)&&!zf.importScripts&&Ef&&"file:"!==Ef.protocol&&!N(ah)?(wf=ah,zf.addEventListener("message",sh,!1)):wf=ih in $f("script")?function(e){Wf.appendChild($f("script"))[ih]=function(){Wf.removeChild(this),Th(e)}}:function(e){setTimeout(oh(e),0)}),{set:S,clear:t}),A=i,E=/ipad|iphone|ipod/i.test(Zs)&&void 0!==A.Pebble,w=/web0s(?!.*chrome)/i.test(Zs),N=i,S=Zc,t=e.f,_h=O.set,A=_,e=E,_=w,Oh=vp,E=N.MutationObserver||N.WebKitMutationObserver,w=N.document,Nh=N.process,R=N.Promise,t=t(N,"queueMicrotask"),t=t&&t.value,_=(t||(fh=function(){var e,t;for(Oh&&(e=Nh.domain)&&e.exit();hh;){t=hh.fn,hh=hh.next;try{t()}catch(e){throw hh?vh():dh=void 0,e}}dh=void 0,e&&e.enter()},vh=A||Oh||_||!E||!w?!e&&R&&R.resolve?((A=R.resolve(void 0)).constructor=R,mh=S(A.then,A),function(){mh(fh)}):Oh?function(){Nh.nextTick(fh)}:(_h=S(_h,N),function(){_h(fh)}):(yh=!0,gh=w.createTextNode(""),new E(fh).observe(gh,{characterData:!0}),function(){gh.data=yh=!yh})),t||function(e){e={fn:e,next:void 0};dh&&(dh.next=e),hh||(hh=e,vh()),dh=e}),Ih=i,e=(ch.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},ch),R=i.Promise,A="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,S=!A&&!vp&&"object"==typeof window&&"object"==typeof document,N=i,Ah=R,w=as,E=Ou,Sh=Ma,t=ys,Rh=S,Mh=A,Ch=ea,xh=(Ah&&Ah.prototype,t("species")),Ph=!1,Uh=w(N.PromiseRejectionEvent),Ma={CONSTRUCTOR:E("Promise",function(){var e=Sh(Ah),t=e!==String(Ah);if(!t&&66===Ch)return!0;if(!Ch||Ch<51||!/native code/.test(e)){var e=new Ah(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[xh]=r,!(Ph=e.then(function(){})instanceof r))return!0}return!t&&(Rh||Mh)&&!Uh}),REJECTION_EVENT:Uh,SUBCLASSING:Ph},S={},kh=ps,A=(S.f=function(e){return new lh(e)},g),Dh=vp,Lh=i,Fh=r,t=bs,w=Hc,N=xp,E=hf,Vh=ps,jh=as,Bh=us,Hh=df,Gh=mf,zh=O.set,Kh=_,Jh=function(e,t){var r=Ih.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Yh=uh,Wh=e,O=G,_=R,e=S,qh="Promise",M=Ma.CONSTRUCTOR,$h=Ma.REJECTION_EVENT,C=Ma.SUBCLASSING,Xh=O.getterFor(qh),Zh=O.set,O=_&&_.prototype,Qh=_,ed=O,td=Lh.TypeError,rd=Lh.document,nd=Lh.process,id=e.f,od=id,sd=!!(rd&&rd.createEvent&&Lh.dispatchEvent),ad="unhandledrejection",ud="rejectionhandled",cd=1,ld=2,pd=1,fd=2,hd=function(e){var t;return!(!Bh(e)||!jh(t=e.then))&&t},dd=function(r,i){r.notified||(r.notified=!0,Kh(function(){for(var e,n,t=r.reactions;e=t.get();)ph(e,r);r.notified=!1,i&&!r.rejection&&(n=r,Fh(zh,Lh,function(){var e=n.facade,t=n.value,r=yd(n);if(r&&(r=Yh(function(){Dh?nd.emit("unhandledRejection",t,e):vd(ad,e,t)}),n.rejection=Dh||yd(n)?fd:pd,r.error))throw r.value}))}))},vd=function(e,t,r){var n;sd?((n=rd.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Lh.dispatchEvent(n)):n={promise:t,reason:r},!$h&&(t=Lh["on"+e])?t(n):e===ad&&Jh("Unhandled promise rejection",r)},yd=function(e){return e.rejection!==pd&&!e.parent},gd=function(t,r,n){return function(e){t(r,e,n)}},md=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=ld,dd(e,!0))},Ed=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw td("Promise can't be resolved itself");var n=hd(e);n?Kh(function(){var t={done:!1};try{Fh(n,e,gd(Ed,t,r),gd(md,t,r))}catch(e){md(t,e,r)}}):(r.value=e,r.state=cd,dd(r,!1))}catch(e){md({done:!1},e,r)}}};if(M&&(ed=(Qh=function(e){Hh(this,ed),Vh(e),Fh(Eh,this);var t=Xh(this);try{e(gd(Ed,t),gd(md,t))}catch(e){md(t,e)}}).prototype,(Eh=function(e){Zh(this,{type:qh,done:!1,notified:!1,parent:!1,reactions:new Wh,rejection:!1,state:0,value:void 0})}).prototype=t(ed,"then",function(e,t){var r=Xh(this),n=id(Gh(this,Qh));return r.parent=!0,n.ok=!jh(e)||e,n.fail=jh(t)&&t,n.domain=Dh?nd.domain:void 0,0==r.state?r.reactions.add(n):Kh(function(){ph(n,r)}),n.promise}),wh=function(){var e=new Eh,t=Xh(e);this.promise=e,this.resolve=gd(Ed,t),this.reject=gd(md,t)},e.f=id=function(e){return e===Qh||void 0===e?new wh:od(e)},jh(_)&&O!==Object.prototype)){bh=O.then,C||t(O,"then",function(e,t){var r=this;return new Qh(function(e,t){Fh(bh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}w&&w(O,ed)}A({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:Qh}),N(Qh,qh,!1),E(qh);var wd=ys("iterator"),bd=!1;try{var Td=0,x={next:function(){return{done:!!Td++}},return:function(){bd=!0}};x[wd]=function(){return this},Array.from(x,function(){throw 2})}catch(e){}function _d(e,t){if(!t&&!bd)return!1;var r=!1;try{var n={};n[wd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var Od=R,e=_d,_=Ma.CONSTRUCTOR||!e(function(e){Od.all(e).then(void 0,function(){})}),Nd=r,Id=ps,Ad=S,Sd=uh,Rd=il,C=(g({target:"Promise",stat:!0,forced:_},{all:function(e){var a=this,t=Ad.f(a),u=t.resolve,c=t.reject,r=Sd(function(){var n=Id(a.resolve),i=[],o=0,s=1;Rd(e,function(e){var t=o++,r=!1;s++,Nd(n,a,e).then(function(e){r||(r=!0,i[t]=e,--s||u(i))},c)}),--s||u(i)});return r.error&&c(r.value),t.promise}}),g),t=R,w=cs,O=as,A=bs,M=t&&t.prototype;C({target:"Promise",proto:!0,forced:Ma.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),O(t)&&(N=w("Promise").prototype.catch,M.catch!==N&&A(M,"catch",N,{unsafe:!0}));var Md=r,Cd=ps,xd=S,Pd=uh,Ud=il;g({target:"Promise",stat:!0,forced:_},{race:function(e){var r=this,n=xd.f(r),i=n.reject,t=Pd(function(){var t=Cd(r.resolve);Ud(e,function(e){Md(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function kd(e,t){return Fd(e),Vd(t)&&t.constructor===e?t:((0,(e=jd.f(e)).resolve)(t),e.promise)}var Dd=r,Ld=S,Fd=(g({target:"Promise",stat:!0,forced:Ma.CONSTRUCTOR},{reject:function(e){var t=Ld.f(this);return Dd(t.reject,void 0,e),t.promise}}),Es),Vd=us,jd=S,E=g,x=cs,e=Ma.CONSTRUCTOR,Bd=kd;x("Promise"),E({target:"Promise",stat:!0,forced:e},{resolve:function(e){return Bd(this,e)}});var Hd=r,Gd=ps,zd=S,Kd=uh,Jd=il;g({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=zd.f(a),u=t.resolve,r=t.reject,n=Kd(function(){var n=Gd(a.resolve),i=[],o=0,s=1;Jd(e,function(e){var t=o++,r=!1;s++,Hd(n,a,e).then(function(e){r||(r=!0,i[t]={status:"fulfilled",value:e},--s||u(i))},function(e){r||(r=!0,i[t]={status:"rejected",reason:e},--s||u(i))})}),--s||u(i)});return n.error&&r(n.value),t.promise}});function Yd(i){return function(e,t){var r,e=av(uv(e)),t=sv(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=lv(e,t))<55296||56319<r||t+1===n||(n=lv(e,t+1))<56320||57343<n?i?cv(e,t):r:i?pv(e,t,t+2):n-56320+(r-55296<<10)+65536}}var Wd=r,qd=ps,$d=cs,Xd=S,Zd=uh,Qd=il,ev="No one promise resolved",C=(g({target:"Promise",stat:!0},{any:function(e){var u=this,c=$d("AggregateError"),t=Xd.f(u),l=t.resolve,p=t.reject,r=Zd(function(){var n=qd(u.resolve),i=[],o=0,s=1,a=!1;Qd(e,function(e){var t=o++,r=!1;s++,Wd(n,u,e).then(function(e){r||a||(a=!0,l(e))},function(e){r||a||(r=!0,i[t]=e,--s||p(new c(i,ev)))})}),--s||p(new c(i,ev))});return r.error&&p(r.value),t.promise}}),g),O=R,t=rs,tv=cs,rv=as,nv=mf,iv=kd,w=bs,ov=O&&O.prototype,M=(C({target:"Promise",proto:!0,real:!0,forced:!!O&&t(function(){ov.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=nv(this,tv("Promise")),e=rv(t);return this.then(e?function(e){return iv(r,t()).then(function(){return e})}:t,e?function(e){return iv(r,t()).then(function(){throw e})}:t)}}),rv(O)&&(A=tv("Promise").prototype.finally,ov.finally!==A&&w(ov,"finally",A,{unsafe:!0})),m),sv=Ts,av=ol,uv=os,cv=M("".charAt),lv=M("".charCodeAt),pv=M("".slice),fv={codeAt:Yd(!1),charAt:Yd(!0)}.charAt,hv=ol,N=G,_=kp,dv="String Iterator",vv=N.set,yv=N.getterFor(dv);_(String,"String",function(e){vv(this,{type:dv,string:hv(e),index:0})},function(){var e=yv(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=fv(t,r),e.index+=t.length,{value:t,done:!1})});function gv(t,e){if(t){if(t[_v]!==Nv)try{Tv(t,_v,Nv)}catch(e){t[_v]=Nv}if(t[Ov]||Tv(t,Ov,e),wv[e])for(var r in bv)if(t[r]!==bv[r])try{Tv(t,r,bv[r])}catch(e){t[r]=bv[r]}}}var mv,Ma=i,x=Ma.Promise,E=ms("span").classList,e=E&&E.constructor&&E.constructor.prototype,R=e===Object.prototype?void 0:e,Ev=i,wv={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},C=R,bv=mp,Tv=b,t=ys,_v=t("iterator"),Ov=t("toStringTag"),Nv=bv.values;for(mv in wv)gv(Ev[mv]&&Ev[mv].prototype,mv);gv(C,"DOMTokenList");var O,w,A=w=O=x,M,Iv=S,Av=uh,Sv=((M=g)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=Iv.f(this),e=Av(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),Es),Rv=rl,Mv=gs,Cv=Sa,xv=ns,N,Pv=Zc,Uv=r,kv=ds,Dv=function(t,e,r,n){try{return n?e(Sv(r)[0],r[1]):e(r)}catch(e){Rv(t,"throw",e)}},Lv=Qc,Fv=I,Vv=y,jv=N=function(e,t,r){t=Mv(t);t in e?Cv.f(e,t,xv(0,r)):e[t]=r},Bv=tl,Hv=el,Gv=Array,_,E=function(e){var t,r,n,i,o,s,a=kv(e),e=Fv(this),u=arguments.length,c=1<u?arguments[1]:void 0,l=void 0!==c,u=(l&&(c=Pv(c,2<u?arguments[2]:void 0)),Hv(a)),p=0;if(!u||this===Gv&&Lv(u))for(t=Vv(a),r=e?new this(t):Gv(t);p<t;p++)s=l?c(a[p],p):a[p],jv(r,p,s);else for(o=(i=Bv(a,u)).next,r=e?new this:[];!(n=Uv(o,i)).done;p++)s=l?Dv(i,c,[n.value,p],!0):n.value,jv(r,p,s);return r.length=p,r},e,R,zv=((_=g)({target:"Array",stat:!0,forced:R=!(e=_d)(function(e){Array.from(e)})},{from:E}),is),mp=Array.isArray||function(e){return"Array"==zv(e)},b,t,C=((b=g)({target:"Array",stat:!0},{isArray:t=mp}),g),x=rs,Kv=I,Jv=N,Yv=Array,O=x(function(){function e(){}return!(Yv.of.call(e)instanceof e)}),Wv=(C({target:"Array",stat:!0,forced:O},{of:function(){for(var e=0,t=arguments.length,r=new(Kv(this)?this:Yv)(t);e<t;)Jv(r,e,arguments[e++]);return r.length=t,r}}),ds),qv=y,$v=Ts,w=al,Xv=(g({target:"Array",proto:!0},{at:function(e){var t=Wv(this),r=qv(t),e=$v(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),w("at"),TypeError),A=function(e){if(9007199254740991<e)throw Xv("Maximum allowed index exceeded");return e},Zv=mp,Qv=I,ey=us,ty=ys("species"),ry=Array,ny=function(e){var t;return Zv(e)&&(t=e.constructor,(Qv(t)&&(t===ry||Zv(t.prototype))||ey(t)&&null===(t=t[ty]))&&(t=void 0)),void 0===t?ry:t},S=function(e,t){return new(ny(e))(0===t?0:t)},iy=rs,oy=ea,sy=ys("species"),M,e=g,_=rs,ay=mp,uy=us,cy=ds,ly=y,py=A,fy=N,hy=S,R=M=function(t){return 51<=oy||!iy(function(){var e=[];return(e.constructor={})[sy]=function(){return{foo:1}},1!==e[t](Boolean).foo})},E=ea,dy=ys("isConcatSpreadable"),b=51<=E||!_(function(){var e=[];return e[dy]=!1,e.concat()[0]!==e}),t=R("concat"),vy=(e({target:"Array",proto:!0,arity:1,forced:!b||!t},{concat:function(e){for(var t,r,n,i=cy(this),o=hy(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!uy(e))return!1;var t=e[dy];return void 0!==t?!!t:ay(e)}(n=-1===a?i:arguments[a]))for(r=ly(n),py(s+r),t=0;t<r;t++,s++)t in n&&fy(o,s,n[t]);else py(s+1),fy(o,s++,n);return o.length=s,o}}),ls),yy=TypeError,x,gy=ds,my=_s,Ey=y,wy=x=function(e,t){if(!delete e[t])throw yy("Cannot delete property "+vy(t)+" of "+vy(e))},by=Math.min,C=al,Ty=(g({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=gy(this),n=Ey(r),i=my(e,n),o=my(t,n),e=2<arguments.length?arguments[2]:void 0,s=by((void 0===e?n:my(e,n))-o,n-i),a=1;for(o<i&&i<o+s&&(a=-1,o+=s-1,i+=s-1);0<s--;)o in r?r[i]=r[o]:wy(r,i),i+=a,o+=a;return r}}),C("copyWithin"),Zc),_y=Fs,Oy=ds,Ny=y,Iy=S,Ay=m([].push),O,w={forEach:(O=function(f){var h=1==f,d=2==f,v=3==f,y=4==f,g=6==f,m=7==f,E=5==f||g;return function(e,t,r,n){for(var i,o,s=Oy(e),a=_y(s),u=Ty(t,r),c=Ny(a),l=0,t=n||Iy,p=h?t(e,c):d||m?t(e,0):void 0;l<c;l++)if((E||l in a)&&(o=u(i=a[l],l,s),f))if(h)p[l]=o;else if(o)switch(f){case 3:return!0;case 5:return i;case 6:return l;case 2:Ay(p,i)}else switch(f){case 4:return!1;case 7:Ay(p,i)}return g?-1:v||y?y:p}})(0),map:O(1),filter:O(2),some:O(3),every:O(4),find:O(5),findIndex:O(6),filterReject:O(7)},Sy=rs,E=function(e,t){var r=[][e];return!!r&&Sy(function(){r.call(null,t||function(){return 1},1)})},_=g,Ry=w.every,My=(_({target:"Array",proto:!0,forced:!E("every")},{every:function(e){return Ry(this,e,1<arguments.length?arguments[1]:void 0)}}),ds),Cy=_s,xy=y,R=al,e=(g({target:"Array",proto:!0},{fill:function(e){for(var t=My(this),r=xy(t),n=arguments.length,i=Cy(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:Cy(n,r);i<o;)t[i++]=e;return t}}),R("fill"),g),Py=w.filter,b=(e({target:"Array",proto:!0,forced:!M("filter")},{filter:function(e){return Py(this,e,1<arguments.length?arguments[1]:void 0)}}),g),Uy=w.find,t=al,C,ky=!0,O=((C="find")in[]&&Array(1)[C](function(){ky=!1}),b({target:"Array",proto:!0,forced:ky},{find:function(e){return Uy(this,e,1<arguments.length?arguments[1]:void 0)}}),t(C),g),Dy=w.findIndex,_=al,R,Ly=!0,Fy=((R="findIndex")in[]&&Array(1)[R](function(){Ly=!1}),O({target:"Array",proto:!0,forced:Ly},{findIndex:function(e){return Dy(this,e,1<arguments.length?arguments[1]:void 0)}}),_(R),Zc),Vy=Fs,jy=ds,By=y,e,b={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=jy(e),o=Vy(i),s=Fy(t,r),a=By(o);0<a--;)if(s(n=o[a],a,i))switch(u){case 0:return n;case 1:return a}return c?-1:void 0}})(0),findLastIndex:e(1)},t=g,Hy=b.findLast,C=al,O=(t({target:"Array",proto:!0},{findLast:function(e){return Hy(this,e,1<arguments.length?arguments[1]:void 0)}}),C("findLast"),g),Gy=b.findLastIndex,_=al,zy=(O({target:"Array",proto:!0},{findLastIndex:function(e){return Gy(this,e,1<arguments.length?arguments[1]:void 0)}}),_("findLastIndex"),mp),Ky=y,Jy=A,Yy=Zc,Wy=function(e,t,r,n,i,o,s,a){for(var u,c,l=i,p=0,f=!!s&&Yy(s,a);p<n;)p in r&&(u=f?f(r[p],p,t):r[p],0<o&&zy(u)?(c=Ky(u),l=Wy(e,t,u,c,l,o-1)-1):(Jy(l+1),e[l]=u),l++),p++;return l},R,qy=R=Wy,$y=ds,Xy=y,Zy=Ts,Qy=S;g({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=$y(this),r=Xy(t),n=Qy(t,0);return n.length=qy(n,t,t,r,0,void 0===e?1:Zy(e)),n}});function eg(c){return function(e,t,r,n){Ig(t);var i=Ag(e),o=Sg(i),s=Rg(i),a=c?s-1:0,u=c?-1:1;if(r<2)for(;;){if(a in o){n=o[a],a+=u;break}if(a+=u,c?a<0:s<=a)throw Mg("Reduce of empty array with no initial value")}for(;c?0<=a:a<s;a+=u)a in o&&(n=t(n,o[a],a,i));return n}}function tg(e,t,r){for(var n=Wg(e),i=Yg(t,n),o=Yg(void 0===r?n:r,n),s=$g(Xg(o-i,0)),a=0;i<o;i++,a++)qg(s,a,e[i]);return s.length=a,s}function rg(e,t){var r=e.length,n=Qg(r/2);if(r<8){for(var i,o,s=e,a=t,u=s.length,c=1;c<u;){for(i=s[o=c];o&&0<a(s[o-1],i);)s[o]=s[--o];o!==c++&&(s[o]=i)}return s}for(var l=e,p=rg(Zg(e,0,n),t),f=rg(Zg(e,n),t),h=t,d=p.length,v=f.length,y=0,g=0;y<d||g<v;)l[y+g]=y<d&&g<v?h(p[y],f[g])<=0?p[y++]:f[g++]:y<d?p[y++]:f[g++];return l}var ng=R,ig=ps,og=ds,sg=y,ag=S,ug=(g({target:"Array",proto:!0},{flatMap:function(e){var t,r=og(this),n=sg(r);return ig(e),(t=ag(r,0)).length=ng(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),w.forEach),e=E("forEach")?[].forEach:function(e){return ug(this,e,1<arguments.length?arguments[1]:void 0)},t=(g({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),g),cg=Nu.includes,C=al,b=(t({target:"Array",proto:!0,forced:rs(function(){return!Array(1).includes()})},{includes:function(e){return cg(this,e,1<arguments.length?arguments[1]:void 0)}}),C("includes"),g),O=m,lg=Nu.indexOf,_=E,pg=O([].indexOf),fg=!!pg&&1/pg([1],1,-0)<0,R=_("indexOf"),e=(b({target:"Array",proto:!0,forced:fg||!R},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return fg?pg(this,e,t)||0:lg(this,e,t)}}),g),t=Fs,hg=ss,C=E,dg=m([].join),Nu=t!=Object,O=C("join",","),vg=(e({target:"Array",proto:!0,forced:Nu||!O},{join:function(e){return dg(hg(this),void 0===e?",":e)}}),Cp),yg=ss,gg=Ts,mg=y,_=E,Eg=Math.min,wg=[].lastIndexOf,bg=!!wg&&1/[1].lastIndexOf(1,-0)<0,b=_("lastIndexOf"),R=bg||!b?function(e){if(bg)return vg(wg,this,arguments)||0;var t=yg(this),r=mg(t),n=r-1;for((n=1<arguments.length?Eg(n,gg(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:wg,t=(g({target:"Array",proto:!0,forced:R!==[].lastIndexOf},{lastIndexOf:R}),g),Tg=w.map,C=(t({target:"Array",proto:!0,forced:!M("map")},{map:function(e){return Tg(this,e,1<arguments.length?arguments[1]:void 0)}}),g),_g=ds,Og=y,Ng=A,e=rs(function(){return 4294967297!==[].push.call({length:4294967296},1)}),Nu=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),Ig=(C({target:"Array",proto:!0,arity:1,forced:e||Nu},{push:function(e){var t=_g(this),r=Og(t),n=arguments.length;Ng(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),ps),Ag=ds,Sg=Fs,Rg=y,Mg=TypeError,O={left:eg(!1),right:eg(!0)},Cp=g,Cg=O.left,_=ea,b=vp,R=(Cp({target:"Array",proto:!0,forced:!E("reduce")||!b&&79<_&&_<83},{reduce:function(e){var t=arguments.length;return Cg(this,e,t,1<t?arguments[1]:void 0)}}),g),xg=O.right,t=ea,C=vp,e=(R({target:"Array",proto:!0,forced:!E("reduceRight")||!C&&79<t&&t<83},{reduceRight:function(e){return xg(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),g),Pg=mp,Ug=m([].reverse),Nu=[1,2],Cp=(e({target:"Array",proto:!0,forced:String(Nu)===String(Nu.reverse())},{reverse:function(){return Pg(this)&&(this.length=this.length),Ug(this)}}),g),kg=mp,Dg=I,Lg=us,Fg=_s,Vg=y,jg=ss,Bg=N,b=ys,Hg=Oa,_=M("slice"),Gg=b("species"),zg=Array,Kg=Math.max,O=(Cp({target:"Array",proto:!0,forced:!_},{slice:function(e,t){var r,n,i,o=jg(this),s=Vg(o),a=Fg(e,s),u=Fg(void 0===t?s:t,s);if(kg(o)&&(r=o.constructor,(r=Dg(r)&&(r===zg||kg(r.prototype))||Lg(r)&&null===(r=r[Gg])?void 0:r)===zg||void 0===r))return Hg(o,a,u);for(n=new(void 0===r?zg:r)(Kg(u-a,0)),i=0;a<u;a++,i++)a in o&&Bg(n,i,o[a]);return n.length=i,n}}),g),Jg=w.some,Yg=(O({target:"Array",proto:!0,forced:!E("some")},{some:function(e){return Jg(this,e,1<arguments.length?arguments[1]:void 0)}}),_s),Wg=y,qg=N,$g=Array,Xg=Math.max,Zg=tg,Qg=Math.floor,vp=rg,R=Zs.match(/firefox\/(\d+)/i),C=!!R&&+R[1],t=/MSIE|Trident/.test(Zs),e=Zs.match(/AppleWebKit\/(\d+)\./),Nu=!!e&&+e[1],Oa=g,b=m,em=ps,tm=ds,rm=y,nm=x,im=ol,Cp=rs,om=vp,_=E,sm=C,am=t,um=ea,cm=Nu,lm=[],pm=b(lm.sort),fm=b(lm.push),O=Cp(function(){lm.sort(void 0)}),R=Cp(function(){lm.sort(null)}),Zs=_("sort"),hm=!Cp(function(){if(um)return um<70;if(!(sm&&3<sm)){if(am)return!0;if(cm)return cm<603;for(var e,t,r,n="",i=65;i<76;i++){switch(e=String.fromCharCode(i),i){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(r=0;r<47;r++)lm.push({k:e+r,v:t})}for(lm.sort(function(e,t){return t.v-e.v}),r=0;r<lm.length;r++)e=lm[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});Oa({target:"Array",proto:!0,forced:O||!R||!Zs||!hm},{sort:function(e){void 0!==e&&em(e);var t=tm(this);if(hm)return void 0===e?pm(t):pm(t,e);for(var r,n,i=[],o=rm(t),s=0;s<o;s++)s in t&&fm(i,t[s]);for(om(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:im(e)>im(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)nm(t,s++);return t}});hf("Array");var e=g,dm=ds,vm=_s,ym=Ts,gm=y,mm=A,Em=S,wm=N,bm=x,vp=M("splice"),Tm=Math.max,_m=Math.min;e({target:"Array",proto:!0,forced:!vp},{splice:function(e,t){var r,n,i,o,s,a,u=dm(this),c=gm(u),l=vm(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-l):(r=e-2,_m(Tm(ym(t),0),c-l)),mm(c+r-n),i=Em(u,n),o=0;o<n;o++)(s=l+o)in u&&wm(i,o,u[s]);if(r<(i.length=n)){for(o=l;o<c-n;o++)a=o+r,(s=o+n)in u?u[a]=u[s]:bm(u,a);for(o=c;c-n+r<o;o--)bm(u,o-1)}else if(n<r)for(o=c-n;l<o;o--)a=o+r-1,(s=o+n-1)in u?u[a]=u[s]:bm(u,a);for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}}),al("flat");al("flatMap");var C=g,Om=ds,Nm=y,Im=x,Am=A,t=1!==[].unshift(0),ea=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();C({target:"Array",proto:!0,arity:1,forced:t||ea},{unshift:function(e){var t=Om(this),r=Nm(t),n=arguments.length;if(n){Am(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:Im(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});Ma.Array;var Nu={exports:{}},b={},Sm=is,Rm=ss,Mm=ta.f,Cm=tg,xm="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];b.f=function(e){if(!xm||"Window"!=Sm(e))return Mm(Rm(e));try{return Mm(e)}catch(e){return Cm(xm)}};function Pm(e){Km(e,Xm,{value:{objectID:"O"+Zm++,weakData:{}}})}function Um(e,t,r){for(var n in t)gE(e,n,t[n],r);return e}function km(e,t){for(var r=0,n=ME(t),i=new e(n);r<n;)i[r]=t[r++];return i}function Dm(e,t,r,n){for(var i,o,s,a=PE(e),u=xE(a),c=CE(t,r),l=DE(null),p=kE(u),f=0;f<p;f++)s=u[f],(o=UE(c(s,f,a)))in l?VE(l[o],s):l[o]=[s];if(n&&(i=n(a))!==FE)for(o in l)l[o]=LE(i,l[o]);return l}var _=rs(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),Cp=rs,Lm=us,Fm=is,Vm=_,jm=Object.isExtensible,Oa=Cp(function(){jm(1)})||Vm?function(e){return!!Lm(e)&&((!Vm||"ArrayBuffer"!=Fm(e))&&(!jm||jm(e)))}:jm,O=!rs(function(){return Object.isExtensible(Object.preventExtensions({}))}),Bm=g,Hm=m,R=mu,Gm=us,zm=T,Km=Sa.f,Jm=ta,Ym=b,Wm=Oa,qm=O,$m=!1,Xm=vs("meta"),Zm=0,Qm=Nu.exports={enable:function(){Qm.enable=function(){},$m=!0;var i=Jm.f,o=Hm([].splice),e={};e[Xm]=1,i(e).length&&(Jm.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===Xm){o(t,r,1);break}return t},Bm({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ym.f}))},fastKey:function(e,t){if(!Gm(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!zm(e,Xm)){if(!Wm(e))return"F";if(!t)return"E";Pm(e)}return e[Xm].objectID},getWeakData:function(e,t){if(!zm(e,Xm)){if(!Wm(e))return!0;if(!t)return!1;Pm(e)}return e[Xm].weakData},onFreeze:function(e){return qm&&$m&&Wm(e)&&!zm(e,Xm)&&Pm(e),e}},eE=(R[Xm]=!0,as),tE=us,rE=Hc,nE=g,iE=i,oE=m,sE=Ou,aE=bs,uE=Nu.exports,cE=il,lE=df,pE=as,fE=us,hE=rs,dE=_d,vE=xp,yE=function(e,t,r){return rE&&eE(t=t.constructor)&&t!==r&&tE(t=t.prototype)&&t!==r.prototype&&rE(e,t),e},gE=bs,mE=Sa.f,EE=Gc,wE=Um,bE=Zc,TE=df,_E=il,OE=kp,NE=hf,IE=Q,AE=Nu.exports.fastKey,SE=G.set,RE=G.getterFor,ME=(function(e,t,r){function n(e){var r=oE(h[e]);aE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(l&&!fE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return l&&!fE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(l&&!fE(e))&&r(this,0===e?0:e)}:function(e,t){return r(this,0===e?0:e,t),this})}var i,o,s,a,u,c=-1!==e.indexOf("Map"),l=-1!==e.indexOf("Weak"),p=c?"set":"add",f=iE[e],h=f&&f.prototype,d=f,v={};return sE(e,!pE(f)||!(l||h.forEach&&!hE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,p),uE.enable()):sE(e,!0)&&(o=(i=new d)[p](l?{}:-0,1)!=i,s=hE(function(){i.has(1)}),a=dE(function(e){new f(e)}),u=!l&&hE(function(){for(var e=new f,t=5;t--;)e[p](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){lE(e,h);e=yE(new f,e,d);return null!=t&&cE(t,e[p],{that:e,AS_ENTRIES:c}),e})).prototype=h).constructor=d),(s||u)&&(n("delete"),n("has"),c&&n("get")),(u||o)&&n(p),l&&h.clear&&delete h.clear),v[e]=d,nE({global:!0,constructor:!0,forced:d!=f},v),vE(d,e),l||r.setStrong(d,e,c),d}("Map",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},{getConstructor:function(e,r,n,i){function o(e,t,r){var n,i=u(e),o=s(e,t);return o?o.value=r:(i.last=o={index:n=AE(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),IE?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=AE(t);if("F"!==n)return e.index[n];for(r=e.first;r;r=r.next)if(r.key==t)return r}var e=e(function(e,t){TE(e,a),SE(e,{type:r,index:EE(null),first:void 0,last:void 0,size:0}),IE||(e.size=0),null!=t&&_E(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=RE(r);return wE(a,{clear:function(){for(var e=u(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,IE?e.size=0:this.size=0},delete:function(e){var t,r,n=u(this),e=s(this,e);return e&&(t=e.next,r=e.previous,delete n.index[e.index],e.removed=!0,r&&(r.next=t),t&&(t.previous=r),n.first==e&&(n.first=t),n.last==e&&(n.last=r),IE?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=bE(e,1<arguments.length?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),wE(a,n?{get:function(e){e=s(this,e);return e&&e.value},set:function(e,t){return o(this,0===e?0:e,t)}}:{add:function(e){return o(this,e=0===e?0:e,e)}}),IE&&mE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=RE(t),o=RE(n);OE(e,t,function(e,t){SE(this,{type:n,target:e,state:i(e),kind:t,last:void 0})},function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:{value:e.target=void 0,done:!0}},r?"entries":"values",!r,!0),NE(t)}}),y),CE=Zc,xE=Fs,PE=ds,UE=gs,kE=y,DE=Gc,LE=km,FE=Array,VE=m([].push),jE=Dm,Zs=al;g({target:"Array",proto:!0},{group:function(e){return jE(this,e,1<arguments.length?arguments[1]:void 0)}}),Zs("group");var BE=Dm,N=al;g({target:"Array",proto:!0,forced:!E("groupBy")},{groupBy:function(e){return BE(this,e,1<arguments.length?arguments[1]:void 0)}}),N("groupBy");function HE(e){for(var t,r,n=KE(this),i=zE(n),o=GE(e,1<arguments.length?arguments[1]:void 0),s=new YE,a=JE(i),u=0;u<a;u++)t=o(r=i[u],u,n),qE(s,t)?XE(WE(s,t),r):$E(s,t,[r]);return s}var GE=Zc,M=m,zE=Fs,KE=ds,JE=y,YE=cs("Map"),e=YE.prototype,WE=M(e.get),qE=M(e.has),$E=M(e.set),XE=M([].push),vp=al,x=HE;g({target:"Array",proto:!0,name:"groupToMap",forced:!E("groupByToMap")},{groupByToMap:x}),vp("groupByToMap");function ZE(e){return nw[e].prototype}var C=al,QE=(g({target:"Array",proto:!0},{groupToMap:HE}),C("groupToMap"),y),ew=function(e,t){for(var r=QE(e),n=new t(r),i=0;i<r;i++)n[i]=e[r-i-1];return n},tw=ss,t=al,rw=Array,nw=(g({target:"Array",proto:!0},{toReversed:function(){return ew(tw(this),rw)}}),t("toReversed"),i),ea=g,iw=ps,ow=ss,sw=km,Ma=al,aw=Array,uw=m(ZE("Array").sort),_=(ea({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&iw(e);var t=ow(this),t=sw(aw,t);return uw(t,e)}}),Ma("toSorted"),g),Cp=al,cw=A,lw=y,pw=_s,fw=ss,hw=Ts,dw=Array,vw=Math.max,yw=Math.min,gw=(_({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=fw(this),a=lw(s),u=pw(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,yw(vw(hw(t),0),a-u)),i=cw(a+r-n),o=dw(i);c<u;c++)o[c]=s[c];for(;c<u+r;c++)o[c]=arguments[c-u+2];for(;c<i;c++)o[c]=s[c+n-r];return o}}),Cp("toSpliced"),y),mw=Ts,Ew=RangeError,ww=function(e,t,r,n){var i=gw(e),r=mw(r),o=r<0?i+r:r;if(i<=o||o<0)throw Ew("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},bw=ss,Tw=Array;g({target:"Array",proto:!0},{with:function(e,t){return ww(bw(this),Tw,e,t)}});mu=i,T=ma,ta=as,b=Su,Oa=bs,O="USE_FUNCTION_CONSTRUCTOR",R=ys("asyncIterator"),Hc=mu.AsyncIterator,Ou=T.AsyncIteratorPrototype;if(Ou)Bb=Ou;else if(ta(Hc))Bb=Hc.prototype;else if(T[O]||mu[O])try{xb=b(b(b(Function("return async function*(){}()")()))),b(xb)===Object.prototype&&(Bb=xb)}catch(e){}ta((Bb=Bb||{})[R])||Oa(Bb,R,function(){return this});function _w(e,t,r){var n=e.done;Cw.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function Ow(e){Pw(this,{type:xw,iterator:Rw(e),next:e.next})}function Nw(e){var f=0==e,h=1==e,d=2==e,v=3==e;return function(e,s,a){var e=Xw(e),u=$w("Promise"),c=e.iterator,t=e.next,l=0,p=void 0!==s;return!p&&f||Yw(s),new u(function(r,n){var i=function(e){Zw(c,n,e,n)},o=function(){try{if(f&&p)try{qw(l)}catch(e){i(e)}u.resolve(Ww(Jw(t,c))).then(function(e){try{if(Ww(e).done)f?(a.length=l,r(a)):r(!v&&(d||void 0));else{var t=e.value;try{p?u.resolve(f?s(t,l):s(t)).then(function(e){if(h)o();else if(d)e?o():Zw(c,r,!1,n);else if(f)try{a[l++]=e,o()}catch(e){i(e)}else e?Zw(c,r,v||t,n):o()},i):(a[l++]=t,o())}catch(e){i(e)}}}catch(e){n(e)}},n)}catch(e){n(e)}};o()})}}function Iw(e,t){if(!d0||!h0(e)||!d0(e))return!1;for(var r,n=0,i=e.length;n<i;)if(!("string"==typeof(r=e[n++])||t&&void 0===r))return!1;return 0!==i}function Aw(e,t,r){return r.get&&v0(r.get,t,{getter:!0}),r.set&&v0(r.set,t,{setter:!0}),y0.f(e,t,r)}var Sw=r,Rw=Es,Nu=Gc,Mw=fs,Zs=Um,N=G,Fs=Bb,Cw=cs("Promise"),xw="AsyncFromSyncIterator",Pw=N.set,Uw=N.getterFor(xw),e=(Ow.prototype=Zs(Nu(Fs),{next:function(){var n=Uw(this);return new Cw(function(e,t){var r=Rw(Sw(n.next,n.iterator));_w(r,e,t)})},return:function(){var n=Uw(this).iterator;return new Cw(function(e,t){var r=Mw(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=Rw(Sw(r,n));_w(r,e,t)})}}),Ow),kw=r,Dw=e,Lw=Es,Fw=tl,Vw=fs,jw=ys("asyncIterator"),Bw=ps,Hw=Es,Gw=r,zw=cs,Kw=fs,Jw=r,Yw=ps,Ww=Es,qw=A,$w=cs,Xw=function(e){return{iterator:e,next:Bw(Hw(e).next)}},Zw=function(e,t,r,n){try{var i=Kw(e,"return");if(i)return zw("Promise").resolve(Gw(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},M={toArray:Nw(0),forEach:Nw(1),every:Nw(2),some:Nw(3),find:Nw(4)},Qw=Zc,e0=ds,t0=I,r0=function(e,t){t=arguments.length<2?Vw(e,jw):t;return t?Lw(kw(t,e)):new Dw(Fw(e))},n0=tl,i0=el,o0=fs,E=ZE,s0=cs,x=ys,a0=e,u0=M.toArray,c0=x("asyncIterator"),l0=E("Array").values,vp=(g({target:"Array",stat:!0,forced:!0},{fromAsync:function(o){var s=this,e=arguments.length,a=1<e?arguments[1]:void 0,u=2<e?arguments[2]:void 0;return new(s0("Promise"))(function(e){var t=e0(o),r=(void 0!==a&&(a=Qw(a,u)),o0(t,c0)),n=r?void 0:i0(t)||l0,i=t0(s)?new s:[],r=r?r0(t,r):new a0(n0(t,n));e(u0(r,a,i))})}}),g),p0=w.filterReject,C=al,t=(vp({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return p0(this,e,1<arguments.length?arguments[1]:void 0)}}),C("filterOut"),g),f0=w.filterReject,ea=al,Ma=(t({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return f0(this,e,1<arguments.length?arguments[1]:void 0)}}),ea("filterReject"),g),h0=mp,d0=Object.isFrozen,v0=(Ma({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!Iw(e,!0))return!1;var t=e.raw;return t.length===e.length&&Iw(t,!1)}}),Qs.exports),y0=Sa,_=al,g0=ds,m0=y;Q&&(Aw(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=g0(this),t=m0(e);return 0==t?void 0:e[t-1]},set:function(e){var t=g0(this),r=m0(t);return t[0==r?0:r-1]=e}}),_("lastItem"));var Cp=al,E0=ds,w0=y;Q&&(Aw(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=E0(this),e=w0(e);return 0==e?0:e-1}}),Cp("lastIndex"));var i=m,b0=ps,T0=y,_0=ds,O0=S,N0=cs("Map"),ma=N0.prototype,I0=i(ma.forEach),A0=i(ma.has),S0=i(ma.set),R0=i([].push),Su=al;g({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=_0(this),i=T0(n),o=O0(n,0),s=new N0,a=null!=e?b0(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),A0(s,r)||S0(s,r,t);return I0(s,function(e){R0(o,e)}),o}}),Su("uniqueBy");C0.exposure=function(e,t,r,n){return new P0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},C0.track=function(e,t,r,n){return new D0(n,r,e,t)},C0.remoteConfig=function(e,t,r,n){return new V0(n,e,t.parameter,t.valueId,t.reason,r)},C0.isExposureEvent=function(e){return void 0!==e.experiment},C0.isTrackEvent=function(e){return void 0!==e.eventType},C0.isRemoteConfigEvent=function(e){return void 0!==e.parameter},C0.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},C0.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},C0.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},C0.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[Bt.ID],identifiers:this.user.identifiers,userProperties:Ue.sanitize(this.user.properties),hackleProperties:Ue.sanitize(this.user.hackleProperties)}};var M0=C0;function C0(e,t,r){void 0===r&&(r=H()),this.timestamp=e,this.user=t,this.insertId=r}Se(U0,x0=M0),U0.prototype.copyWithUser=function(e){return new U0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},U0.prototype.toDto=function(){return c(c({},x0.prototype.toDto.call(this)),{experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,experimentVersion:this.experiment.version,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),properties:this.properties})};var x0,P0=U0;function U0(e,t,r,n,i,o,s,a){e=x0.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}Se(L0,k0=M0),L0.prototype.copyWithUser=function(e){return new L0(this.timestamp,e,this.eventType,this.event,this.insertId)},L0.prototype.toDto=function(){return c(c({},k0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Ue.sanitize(this.event.properties)})};var k0,D0=L0;function L0(e,t,r,n,i){e=k0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}Se(j0,F0=M0),j0.prototype.copyWithUser=function(e){return new j0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},j0.prototype.toDto=function(){return c(c({},F0.prototype.toDto.call(this)),{parameterId:this.parameter.id,parameterKey:this.parameter.key,parameterType:this.parameter.type,valueId:this.valueId,decisionReason:this.decisionReason.toString(),properties:Ue.sanitize(this.properties)})};var F0,V0=j0;function j0(e,t,r,n,i,o,s){e=F0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}H0.isSessionEvent=function(e){return!!M0.isTrackEvent(e)&&(e.event.key===H0.SESSION_START_EVENT_NAME||e.event.key===H0.SESSION_END_EVENT_NAME)},H0.prototype.onSessionStarted=function(e,t,r){this.track(H0.SESSION_START_EVENT_NAME,e,t,r)},H0.prototype.onSessionEnded=function(e,t,r){this.track(H0.SESSION_END_EVENT_NAME,e,t,r)},H0.prototype.track=function(e,t,r,n){e={key:e},r=this.userManager.toHackleUser(r),r=this.decorateSession(r,t);this.core.track(e,r,n)},H0.prototype.decorateSession=function(e,t){t=(new zt).add(Bt.SESSION,t).addIdentifiers(e.identifiers).build();return c(c({},e),{identifiers:t})},H0.SESSION_START_EVENT_NAME="$session_start",H0.SESSION_END_EVENT_NAME="$session_end";var B0=H0;function H0(e,t){this.userManager=e,this.core=t}z0.prototype.process=function(e){var t;B0.isSessionEvent(e)||this.sessionManager.startNewSessionIfNeeded(this.userManager.currentUser,e.timestamp),this.eventDedupDeterminer.isDedupTarget(e)||(e=e.copyWithUser(e.user),t=null===(t=this.sessionManager).currentSessionId||e.user.identifiers[Bt.SESSION]?e:e.copyWithUser(c(c({},e.user),{identifiers:c(c({},e.user.identifiers),((e={})[Bt.SESSION]=t.sessionId,e))})),this.delegate.process(t))},z0.prototype.flush=function(e){this.delegate.flush(e)},z0.prototype.close=function(){this.delegate.close()},z0.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.flush(!0);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var G0=z0;function z0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n}J0.toEvent=function(e){var t;return{key:J0.EVENT_KEY,properties:{level:J0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:J0._stacktrace(e)}}},J0._stacktrace=function(e){return u.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,J0.STACK_TRACK_LIMIT).join("\n")},J0.EVENT_KEY="$trace",J0.LEVEL_ERROR="error",J0.STACK_TRACK_LIMIT=30;var K0=J0;function J0(){}Y0.prototype.evaluate=function(e,t){if(!this.supports(e))throw new Error("Unsupported EvaluatorRequest ".concat(e.toString()));var r;if(t.contains(e))throw r=t.stack.map(function(e){return e.toString()}).join(" - "),new Error("Circular evaluation has occurred [".concat(r," - ").concat(e.toString(),"]"));t.addRequest(e);try{return this.evaluateInternal(e,t)}finally{t.removeRequest(e)}};Ou=Y0;function Y0(){}q0.prototype.with=function(e){return new q0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},q0.of=function(e,t,r,n){return new q0(n,t.targetEvaluations,e.experiment,r.id,r.key,r.config)},q0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return u.isNotNullOrUndefined(n)?this.of(e,t,n,r):new q0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)};var W0=q0;function q0(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.experiment=r,this.variationId=n,this.variationKey=i,this.config=o}Se(Z0,$0=Ou),Z0.prototype.supports=function(e){return void 0!==e.experiment},Z0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:W0.ofDefault(e,t,p.TRAFFIC_NOT_ALLOCATED)};var $0,X0=Z0;function Z0(e){var t=$0.call(this)||this;return t.evaluationFlowFactory=e,t}eb.of=function(e,t,r,n,i,o){return o.returnValue=Ue.truncateStringValue(n),new eb(i,t.targetEvaluations,e.parameter,r,n,o)},eb.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var Q0=eb;function eb(e,t,r,n,i,o){this.reason=e,this.targetEvaluations=t,this.parameter=r,this.valueId=n,this.value=i,this.properties=o}Se(nb,tb=Ou),nb.prototype.supports=function(e){return void 0!==e.parameter},nb.prototype.evaluateInternal=function(e,t){var r={};if(r.requestValueType=e.requiredType,r.requestDefaultValue=Ue.truncateStringValue(e.defaultValue),u.isNullOrUndefined(e.user.identifiers[e.parameter.identifierType]))return Q0.ofDefault(e,t,p.IDENTIFIER_NOT_FOUND,r);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);return u.isNotNullOrUndefined(n)?(r.targetRuleKey=n.key,r.targetRuleName=n.name,this.evaluation(e,t,n.value,p.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,p.DEFAULT_RULE,r)},nb.prototype.evaluation=function(e,t,r,n,i){return"UNKNOWN"===e.requiredType||"NULL"!==e.requiredType&&typeof e.defaultValue!=typeof r.rawValue?Q0.ofDefault(e,t,p.TYPE_MISMATCH,i):Q0.of(e,t,r.id,r.rawValue,n,i)};var tb,rb=nb;function nb(e){var t=tb.call(this)||this;return t.targetRuleDeterminer=e,t}ob.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var ib=ob;function ob(e,t){this.type=e,this.id=t}ab.create=function(){return new ab},Object.defineProperty(ab.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(ab.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(ab.prototype,"properties",{get:function(){return Ue.sanitize(this._properties)},enumerable:!1,configurable:!0}),ab.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},ab.prototype.addRequest=function(e){this._stack.push(e)},ab.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},ab.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof W0&&e.experiment.id===t.id})},ab.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},ab.prototype.setProperty=function(e,t){this._properties[e]=t};var sb=ab;function ab(){this._stack=[],this._targetEvaluations=[],this._properties={}}cb.of=function(e,t,r,n){return new cb(e,t,r,n)},cb.by=function(e,t){return new cb(e.workspace,e.user,t,"A")},cb.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var ub=cb;function cb(e,t,r,n){this.key=new ib("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}pb.of=function(e,t,r,n,i){return new pb(e,t,r,n,i)},pb.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var lb=pb;function pb(e,t,r,n,i){this.key=new ib("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}fb.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();case"boolean":return e?"true":"false";default:return}},fb.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},fb.asBoolean=function(e){switch(typeof e){case"boolean":return e;case"string":switch(e){case"true":return!0;case"false":return!1;default:return}default:return}},fb.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var P=fb;function fb(){}db.prototype.getVariation=function(e,t){if(0!==this.storages.length)for(var r=0,n=this.storages;r<n.length;r++){var i=n[r].getVariation(e,t);if(void 0!==i)return i}};var hb=db;function db(e){this.storages=e}yb.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},yb.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return P.asNumber(e)},yb.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=P.asNumber(t),e=P.asNumber(e);u.isNullOrUndefined(t)||t<0||u.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},yb.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},yb.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},yb.prototype.clear=function(){this.listStorage.clear()};var vb=yb;function yb(e){this.listStorage=e}mb.prototype.add=function(e){this.evaluators.push(e)},mb.prototype.evaluate=function(t,e){var r=this.evaluators.find(function(e){return e.supports(t)});if(u.isNullOrUndefined(r))throw new Error("Unsupported EvaluatorRequest [".concat(t.toString(),"]"));return r.evaluate(t,e)};var gb=mb;function mb(){this.evaluators=new Array}wb.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},wb.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},wb.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var Eb=wb;function wb(e){this.conditionMatcherFactory=e}Tb.prototype.decorate=function(e){return e};var bb=Tb;function Tb(){}Ob.prototype.decorate=function(e){return"string"==typeof e?Bo.decodeURIOrOriginal(e):e};var _b=Ob;function Ob(){}Ib.prototype.matches=function(e,t,r){void 0===r&&(r=new bb);var n=this.valueMatcherFactory.getMatcher(t.valueType),i=this.operatorMatcherFactory.getMatcher(t.operator),e=this.userValueMatches(e,t,n,i,r);return this.typeMatches(t.type,e)},Ib.prototype.userValueMatches=function(e,t,r,n,i){return Array.isArray(e)?this.arrayMatches(e,t,r,n,i):this.singleMatches(e,t,r,n,i)},Ib.prototype.singleMatches=function(e,t,r,n,i){e=i.decorate(e),t=t.values.map(i.decorate);return n.matches(r,e,t)},Ib.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},Ib.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var Nb=Ib;function Ib(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}Ab.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.inMatches(r,e)})};Hc=Ab;function Ab(){}Sb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.containsMatches(r,e)})};T=Sb;function Sb(){}Rb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.startsWithMatches(r,e)})};mu=Rb;function Rb(){}Mb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.endsWithMatches(r,e)})};O=Mb;function Mb(){}Cb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanMatches(r,e)})};b=Cb;function Cb(){}Pb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.greaterThanOrEqualMatches(r,e)})};var xb=Pb;function Pb(){}Ub.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanMatches(r,e)})};ta=Ub;function Ub(){}kb.prototype.matches=function(t,r,e){return!u.isNullOrUndefined(r)&&e.some(function(e){return t.lessThanOrEqualMatches(r,e)})};Oa=kb;function kb(){}Db.prototype.matches=function(e,t,r){return!u.isNullOrUndefined(t)};R=Db;function Db(){}Fb.prototype.getMatcher=function(e){switch(e){case"IN":return Fb.IN_MATCHER;case"CONTAINS":return Fb.CONTAINS_MATCHER;case"STARTS_WITH":return Fb.STARTS_WITH_MATCHER;case"ENDS_WITH":return Fb.ENDS_WITH_MATCHER;case"GT":return Fb.GT_MATCHER;case"GTE":return Fb.GTE_MATCHER;case"LT":return Fb.LT_MATCHER;case"LTE":return Fb.LTE_MATCHER;case"EXISTS":return Fb.EXISTS_MATCHER}},Fb.IN_MATCHER=new Hc,Fb.CONTAINS_MATCHER=new T,Fb.STARTS_WITH_MATCHER=new mu,Fb.ENDS_WITH_MATCHER=new O,Fb.GT_MATCHER=new b,Fb.GTE_MATCHER=new xb,Fb.LT_MATCHER=new ta,Fb.LTE_MATCHER=new Oa,Fb.EXISTS_MATCHER=new R;var Lb=Fb;function Fb(){}Vb.prototype.inMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},Vb.prototype.containsMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.includes(t)},Vb.prototype.startsWithMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.startsWith(t)},Vb.prototype.endsWithMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.endsWith(t)},Vb.prototype.greaterThanMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<e},Vb.prototype.greaterThanOrEqualMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<=e},Vb.prototype.lessThanMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<t},Vb.prototype.lessThanOrEqualMatches=function(e,t){e=P.asString(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<=t};Gc=Vb;function Vb(){}jb.prototype.inMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},jb.prototype.containsMatches=function(e,t){return!1},jb.prototype.startsWithMatches=function(e,t){return!1},jb.prototype.endsWithMatches=function(e,t){return!1},jb.prototype.greaterThanMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<e},jb.prototype.greaterThanOrEqualMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&t<=e},jb.prototype.lessThanMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<t},jb.prototype.lessThanOrEqualMatches=function(e,t){e=P.asNumber(e),t=P.asNumber(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e<=t};G=jb;function jb(){}Hb.prototype.inMatches=function(e,t){e=P.asBoolean(e),t=P.asBoolean(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e===t},Hb.prototype.containsMatches=function(e,t){return!1},Hb.prototype.startsWithMatches=function(e,t){return!1},Hb.prototype.endsWithMatches=function(e,t){return!1},Hb.prototype.greaterThanMatches=function(e,t){return!1},Hb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},Hb.prototype.lessThanMatches=function(e,t){return!1},Hb.prototype.lessThanOrEqualMatches=function(e,t){return!1};var Bb=Hb;function Hb(){}Gb.prototype.inMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isEqualTo(t)},Gb.prototype.containsMatches=function(e,t){return!1},Gb.prototype.startsWithMatches=function(e,t){return!1},Gb.prototype.endsWithMatches=function(e,t){return!1},Gb.prototype.greaterThanMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isGreaterThan(t)},Gb.prototype.greaterThanOrEqualMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isGreaterThanOrEqualTo(t)},Gb.prototype.lessThanMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isLessThan(t)},Gb.prototype.lessThanOrEqualMatches=function(e,t){e=gr.tryParse(e),t=gr.tryParse(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&e.isLessThanOrEqualTo(t)};N=Gb;function Gb(){}zb.prototype.inMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);return!u.isNullOrUndefined(e)&&!u.isNullOrUndefined(t)&&Bo.decodeURIOrOriginal(Bo.removePathnameTrailingSlash(e))===Bo.decodeURIOrOriginal(Bo.removePathnameTrailingSlash(t))},zb.prototype.containsMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);if(u.isNullOrUndefined(e)||u.isNullOrUndefined(t))return!1;e=Bo.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))},zb.prototype.startsWithMatches=function(e,t){e=Bo.tryParse(e),t=P.asString(t);if(u.isNullOrUndefined(e)||u.isNullOrUndefined(t))return!1;e=Bo.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))},zb.prototype.endsWithMatches=function(e,t){return!1},zb.prototype.greaterThanMatches=function(e,t){return!1},zb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},zb.prototype.lessThanMatches=function(e,t){return!1},zb.prototype.lessThanOrEqualMatches=function(e,t){return!1};Zs=zb;function zb(){}Kb.prototype.inMatches=function(e,t){return!1},Kb.prototype.containsMatches=function(e,t){return!1},Kb.prototype.startsWithMatches=function(e,t){return!1},Kb.prototype.endsWithMatches=function(e,t){return!1},Kb.prototype.greaterThanMatches=function(e,t){return!1},Kb.prototype.greaterThanOrEqualMatches=function(e,t){return!1},Kb.prototype.lessThanMatches=function(e,t){return!1},Kb.prototype.lessThanOrEqualMatches=function(e,t){return!1};Nu=Kb;function Kb(){}Yb.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return Yb.STRING_MATCHER;case"NUMBER":return Yb.NUMBER_MATCHER;case"BOOLEAN":return Yb.BOOLEAN_MATCHER;case"VERSION":return Yb.VERSION_MATCHER;case"URL":return Yb.URL_MATCHER;case"NULL":case"UNKNOWN":return Yb.NULL_MATCHER}},Yb.STRING_MATCHER=new Gc,Yb.NUMBER_MATCHER=new G,Yb.BOOLEAN_MATCHER=new Bb,Yb.VERSION_MATCHER=new N,Yb.URL_MATCHER=new Zs,Yb.NULL_MATCHER=new Nu;var Jb=Yb;function Yb(){}qb.prototype.matches=function(e,t,r){var e=this.userValueResolver.resolveOrNull(e.user,r.key),n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},qb.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?_b:bb)};var Wb=qb;function qb(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}Xb.prototype.resolveOrNull=function(e,t){switch(t.type){case"USER_ID":return e.identifiers[t.name];case"USER_PROPERTY":return e.properties[t.name];case"HACKLE_PROPERTY":return e.hackleProperties[t.name];default:throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}};var $b=Xb;function Xb(){}Qb.prototype.matches=function(t,r,e){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return n._matches(t,r,e)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},Qb.prototype._matches=function(e,t,r){if("string"!=typeof r)throw new Error("SegmentKey[".concat(r,"]"));var n=e.workspace.getSegmentOrNull(r);if(n)return this.segmentMatcher.matches(e,t,n);throw new Error("Segment[".concat(r,"]"))};var Zb=Qb;function Qb(e){this.segmentMatcher=e}tT.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},tT.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var eT=tT;function tT(e){this.userConditionMatcher=e}nT.prototype.matches=function(e,t,r){switch(r.key.type){case"AB_TEST":return this.abTestMatcher.matches(e,t,r);case"FEATURE_FLAG":return this.featureFlagMatcher.matches(e,t,r);default:throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"))}};var rT=nT;function nT(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}iT.prototype.matches=function(e,t,r){var n=u.requiredNotNullOrUndefined(P.asNumber(r.key.name),function(){return"Invalid key [".concat(r.key.type,", ").concat(r.key.name,"]")}),n=this.experiment(e,n);if(u.isNullOrUndefined(n))return!1;var i=null!=(i=t.getEvaluation(n))?i:this.evaluate(e,t,n);return this.evaluationMatches(i,r)},iT.prototype.evaluate=function(e,t,r){r=ub.by(e,r),r=this.evaluator.evaluate(r,t),e=this.resolve(e,r);return t.addEvaluation(e),e};Fs=iT;function iT(e,t){this.evaluator=e,this.valueOperatorMatcher=t}Se(aT,oT=Fs),aT.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},aT.prototype.resolve=function(e,t){return e instanceof ub&&t.reason===p.TRAFFIC_ALLOCATED?t.with(p.TRAFFIC_ALLOCATED_BY_TARGETING):t},aT.prototype.evaluationMatches=function(e,t){return!!aT.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},aT.AB_TEST_MATCHED_REASONS=[p.OVERRIDDEN,p.TRAFFIC_ALLOCATED,p.EXPERIMENT_COMPLETED,p.TRAFFIC_ALLOCATED_BY_TARGETING];var oT,sT=aT;function aT(e,t){return oT.call(this,e,t)||this}Se(lT,uT=Fs),lT.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},lT.prototype.resolve=function(e,t){return t},lT.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var uT,cT=lT;function lT(e,t){return uT.call(this,e,t)||this}fT.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return this.valueOperatorMatcher.matches(e,r.match)},fT.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var pT=fT;function fT(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}dT.prototype.resolveOrNull=function(e,t){var r;switch(t.type){case"EVENT_PROPERTY":return null==(r=this.properties(e))?void 0:r[t.name];case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":case"SEGMENT":case"AB_TEST":case"FEATURE_FLAG":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},dT.prototype.properties=function(e){return M0.isTrackEvent(e)?e.event.properties:M0.isExposureEvent(e)||M0.isRemoteConfigEvent(e)?e.properties:void 0};var hT=dT;function dT(){}yT.prototype.matches=function(e,t,r){if("COHORT"!==r.key.type)throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"));e=null!=(e=null==(e=e.user.cohorts)?void 0:e.map(function(e){return e.id}))?e:[];return this.valueOperatorMatcher.matches(e,r.match)};var vT=yT;function yT(e){this.valueOperatorMatcher=e}mT.prototype.supports=function(e){return"NUMBER_OF_EVENTS_IN_DAYS"===e||"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"===e},mT.prototype.matches=function(e,t,r){var n,i=r.key.type;if(!this.supports(i))throw new Error("Unsupported TargetKeyType [".concat(i,"]"));var o=null!=(n=e.user.targetEvents)?n:[];switch(i){case"NUMBER_OF_EVENTS_IN_DAYS":return new bT(this.valueOperatorMatcher,this.clock).matches(e,o,r);case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return new OT(this.valueOperatorMatcher,this.clock).matches(e,o,r);default:return i}};var gT=mT;function mT(e,t){this.valueOperatorMatcher=e,this.clock=t}function ET(){}Se(TT,wT=ET),TT.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Le.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},TT.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&null===e.property},TT.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var wT,bT=TT;function TT(e,t){var r=wT.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}Se(NT,_T=ET),NT.prototype.matches=function(e,t,r){var n=this,i=this.convertTargetConditionToExpression(r),o=this.clock.currentMillis()-Le.daysToUnit(i.days,"milliseconds"),t=t.filter(function(e){return n.expressionMatch(e,i)}),t=f.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},NT.prototype.propertyMatch=function(e,t){return(null==e?void 0:e.type)===t.key.type&&e.key===t.key.name&&this.valueOperatorMatcher.matches(e.value,t.match)},NT.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&this.propertyMatch(e.property,t.propertyFilter)},NT.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var _T,OT=NT;function NT(e,t){var r=_T.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}AT.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return this.userConditionMatcher;case"EVENT_PROPERTY":return this.eventConditionMatcher;case"SEGMENT":return this.segmentConditionMatcher;case"AB_TEST":case"FEATURE_FLAG":return this.experimentConditionMatcher;case"COHORT":return this.cohortConditionMatcher;case"NUMBER_OF_EVENTS_IN_DAYS":case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return this.userTargetConditionMatcher;default:return e}};var IT=AT;function AT(e,t){var r=new Nb(new Jb,new Lb);this.userConditionMatcher=new Wb(new $b,r),this.eventConditionMatcher=new pT(new hT,r),this.segmentConditionMatcher=new Zb(new eT(this.userConditionMatcher)),this.experimentConditionMatcher=new rT(new sT(e,r),new cT(e,r)),this.cohortConditionMatcher=new vT(r),this.userTargetConditionMatcher=new gT(r,t)}RT.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},RT.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},RT.prototype.resolveBucket=function(e,t){var t=e.workspace.getBucketOrNull(t.bucketId),r=e.user.identifiers[e.experiment.identifierType];if(r){t=this.bucketer.bucketing(t,r);if(t)return e.experiment._getVariationByIdOrNull(t.variationId)}};var ST=RT;function RT(e){this.bucketer=e}var MT={murmurhash3_x86_32:function(e,t,r,n){for(var i,o=-4&(n=void 0===n?e.length:n),s=t,a=0;a<o;a+=4)i=255&e.charCodeAt(a)|(255&e.charCodeAt(a+1))<<8|(255&e.charCodeAt(a+2))<<16|(255&e.charCodeAt(a+3))<<24,i=this.mul32(i,3432918353),s=5*(s=(524287&(s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)))<<13|s>>>19)+3864292196|0;switch(i=0,n%4){case 3:i=(255&e.charCodeAt(2+o))<<16;case 2:i|=(255&e.charCodeAt(1+o))<<8;case 1:i|=255&e.charCodeAt(o),i=this.mul32(i,3432918353),s^=i=this.mul32(i=(131071&i)<<15|i>>>17,461845907)}return s=this.mul32(s=(s^=n)^s>>>16,2246822507),s=this.mul32(s^=s>>>13,3266489909),s^=s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},CT=(xT.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},xT.prototype.calculateSlotNumber=function(e,t,r){r=MT.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},xT);function xT(){}UT.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},UT.end=function(){return new UT(void 0,void 0)},UT.decision=function(e,t){return new UT(e,t)},UT.of=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this.end(),n=0,i=e.reverse();n<i.length;n++)var o=i[n],r=this.decision(o,r);return r};var PT=UT;function UT(e,t){this.flowEvaluator=e,this.nextFlow=t}DT.prototype.evaluate=function(e,t,r){var n=this.overrideResolver.resolveOrNull(e,t);if(!n)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return W0.of(e,t,n,p.OVERRIDDEN);case"FEATURE_FLAG":return W0.of(e,t,n,p.INDIVIDUAL_TARGET_MATCH)}};var kT=DT;function DT(e){this.overrideResolver=e}FT.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?W0.ofDefault(e,t,p.EXPERIMENT_DRAFT):r.evaluate(e,t)};var LT=FT;function FT(){}jT.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return W0.ofDefault(e,t,p.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return W0.ofDefault(e,t,p.FEATURE_FLAG_INACTIVE)}};var VT=jT;function jT(){}HT.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return W0.of(e,t,r,p.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var BT=HT;function HT(){}zT.prototype.evaluate=function(e,t,r){if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t)?r.evaluate(e,t):W0.ofDefault(e,t,p.NOT_IN_EXPERIMENT_TARGET)};var GT=zT;function zT(e){this.experimentTargetDeterminer=e}JT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("AB_TEST"!==e.experiment.type)throw new Error("experiment type must be AB_TEST [".concat(e.experiment.id,"]"));var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);return n?n.isDropped?W0.ofDefault(e,t,p.VARIATION_DROPPED):W0.of(e,t,n,p.TRAFFIC_ALLOCATED):W0.ofDefault(e,t,p.TRAFFIC_NOT_ALLOCATED)};var KT=JT;function JT(e){this.actionResolver=e}WT.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return r.evaluate(e,t);var n=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t);if(!n)return r.evaluate(e,t);r=this.actionResolver.resolveOrNull(e,t,n.action);if(r)return W0.of(e,t,r,p.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var YT=WT;function WT(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}$T.prototype.evaluate=function(e,t,r){if("RUNNING"!==e.experiment.status)throw new Error("experiment status must be RUNNING [".concat(e.experiment.id,"]"));if("FEATURE_FLAG"!==e.experiment.type)throw new Error("experiment type must be FEATURE_FLAG [".concat(e.experiment.id,"]"));if(!e.user.identifiers[e.experiment.identifierType])return W0.ofDefault(e,t,p.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return W0.of(e,t,n,p.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var qT=$T;function $T(e){this.actionResolver=e}ZT.prototype.evaluate=function(e,t,r){var n=e.experiment.containerId;if(!n)return r.evaluate(e,t);var i=e.workspace.getContainerOrNull(n);if(i)return this.containerResolver.isUserInContainerGroup(e,t,i)?r.evaluate(e,t):W0.ofDefault(e,t,p.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var XT=ZT;function ZT(e){this.containerResolver=e}e_.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):W0.ofDefault(e,t,p.IDENTIFIER_NOT_FOUND)};var QT=e_;function e_(){}r_.prototype.isUserInExperimentTarget=function(t,r){var n=this;return 0===t.experiment.targetAudiences.length||t.experiment.targetAudiences.some(function(e){return n.targetMatcher.matches(t,r,e)})};var t_=r_;function r_(e){this.targetMatcher=e}i_.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var n_=i_;function i_(e){this.targetMatcher=e}s_.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},s_.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},s_.prototype._resolveUserOverride=function(e){var t=e.experiment,e=e.user.identifiers[t.identifierType];if(e){e=t.userOverrides.get(e);if(e)return t._getVariationByIdOrNull(e)}},s_.prototype._resolveSegmentOverride=function(t,r){var n=this,e=t.experiment.segmentOverrides.find(function(e){return n.targetMatcher.matches(t,r,e.target)});if(e)return this.actionResolver.resolveOrNull(t,r,e.action)};var o_=s_;function s_(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}u_.prototype.isUserInContainerGroup=function(e,t,r){var n=e.user.identifiers[e.experiment.identifierType];if(u.isNullOrUndefined(n))return!1;var i=e.workspace.getBucketOrNull(r.bucketId);if(u.isNullOrUndefined(i))throw new Error("Bucket[".concat(r.bucketId,"]"));i=this.bucketer.bucketing(i,n);if(u.isNullOrUndefined(i))return!1;n=r.getGroupOrNull(i.variationId);if(u.isNullOrUndefined(n))throw new Error("ContainerGroup[".concat(i.variationId,"]"));return n.experiments.includes(e.experiment.id)};var a_=u_;function u_(e){this.bucketer=e}l_.of=function(e,t,r,n){return new l_(r,t.targetEvaluations,e.inAppMessage,n,t.properties)};var c_=l_;function l_(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.message=n,this.properties=i}f_.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):c_.of(e,t,p.UNSUPPORTED_PLATFORM)};var p_=f_;function f_(){}d_.prototype.evaluate=function(e,t,r){var n;return this.userOverrideMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),c_.of(e,t,p.OVERRIDDEN,n)):r.evaluate(e,t)};var h_=d_;function d_(e,t){this.userOverrideMatcher=e,this.inAppMessageResolver=t}y_.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?c_.of(e,t,p.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var v_=y_;function y_(){}m_.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?c_.of(e,t,p.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var g_=m_;function m_(){}w_.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):c_.of(e,t,p.NOT_IN_IN_APP_MESSAGE_PERIOD)};var E_=w_;function w_(){}T_.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?c_.of(e,t,p.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var b_=T_;function T_(e){this.hiddenMatcher=e}O_.prototype.evaluate=function(e,t,r){return this.targetMatcher.matches(e,t)?r.evaluate(e,t):c_.of(e,t,p.NOT_IN_IN_APP_MESSAGE_TARGET)};var __=O_;function O_(e){this.targetMatcher=e}I_.prototype.evaluate=function(e,t,r){return this.frequencyCapMatcher.matches(e,t)?c_.of(e,t,p.IN_APP_MESSAGE_FREQUENCY_CAPPED):r.evaluate(e,t)};var N_=I_;function I_(e){this.frequencyCapMatcher=e}S_.prototype.evaluate=function(e,t,r){return"NONE"===this.inAppMessageResolver.resolve(e,t).layout.displayType?c_.of(e,t,p.EXPERIMENT_CONTROL_GROUP):r.evaluate(e,t)};var A_=S_;function S_(e){this.inAppMessageResolver=e}M_.prototype.evaluate=function(e,t,r){var n=this.inAppMessageResolver.resolve(e,t);return c_.of(e,t,p.IN_APP_MESSAGE_TARGET,n)};var R_=M_;function M_(e){this.inAppMessageResolver=e}C_.prototype.evaluateInternal=function(e,t,r){r=ub.by(e,r),r=this.evaluator.evaluate(r,t),e=this.decorate(e,t,r);return t.addEvaluation(e),e},C_.prototype.evaluate=function(e,t,r){var n;return null!=(n=t.getEvaluation(r))?n:this.evaluateInternal(e,t,r)};r=C_;function C_(e){this.evaluator=e}P_.prototype.resolve=function(t,e){var r=this.experiment(t);if(u.isNullOrUndefined(r))return this.messageSelector.select(t.inAppMessage,function(e){return e.lang===t.inAppMessage.messageContext.defaultLang});var n=this.experimentEvaluator.evaluate(t,e,r);return this.messageSelector.select(t.inAppMessage,function(e){return e.lang===t.inAppMessage.messageContext.defaultLang&&n.variationKey===e.variationKey})},P_.prototype.experiment=function(e){var t=e.inAppMessage.messageContext.experimentContext;return null===t?null:u.requiredNotNullOrUndefined(e.workspace.getExperimentOrNull(t.key),function(){return"Experiment[".concat(t.key,"]")})};var x_=P_;function P_(e,t){this.experimentEvaluator=e,this.messageSelector=t}k_.prototype.select=function(e,t){t=e.messageContext.messages.find(t);return u.requiredNotNullOrUndefined(t,function(){return"InAppMessage must be decided [".concat(e.id,"]")})};var U_=k_;function k_(){}Se(F_,D_=r),F_.prototype.decorate=function(e,t,r){return t.setProperty("experiment_id",r.experiment.id),t.setProperty("experiment_key",r.experiment.key),t.setProperty("variation_id",r.variationId),t.setProperty("variation_key",r.variationKey),t.setProperty("experiment_decision_reason",r.reason),r};var D_,L_=F_;function F_(e){var t=D_.call(this,e)||this;return t.evaluator=e,t}j_.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},j_.prototype.matches=function(e,t,r){if(!this.targetMatcher.matches(e,t,r.target))return!1;t=e.user.identifiers[e.parameter.identifierType];if(u.isNullOrUndefined(t))return!1;e=e.workspace.getBucketOrNull(r.bucketId);if(u.isNullOrUndefined(e))throw new Error("bucket[".concat(r.bucketId,"]"));return u.isNotNullOrUndefined(this.bucketer.bucketing(e,t))};var V_=j_;function j_(e,t){this.targetMatcher=e,this.bucketer=t}H_.get=function(e){return u.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},H_.getOrNull=function(e){return H_.instances.get(e)},H_.register=function(e,t){return H_.instances.set(e,t),t},H_.instances=new Map;var B_=H_;function H_(){}z_.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},z_.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!u.isNullOrUndefined(e)&&t.identifiers.includes(e)};var G_=z_;function z_(){}J_.prototype.matches=function(t,r){var n=this,e=t.inAppMessage.targetContext.targets;return 0===e.length||e.some(function(e){return n.targetMatcher.matches(t,r,e)})};var K_=J_;function J_(e){this.targetMatcher=e}W_.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var Y_=W_;function W_(e){this.storage=e}$_.prototype.matches=function(e,t){var r=e.inAppMessage,n=e.user,e=e.timestamp;return this.isFrequencyCapped(r,n,e)},$_.prototype.isFrequencyCapped=function(e,t,r){if(!e.eventTrigger.frequencyCap)return!1;var n=this.createMatchContexts(e.eventTrigger.frequencyCap);if(0===n.length)return!1;for(var i=0,o=this.storage.get(e);i<o.length;i++)for(var s=o[i],a=0,u=n;a<u.length;a++)if(u[a].matches(t,r,s))return!0;return!1},$_.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new X_(new Q_(i)))}return e.durationCap&&t.push(new X_(new tO(e.durationCap))),t};var q_=$_;function $_(e){this.storage=e}Z_.prototype.matches=function(e,t,r){return this.predicate.matches(e,t,r)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var X_=Z_;function Z_(e){this.matchCount=0,this.predicate=e}Object.defineProperty(eO.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),eO.prototype.matches=function(e,t,r){e=e.identifiers[this.identifierCap.identifierType];if(u.isNullOrUndefined(e))return!1;r=r.identifiers[this.identifierCap.identifierType];return!u.isNullOrUndefined(r)&&e===r};var Q_=eO;function eO(e){this.identifierCap=e}Object.defineProperty(rO.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),rO.prototype.matches=function(e,t,r){return t-r.timestamp<=this.durationCap.durationMillis};var tO=rO;function rO(e){this.durationCap=e}iO.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},iO.prototype.getInAppMessageFlow=function(){return this.inAppMessageFlow};var nO=iO;function iO(e,t,r,n,i){var o=new CT,i=B_.register("targetMatcher",new Eb(new IT(e,i))),s=new ST(o),t=new o_(t,i,s),a=new a_(o),a=(this.abTestFlow=PT.of(new kT(t),new QT,new XT(a),new GT(new t_(i)),new LT,new VT,new BT,new KT(s)),this.featureFlagFlow=PT.of(new LT,new VT,new BT,new kT(t),new QT,new YT(new n_(i),s),new qT(s)),new x_(new L_(e),new U_));this.inAppMessageFlow=PT.of(new p_,new h_(new G_,a),new v_,new g_,new E_,new __(new K_(i)),new A_(a),new N_(new q_(n)),new b_(new Y_(r)),new R_(a)),this.remoteConfigParameterTargetRuleDeterminer=new V_(i,o)}sO.prototype.create=function(r,e){var n=this,i=this.clock.currentMillis(),o=new Array,t=this.createEvent(r,e,i,{});return t&&o.push(t),e.targetEvaluations.forEach(function(e){var t;(t={})[sO.ROOT_TYPE]=r.key.type,t[sO.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},sO.prototype.createEvent=function(e,t,r,n){var i;if(t instanceof W0)return n[sO.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[sO.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[sO.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,M0.exposure(e.user,t,n,r);if(t instanceof Q0)return M0.remoteConfig(e.user,t,c(c({},n),t.properties),r);if(t instanceof c_)return null;throw new Error("Unsupported Evaluation [".concat(typeof t,"]"))},sO.ROOT_TYPE="$targetingRootType",sO.ROOT_ID="$targetingRootId",sO.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",sO.EXPERIMENT_VERSION_KEY="$experiment_version",sO.EXECUTION_VERSION_KEY="$execution_version";var oO=sO;function sO(e){this.clock=e}Se(cO,aO=Ou),cO.prototype.supports=function(e){return void 0!==e.inAppMessage},cO.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getInAppMessageFlow().evaluate(e,t))?r:c_.of(e,t,p.NOT_IN_IN_APP_MESSAGE_TARGET)};var aO,uO=cO;function cO(e){var t=aO.call(this)||this;return t.evaluationFlowFactory=e,t}pO.of=function(e,t,r,n){return new pO(e,t,r,n)},pO.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var lO=pO;function pO(e,t,r,n){this.key=new ib("IN_APP_MESSAGE",r.id),this.workspace=e,this.user=t,this.inAppMessage=r,this.timestamp=n}var fO=s.log,hO=(dO.create=function(e,t,r,n,i){var o=Fe.instance,s=new gb,r=new hb(r),r=new nO(s,r,n,i,o),n=new X0(r),i=new rb(r.remoteConfigParameterTargetRuleDeterminer),r=new uO(r);return s.add(n),s.add(i),new dO(n,i,r,e,new oO(o),t,new vO,o)},dO.prototype.getExperiment=function(e){if(e){var t=this.workspaceFetcher.get();if(t)return t.getExperimentOrNull(e)}else fO.error("experimentKey must not be empty")},dO.prototype.experiment=function(e,t,r){var n=this;if(!e)return fO.error("experimentKey must not be empty"),Tt.of(r,p.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return fO.warn("SDK not ready."),Tt.of(r,p.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return fO.warn("Experiment does not exist."),Tt.of(r,p.EXPERIMENT_NOT_FOUND);i=ub.of(i,t,e,r),t=this.experimentInternal(i),e=t[0],r=t[1];return this.eventFactory.create(i,e).forEach(function(e){return n.eventProcessor.process(e)}),r},dO.prototype.experiments=function(r){var n=this,i=new Wn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getExperiments().forEach(function(e){var t=ub.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},dO.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,sb.create()),t=null!=(t=e.config)?t:new je;return[e,Tt.of(e.variationKey,e.reason,t,e.experiment)]},dO.prototype.featureFlag=function(e,t){var r=this;if(!e)return fO.error("featureKey must not be empty"),Ot.off(p.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return fO.warn("SDK not ready."),Ot.off(p.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return fO.warn("FeatureFlag does not exist."),Ot.off(p.FEATURE_FLAG_NOT_FOUND);n=ub.of(n,t,e,"A"),t=this.featureFlagInternal(n),e=t[0],t=t[1];return this.eventFactory.create(n,e).forEach(function(e){return r.eventProcessor.process(e)}),t},dO.prototype.featureFlags=function(r){var n=this,i=new Wn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getFeatureFlags().forEach(function(e){var t=ub.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},dO.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,sb.create()),t=null!=(t=e.config)?t:new je;return[e,"A"===e.variationKey?Ot.off(e.reason,t,e.experiment):Ot.on(e.reason,t,e.experiment)]},dO.prototype.inAppMessage=function(e,t){var r=this,n=this.workspaceFetcher.get();if(!n)return fO.warn("SDK not ready."),wt.of(p.SDK_NOT_READY);e=n.getInAppMessageOrNull(e);if(!e)return fO.warn("In app message does not exist."),wt.of(p.IN_APP_MESSAGE_NOT_FOUND);n=lO.of(n,t,e,this.clock.currentMillis()),t=this.inAppMessageEvaluator.evaluate(n,sb.create());return this.eventFactory.create(n,t).forEach(function(e){return r.eventProcessor.process(e)}),wt.of(t.reason,t.inAppMessage,t.message,t.properties)},dO.prototype.tryInAppMessage=function(t,e){var r,n=zn.start();try{r=this.inAppMessage(t,e)}catch(e){fO.error("Unexpected error while deciding in app message [".concat(t,"]: ").concat(e)),r=wt.of(p.EXCEPTION)}return Vi.inAppMessage(n,t,r),r},dO.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?fO.warn("Event must be event type."):"object"!=typeof e||e.key&&"string"==typeof e.key?(n=(null==(n=this.workspaceFetcher.get())?void 0:n.getEventTypeOrNull(e.key))||new Vt(0,e.key),this.eventProcessor.process(M0.track(n,e,t,r))):fO.warn("Event key must be not null. or event key must be string type."):fO.warn("event must not be null.")},dO.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=K0.toEvent(e),this.flush(),this.track(e,t),this.flush())},dO.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},dO.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(u.isNullOrUndefined(o))return fO.warn("SDK not ready."),mt.of(n,p.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(u.isNullOrUndefined(e))return fO.warn("Remote config parameter does not exist."),mt.of(n,p.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=lb.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,sb.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),mt.of(t.value,t.reason)},dO.prototype.close=function(){this.eventProcessor.close()},dO);function dO(e,t,r,n,i,o,s,a){this.experimentEvaluator=e,this.remoteConfigEvaluator=t,this.inAppMessageEvaluator=r,this.workspaceFetcher=n,this.eventFactory=i,this.eventProcessor=o,this.errorDedupDeterminer=s,this.clock=a}yO.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},yO.prototype._isSameError=function(e,t){return!u.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var vO=yO;function yO(){}mO.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},mO.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var gO=mO;function mO(){this._installed=[],this._installations={onerror:bO,onunhandledrejection:TO}}var EO,wO=null;function bO(o,s){wO=window.onerror,window.onerror=function(e,t,r,n,i){u.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),wO&&wO.apply(this,arguments)}}function TO(r,n){EO=window.onunhandledrejection,window.onunhandledrejection=function(e){var t;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}t instanceof Error&&r.trackException(t,n.resolve()),EO&&EO.apply(this,arguments)}}OO.prototype.read=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){return(t=this.storage.getItem(this.storageKey))?[2,JSON.parse(t)]:[2,[]]})})},OO.prototype.save=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){return 0===r.length?[2,this.clear()]:(t=JSON.stringify(r.slice(-this.maxSize)),this.storage.setItem(this.storageKey,t),[2])})})},OO.prototype.add=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),[4,this.save(t.concat(r).slice(-this.maxSize))];case 2:return e.sent(),[2]}})})},OO.prototype.delete=function(n){return a(this,void 0,void 0,function(){var t,r=this;return l(this,function(e){switch(e.label){case 0:return[4,this.read()];case 1:return t=e.sent(),t=t.filter(function(e){return!r.isDeleteTarget(e,n)}),[4,this.save(t)];case 2:return e.sent(),[2]}})})},OO.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},OO.prototype.clear=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var _O=OO;function OO(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}var NO=function(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)},IO=(AO.builder=function(){return new SO},AO.empty=function(){return AO.builder().build()},AO.from=function(e){return new AO(e)},AO.fromDto=function(e){for(var t=AO.builder(),r=0,n=e.cohorts;r<n.length;r++){var i=n[r];t.put({identifier:i.identifier,cohorts:i.cohorts.map(function(e){return new kn(e)})})}return t.build()},Object.defineProperty(AO.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),AO.prototype.get=function(e){return this.cohorts.get(e)},AO.prototype.filterBy=function(e){var r=Gt(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return AO.from(e)},AO.prototype.asArray=function(){return this.cohorts.values()},AO.prototype.asComparable=function(){return this.cohorts},AO.prototype.toBuilder=function(){return new SO(this)},AO);function AO(e){this.cohorts=e}RO.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},RO.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},RO.prototype.build=function(){return new IO(this.cohorts)};var SO=RO;function RO(e){this.cohorts=new Wn(Ce.isEqual),e&&this.putAll(e)}var A="model",I="name",e="type",M="vendor",x="version",E="architecture",vp="console",C="mobile",w="tablet",t="smarttv",ea="wearable",MO=(U.parse=function(e){return{browser:U.getBrowser(e),cpu:U.getCPU(e),device:U.getDevice(e),engine:U.getEngine(e),os:U.getOS(e)}},U.getBrowser=function(e){var t={name:void 0,version:void 0,major:void 0};return U.mapper.rgx.call(t,e,U.regexes.browser),t.major=U.util.major(t.version),t},U.getCPU=function(e){var t={architecture:void 0};return U.mapper.rgx.call(t,e,U.regexes.cpu),t},U.getDevice=function(e){var t={model:void 0,type:void 0,vendor:void 0};return U.mapper.rgx.call(t,e,U.regexes.device),t},U.getEngine=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.getOS=function(e){var t={name:void 0,version:void 0};return U.mapper.rgx.call(t,e,U.regexes.os),t},U.util={extend:function(e,t){var r,n={};for(r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},U.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[I,x],[/(opios)[\/\s]+([\w\.]+)/i],[[I,"Opera Mini"],x],[/\s(opr)\/([\w\.]+)/i],[[I,"Opera"],x],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]*)/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w\.]*)/i,/(bidubrowser|baidubrowser)[\/\s]?([\w\.]+)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]*)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w\.-]+)/i],[I,x],[/(konqueror)\/([\w\.]+)/i],[[I,"Konqueror"],x],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[I,"IE"],x],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[I,"Edge"],x],[/(yabrowser)\/([\w\.]+)/i],[[I,"Yandex"],x],[/(Avast)\/([\w\.]+)/i],[[I,"Avast Secure Browser"],x],[/(AVG)\/([\w\.]+)/i],[[I,"AVG Secure Browser"],x],[/(puffin)\/([\w\.]+)/i],[[I,"Puffin"],x],[/(focus)\/([\w\.]+)/i],[[I,"Firefox Focus"],x],[/(opt)\/([\w\.]+)/i],[[I,"Opera Touch"],x],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[I,"UCBrowser"],x],[/(comodo_dragon)\/([\w\.]+)/i],[[I,/_/g," "],x],[/(windowswechat qbcore)\/([\w\.]+)/i],[[I,"WeChat(Win) Desktop"],x],[/(micromessenger)\/([\w\.]+)/i],[[I,"WeChat"],x],[/(brave)\/([\w\.]+)/i],[[I,"Brave"],x],[/(whale)\/([\w\.]+)/i],[[I,"Whale"],x],[/(qqbrowserlite)\/([\w\.]+)/i],[I,x],[/(QQ)\/([\d\.]+)/i],[I,x],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[I,x],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[I,x],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[I,x],[/(MetaSr)[\/\s]?([\w\.]+)/i],[I],[/(LBBROWSER)/i],[I],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[x,[I,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[x,[I,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[I,x],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[x,[I,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[I,/(.+)/,"$1 WebView"],x],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[I,/(.+(?:g|us))(.+)/,"$1 $2"],x],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[I,"Chrome Mobile"],x],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[x,[I,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[I,"Sailfish Browser"],x],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[I,x],[/(dolfin)\/([\w\.]+)/i],[[I,"Dolphin"],x],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[I,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[I,"Opera Coast"],x],[/fxios\/([\w\.-]+)/i],[x,[I,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[x,[I,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[x,I],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[I,"GSA"],x],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[I,[x,(U.mapper={rgx:function(e,t){for(var r,n,i,o,s,a=0;a<t.length&&!o;){for(var u=t[a],c=t[a+1],l=r=0;l<u.length&&!o;)if(o=u[l++].exec(e))for(n=0;n<c.length;n++)s=o[++r],"object"==typeof(i=c[n])&&0<i.length?2==i.length?"function"==typeof i[1]?this[i[0]]=i[1].call(this,s):this[i[0]]=i[1]:3==i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?this[i[0]]=s?s.replace(i[1],i[2]):void 0:this[i[0]]=s?i[1].call(this,s,i[2]):void 0:4==i.length&&(this[i[0]]=s?i[3].call(this,s.replace(i[1],i[2])):void 0):this[i]=s||void 0;a+=2}},str:function(e,t){for(var r in t)if("object"==typeof t[r]&&0<t[r].length){for(var n=0;n<t[r].length;n++)if(U.util.has(t[r][n],e))return"?"===r?void 0:r}else if(U.util.has(t[r],e))return"?"===r?void 0:r;return e}}).str,(U.maps={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}}).browser.oldsafari.version]],[/(webkit|khtml)\/([\w\.]+)/i],[I,x],[/(navigator|netscape)\/([\w\.-]+)/i],[[I,"Netscape"],x],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]*)/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[I,x]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[E,"amd64"]],[/(ia32(?=;))/i],[[E,U.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[E,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[E,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[E,/ower/,"",U.util.lowerize]],[/(sun4\w)[;\)]/i],[[E,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[E,U.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[A,M,[e,w]],[/applecoremedia\/[\w\.]+ \((ipad)/],[A,[M,"Apple"],[e,w]],[/(apple\s{0,1}tv)/i],[[A,"Apple TV"],[M,"Apple"],[e,t]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[M,A,[e,w]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[A,[M,"Amazon"],[e,w]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[A,U.mapper.str,U.maps.device.amazon.model],[M,"Amazon"],[e,C]],[/android.+aft([bms])\sbuild/i],[A,[M,"Amazon"],[e,t]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[A,M,[e,C]],[/\((ip[honed|\s\w*]+);/i],[A,[M,"Apple"],[e,C]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s_-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[M,A,[e,C]],[/\(bb10;\s(\w+)/i],[A,[M,"BlackBerry"],[e,C]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[A,[M,"Asus"],[e,w]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[M,"Sony"],[A,"Xperia Tablet"],[e,w]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[A,[M,"Sony"],[e,C]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[M,A,[e,vp]],[/android.+;\s(shield)\sbuild/i],[A,[M,"Nvidia"],[e,vp]],[/(playstation\s[34portablevi]+)/i],[A,[M,"Sony"],[e,vp]],[/(sprint\s(\w+))/i],[[M,U.mapper.str,U.maps.device.sprint.vendor],[A,U.mapper.str,U.maps.device.sprint.model],[e,C]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[M,[A,/_/g," "],[e,C]],[/(nexus\s9)/i],[A,[M,"HTC"],[e,w]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[A,[M,"Huawei"],[e,C]],[/android.+(bah2?-a?[lw]\d{2})/i],[A,[M,"Huawei"],[e,w]],[/(microsoft);\s(lumia[\s\w]+)/i],[M,A,[e,C]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[A,[M,"Microsoft"],[e,vp]],[/(kin\.[onetw]{3})/i],[[A,/\./g," "],[M,"Microsoft"],[e,C]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w*)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[A,[M,"Motorola"],[e,C]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[A,[M,"Motorola"],[e,w]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[M,U.util.trim],[A,U.util.trim],[e,t]],[/hbbtv.+maple;(\d+)/i],[[A,/^/,"SmartTV"],[M,"Samsung"],[e,t]],[/\(dtv[\);].+(aquos)/i],[A,[M,"Sharp"],[e,t]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[M,"Samsung"],A,[e,w]],[/smart-tv.+(samsung)/i],[M,[e,t],A],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[M,"Samsung"],A,[e,C]],[/sie-(\w*)/i],[A,[M,"Siemens"],[e,C]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[M,"Nokia"],A,[e,C]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[A,[M,"Acer"],[e,w]],[/android.+([vl]k\-?\d{3})\s+build/i],[A,[M,"LG"],[e,w]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[M,"LG"],A,[e,w]],[/(lg) netcast\.tv/i],[M,A,[e,t]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[A,[M,"LG"],[e,C]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[M,A,[e,w]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[A,[M,"Lenovo"],[e,w]],[/(lenovo)[_\s-]?([\w-]+)/i],[M,A,[e,C]],[/linux;.+((jolla));/i],[M,A,[e,C]],[/((pebble))app\/[\d\.]+\s/i],[M,A,[e,ea]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[M,A,[e,C]],[/crkey/i],[[A,"Chromecast"],[M,"Google"],[e,t]],[/android.+;\s(glass)\s\d/i],[A,[M,"Google"],[e,ea]],[/android.+;\s(pixel c)[\s)]/i],[A,[M,"Google"],[e,w]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[A,[M,"Google"],[e,C]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:a\d|one|one[\s_]plus|note lte)?[\s_]*(?:\d?\w?)[\s_]*(?:plus)?)\s+build/i,/android.+(redmi[\s\-_]*(?:note)?(?:[\s_]*[\w\s]+))\s+build/i],[[A,/_/g," "],[M,"Xiaomi"],[e,C]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[A,/_/g," "],[M,"Xiaomi"],[e,w]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[A,[M,"Meizu"],[e,C]],[/(mz)-([\w-]{2,})/i],[[M,"Meizu"],A,[e,C]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[A,[M,"OnePlus"],[e,C]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[A,[M,"RCA"],[e,w]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[A,[M,"Dell"],[e,w]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[A,[M,"Verizon"],[e,w]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[M,"Barnes & Noble"],A,[e,w]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[A,[M,"NuVision"],[e,w]],[/android.+;\s(k88)\sbuild/i],[A,[M,"ZTE"],[e,w]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[A,[M,"Swiss"],[e,C]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[A,[M,"Swiss"],[e,w]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[A,[M,"Zeki"],[e,w]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[M,"Dragon Touch"],A,[e,w]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[A,[M,"Insignia"],[e,w]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[A,[M,"NextBook"],[e,w]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[M,"Voice"],A,[e,C]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[M,"LvTel"],A,[e,C]],[/android.+;\s(PH-1)\s/i],[A,[M,"Essential"],[e,C]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[A,[M,"Envizen"],[e,w]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[M,A,[e,w]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[A,[M,"MachSpeed"],[e,w]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[M,A,[e,w]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[A,[M,"Rotor"],[e,w]],[/android.+(KS(.+))\s+build/i],[A,[M,"Amazon"],[e,w]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[M,A,[e,w]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[e,U.util.lowerize],M,A],[/[\s\/\(](smart-?tv)[;\)]/i],[[e,t]],[/(android[\w\.\s\-]{0,9});.+build/i],[A,[M,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[x,[I,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[x,[I,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[I,x],[/rv\:([\w\.]{1,9}).+(gecko)/i],[x,I]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[I,x],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[I,U.mapper.str,U.maps.os.windows],[x,U.mapper.str,U.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[I,"Windows"],[x,U.mapper.str,U.maps.os.windows.version]],[/\((bb)(10);/i],[[I,"BlackBerry"],x],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[I,x],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[I,"Symbian"],x],[/\((series40);/i],[I],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[I,"Firefox OS"],x],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w*)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]*)/i,/(hurd|linux)\s?([\w\.]*)/i,/(gnu)\s?([\w\.]*)/i],[[I,"Linux"],x],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[I,"Chromium OS"],x],[/(sunos)\s?([\w\.\d]*)/i],[[I,"Solaris"],x],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[I,"Linux"],x],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[I,"iOS"],[x,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[I,"iOS"],[x,/_/g,"."]],[/(haiku)\s(\w+)/i],[I,x],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[x,/_/g,"."],[I,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[I,"Mac"],[x,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]*)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.])*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w\.]*)/i],[I,x]]},U);function U(){}xO.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=MO.parse(e.navigator.userAgent),s=o.browser,a=o.os,o=o.device,u=e.screen,c=(null==(c=e.navigator.languages)?void 0:c[0])||"",l=c.split("-")[0],p=(null!=(p=o.type)?p:"pc").replace(/\b(mobile|smarttv)\b/g,function(e,t){return"mobile"===t?"phone":"smarttv"===t?"tv":e}),f=a.name||"",h="",d="";try{f=null!=(r=null==(t=f.match(/\b(Mac|Windows|Linux|Android|iOS)\b/))?void 0:t[0])?r:f,h=null!=(i=null==(n=u.orientation.type.match(/\b(landscape|portrait)\b/))?void 0:n[0])?i:"",d=Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch(e){}return{platform:"Web",browserName:s.name||"",browserMajorVersion:s.major||"",browserVersion:s.version||"",osName:f,osVersion:a.version||"",deviceModel:o.model||"",deviceType:p,deviceVendor:o.vendor||"",deviceBrand:o.vendor||"",locale:c,language:l,orientation:h,userAgent:e.navigator.userAgent||"",screenWidth:u.width||"",screenHeight:u.height||"",timeZone:d}};var CO=xO;function xO(){}UO.prototype.map=function(e){return new UO(e(this.previous),e(this.current))};var PO=UO;function UO(e,t){this.previous=e,this.current=t}DO.empty=function(){return this.from([])},DO.from=function(e){return new DO(e)},DO.fromDto=function(e){return this.from(e.events.map(function(e){return jn.fromJson(e)}))},Object.defineProperty(DO.prototype,"rawEvents",{get:function(){return this.events},enumerable:!1,configurable:!0});var kO=DO;function DO(e){this.events=e}FO.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return BO.of(GO(e,this.hackleDeviceId),IO.empty(),kO.empty())},FO.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(FO.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),FO.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},FO.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},FO.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},FO.prototype.hackleUser=function(e){var t=(new zt).addIdentifiers(e.user.identifiers||{}).add(Bt.ID,e.user.id||this.hackleDeviceId).add(Bt.DEVICE,e.user.deviceId||this.hackleDeviceId).add(Bt.HACKLE_DEVICE,this.hackleDeviceId),t=(u.isNotNullOrUndefined(e.user.userId)&&t.add(Bt.USER,e.user.userId),t.build()),r=this.campaignParser.parse();return{identifiers:t,properties:c(c({},r),e.user.properties),hackleProperties:this.hackleProperties(),cohorts:e.cohorts.rawCohorts,targetEvents:e.targetEvents.rawEvents}},FO.prototype.hackleProperties=function(){var e;return(e="undefined"!=typeof window?c(c({},CO.generate(window)),this.pageManager.currentPage.toProperties()):e)||{}},FO.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},FO.prototype.setUserId=function(e){e=c(c({},this.context.user),{userId:e});return this.setUser(e)},FO.prototype.setDeviceId=function(e){e=c(c({},this.context.user),{deviceId:e});return this.setUser(e)},FO.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},FO.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},FO.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},FO.prototype.saveUser=function(e){this.storage.saveUser(e)},FO.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,NO(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new PO(t,n)},FO.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=GO(r,n.hackleDeviceId),NO(e,t)?c(c({},t),{properties:c(c({},e.properties),t.properties)}):t;var t})},FO.prototype.operateProperties=function(r){return this.updateContext(function(e){var t=null!=(t=e.properties)?t:{},t=r.operate(new Map(Object.entries(t)));return c(c({},e),{properties:u.fromMap(t)})})},FO.prototype.sync=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return[4,Promise.all([this.syncCohort(),this.syncUserTarget()])];case 1:return e.sent(),[2]}})})},FO.prototype.syncIfNeeded=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return this.hasNewIdentifiers(t.previous,t.current)?[4,this.syncCohort()]:[3,2];case 1:e.sent(),e.label=2;case 2:return NO(t.previous,t.current)?[3,4]:[4,this.syncUserTarget()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},FO.prototype.syncCohort=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userCohortFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(t,this.context.targetEvents),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync cohorts: ".concat(t)),[3,3];case 3:return[2]}})})},FO.prototype.syncUserTarget=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.userTargetFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(this.context.cohorts,t),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync userTargets: ".concat(t)),[3,3];case 3:return[2]}})})},FO.prototype.hasNewIdentifiers=function(e,t){var r=Gt(e),e=Gt(t);return Object.entries(e).some(function(e){var t=e[0],e=e[1];return r[t]!==e})},FO.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var LO=FO;function FO(e,t,r,n,i,o,s,a,u){this.hackleDeviceId=e,this.storage=t,this.userTargetFetcher=r,this.userCohortFetcher=n,this.campaignParser=i,this.pageManager=o,this.clock=s,this.userListeners=[],this.defaultUser={id:this.hackleDeviceId,deviceId:this.hackleDeviceId},this.context=this.initContext(a,u),this.storage.saveUser(this.context.user)}jO.prototype.getUser=function(){var e=this.deviceId||void 0,t=this.userId||void 0;return void 0!==e||void 0!==t?{deviceId:e,userId:t}:null},jO.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(jO.prototype,"deviceId",{get:function(){return this.storage.getItem(it)},enumerable:!1,configurable:!0}),Object.defineProperty(jO.prototype,"userId",{get:function(){return this.storage.getItem(nt)},enumerable:!1,configurable:!0}),jO.prototype.setDeviceId=function(e){this.setId(it,e)},jO.prototype.setUserId=function(e){this.setId(nt,e)},jO.prototype.setId=function(e,t){u.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var VO=jO;function jO(e){this.storage=e}HO.of=function(e,t,r){return new HO(e,t.filterBy(e),r)},HO.prototype.with=function(e){return HO.of(e,this.cohorts.filterBy(e),this.targetEvents)},HO.prototype.update=function(e,t){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return HO.of(this.user,e,t)};var BO=HO;function HO(e,t,r){this.user=e,this.cohorts=t,this.targetEvents=r}var GO=function(e,t){return c(c({},e),{id:e.id||t,deviceId:e.deviceId||t})},zO=(Object.defineProperty(KO.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(KO.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:KO.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(KO.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),KO.prototype.addListener=function(e){this.sessionListeners.push(e)},KO.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},KO.prototype.startNewSessionIfNeeded=function(e,t){var r=this._lastEventTime;return null!==r&&null!==this._currentSessionId&&t-r<this.sessionTimeoutMillis?(this.updateLastEventTime(t),this._currentSessionId):this.startNewSession(e,e,t)},KO.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(rt,"".concat(e))},KO.prototype.endSession=function(t){var r=this._currentSessionId,n=this._lastEventTime;null!==r&&null!==n&&this.sessionListeners.forEach(function(e){return e.onSessionEnded(r,t,n)})},KO.prototype.newSession=function(t,r){var n="".concat(r,".").concat(H().slice(0,8));return this.saveSession(n),this.updateLastEventTime(r),this.sessionListeners.forEach(function(e){e.onSessionStarted(n,t,r)}),n},KO.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(tt,e)},KO.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(tt)},KO.prototype.loadLastEventTime=function(){var e=this.storage.getItem(rt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},KO.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},KO.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return this.updateLastEventTime(t);case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}},KO.EMPTY_SESSION_ID="0.ffffffff",KO);function KO(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}YO.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},YO.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},YO.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},YO.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var JO=YO;function YO(){this.storage=window.localStorage}qO.postfix=function(e,t){return new qO(e,function(e){return"".concat(e).concat(t)})},qO.prefix=function(e,t){return new qO(e,function(e){return"".concat(t).concat(e)})},qO.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},qO.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},qO.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var WO=qO;function qO(e,t){this.delegate=e,this.transform=t}XO.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},XO.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},XO.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},XO.prototype.getVictimIndex=function(e){var t=this.getRemainListSize();try{var r=JSON.stringify(e),n=this.getList(),i=0;return n.findIndex(function(e){return(i+=JSON.stringify(e).length)+t>=r.length})}catch(e){return-1}},XO.prototype.getList=function(){try{var e=this.delegate.getItem(this.listKey);if(!e)return[];var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}},XO.prototype.entries=function(){return this.getList().flatMap(Object.entries)},XO.prototype.setItem=function(e,t){var r;try{this.removeItem(e);var n=this.getList(),i=((r={})[e]=t,r);if(!this.isAddableItem(i)){var o=this.getVictimIndex(i);if(o<0)return;n=n.slice(o+1)}var s=JSON.stringify(n.concat(i));this.delegate.setItem(this.listKey,s)}catch(e){}},XO.prototype.getItem=function(t){var r=this,e=this.getList().find(function(e){return r.isEqualItem(e,t)});if(e&&e[t])return e[t]},XO.prototype.removeItem=function(t){var r=this,e=this.getList();try{var n=e.filter(function(e){return!r.isEqualItem(e,t)}),i=JSON.stringify(n);this.delegate.setItem(this.listKey,i)}catch(e){}},XO.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var $O=XO;function XO(e,t,r){void 0===r&&(r=4096);var n=this;this.delegate=e,this.listKey=t,this.encodedListCharLen=6,this.resolveMaxLength=function(e){e-=n.encodedListCharLen;return e<0?0:e},this.maxLength=this.resolveMaxLength(r)}QO.prototype.currentUser=function(){return this.userManager.resolve()},QO.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},QO.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},QO.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},QO.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},QO.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},QO.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},QO.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},QO.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},QO.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},QO.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},QO.prototype.increment=function(e,t){Ti.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var ZO=QO;function QO(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}tN.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},tN.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},tN.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},tN.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},tN.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},tN.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},tN.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},tN.monitoring=function(e){return"".concat(e,"/metrics")},tN.userTargets=function(e){return"".concat(e,"/api/v1/user-targets")};var eN=tN;function tN(){}nN.prototype.exist=function(e,t){var e=this.key(e),r=this.storage.getItem(e);if(u.isNullOrUndefined(r))return!1;r=Number.parseInt(r,10);return!Number.isNaN(r)&&t<=r||(this.storage.removeItem(e),!1)},nN.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},nN.prototype.key=function(e){return"".concat(e.key)};var rN=nN;function nN(e){this.storage=e}oN.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var iN=oN;function oN(e){this.handlers=e}aN.prototype.handle=function(e,t){e.close()},aN.prototype.supports=function(e){return"CLOSE"===e.type};var sN=aN;function aN(){}cN.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},cN.prototype.supports=function(e){return"WEB_LINK"===e.type};var uN=cN;function cN(e){this.urlHandler=e}pN.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},pN.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var lN=pN;function pN(e){this.urlHandler=e}hN.prototype.handle=function(e,t){var r;e.context.reason!==p.OVERRIDDEN&&(r=this.clock.currentMillis()+864e5,this.storage.put(e.context.inAppMessage,r)),e.close()},hN.prototype.supports=function(e){return"HIDDEN"===e.type};var fN=hN;function hN(e,t){this.storage=e,this.clock=t}vN.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},vN.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var dN=vN;function vN(e){this.urlHandler=e}gN.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},gN.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var yN=gN;function gN(e){this.urlHandler=e}EN.prototype.handle=function(e,t){try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},EN.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var mN=EN;function EN(e){this.urlHandler=e}bN.prototype.handle=function(e,t){e.close();try{if(!t.value)return;this.urlHandler.open(new URL(t.value))}catch(e){s.log.error("Invalid url: ".concat(t.value))}},bN.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var wN=bN;function bN(e){this.urlHandler=e}_N.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},_N.prototype.createTrackEvent=function(e,t){switch(e.type){case"IMPRESSION":return{key:"$in_app_impression",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,title_text:null==(r=null==(r=t.message.text)?void 0:r.title)?void 0:r.text,body_text:null==(r=null==(r=t.message.text)?void 0:r.body)?void 0:r.text,button_text:t.message.buttons.map(function(e){return e.text}),image_url:t.message.images.map(function(e){return e.imagePath})})};case"CLOSE":return{key:"$in_app_close",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType})};case"ACTION":var r=e;return{key:"$in_app_action",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,action_type:r.action.type,action_area:r.area,action_value:r.action.value,button_text:r.buttonText,image_url:r.imageUrl,image_order:r.imageOrder})};case"IMAGE_IMPRESSION":r=e;return{key:"$in_app_image_impression",properties:c(c({},t.properties),{in_app_message_id:t.inAppMessage.id,in_app_message_key:t.inAppMessage.key,in_app_message_display_type:t.message.layout.displayType,image_url:r.imageUrl,image_order:r.imageOrder})}}};var TN=_N;function _N(e){this.core=e}NN.prototype.setListener=function(e){this.inAppMessageListener=e},NN.prototype.present=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:if(this.currentMessageView)return[2];if(this.opening)return[2];this.opening=!0,t=null,e.label=1;case 1:return(e.trys.push([1,3,4,5]),null===(t=this.messageViewFactory.create(r,this)))?[2]:[4,(this.currentMessageView=t).open()];case 2:return e.sent(),[3,5];case 3:return e.sent(),null!=t&&t.close(),[3,5];case 4:return this.opening=!1,[7];case 5:return[2]}})})};var ON=NN;function NN(e,t,r,n){void 0===n&&(n=null),this.messageViewFactory=e,this.eventHandler=t,this.interactionHandlerFactory=r,this.inAppMessageListener=n,this.currentMessageView=null,this.opening=!1}AN.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},AN.prototype.destroy=function(){this.userEventEmitter.off("event",this.onEvent)};var IN=AN;function AN(e,t,r){var n=this;this.userEventEmitter=e,this.determiner=t,this.presenter=r,this.onEvent=function(e){e=n.determiner.determineOrNull(e);e&&n.presenter.present(e)},this.initialize()}var SN=function(e,t,r,n,i){this.inAppMessage=e,this.message=t,this.user=r,this.properties=n,this.reason=i},RN=(MN.prototype.determineOrNull=function(e){var t=this.workspaceFetcher.get();if(t)for(var r=0,n=t.getInAppMessages();r<n.length;r++){var i=n[r];if(this.eventMatcher.matches(t,i,e)){i=this.context(i,e);if(i)return i}}},MN.prototype.context=function(e,t){var r,e=this.core.tryInAppMessage(e.key,t.user);if(e.inAppMessage&&e.message)return r=c(c({},e.properties),{decision_reason:e.reason}),new SN(e.inAppMessage,e.message,t.user,Ue.sanitize(r),e.reason)},MN);function MN(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.core=r}xN.prototype.open=function(){var i,o;return a(this,void 0,void 0,function(){var t,r,n=this;return l(this,function(e){switch(e.label){case 0:if(!this.status.canOpen())return s.log.debug("InAppMessage is already opened. (key=".concat(this.context.inAppMessage.key,")")),[2];e.label=1;case 1:return e.trys.push([1,4,,5]),null!=(o=null==(i=this.ui.inAppMessageListener)?void 0:i.beforeInAppMessageOpen)&&o.call(i,this.context.inAppMessage),this.status.current="OPENING",window.addEventListener(xN.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(xN.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),[4,this.scriptLoader.load()];case 2:return e.sent(),(t=this.addContainer()).style.display="none",t.classList.add("".concat(xN.CONTAINER_CLASS_NAME,"--loading")),r=window.HackleInAppMessageRenderer,this.renderer=new r.HackleInAppMessageRenderer(t),r=this.renderTypeResolver.resolve(this.context),[4,this.renderer.render({messageId:this.context.inAppMessage.id,message:this.context.message.toJson(),renderType:r})];case 3:return e.sent(),t.classList.remove("".concat(xN.CONTAINER_CLASS_NAME,"--loading")),t.style.display="block",this.handleInAppMessageLifecycle("OPEN",function(){var e,t;n.handleEvent({type:"IMPRESSION"}),n.status.current="OPENED",null!=(t=null==(e=n.ui.inAppMessageListener)?void 0:e.afterInAppMessageOpen)&&t.call(e,n.context.inAppMessage)},function(){s.log.warn("Failed to open inAppMessage with [Timeout expired.]"),n.destroy()}),[3,5];case 4:return e.sent(),this.destroy(),[3,5];case 5:return[2]}})})},xN.prototype.close=function(){var e,t,r=this;this.status.canClose()?(null!=(t=null==(e=this.ui.inAppMessageListener)?void 0:e.beforeInAppMessageClose)&&t.call(e,this.context.inAppMessage),this.status.current="CLOSING",this.handleInAppMessageLifecycle("CLOSE",function(){var e,t;r.handleEvent({type:"CLOSE"}),r.destroy(),null!=(t=null==(e=r.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r.context.inAppMessage)},function(){var e,t;s.log.warn("Failed to close inAppMessage with [Timeout expired.]"),r.destroy(),null!=(t=null==(e=r.ui.inAppMessageListener)?void 0:e.afterInAppMessageClose)&&t.call(e,r.context.inAppMessage)})):s.log.debug("InAppMessage is already closed. (key=".concat(this.context.inAppMessage.key,")"))},xN.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(xN.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},xN.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},xN.prototype.destroy=function(){var e;window.removeEventListener(xN.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(xN.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE,this.resolveLifecycleEnd),null!=(e=this.renderer)&&e.destroy(),this.renderer=null,this.removeContainer(),this.ui.currentMessageView=null,this.status.current="CLOSED"},xN.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(xN.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},xN.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},xN.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},xN.prototype.handleEvent=function(e){this.ui.eventHandler.handle(this,e)},xN.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",xN.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",xN.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",xN.CONTAINER_CLASS_NAME="hackle-iam",xN.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var CN=xN;function xN(e,t,r,n,i,o){var s=this;this.scriptLoader=e,this.context=t,this.ui=r,this.renderTypeResolver=n,this.status=i,this.lifecycleRegistry=o,this.container=null,this.renderer=null,this.resolveLifecycleEnd=function(e){var t;e instanceof CustomEvent&&("string"==typeof(t=e).detail.id&&["OPEN","CLOSE"].includes(t.detail.type))&&(e=(t=e.detail).id,t=t.type,null!=(t=s.lifecycleRegistry.getAndRemove(t,e))&&t())},this.handleInAppMessageInteraction=function(e){e instanceof CustomEvent&&e.type===xN.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))}}UN.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},UN.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},UN.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var PN=UN;function UN(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}DN.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},DN.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var kN=DN;function DN(e){this.current=e=void 0===e?"CLOSED":e}FN.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},FN.prototype.register=function(e,t){var r=H(),e=this.resolveKey(e,r);return this.record[e]=t,r},FN.prototype.getAndRemove=function(e,t){var e=this.resolveKey(e,t),t=this.record,r=t[e],t=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]]);return r}(t,["symbol"==typeof e?e:e+""]);return this.record=t,r};var LN=FN;function FN(){this.record={}}jN.create=function(e){return new jN(e)},jN.prototype.create=function(e,t){var r=new PN,n=new kN,i=new LN;switch(e.message.layout.displayType){case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new CN(this.scriptLoader,e,t,r,n,i);case"NONE":return null}};var VN=jN;function jN(e){this.scriptLoader=e}HN.prototype.load=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return window.HackleInAppMessageRenderer?[2]:(t=this.createScript(),document.head.appendChild(t),[4,this.waitForLoad(t)]);case 1:return[2,e.sent()]}})})},HN.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},HN.prototype.waitForLoad=function(o){return new Promise(function(e,t){function r(){o.removeEventListener("error",i),o.removeEventListener("load",n)}var n=function(){r(),e(o)},i=function(e){r(),t(e.message)};o.addEventListener("load",n),o.addEventListener("error",i)})};var BN=HN;function HN(e){this.scriptUrl=e}zN.prototype.isTriggerTarget=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},zN.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=KN.of(e,t,r);return this.targetMatcher.anyMatches(e,sb.create(),n.targets)};var GN=zN;function zN(e){this.targetMatcher=e}JN.of=function(e,t,r){return new JN(new ib("IN_APP_MESSAGE",r.id),e,t.user,t)};var KN=JN;function JN(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}WN.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return u.isNullOrUndefined(e)?[]:JSON.parse(e)},WN.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var YN=WN;function WN(e){this.storage=e}$N.prototype.get=function(t){return this.processors.find(function(e){return e.supports(t)})};var qN=$N;function $N(e){this.processors=e}ZN.prototype.process=function(e,t,r){e.context.reason!==p.OVERRIDDEN&&this.saveImpression(e.context.inAppMessage,e.context.user,r)},ZN.prototype.saveImpression=function(e,t,r){var n=this.impressionStorage.get(e),t={identifiers:t.identifiers,timestamp:r};n.push(t),n.length>ZN.IMPRESSION_MAX_SIZE&&n.splice(0,n.length-ZN.IMPRESSION_MAX_SIZE),this.impressionStorage.set(e,n)},ZN.prototype.supports=function(e){return"IMPRESSION"===e.type},ZN.IMPRESSION_MAX_SIZE=100;var XN=ZN;function ZN(e){this.impressionStorage=e}eI.prototype.process=function(e,t,r){},eI.prototype.supports=function(e){return"CLOSE"===e.type};var QN=eI;function eI(){}rI.prototype.process=function(e,t,r){var n,i,o=this.actionHandlerFactory.get(t.action);!(null==(i=null==(n=e.ui.inAppMessageListener)?void 0:n.onInAppMessageClick)?void 0:i.call(n,e.context.inAppMessage,e,Pn.fromAction(t.action)))&&e.status.canClose()&&null!=o&&o.handle(e,t.action)},rI.prototype.supports=function(e){return"ACTION"===e.type};var tI=rI;function rI(e){this.actionHandlerFactory=e}iI.prototype.handle=function(e,t){var r=this.clock.currentMillis(),n=(this.eventTracker.track(e.context,t,r),this.eventProcessorFactory.get(t));n&&n.process(e,t,r)};var nI=iI;function iI(e,t,r){this.clock=e,this.eventTracker=t,this.eventProcessorFactory=r}sI.prototype.matches=function(e,t,r){return!!M0.isTrackEvent(r)&&this.ruleDeterminer.isTriggerTarget(e,t,r)};var oI=sI;function sI(e){this.ruleDeterminer=e}uI.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var aI=uI;function uI(e){this.handlers=e}lI.prototype.handle=function(e,t){e.close()},lI.prototype.supports=function(e){return"CLOSE"===e.type};var cI=lI;function lI(){}fI.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.eventHandler.handle(e,t)},fI.prototype.eventOrNull=function(e){var t=Cn.fromJson(e.action);return t?{type:"ACTION",action:t,area:e.area,buttonText:e.buttonText,imageUrl:e.imageUrl,imageOrder:e.imageOrder}:null},fI.prototype.supports=function(e){return"ACTION"===e.type};var pI=fI;function fI(e){this.eventHandler=e}dI.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.eventHandler.handle(e,t)},dI.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var hI=dI;function dI(e){this.eventHandler=e}yI.prototype.open=function(e){window.location.href=e.href};var vI=yI;function yI(){}mI.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var gI=mI;function mI(){}wI.prototype.open=function(e){window.open(e.href)};var EI=wI;function wI(){}TI.prototype.open=function(e){window.location.replace(e)};var bI=TI;function TI(){}function _I(e,t,r){return null===e||(!II(t,OI)||r.current!==r.referrer)&&!II(e,t)}var OI={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,gclid:void 0,fbclid:void 0},NI={current:void 0,referrer:void 0},II=function(t,r){return Object.keys(OI).every(function(e){return t[e]===r[e]})},AI=(SI.prototype.startNewCampaign=function(e,t,r){for(var t=c(c({},OI),t),n=new Io,i=0,o=Object.entries(t);i<o.length;i++){var s=o[i],a=s[0],s=s[1];s?n.set(a,s):n.unset(a)}var t=n.build(),u=t.toEvent(),e=this.userManager.toHackleUser(e);this.core.track(u,e,r),this.userManager.updateUserProperties(t)},SI.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();_I(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},SI.prototype.onSessionEnded=function(e,t,r){},SI.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},SI);function SI(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}MI.prototype.get=function(){var e=this.storage.getItem(ot);return e?JSON.parse(e):null},MI.prototype.set=function(e){this.storage.setItem(ot,JSON.stringify(e))};var RI=MI;function MI(e){this.storage=e}xI.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},xI.prototype.getQueryParams=function(e){for(var t={},r=0,n=this.search.substring(1).split("&");r<n.length;r++){var i=n[r].split("="),o=i[0],i=i[1];e&&!e(o,i)||(i=Bo.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var CI=xI;function xI(e){this.search=e}UI.extractDomain=function(e){var t=this.DOMAIN_MATCH_REGEX,r=e.split("."),r=r[r.length-1],r=((4<r.length||"com"===r||"org"===r)&&(t=this.SIMPLE_DOMAIN_MATCH_REGEX),e.match(t));return r?r[0]:e},UI.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,UI.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var PI=UI;function UI(){}DI.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},DI.prototype.params=function(e){e=u.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new CI(e).getQueryParams(DI.CAMPAIGN_QUERY_CONDITION)},DI.prototype.resolve=function(e){return{utm_campaign:e[LI],utm_content:e[FI],utm_id:e[VI],utm_medium:e[jI],utm_source:e[BI],utm_term:e[HI],gclid:e[GI],fbclid:e[zI]}},DI.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return NI;return{current:PI.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,PI.extractDomain(e)}()}},DI.CAMPAIGN_QUERY_CONDITION=function(e,t){return Oi.isNotEmptyString(t)};var kI=DI;function DI(e){this.pageManager=e}var LI="utm_campaign",FI="utm_content",VI="utm_id",jI="utm_medium",BI="utm_source",HI="utm_term",GI="gclid",zI="fbclid",KI=(JI.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},JI.prototype.send=function(e){var t=e.experiment.key,r=e.variationKey,t="HACKLE-EXPERIMENT_".concat(t,"_V").concat(e.experiment.version,"-").concat(r);try{window.gtag("event","experience_impression",{exp_variant_string:t})}catch(e){s.log.error("Unexpected exception while sending an event to Google Analytics with gtag: ".concat(e))}},JI);function JI(e,t){var r=this;this.userEventEmitter=e,this.determiner=t,this.onEvent=function(e){e=r.determiner.determineTargetExposureOrNull(e);e&&r.send(e)},this.initialize()}WI.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!M0.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==p.TRAFFIC_ALLOCATED?null:e};var YI=WI;function WI(e){this.workspaceFetcher=e}var qI={user:void 0,debug:!1,log_disabled:!1,automaticPageTracking:!0,pollingIntervalMillis:-1,exposureEventDedupIntervalMillis:6e4,sessionTimeoutMillis:18e5,autoOpenDevTool:!1,sdkUrl:"https://client-sdk.hackle.io",eventUrl:"https://event.hackle.io",monitoringUrl:"https://monitoring.hackle.io",cdnUrl:"https://static.hackle.io",sameSiteCookie:"LAX",secureCookie:!1,SDK_NAME_HEADER:"javascript-sdk_browser",SDK_VERSION_HEADER:"11.44.0",IAM_RENDERER_VERSION_HEADER:"0.0.9"},$I=(XI.config=function(e){return c(c(c({},qI),e),{automaticPageTracking:XI.resolveAutomaticPageTracking(e)})},XI.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?qI.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},XI.logging=function(e){s.initCounter(function(e){return Ti.counter("log",{level:e})}),s.setLogLevel(_e.INFO),e.log_disabled?s.setLogLevel(_e.DISABLE):e.debug&&s.setLogLevel(_e.DEBUG)},XI.sdk=function(e,t){return s.log.debug("SDK key: ".concat(e)),e||s.log.error("invalid sdk key: '".concat(e,"' (expected: not null, not undefined and not empty string)")),{key:e,name:t.SDK_NAME_HEADER,version:t.SDK_VERSION_HEADER}},XI.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&s.log.debug("support sendBeacon API"),e},XI.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,6e4)},XI.dedupIntervalMillis=function(e){return void 0===e.exposureEventDedupIntervalMillis||"number"!=typeof e.exposureEventDedupIntervalMillis?6e4:e.exposureEventDedupIntervalMillis<1e3||36e5<e.exposureEventDedupIntervalMillis?(s.log.warn("Exposure event dedup interval is outside allowed range[1_000ms..3_600_000ms]. Setting to default value[1m]."),6e4):e.exposureEventDedupIntervalMillis},XI);function XI(){}QI.prototype.add=function(e){this.synchronizers.push(e)},QI.prototype.sync=function(){return a(this,void 0,void 0,function(){var t=this;return l(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.sync())}))];case 1:return e.sent(),[2]}})})},QI.prototype.close=function(){return a(this,void 0,void 0,function(){var t=this;return l(this,function(e){switch(e.label){case 0:return[4,Promise.all(this.synchronizers.map(function(e){return t.safe(e.close())}))];case 1:return e.sent(),[2]}})})},QI.prototype.safe=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,r];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})};var ZI=QI;function QI(){this.synchronizers=[]}tA.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.delegate.sync()];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync: ".concat(t)),[3,3];case 3:return[2]}})})},tA.prototype.start=function(){var e=this;-1!==this.intervalMillis&&null===this.pollingJob&&(this.pollingJob=this.scheduler.schedulePeriodically(this.intervalMillis,this.intervalMillis,function(){return e.sync()}))},tA.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},tA.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){switch(e.label){case 0:return this.stop(),[4,this.delegate.close()];case 1:return e.sent(),[2]}})})};var eA=tA;function tA(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}nA.prototype.schedule=function(e,t){e=new iA(e,t);return e.start(),e},nA.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new sA(e,t,r);break;case"setInterval":n=new uA(e,t,r)}return n.start(),n};var rA=nA;function nA(e){this.scheduleType=e}oA.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.task()},this.delayMillis)},oA.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var iA=oA;function oA(e,t){this.delayMillis=e,this.task=t,this.timeout=null}aA.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},aA.prototype.run=function(){var e=this;try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}this.timeout=setTimeout(function(){return e.run()},this.intervalMillis)},aA.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var sA=aA;function aA(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}cA.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},cA.prototype.run=function(){try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}},cA.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var uA=cA;function cA(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}pA.prototype.fetchIfModified=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},pA.prototype.createRequest=function(e){var t=Ii.builder().url(this.url).method("GET");return null!==e&&t.addHeader(xi.IF_MODIFIED_SINCE,e),t.build()},pA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Bi.record("get.workspace",t,r),[2,r];case 3:throw r=e.sent(),Bi.record("get.workspace",t,null),r;case 4:return[2]}})})},pA.prototype.handleResponse=function(e){if(e.isNotModified())return null;if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is empty");return{config:JSON.parse(e.body),lastModified:e.headers.get(xi.LAST_MODIFIED)}};var lA=pA;function pA(e,t){this.url=e,this.transport=t}hA.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},hA.prototype.createRequest=function(e){e={identifiers:Gt(e)},e=we.encodeURL(JSON.stringify(e));return Ii.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},hA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Bi.record("get.cohorts",t,r),[2,r];case 3:throw r=e.sent(),Bi.record("get.cohorts",t,null),r;case 4:return[2]}})})},hA.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return IO.fromDto(e)};var fA=hA;function hA(e,t){this.url=e,this.transport=t}vA.prototype.fetch=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return t=this.createRequest(r),[4,this.execute(t)];case 1:return t=e.sent(),[2,this.handleResponse(t)]}})})},vA.prototype.createRequest=function(e){e={identifiers:Gt(e)},e=we.encodeURL(JSON.stringify(e));return Ii.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},vA.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Bi.record("get.user-targets",t,r),[2,r];case 3:throw r=e.sent(),Bi.record("get.user-targets",t,null),r;case 4:return[2]}})})},vA.prototype.handleResponse=function(e){if(!e.isSuccessful())throw new Error("Http status code: ".concat(e.statusCode));if(null===e.body)throw new Error("Response body is null");e=JSON.parse(e.body);return kO.fromDto(e)};var dA=vA;function vA(e,t){this.url=e,this.transport=t}gA.prototype.getExperiments=function(){return Array.from(this.experiments.values())},gA.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},gA.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},gA.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},gA.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},gA.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},gA.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},gA.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},gA.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},gA.prototype.getContainerOrNull=function(e){return this.containers.get(e)},gA.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},gA.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},gA.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},gA.prototype.getAttributes=function(){return this.attributes},gA.from=function(e){var t=e.parameterConfigurations.map(St.fromJson),r=f.mapNotNullOrUndefined(e.experiments,function(e){return Ct.fromJson("AB_TEST",e,t)}),n=f.mapNotNullOrUndefined(e.experiments,function(e){return Ct.fromJson("AB_TEST",e,t)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),i=f.mapNotNullOrUndefined(e.featureFlags,function(e){return Ct.fromJson("FEATURE_FLAG",e,t)}),o=e.buckets.map(kt.fromJson),s=e.events.map(Vt.fromJson),a=f.mapNotNullOrUndefined(e.segments,or.fromJson),u=e.containers.map(ar.fromJson),c=f.mapNotNullOrUndefined(e.remoteConfigParameters,pr.fromJson),l=f.mapNotNullOrUndefined(e.inAppMessages,Br.fromJson),e=e.workspace.attributes;return new gA(r,n,i,o,s,a,u,t,c,l,e)};var yA=gA;function gA(e,t,r,n,i,o,s,a,u,c,l){this.experiments=f.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=f.associateBy(t,function(e){return e.key}),this.featureFlags=f.associateBy(r,function(e){return e.key}),this.buckets=f.associateBy(n,function(e){return e.id}),this.eventTypes=f.associateBy(i,function(e){return e.key}),this.segments=f.associateBy(o,function(e){return e.key}),this.containers=f.associateBy(s,function(e){return e.id}),this.parameterConfigurations=f.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=f.associateBy(u,function(e){return e.key}),this.inAppMessages=f.associateBy(c,function(e){return e.key}),this.attributes=l}EA.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},EA.prototype.setWorkspace=function(e){try{this.workspace=yA.from(e.config)}catch(e){s.log.error("Failed to set workspace: ".concat(e))}},EA.prototype.get=function(){return this.workspace},EA.prototype.sync=function(){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.workspaceFetcher.fetchIfModified(this.lastModified)];case 1:return(t=e.sent())&&(this.setConfig(t),this.workspaceConfigStorage.set(t)),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync workspace: ".concat(t)),[3,3];case 3:return[2]}})})},EA.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var mA=EA;function EA(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}bA.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},bA.prototype.dispatchEventsSynchronously=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.retryManager.add(r)];case 1:return e.sent(),[4,this.synchronousTransport.send(r)];case 2:return(t=e.sent()).isSuccessful()||t.isClientError()?[4,this.retryManager.delete(r)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},bA.prototype.dispatchEvents=function(r){return a(this,void 0,void 0,function(){var t;return l(this,function(e){switch(e.label){case 0:return[4,this.transport.send(r)];case 1:return(t=e.sent()).isSuccessful()||t.isClientError()?[2]:[4,this.retryManager.add(r)];case 2:return e.sent(),[2]}})})};var wA=bA;function bA(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}_A.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},_A.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof M0?M0.isExposureEvent(e)?t.push(e.toDto()):M0.isTrackEvent(e)?r.push(e.toDto()):M0.isRemoteConfigEvent(e)&&n.push(e.toDto()):M0.isExposureEventDto(e)?t.push(e):M0.isTrackEventDto(e)?r.push(e):M0.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return Ii.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},_A.prototype.execute=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:t=zn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Bi.record("post.events",t,r),[2,r];case 3:throw r=e.sent(),Bi.record("post.events",t,null),r;case 4:return[2]}})})};var TA=_A;function _A(e,t){this.url=e,this.transport=t}NA.prototype.add=function(e){return this.repository.add(e)},NA.prototype.delete=function(e){return this.repository.delete(e)},NA.prototype.flush=function(){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){switch(e.label){case 0:return[4,this.repository.read()];case 1:return 0===(t=e.sent()).length?[2]:[4,this.transport.send(t)];case 2:return(r=e.sent()).isSuccessful()||r.isClientError()?[4,this.delete(t)]:[3,4];case 3:e.sent(),e.label=4;case 4:return[2]}})})},NA.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"pageshow":return void this.flush().catch(function(e){return s.log.warn("Failed to flush retry events: ".concat(e))});case"blur":case"focus":case"hidden":case"locationChange":case"pagehide":return}};var OA=NA;function NA(e,t){this.repository=e,this.transport=t}function IA(){this.listeners={}}IA.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},IA.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},IA.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Se(SA,AA=IA);var AA,mp=SA;function SA(){return null!==AA&&AA.apply(this,arguments)||this}Se(CA,RA=mp),CA.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},CA.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},CA.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},CA.prototype.flush=function(e){var t;void 0===e&&(e=!1),null!=(t=this.flushingJob)&&t.cancel(),0!==this.queue.length&&(this.eventDispatcher.dispatch(this.queue,e).catch(function(e){return s.log.warn("Failed to dispatch events: ".concat(e))}),this.queue=[])},CA.prototype.close=function(){this.flush(!0)};var RA,MA=CA;function CA(e,t,r,n){var i=RA.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}PA.prototype.send=function(e){e=e.toBuilder().addHeader(ze,this.sdk.key).addHeader(Ke,this.sdk.name).addHeader(Je,this.sdk.version).addHeader(Ye,this.clock.currentMillis().toString()).build();return this.delegate.send(e)};var xA=PA;function PA(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}kA.intercept=function(e,t){return t instanceof xA?t:new xA(e,Fe.instance,t)};var UA=kA;function kA(){}LA.create=function(){return new LA},LA.prototype.send=function(s){return new Promise(function(t,r){var e,n=new XMLHttpRequest,i=(s.options.timeoutMillis&&(n.timeout=s.options.timeoutMillis),n.open(s.method,s.url),n.onreadystatechange=function(){var e;n.readyState===n.DONE&&(0===n.status?r(new Error("Request Error")):(e=new Mi(n.status,n.responseText,function(e){var t=xi.builder(),e=e.getAllResponseHeaders();if(!e)return t.build();for(var r=0,n=e.split("\r\n");r<n.length;r++){var i,o=n[r],s=o.indexOf(": ");0<s&&(i=o.slice(0,s),o=o.slice(s+2),t.add(i,o))}return t.build()}(n)),t(e)))},n),o=s.headers.raw();for(e in o)o.hasOwnProperty(e)&&i.setRequestHeader(e,o[e]);n.send(s.body)})};var DA=LA;function LA(){}VA.create=function(){return new VA},VA.prototype.send=function(n){var i=this;return new Promise(function(e,t){var r=!1;if(!(r="undefined"!=typeof window?window&&window.navigator&&!!window.navigator.sendBeacon&&!0:r))throw new Error("BeaconTransport not supported.");r=i.createBody(n);if(!window.navigator.sendBeacon(n.url,r))throw Error("Failed to sendBeacon");e(Mi.ok())})},VA.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(ze),r=(r&&t.append("sdkKey",r),t.append("sdkName",e.headers.getOrDefault(Ke,"unknown")),t.append("sdkVersion",e.headers.getOrDefault(Je,"unknown")),e.headers.get(Ye));return r&&t.append("sdkTime",r),e.body&&t.append("data",e.body),t};var FA=VA;function VA(){}BA.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var jA=BA;function BA(e){this.invocationResponseResolver=e}zA.prototype.invoke=function(e){if(null==(t=window._hackleApp)||!t.invoke)throw new Error("window._hackleApp.invoke is not implemented");var t=window._hackleApp.invoke(JSON.stringify(e));return this.invocationResponseResolver.resolve(t)};var HA,GA=zA;function zA(e){this.invocationResponseResolver=e}(Ma=HA=HA||{}).prompt="prompt",Ma.function="function";JA.prototype.getInvocator=function(e,t){return e===HA.prompt?new jA(t):e===HA.function?new GA(t):null};var KA=JA;function JA(){}WA.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},WA.prototype.onPageEnded=function(e,t){};var YA=WA;function WA(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var qA=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},$A=(XA.prototype.determineOrNull=function(e){if(this.splitUrlRedirectedCookieStorage.alreadyRedirected())return this.splitUrlRedirectedCookieStorage.clear(),null;var t=this.workspaceFetcher.get();if(!t)return null;for(var r=0,n=t.getSplitUrlExperiments();r<n.length;r++){var i,o=n[r];if(this.splitUrlMatcher.matches(t,o,e))return i=this.core.experiment(o.key,e,"A"),new qA(t,o,i,e)}return null},XA);function XA(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}QA.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=eS.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,sb.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,sb.create(),t.includeTargets))};var ZA=QA;function QA(e){this.targetMatcher=e}tS.of=function(e,t){return new tS(new ib("SPLIT_URL",H()),t,e)};var eS=tS;function tS(e,t,r){this.key=e,this.user=t,this.workspace=r}nS.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var rS=nS;function nS(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}oS.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(oS.SPLIT_URL_CONFIG_KEY,"")),r=Dn.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},oS.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},oS.prototype.resolveManualRedirectUrl=function(e,t){e=Bo.tryParse(e);return e?this.decorateCampaign(e,t):null},oS.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(Oi.isNotEmptyString(t)){for(var t=this.campaignParser.parse(t),r=e,n=0,i=Object.entries(t);n<i.length;n++){var o=i[n],s=o[0],o=o[1];Oi.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},oS.SPLIT_URL_CONFIG_KEY="redirectUrl";var iS=oS;function oS(e){this.campaignParser=e}aS.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return u.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},aS.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},aS.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var sS=aS;function aS(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}cS.prototype.setNeedDispatch=function(e){this.needDispatch=e},cS.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(cS.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},cS.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var uS=cS;function cS(){this.needDispatch=!0}pS.prototype.get=function(){var e=this.storage.getItem(ft);if(u.isNullOrUndefined(e))return null;try{var t=JSON.parse(e);return this.sdk.version!==t.version?(this.clear(),null):t}catch(e){return this.clear(),null}},pS.prototype.set=function(e){e=c(c({},e),{version:this.sdk.version});this.storage.setItem(ft,JSON.stringify(e))},pS.prototype.clear=function(){this.storage.removeItem(ft)};var lS=pS;function pS(e,t){this.sdk=e,this.storage=t}var fS=s.log,hS=(dS.prototype.install=function(e){void 0===e&&(e=null);try{var t=this.changeLifecycle.bind(this);window.addEventListener("pageshow",function(){return t("pageshow")}),window.addEventListener("pagehide",function(){return t("pagehide")}),document.addEventListener("visibilitychange",function(){return t(document.visibilityState)}),window.addEventListener("blur",function(){return t("blur")}),window.addEventListener("focus",function(){return t("focus")}),dS.isSafariBrowser(e)&&window.addEventListener("beforeunload",function(){return t("hidden")}),history.pushState=(n=history.pushState,function(){try{var e=n.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&fS.error(e)}}),history.replaceState=(r=history.replaceState,function(){try{var e=r.apply(history,arguments);return t("locationChange"),e}catch(e){(e instanceof Error||"string"==typeof e)&&fS.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&fS.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&fS.error(e)}var r,n},dS.prototype.addListener=function(e){this.listeners.push(e)},dS.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},dS.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},dS.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},dS.isSafariBrowser=function(e){return!u.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},dS);function dS(e){void 0===e&&(e=Fe.instance),this.clock=e,this.listeners=[],this._initialized=!1}yS.create=function(e,t,r){return void 0===r&&(r=Fe.instance),new yS(new gS(r,e,t))},yS.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var vS=yS;function yS(e){this.limiter=e}mS.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},mS.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new ES(e+this.intervalMillis,this.limit)),this.currentScope};var gS=mS;function mS(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}wS.prototype.isExpired=function(e){return this.expirationTime<e},wS.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var ES=wS;function wS(e,t){this.expirationTime=e,this.token=t}TS.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var bS=TS;function TS(e){this.determiners=e}_S.prototype.isDedupTarget=function(e){if(-1===this.dedupIntervalMillis)return!1;Ce.isEquals(e.user.identifiers,null==(t=this.currentUser)?void 0:t.identifiers)||(this.currentUser=e.user,this.cache={});var t=this.cacheKey(e),e=this.clock.currentMillis(),r=this.cache[t];return void 0!==r&&e-r<=this.dedupIntervalMillis||(this.cache[t]=e,!1)};Qs=_S;function _S(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}Se(IS,OS=Qs),IS.prototype.supports=function(e){return M0.isRemoteConfigEvent(e)},IS.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var OS,NS=IS;function IS(e,t){return void 0===t&&(t=Fe.instance),OS.call(this,e,t)||this}Se(RS,AS=Qs),RS.prototype.supports=function(e){return M0.isExposureEvent(e)},RS.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var AS,SS=RS;function RS(e,t){return void 0===t&&(t=Fe.instance),AS.call(this,e,t)||this}CS.prototype.isInvocatorResponse=function(e){return"object"==typeof e&&null!==e&&"success"in e&&"boolean"==typeof e.success&&"message"in e&&"string"==typeof e.message},CS.prototype.resolve=function(e){e=JSON.parse(null!=e?e:"");if(!this.isInvocatorResponse(e))throw new Error("invalid invocator response data");if(e.success)return{message:e.message,success:e.success,data:e.data};throw new Error("failed response")};var MS=CS;function CS(){}PS.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters}}},PS.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var xS=PS;function PS(e){this.invocator=e}var US=s.log,kS=(DS.prototype.onPageStarted=function(e,t){this.track(e,t)},DS.prototype.onPageEnded=function(e,t){},DS.prototype.track=function(e,t){US.debug("tracking page view");var r,e={key:DS.PAGE_VIEW_EVENT_KEY,properties:((r={})[DS.PAGE_NAME_PROPERTY_KEY]=e.pageTitle,r)};this.core.track(e,this.userManager.resolve(),t)},DS.PAGE_VIEW_EVENT_KEY="$page_view",DS.PAGE_NAME_PROPERTY_KEY="$page_name",DS);function DS(e,t){this.core=e,this.userManager=t}Object.defineProperty(FS.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:xo.createWithCurrentPage()},enumerable:!1,configurable:!0}),FS.prototype.updatePage=function(e,t){var r=this._currentPage;r&&e.isEquals(r)||(r&&this.publishEnd(r,t),this._currentPage=e,this.publishStart(e,t))},FS.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},FS.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},FS.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=xo.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},FS.prototype.addListener=function(e){this.listeners.push(e)};var LS=FS;function FS(){this.listeners=[],this._currentPage=null}var VS=s.log,jS=(Object.defineProperty(BS.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),BS.prototype.startEngagement=function(e){VS.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},BS.prototype.endEngagement=function(e,t){var r;u.isNullOrUndefined(this._lastEngagementTime)||(r=this._lastEngagementTime,(r=(this._lastEngagementTime=t)-r)<this.minimumEngagementDurationMillis||this.publish({page:e,durationMillis:r},this.userManager.resolve(),t))},BS.prototype.publish=function(e,t,r){VS.debug("onEngagement timestamp:".concat(r,", page:").concat(this.pageManager.currentPage.url));for(var n=0,i=this.listeners;n<i.length;n++)i[n].onEngagement(e,t,r)},BS.prototype.onPageStarted=function(e,t){this.startEngagement(t)},BS.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},BS.prototype.onLifecycleChanged=function(e,t){switch(e){case"visible":case"focus":return this.startEngagement(t);case"pagehide":case"hidden":case"blur":return this.endEngagement(this.pageManager.currentPage,t);case"pageshow":case"locationChange":return}},BS.prototype.addListener=function(e){this.listeners.push(e)},BS);function BS(e,t,r){this.userManager=e,this.pageManager=t,this.minimumEngagementDurationMillis=r,this.listeners=[],this._lastEngagementTime=null}GS.prototype.onEngagement=function(e,t,r){var n,e={key:GS.ENGAGEMENT_EVENT_KEY,properties:((n={})[kS.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,n[GS.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,n)};this.core.track(e,t,r)},GS.ENGAGEMENT_EVENT_KEY="$engagement",GS.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var HS=GS;function GS(e){this.core=e}KS.prototype.setPhoneNumber=function(e,t){e=(new Io).set(KS.PHONE_NUMBER_PROPERTY_KEY,e.getValue()).build().toSecuredEvent();this.track(e,t)},KS.prototype.unsetPhoneNumber=function(e){var t=(new Io).unset(KS.PHONE_NUMBER_PROPERTY_KEY).build().toSecuredEvent();this.track(t,e)},KS.prototype.track=function(e,t){var r=this.userManager.resolve();this.core.track(e,r,t)},KS.PHONE_NUMBER_PROPERTY_KEY="$phone_number";var zS=KS;function KS(e,t){this.core=e,this.userManager=t}var JS=s.log,YS=null;function WS(e,t){var r,t=$I.config(t);$I.logging(t);try{if((r=window)&&"_hackleApp"in r&&null!==r._hackleApp&&"object"==typeof r._hackleApp&&("getAppSdkKey"in r._hackleApp&&"function"==typeof r._hackleApp.getAppSdkKey&&("getInvocationType"in r._hackleApp&&"function"==typeof r._hackleApp.getInvocationType))&&e===window._hackleApp.getAppSdkKey()){var n=e,i=t,o=window._hackleApp,s=(new KA).getInvocator(o.getInvocationType(),new MS);if(null===s)throw new Error("Failed to get invocator with invocationType:".concat(o.getInvocationType()));if(s=new xS(s),s=new Zo(s),!o.getAppMode)return s;if((o=o.getAppMode().toLowerCase())===$o.native)return s;if(o!==$o.web_view_wrapper)throw new Error("Unsupported HackleAppMode: ".concat(o));return o=qS(n,i),(n=new Qo(o,s)).syncUser(),n}}catch(e){JS.error("Unexpected exception while check WebApp client: ".concat(e))}return qS(e,t)}function qS(e,t){var r=$I.sdk(e,t);if(YS)return JS.debug("use already exists hackleClient"),YS;var n=new Ko,i=(n.initialize(),new JO),o=Go.getInstance({days:Xe,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),s=$I.isBeaconSupported(),a=UA.intercept(r,DA.create()),u=UA.intercept(r,FA.create()),c=a,l=(s&&(c=u),new ZI),p=new eA(l,new rA("setTimeout"),$I.pollingIntervalMillis(t)),f=new lS(r,WO.postfix(i,"_".concat(e.slice(0,8)))),h=new lA(eN.clientFetch(t.sdkUrl,r.key),a),f=new mA(f,h),h=(l.add(f),new LS),d=new dA(eN.userTargets(t.sdkUrl),a),v=new fA(eN.userCohorts(t.sdkUrl),a),y=new kI(h),g=new VO(WO.postfix(o,"_".concat(e))),m=g.getUser(),E=t.user||null,g=new LO(Yo(),g,d,v,y,h,Fe.instance,m,E),d=(l.add(g),new zO(t.sessionTimeoutMillis,WO.postfix(o,"_".concat(e.slice(8))))),v=(g.addListener(d),new _O(i,"".concat(et,"_").concat(e),We)),E=new TA(eN.clientDispatch(t.eventUrl),a),l=E,s=(s&&(l=new TA(eN.beaconDispatch(t.eventUrl,r.key),u)),new OA(v,E)),r=new wA(E,l,s),u=new bS([new NS($I.dedupIntervalMillis(t)),new SS($I.dedupIntervalMillis(t))]),v=new MA(r,We,new rA("setTimeout"),$e),E=new G0(v,u,d,g),w=new uS,l=new vb(new $O(o,"".concat(st,"_").concat(e.slice(0,8)))),r=new vb(new $O(o,"".concat(at,"_").concat(e.slice(0,8)))),u=new rN(WO.prefix(i,"".concat(ut,"_").concat(e.slice(0,8),"_"))),i=new YN(WO.prefix(i,"".concat(ct,"_").concat(e.slice(0,8),"_"))),b=hO.create(f,E,[l,r],u,i),T=new zS(b,g),e=new AI(new RI(WO.postfix(o,"_".concat(e.slice(0,8)))),y,b,g),_=new B0(g,b),_=(d.addListener(e),d.addListener(_),new TN(b)),u=new iN([new sN,new uN(new vI),new lN(new vI),new fN(u,Fe.instance),new dN(new gI),new yN(new gI),new mN(new EI),new wN(new EI)]),i=new qN([new XN(i),new tI(u),new QN]),u=new nI(Fe.instance,_,i),_=new aI([new cI,new pI(u),new hI(u)]),i=new BN(eN.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),i=new ON(VN.create(i),u,_),u=new oI(new GN(B_.get("targetMatcher"))),_=new RN(f,u,b),u=(new IN(v,_,i),new YI(f)),_=(new KI(v,u),new jS(g,h,dt)),v=(h.addListener(_),new HS(b)),u=(_.addListener(v),new kS(b,g)),v=(t.automaticPageTracking&&h.addListener(u),new ZA(B_.get("targetMatcher"))),o=new sS(o,lt,{days:pt}),f=new $A(f,v,o,b),v=new rS(new iS(y),new bI,o,w),y=new YA(f,v,g,b),o=(h.addListener(y),new ZO(b,g,l,r)),y=(null==(f=t.devTool)?void 0:f.userExplorer)&&"function"==typeof(null==(v=t.devTool)?void 0:v.userExplorer),l=t.devTool&&y?{manager:t.devTool,userExplorer:o}:void 0,r=new Li(eN.monitoring(t.monitoringUrl),a,c,new rA("setTimeout"),qe),O=(Ti.addRegistry(r),new hS),f=(O.addListener(h),O.addListener(_),O.addListener(d),O.addListener(n),O.addListener(s),O.addListener(E),O.addListener(r),p.start(),vS.create(ht,1)),N=new Lo(b,p,d,g,T,f,u,i,l),v=(YS=N,(new gO).install(b,g),g.resolve().hackleProperties.browserName);return O.install("string"==typeof v?v:null),y=Date.now(),o=g.currentUser,a=d.currentSessionId,(NO(m,o)?d.startNewSessionIfNeeded(o,y):d.startNewSession(m,o,y))===a&&e.startNewCampaignIfNeeded(o,y),N.onReady(function(){t.autoOpenDevTool&&(t.devTool?N.showUserExplorer():JS.error("DevTool is not provided")),O.initialize(),w.dispatchDoneEventIfNeeded()}),N}var $S=function(e,t){return($S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};var XS=function(){return(XS=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function ZS(e,s,a,u){return new(a=a||Promise)(function(r,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function i(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,i)}o((u=u.apply(e,s||[])).next())})}function QS(n,i){var o,s,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(a=0<(a=u.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){u.label=t[1];break}if(6===t[0]&&u.label<a[1]){u.label=a[1],a=t;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(t);break}a[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(n,u)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function eR(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}tR.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},tR.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},tR.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Sa=tR;function tR(){this.listeners={}}nR.arePropertiesEqual=function(e,t){var r=nR.coerceUnknownToProperties(e),n=nR.coerceUnknownToProperties(t),e=Object.keys(r),t=Object.keys(n);return e.length===t.length&&e.every(function(e){return e in n&&r[e]===n[e]})},nR.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var rR=nR;function nR(){}oR.isUserEqual=function(e,t){return(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(null==e?void 0:e.deviceId)===(null==t?void 0:t.deviceId)&&(null==e?void 0:e.userId)===(null==t?void 0:t.userId)&&rR.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&rR.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var iR=oR;function oR(){}var sR=function(n){var e=i,t=n;if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}function i(e,t){var r=n.call(this)||this;return r._currentUser=null,r.client=WS(e,XS(XS({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.44.0"})),r.getSessionId=r.getSessionId.bind(r),r.getUser=r.getUser.bind(r),r.setUser=r.setUser.bind(r),r.setUserId=r.setUserId.bind(r),r.setDeviceId=r.setDeviceId.bind(r),r.setUserProperty=r.setUserProperty.bind(r),r.setUserProperties=r.setUserProperties.bind(r),r.updateUserProperties=r.updateUserProperties.bind(r),r.resetUser=r.resetUser.bind(r),r.variation=r.variation.bind(r),r.variationDetail=r.variationDetail.bind(r),r.isFeatureOn=r.isFeatureOn.bind(r),r.featureFlagDetail=r.featureFlagDetail.bind(r),r.track=r.track.bind(r),r.trackPageView=r.trackPageView.bind(r),r.remoteConfig=r.remoteConfig.bind(r),r.onReady=r.onReady.bind(r),r.onInitialized=r.onInitialized.bind(r),r.showUserExplorer=r.showUserExplorer.bind(r),r.hideUserExplorer=r.hideUserExplorer.bind(r),r.fetch=r.fetch.bind(r),r.close=r.close.bind(r),r.setInAppMessageListener=r.setInAppMessageListener.bind(r),r.getExperiment=r.getExperiment.bind(r),r.setPhoneNumber=r.setPhoneNumber.bind(r),r.unsetPhoneNumber=r.unsetPhoneNumber.bind(r),r.emitUpdatedUser=r.emitUpdatedUser.bind(r),null!=t&&t.devTool&&null!=t&&t.autoOpenDevTool&&"undefined"!=typeof window&&r.showUserExplorer(),r}return $S(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r),i.prototype.getSessionId=function(){return this.client.getSessionId()},i.prototype.getUser=function(){return this.client.getUser()},i.prototype.setUser=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setUser(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserId=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setUserId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setDeviceId=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setDeviceId(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperty=function(t,r){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setUserProperty(t,r),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.setUserProperties=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.updateUserProperties=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.updateUserProperties(t),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.resetUser=function(){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.resetUser(),this.emitUpdatedUser(this.getUser()),[2]})})},i.prototype.variation=function(e,t,r){return this.client.variation(e,t||void 0,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t||void 0,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t||void 0)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t||void 0)},i.prototype.track=function(e,t){this.client.track(e,t||void 0)},i.prototype.trackPageView=function(e){this.client.trackPageView(XS(XS({},e),{user:(null==e?void 0:e.user)||void 0}))},i.prototype.remoteConfig=function(e){return this.client.remoteConfig(e||void 0)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.getExperiment=function(e){return this.client.getExperiment(e)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i.prototype.emitUpdatedUser=function(e){iR.isUserEqual(this._currentUser,e)||this.emit("user-updated",e),this._currentUser=e},i.prototype.showUserExplorer=function(){this.client.showUserExplorer()},i.prototype.hideUserExplorer=function(){this.client.hideUserExplorer()},i.prototype.fetch=function(){return this.client.fetch()},i.prototype.setInAppMessageListener=function(e){this.client.setInAppMessageListener(e)},i.prototype.close=function(){this.client.close()},i.prototype.setPhoneNumber=function(t){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.setPhoneNumber(t),[2]})})},i.prototype.unsetPhoneNumber=function(){return ZS(this,void 0,void 0,function(){return QS(this,function(e){return this.client.unsetPhoneNumber(),[2]})})},i}(Sa);var k={exports:{}},_={},aR=Object.getOwnPropertySymbols,uR=Object.prototype.hasOwnProperty,cR=Object.prototype.propertyIsEnumerable;var Q=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;i<arguments.length;i++){for(var o in r=Object(arguments[i]))uR.call(r,o)&&(n[o]=r[o]);if(aR)for(var s=aR(r),a=0;a<s.length;a++)cR.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},lR=Q,Cp="function"==typeof Symbol&&Symbol.for,pR=Cp?Symbol.for("react.element"):60103,fR=Cp?Symbol.for("react.portal"):60106,m=Cp?Symbol.for("react.fragment"):60107,S=Cp?Symbol.for("react.strict_mode"):60108,ma=Cp?Symbol.for("react.profiler"):60114,hR=Cp?Symbol.for("react.provider"):60109,dR=Cp?Symbol.for("react.context"):60110,vR=Cp?Symbol.for("react.forward_ref"):60112,i=Cp?Symbol.for("react.suspense"):60113,yR=Cp?Symbol.for("react.memo"):60115,gR=Cp?Symbol.for("react.lazy"):60116,mR="function"==typeof Symbol&&Symbol.iterator;function ER(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bR={};function TR(e,t,r){this.props=e,this.context=t,this.refs=bR,this.updater=r||wR}function _R(){}function OR(e,t,r){this.props=e,this.context=t,this.refs=bR,this.updater=r||wR}TR.prototype.isReactComponent={},TR.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(ER(85));this.updater.enqueueSetState(this,e,t,"setState")},TR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_R.prototype=TR.prototype;var Su=OR.prototype=new _R,NR=(Su.constructor=OR,lR(Su,TR.prototype),Su.isPureReactComponent=!0,{current:null}),IR=Object.prototype.hasOwnProperty,AR={key:!0,ref:!0,__self:!0,__source:!0};function SR(e,t,r){var n,i={},o=null,s=null;if(null!=t)for(n in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)IR.call(t,n)&&!AR.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(1===a)i.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];i.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===i[n]&&(i[n]=a[n]);return{$$typeof:pR,type:e,key:o,ref:s,props:i,_owner:NR.current}}function RR(e){return"object"==typeof e&&null!==e&&e.$$typeof===pR}var MR=/\/+/g,CR=[];function xR(e,t,r,n){var i;return CR.length?((i=CR.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function PR(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,CR.length<10&&CR.push(e)}function UR(e,t,r){return null==e?0:function e(t,r,n,i){var o=!1;if(null===(t="undefined"!=(a=typeof t)&&"boolean"!==a?t:null))o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case pR:case fR:o=!0}}if(o)return n(i,t,""===r?"."+kR(t,0):r),1;if(o=0,r=""===r?".":r+":",Array.isArray(t))for(var s=0;s<t.length;s++){var a,u=r+kR(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=mR&&t[mR]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+kR(a,s++),n,i);else if("object"===a)throw n=""+t,Error(ER(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function kR(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function DR(e,t){e.func.call(e.context,t,e.count++)}function LR(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?FR(e,n,r,function(e){return e}):null!=e&&(RR(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(MR,"$&/")+"/")+r,e={$$typeof:pR,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function FR(e,t,r,n,i){var o="";UR(e,LR,t=xR(t,o=null!=r?(""+r).replace(MR,"$&/")+"/":o,n,i)),PR(t)}var VR={current:null};function jR(){var e=VR.current;if(null===e)throw Error(ER(321));return e}var BR,HR,GR,Hc={ReactCurrentDispatcher:VR,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:NR,IsSomeRendererActing:{current:!1},assign:lR},T=(_.Children={map:function(e,t,r){if(null==e)return e;var n=[];return FR(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;UR(e,DR,t=xR(null,null,t,r)),PR(t)},count:function(e){return UR(e,function(){return null},null)},toArray:function(e){var t=[];return FR(e,t,null,function(e){return e}),t},only:function(e){if(RR(e))return e;throw Error(ER(143))}},_.Component=TR,_.Fragment=m,_.Profiler=ma,_.PureComponent=OR,_.StrictMode=S,_.Suspense=i,_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hc,_.cloneElement=function(e,t,r){if(null==e)throw Error(ER(267,e));var n=lR({},e.props),i=e.key,o=e.ref,s=e._owner;if(null!=t)for(a in void 0!==t.ref&&(o=t.ref,s=NR.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)IR.call(t,a)&&!AR.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==u?u:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];n.children=u}return{$$typeof:pR,type:e.type,key:i,ref:o,props:n,_owner:s}},_.createContext=function(e,t){return(e={$$typeof:dR,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:hR,_context:e},e.Consumer=e},_.createElement=SR,_.createFactory=function(e){var t=SR.bind(null,e);return t.type=e,t},_.createRef=function(){return{current:null}},_.forwardRef=function(e){return{$$typeof:vR,render:e}},_.isValidElement=RR,_.lazy=function(e){return{$$typeof:gR,_ctor:e,_status:-1,_result:null}},_.memo=function(e,t){return{$$typeof:yR,type:e,compare:void 0===t?null:t}},_.useCallback=function(e,t){return jR().useCallback(e,t)},_.useContext=function(e,t){return jR().useContext(e,t)},_.useDebugValue=function(){},_.useEffect=function(e,t){return jR().useEffect(e,t)},_.useImperativeHandle=function(e,t,r){return jR().useImperativeHandle(e,t,r)},_.useLayoutEffect=function(e,t){return jR().useLayoutEffect(e,t)},_.useMemo=function(e,t){return jR().useMemo(e,t)},_.useReducer=function(e,t,r){return jR().useReducer(e,t,r)},_.useRef=function(e){return jR().useRef(e)},_.useState=function(e){return jR().useState(e)},_.version="16.14.0",{}),mu=Function.call.bind(Object.prototype.hasOwnProperty),zR=function(){};function KR(e,t,r,n,i){if("production"!==production)for(var o in e)if(GR(e,o)){var s,a;try{if("function"!=typeof e[o])throw(a=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;s=e[o](t,o,n,r,null,BR)}catch(e){s=e}!s||s instanceof Error||zR((n||"React class")+": type specification of "+r+" `"+o+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in HR)&&(HR[s.message]=!0,o=i?i():"",zR("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(BR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",HR={},GR=mu,zR=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),KR.resetWarningCache=function(){"production"!==production&&(HR={})},"production"!==production){var JR=Q,YR=KR,O="function"==typeof Symbol&&Symbol.for,WR=O?Symbol.for("react.element"):60103,qR=O?Symbol.for("react.portal"):60106,$R=O?Symbol.for("react.fragment"):60107,XR=O?Symbol.for("react.strict_mode"):60108,ZR=O?Symbol.for("react.profiler"):60114,QR=O?Symbol.for("react.provider"):60109,eM=O?Symbol.for("react.context"):60110,tM=O?Symbol.for("react.concurrent_mode"):60111,rM=O?Symbol.for("react.forward_ref"):60112,nM=O?Symbol.for("react.suspense"):60113,iM=O?Symbol.for("react.suspense_list"):60120,oM=O?Symbol.for("react.memo"):60115,sM=O?Symbol.for("react.lazy"):60116,aM=O?Symbol.for("react.block"):60121,uM=O?Symbol.for("react.fundamental"):60117,cM=O?Symbol.for("react.responder"):60118,lM=O?Symbol.for("react.scope"):60119,pM="function"==typeof Symbol&&Symbol.iterator,fM="@@iterator";function hM(e){if(null===e||"object"!=typeof e)return null;e=pM&&e[pM]||e[fM];return"function"==typeof e?e:null}var dM={current:null},vM={current:null},yM=/^(.*)[\\\/]/,gM=1;function mM(e){if(null==e)return null;if("number"==typeof e.tag&&OM("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case $R:return"Fragment";case qR:return"Portal";case ZR:return"Profiler";case XR:return"StrictMode";case nM:return"Suspense";case iM:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case eM:return"Context.Consumer";case QR:return"Context.Provider";case rM:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case oM:return mM(e.type);case aM:return mM(e.render);case sM:r=(t=e)._status===gM?t._result:null;if(r)return mM(r)}var t,r;return null}var EM={},wM=null;function bM(e){wM=e}EM.getCurrentStack=null,EM.getStackAddendum=function(){var e,t,r,n,i,o="",s=(wM&&(e=mM(wM.type),r=wM._owner,o+=(e=e,t=wM._source,r=r&&mM(r.type),i="",t?(n=(s=t.fileName).replace(yM,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match(yM))&&(s=s[1])?s.replace(yM,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),EM.getCurrentStack);return s&&(o+=s()||""),o};var TM={ReactCurrentDispatcher:dM,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:vM,IsSomeRendererActing:{current:!1},assign:JR};function _M(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];NM("warn",e,r)}function OM(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];NM("error",e,r)}function NM(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=TM.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var i=0,o="Warning: "+t.replace(/%s/g,function(){return r[i++]});throw new Error(o)}catch(e){}}JR(TM,{ReactDebugCurrentFrame:EM,ReactComponentTreeHook:{}});var IM={};function AM(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;IM[r]||(OM("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),IM[r]=!0)}var SM={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){AM(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){AM(e,"replaceState")},enqueueSetState:function(e,t,r,n){AM(e,"setState")}},RM={};function MM(e,t,r){this.props=e,this.context=t,this.refs=RM,this.updater=r||SM}Object.freeze(RM),MM.prototype.isReactComponent={},MM.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},MM.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var CM,xM={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(CM in xM)xM.hasOwnProperty(CM)&&!function(e,t){Object.defineProperty(MM.prototype,e,{get:function(){_M("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(CM,xM[CM]);function PM(){}function UM(e,t,r){this.props=e,this.context=t,this.refs=RM,this.updater=r||SM}PM.prototype=MM.prototype,(O=UM.prototype=new PM).constructor=UM,JR(O,MM.prototype),O.isPureReactComponent=!0;var kM,DM,LM=Object.prototype.hasOwnProperty,FM={key:!0,ref:!0,__self:!0,__source:!0};function VM(e){if(LM.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function jM(e){if(LM.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var BM={},HM=function(e,t,r,n,i,o,s){e={$$typeof:WR,type:e,key:t,ref:r,props:s,_owner:o,_store:{}};return Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function GM(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in VM(t)&&(s=t.ref,"string"==typeof(c=t).ref&&vM.current&&c.__self&&vM.current.stateNode!==c.__self&&(p=mM(vM.current.type),BM[p]||(OM('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',mM(vM.current.type),c.ref),BM[p]=!0))),jM(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)LM.call(t,n)&&!FM.hasOwnProperty(n)&&(i[n]=t[n]);var c,l,p,f,h=arguments.length-2;if(1==h)i.children=r;else if(1<h){for(var d=Array(h),v=0;v<h;v++)d[v]=arguments[v+2];Object.freeze&&Object.freeze(d),i.children=d}if(e&&e.defaultProps){var y=e.defaultProps;for(n in y)void 0===i[n]&&(i[n]=y[n])}function g(){DM||(DM=!0,OM("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",l))}function m(){kM||(kM=!0,OM("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}return(o||s)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,o&&(p=i,f=c,m.isReactWarning=!0,Object.defineProperty(p,"key",{get:m,configurable:!0})),s&&(r=i,l=c,g.isReactWarning=!0,Object.defineProperty(r,"ref",{get:g,configurable:!0}))),HM(e,o,s,a,u,vM.current,i)}function zM(e){return"object"==typeof e&&null!==e&&e.$$typeof===WR}var KM=".",JM=":",YM=!1,WM=/\/+/g;function qM(e){return(""+e).replace(WM,"$&/")}var $M=10,XM=[];function ZM(e,t,r,n){var i;return XM.length?((i=XM.pop()).result=e,i.keyPrefix=t,i.func=r,i.context=n,i.count=0,i):{result:e,keyPrefix:t,func:r,context:n,count:0}}function QM(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,XM.length<$M&&XM.push(e)}function eC(e,t,r){return null==e?0:function e(t,r,n,i){var o,s=typeof t,a=!1;if(null===(t="undefined"!=s&&"boolean"!=s?t:null))a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case WR:case qR:a=!0}}if(a)return n(i,t,""===r?KM+tC(t,0):r),1;var u=0,c=""===r?KM:r+JM;if(Array.isArray(t))for(var l=0;l<t.length;l++)u+=e(o=t[l],c+tC(o,l),n,i);else if("function"==typeof(r=hM(t))){r===t.entries&&(YM||_M("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),YM=!0);for(var p,f=r.call(t),h=0;!(p=f.next()).done;)u+=e(o=p.value,c+tC(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+EM.getStackAddendum(),s=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==s?"object with keys {"+Object.keys(t).join(", ")+"}":s)+")."+r);return u}(e,"",t,r)}function tC(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function rC(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function nC(e,t,r){var n=e.result,i=e.keyPrefix,o=e.func,s=e.context,o=o.call(s,t,e.count++);Array.isArray(o)?iC(o,n,r,function(e){return e}):null!=o&&(zM(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":qM(o.key)+"/")+r,o=HM(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function iC(e,t,r,n,i){var o="",t=ZM(t,o=null!=r?qM(r)+"/":o,n,i);eC(e,nC,t),QM(t)}function oC(e){return"string"==typeof e||"function"==typeof e||e===$R||e===tM||e===ZR||e===XR||e===nM||e===iM||"object"==typeof e&&null!==e&&(e.$$typeof===sM||e.$$typeof===oM||e.$$typeof===QR||e.$$typeof===eM||e.$$typeof===rM||e.$$typeof===uM||e.$$typeof===cM||e.$$typeof===lM||e.$$typeof===aM)}function sC(){var e=dM.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function aC(){if(vM.current){var e=mM(vM.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var uC=!1,cC={};function lC(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=aC())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),cC[t=r]||(cC[t]=!0,r="",e&&e._owner&&e._owner!==vM.current&&(r=" It was passed a child from "+mM(e._owner.type)+"."),bM(e),OM('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',t,r),bM(null)))}function pC(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];zM(n)&&lC(n,t)}else if(zM(e))e._store&&(e._store.validated=!0);else if(e){var i=hM(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)zM(o.value)&&lC(o.value,t)}}function fC(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=mM(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==rM&&t.$$typeof!==oM)return;r=t.propTypes}r?(bM(e),YR(r,e.props,"prop",n,EM.getStackAddendum),bM(null)):void 0===t.PropTypes||uC||(uC=!0,OM("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||OM("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function hC(e,t,r){var n,i=oC(e),t=(i||(n="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n+=(null!=(t=t)&&void 0!==(t=t.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"")||aC(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===WR?(s="<"+(mM(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,OM("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,n)),GM.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)pC(arguments[o],e);if(e===$R){var s=t;bM(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){OM("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&OM("Invalid attribute `ref` supplied to `React.Fragment`."),bM(null)}else fC(t);return t}var dC=!1;try{var vC=Object.freeze({}),yC=new Map([[vC,null]]),gC=new Set([vC]);yC.set(0,0),gC.add(0)}catch(e){}function mC(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,i,o=JR({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,l=e._owner;if(null!=t)for(n in VM(t)&&(a=t.ref,l=vM.current),jM(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)LM.call(t,n)&&!FM.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==i?o[n]=i[n]:o[n]=t[n]);var p=arguments.length-2;if(1==p)o.children=r;else if(1<p){for(var f=Array(p),h=0;h<p;h++)f[h]=arguments[h+2];o.children=f}return HM(e.type,s,a,u,c,l,o)}.apply(this,arguments),i=2;i<arguments.length;i++)pC(arguments[i],n.type);return fC(n),n}function EC(e){var t=hC.bind(null,e);return t.type=e,dC||(dC=!0,_M("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return _M("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}O=hC,T.Children={map:function(e,t,r){if(null==e)return e;var n=[];return iC(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=ZM(null,null,t,r),eC(e,rC,t),QM(t)},count:function(e){return eC(e,function(){return null},null)},toArray:function(e){var t=[];return iC(e,t,null,function(e){return e}),t},only:function(e){if(zM(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},T.Component=MM,T.Fragment=$R,T.Profiler=ZR,T.PureComponent=UM,T.StrictMode=XR,T.Suspense=nM,T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TM,T.cloneElement=mC,T.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&OM("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:eM,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:QR,_context:r}),i=!1,t={$$typeof:eM,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,OM("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,OM("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=t,r._currentRenderer=null,r._currentRenderer2=null,r},T.createElement=O,T.createFactory=EC,T.createRef=function(){var e={current:null};return Object.seal(e),e},T.forwardRef=function(e){return null!=e&&e.$$typeof===oM?OM("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?OM("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&OM("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null==e||null==e.defaultProps&&null==e.propTypes||OM("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:rM,render:e}},T.isValidElement=zM,T.lazy=function(e){var t,r,n={$$typeof:sM,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){OM("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){OM("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},T.memo=function(e,t){return oC(e)||OM("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:oM,type:e,compare:void 0===t?null:t}},T.useCallback=function(e,t){return sC().useCallback(e,t)},T.useContext=function(e,t){var r,n=sC();return void 0!==t&&OM("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?OM("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&OM("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},T.useDebugValue=function(e,t){return sC().useDebugValue(e,t)},T.useEffect=function(e,t){return sC().useEffect(e,t)},T.useImperativeHandle=function(e,t,r){return sC().useImperativeHandle(e,t,r)},T.useLayoutEffect=function(e,t){return sC().useLayoutEffect(e,t)},T.useMemo=function(e,t){return sC().useMemo(e,t)},T.useReducer=function(e,t,r){return sC().useReducer(e,t,r)},T.useRef=function(e){return sC().useRef(e)},T.useState=function(e){return sC().useState(e)},T.version="16.14.0"}"production"===production?k.exports=_:k.exports=T;var wC=k.exports,bC=k.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),b=bC.Consumer,TC=bC.Provider;var _C=s.log;function OC(e,t){e=NC(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function NC(e,t){void 0===t&&(t="A");var r=k.exports.useContext(bC),n=r.hackle,i=r.userVersion,o=r.initialized,s=k.exports.useCallback(function(){return o?(null==n?void 0:n.variationDetail(e))||Tt.of(t,p.EXCEPTION):Tt.of(t,p.SDK_NOT_READY)},[t,e,n,o]),r=eR(k.exports.useState(function(){return n?s():(_C.error("HackleClient is not existed"),Tt.of(t,p.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=eR(k.exports.useState(i),2),c=u[0],u=u[1];return SC(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function IC(e){e=AC(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function AC(e){var t=k.exports.useContext(bC),r=t.hackle,n=t.userVersion,i=t.initialized,o=k.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||Ot.off(p.EXCEPTION):Ot.off(p.SDK_NOT_READY)},[e,r,i]),t=eR(k.exports.useState(function(){return r?o():(_C.error("HackleClient is not existed"),Ot.off(p.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=eR(k.exports.useState(n),2),u=a[0],a=a[1];return SC(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function SC(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function RC(e){var t,r=e.experimentKey,e=e.children,n=(r=OC(r)).isLoading,i=r.variation;return n?null:e&&"function"==typeof e?e(i):(k.exports.Children.forEach(e,function(e){k.exports.isValidElement(e)&&(e.props.variation?i===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?k.exports.cloneElement(t,{variation:i}):null)}function MC(e){return e.variation,e=e.children,k.exports.createElement(k.exports.Fragment,null,e)}function CC(e){var t=(r=IC(e.featureKey)).isLoading,r=r.isOn;return t?null:wC.createElement(wC.Fragment,null,e.children(r))}n.Bucket=kt,n.Cohort=kn,n.Container=ar,n.ContainerGroup=cr,n.CoreVersion=Er,n.Decision=Tt,n.DecisionReason=p,n.EXPERIMENT_IMPLEMENTATION_TYPE=Mt,n.EmptyHackleRemoteConfig=It,n.EmptyParameterConfig=je,n.EventType=Vt,n.Experiment=Ct,n.FeatureFlagDecision=Ot,n.HackleContext=bC,n.HackleContextConsumer=b,n.HackleContextProvider=TC,n.HackleExperiment=RC,n.HackleFeature=CC,n.HackleInAppMessageActionImpl=Pn,n.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(i=e.timeout)?3e3:i,i=void 0!==(i=e.supportSSR)&&i,e=e.children,o=eR(k.exports.useState({hackle:t,initialized:!1,userVersion:0}),2),s=o[0],a=o[1];return k.exports.useEffect(function(){null!=r&&t.setUser(r)},[r]),k.exports.useEffect(function(){function e(){a(function(e){return XS(XS({},e),{userVersion:e.userVersion+1})})}return t.on("user-updated",e),function(){t.off("user-updated",e)}},[t]),k.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(function(e){return XS(XS({},e),{initialized:!0})})},function(){a(function(e){return XS(XS({},e),{initialized:!0})})}).catch(function(){a(function(e){return XS(XS({},e),{initialized:!0})})})},[t]),i||s.initialized?wC.createElement(TC,{value:s},e):null},n.HackleVariation=MC,n.IAM_ACTION_AREA=["BUTTON","IMAGE","MESSAGE","X_BUTTON"],n.IAM_ACTION_TYPE=Fr,n.IAM_BEHAVIOR=Lr,n.IAM_DISPLAY_TYPE=Ur,n.IAM_HORIZONTAL_ALIGNMENT=jr,n.IAM_LAYOUT_TYPE=kr,n.IAM_ORIENTATION=Dr,n.IAM_PLATFORM_TYPE=xr,n.IAM_STATUS=Cr,n.IAM_TIMEUNIT=Pr,n.IAM_VERTICAL_ALIGNMENT=Vr,n.IdentifierType=Bt,n.IdentifiersBuilder=zt,n.InAppMessage=Br,n.InAppMessageAction=Cn,n.InAppMessageAlignment=dn,n.InAppMessageBackground=Mn,n.InAppMessageButton=Nn,n.InAppMessageButtonStyle=Rn,n.InAppMessageContext=an,n.InAppMessageContextLayout=fn,n.InAppMessageContextMessage=ln,n.InAppMessageDecision=wt,n.InAppMessageDurationCap=en,n.InAppMessageEventFrequencyCap=$r,n.InAppMessageEventTrigger=Yr,n.InAppMessageEventTriggerRule=Wr,n.InAppMessageExperimentContext=cn,n.InAppMessageIdentifierCap=Zr,n.InAppMessageImage=yn,n.InAppMessageImageAutoScroll=mn,n.InAppMessagePeriodAlways=Gr,n.InAppMessagePeriodCustom=Kr,n.InAppMessagePositionalButton=An,n.InAppMessageTargetContext=rn,n.InAppMessageText=wn,n.InAppMessageTextAttribute=Tn,n.InAppMessageTextStyle=On,n.InAppMessageUserOverride=on,n.Logger=s,n.MATCH_OPERATORS=Nr,n.MATCH_TYPES=_r,n.MATCH_VALUE_TYPES=Or,n.MetaVersion=br,n.ParameterConfiguration=St,n.PropertyOperations=So,n.PropertyOperationsBuilder=Io,n.RemoteConfigDecision=mt,n.RemoteConfigParameter=pr,n.RemoteConfigParameterValue=vr,n.RemoteConfigTargetRule=hr,n.SEGMENT_TYPES=Sr,n.Segment=or,n.Slot=Lt,n.SplitUrlConfig=Dn,n.SplitUrlTargets=Fn,n.TARGET_ACTION_TYPES=Ir,n.TARGET_KEY_TYPES=Ar,n.Target=Yt,n.TargetAction=tr,n.TargetCondition=qt,n.TargetKey=Xt,n.TargetMatch=Qt,n.TargetRule=nr,n.TargetingType=Rr,n.UserTargetEvent=jn,n.Variation=Pt,n.Version=gr,n.createInstance=function(e,t){return new sR(e,t)},n.getUserId=Yo,n.removeUserId=Wo,n.resolveIdentifiers=Gt,n.sanitizeUser=Jt,n.setUserId=function(e){Go.getInstance().setItem(Qe,e)},n.useFeature=function(e){var t=(n=k.exports.useContext(bC)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e))||!1},[e,t,n]),o=(s=eR(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&_C.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=eR(k.exports.useState(r),2))[0],n=n[1];return SC(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=k.exports.useContext(bC)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||Ot.off(p.EXCEPTION)},[e,t,n]),o=(s=eR(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&_C.error("HackleClient is not existed"),Ot.off(p.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=eR(k.exports.useState(r),2))[0],n=n[1];return SC(a,r)||(n(r),s(i())),o},n.useLoadableFeature=IC,n.useLoadableFeatureDetail=AC,n.useLoadableRemoteConfig=function(){var e=(o=k.exports.useContext(bC)).hackle,t=o.userVersion,r=o.initialized,n=k.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new It},[e,r]),i=(o=eR(k.exports.useState(function(){return e||_C.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=eR(k.exports.useState(t),2))[0],a=a[1];return SC(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=OC,n.useLoadableVariationDetail=NC,n.useRemoteConfig=function(){var e=(r=k.exports.useContext(bC)).hackle,t=r.userVersion,r=r.initialized,n=k.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new It},[e,r]),i=(o=eR(k.exports.useState(function(){return e||_C.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=eR(k.exports.useState(t),2))[0],r=r[1];return SC(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=k.exports.useContext(bC).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(_C.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=k.exports.useContext(bC)).hackle,n=a.userVersion,i=a.initialized,o=k.exports.useCallback(function(){return i&&(null==r?void 0:r.variation(e))||t},[t,e,r,i]),s=(a=eR(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&_C.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=eR(k.exports.useState(n),2))[0],c=c[1];return SC(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=k.exports.useContext(bC)).hackle,n=i.userVersion,i=i.initialized,o=k.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||Tt.of(t,p.EXCEPTION)},[t,e,r,i]),s=(a=eR(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&_C.error("HackleClient is not existed"),Tt.of(t,p.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=eR(k.exports.useState(n),2))[0],i=i[1];return SC(u,n)||(i(n),a(o())),s},Object.defineProperty(n,"__esModule",{value:!0})});
|