@hackler/react-sdk 11.38.0 → 11.39.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/CHANGELOG.md +6 -0
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- 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 L,D=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 j=[],V=0;V<256;++V)j.push((V+256).toString(16).substr(1));function H(e,t){var t=1<arguments.length&&void 0!==t?t:0,e=(j[e[t+0]]+j[e[t+1]]+j[e[t+2]]+j[e[t+3]]+"-"+j[e[t+4]]+j[e[t+5]]+"-"+j[e[t+6]]+j[e[t+7]]+"-"+j[e[t+8]]+j[e[t+9]]+"-"+j[e[t+10]]+j[e[t+11]]+j[e[t+12]]+j[e[t+13]]+j[e[t+14]]+j[e[t+15]]).toLowerCase();if("string"==typeof(t=e)&&F.test(t))return e;throw TypeError("Stringified UUID is invalid")}function B(e,t,r){var n=(e=e||{}).random||(e.rng||function(){if(L=L||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto))return L(D);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 H(n)}var e="3.7.5",z="function"==typeof atob,t="function"==typeof btoa,r="function"==typeof Buffer;const G="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),q=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,W=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(W.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?W(192|t>>>6)+W(128|63&t):W(224|t>>>12&15)+W(128|t>>>6&63)+W(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),W(240|t>>>18&7)+W(128|t>>>12&63)+W(128|t>>>6&63)+W(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 W(55296+(t>>>10))+W(56320+(1023&t));case 3:return W((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return W((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},le=e=>e.replace(ue,ce);var i=t=>{if(t=t.replace(/\s+/g,""),!q.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?W(r>>16&255):64===o?W(r>>16&255,r>>8&255):W(r>>16&255,r>>8&255,255&r);return n};const pe=z?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"):G?e=>G.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.chunked=function(e,t){for(var r=[],n=e.slice();n.length;)r.push(n.splice(0,t));return r};var p=Te;function Te(){}var _e={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},s=(Ie.setLogLevel=function(e){this.logLevel=e=void 0===e?_e.INFO:e},Ie.initCounter=function(t){this.counters=p.associate(Object.keys(_e),function(e){return[e,t(e)]})},Ie._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)Ae.log(e,r,t.message,t);else try{Ae.log(e,r,t)}catch(e){}},Ie.increment=function(e){var t;null!=(t=null==(t=Ie.counters)?void 0:t.get(e))&&t.increment()},Ie.logLevel=_e.INFO,Ie.log={error:function(e){_e.ERROR<=Ie.logLevel&&(Ie._log("ERROR",e),Ie.increment("ERROR"))},warn:function(e){_e.WARN<=Ie.logLevel&&(Ie._log("WARN",e),Ie.increment("WARN"))},info:function(e){_e.INFO<=Ie.logLevel&&(Ie._log("INFO",e),Ie.increment("INFO"))},debug:function(e){_e.DEBUG<=Ie.logLevel&&(Ie._log("DEBUG",e),Ie.increment("DEBUG"))}},Ie);function Ie(){}Oe.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Ae=Oe;function Oe(){}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 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}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 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 Ce=s.log,Me=(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)?Ce.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Ce.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,ke=(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){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},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 Le=["nanoseconds","microseconds","milliseconds","seconds","minutes","hours","days"],De=(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(){}je.prototype.tick=function(){return 1e3*Date.now()},je.prototype.currentMillis=function(){return Date.now()},je.instance=new je;var Fe=je;function je(){}He.prototype.get=function(e,t){return t};var Ve=He;function He(){}ze.prototype.get=function(e,t){e=this.parameters.get(e);return!u.isNullOrUndefined(e)&&(u.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var Be=ze;function ze(e){this.parameters=e}var Ge="X-HACKLE-SDK-KEY",Ke="X-HACKLE-SDK-NAME",Je="X-HACKLE-SDK-VERSION",Ye="X-HACKLE-SDK-TIME",qe=100,We=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 Ve:r,n=void 0===n?void 0:n)},_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}At.on=function(e,t,r){return new At(!0,e,t=void 0===t?new Ve:t,r=void 0===r?void 0:r)},At.off=function(e,t,r){return new At(!1,e,t=void 0===t?new Ve:t,r=void 0===r?void 0:r)},At.prototype.get=function(e,t){return this.config.get(e,t)};var It=At;function At(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 Ot=Nt;function Nt(){}Rt.fromJson=function(e){return new Rt(e.id,new Be(p.associate(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";var f=h;function h(){}var Ct=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Mt=(xt.fromJson=function(e,t){var r=xt.experimentStatusOrNull(t.execution.status),n=t.variations.map(function(e){return new Pt(e.id,e.key,"DROPPED"===e.status,e.parameterConfigurationId)}),i=p.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),o=p.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return rr.fromJson(e,Sr.IDENTIFIER)}),s=p.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),a=Dn.fromJson(t.execution.targetUrls),u=yt(Ct,t.implementationType),c=p.mapNotNullOrUndefined(t.execution.targetRules,function(e){return rr.fromJson(e,Sr.PROPERTY)}),l=er.fromJson(t.execution.defaultRule);return r&&u&&l&&new xt(t.id,t.key,e,t.identifierType,r,t.version,t.execution.version,n,i,o,s,a,c,l,t.containerId,u,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}var Pt=function(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.parameterConfigurationId=n},kt=(Ut.fromJson=function(e){return new Ut(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)}))},Ut);function Ut(e,t,r,n){this.id=e,this.seed=t,this.slotSize=r,this.slots=n}Dt.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive};var Lt=Dt;function Dt(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}jt.fromJson=function(e){return new jt(e.id,e.key)};var Ft=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 Vt=Ht;function Ht(){}function Bt(e){var t=new zt;return t.addIdentifiers(e.identifiers||{}),t.add(Vt.ID,e.id),t.add(Vt.DEVICE,e.deviceId),u.isNotNullOrUndefined(e.userId)&&t.add(Vt.USER,e.userId),t.build()}Gt.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},Gt.prototype.add=function(e,t){var r=Me.sanitizeValue(t);return Me.isValidType(e)&&r?this.identifiers[e]=t:vt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},Gt.prototype.build=function(){return this.identifiers};var zt=Gt;function Gt(){this.identifiers={}}function Kt(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=ke.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(p.mapNotNullOrUndefined(e.conditions,function(e){return qt.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}Wt.fromJson=function(e,t){var r=$t.fromJson(e.key);if(r&&t.supports(r.type))return(t=Zt.fromJson(e.match))&&new Wt(r,t)},Wt.prototype.toJson=function(){return{key:this.key.toJson(),match:this.match.toJson()}};var qt=Wt;function Wt(e,t){this.key=e,this.match=t}Xt.fromJson=function(e){var t=yt(Or,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(Ir,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(Ar,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(Nr,e.type);return t&&new or(e.id,e.key,t,p.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=p.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}vr.fromJson=function(e){return new vr(e.id,e.value)};var dr=vr;function vr(e,t){this.id=e,this.rawValue=t}gr.tryParse=function(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 yr=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"],Ir=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ar=["VARIATION","BUCKET"],Or=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT","AB_TEST","FEATURE_FLAG","EVENT_PROPERTY","COHORT"],Nr=["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"),Rr.SEGMENT=new Rr("USER_ID","USER_PROPERTY","HACKLE_PROPERTY","COHORT"),Rr);function Rr(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}var Cr=["ACTIVE","DRAFT","PAUSE"],Mr=["WEB","ANDROID","IOS"],xr=["IMMEDIATE","CUSTOM"],Pr=["MODAL","BANNER","BOTTOM_SHEET","NONE"],kr=["IMAGE_TEXT","IMAGE_ONLY","TEXT_ONLY","IMAGE","NONE"],Ur=["VERTICAL","HORIZONTAL"],Lr=["CLICK"],Dr=["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"],jr=["LEFT","CENTER","RIGHT"],Vr=(Hr.fromJson=function(e){var t,r=yt(Cr,e.status);if(!u.isNullOrUndefined(r)){switch(yt(xr,e.timeUnit)){case"IMMEDIATE":t=new Br;break;case"CUSTOM":if(u.isNullOrUndefined(e.startEpochTimeMillis))return;if(u.isNullOrUndefined(e.endEpochTimeMillis))return;t=new Gr(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=Wr.fromJson(e.eventFrequencyCap),new Hr(e.id,e.key,r,t,new Jr(n,i),tn.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 Br=zr;function zr(){this.type="IMMEDIATE"}Kr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var Gr=Kr;function Kr(e,t){this.startMillisInclusive=e,this.endMillisExclusive=t,this.type="CUSTOM"}var Jr=function(e,t){this.rules=e,this.frequencyCap=t},Yr=(qr.fromJson=function(e){return new qr(e.eventKey,p.mapNotNullOrUndefined(e.targets,function(e){return Jt.fromJson(e,Sr.PROPERTY)}))},qr);function qr(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 Wr=$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(Le,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),p.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)),gt(Mr,e.platformTypes));if(!u.isNullOrUndefined(r)){var n=gt(Ur,e.orientations);if(!u.isNullOrUndefined(n)){var i=p.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=p.mapOrUndefined(e.images,vn.fromJson);if(!u.isNullOrUndefined(r)){var n=void 0;if(!u.isNotNullOrUndefined(e.imageAutoScroll)||(n=gn.fromJson(e.imageAutoScroll),!u.isNullOrUndefined(n))){var i=p.mapOrUndefined(e.buttons,In.fromJson);if(!u.isNullOrUndefined(i)){var o=void 0;if(!u.isNotNullOrUndefined(e.closeButton)||(o=In.fromJson2(e.closeButton),!u.isNullOrUndefined(o))){var s=p.mapOrUndefined(e.outerButtons,On.fromJson),a=p.mapOrUndefined(e.innerButtons,On.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?Cn.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(kr,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(jr,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}yn.fromJson=function(e){var t=yt(Ur,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 yn(t,e.imagePath,r)}},yn.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 vn=yn;function yn(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}mn.fromJson=function(e){var t=yt(Le,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},In=(An.fromJson=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new An(e.text,new Sn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},An.fromJson2=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new An("✕",new Sn(e.style.color,"#FFFFFF","#FFFFFF"),t)},An.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},An.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},An);function An(e,t,r){this.text=e,this.style=t,this.action=r}Nn.fromJson=function(e){var t=In.fromJson(e.button);if(!u.isNullOrUndefined(t)){e=hn.fromJson(e.alignment);if(!u.isNullOrUndefined(e))return new Nn(t,e)}},Nn.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var On=Nn;function Nn(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},Cn=(Mn.fromJson=function(e){var t=yt(Lr,e.behavior);if(!u.isNullOrUndefined(t)){var r=yt(Dr,e.type);if(!u.isNullOrUndefined(r))return new Mn(t,r,null!=(t=e.value)?t:void 0)}},Mn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},Mn);function Mn(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 kn=function(e){this.id=e},Un=(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}Fn.fromJson=function(e){if(null!==e)return new Fn(p.mapNotNullOrUndefined(e.match,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),p.mapNotNullOrUndefined(e.notMatch,function(e){return Jt.fromJson(e,Sr.PROPERTY)}))};var Dn=Fn;function Fn(e,t){this.includeTargets=e,this.excludeTargets=t}Vn.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},Vn.prototype.tag=function(e,t){return this._tags[e]=t,this},Vn.prototype.register=function(e){return e.registerTimer({name:this.name,tags:this._tags,type:"TIMER"})};var jn=Vn;function Vn(e){this.name=e,this._tags={},this.name=e}Bn.start=function(e){return new Bn(e=void 0===e?Bn.defaultClock:e)},Bn.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},Bn.defaultClock=new Fe;var Hn=Bn;function Bn(e){this._clock=e,this.startTime=this._clock.tick()}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.registerCounter({name:this.name,tags:this._tags,type:"COUNTER"})};var zn=Gn;function Gn(e){this.name=e,this._tags={}}Jn.prototype.values=function(){return Array.from(this.data.values())},Jn.prototype.keys=function(){return Array.from(this.data.keys())},Jn.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},Jn.prototype.has=function(e){return void 0!==this.get(e)},Jn.prototype.add=function(e,t){t=(t=t)||e;return this.data.set(e,t),this},Jn.prototype.delete=function(e){var t;if(this.has(e))return t=this.get(e),this.data.delete(e),t},Jn.prototype.forEach=function(e){this.data.forEach(e)},Jn.prototype.filter=function(e){for(var t=new Jn(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},Jn.prototype.entries=function(){return Array.from(this.data.entries())};var Kn=Jn;function Jn(e){this.compareFn=e,this.data=new Map,this.compareFn=e,this.data=new Map}Object.defineProperty(qn.prototype,"value",{get:function(){return this.valueSupplier()},enumerable:!1,configurable:!0});var Yn=qn;function qn(e,t){this.valueSupplier=t,this.field=e}function Wn(e,t){return e.name===t.name&&Me.isEquals(e.tags,t.tags)}Object.defineProperty($n.prototype,"metrics",{get:function(){return Array.from(this._metrics.values())},enumerable:!1,configurable:!0}),$n.prototype.registerCounter=function(e){return this.registerMetricIfNecessary(e,this.createCounter.bind(this))},$n.prototype.registerTimer=function(e){return this.registerMetricIfNecessary(e,this.createTimer.bind(this))},$n.prototype.counter=function(e,t){return void 0===t&&(t={}),new zn(e).tags(t).register(this)},$n.prototype.timer=function(e,t){return void 0===t&&(t={}),new jn(e).tags(t).register(this)},$n.prototype.registerMetricIfNecessary=function(e,t){return this.getOrCreateMetric(e,t)},$n.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},$n.prototype.close=function(){};z=$n;function $n(){this.id=B(),this.name="MetricRegistry",this._metrics=new Kn(Wn)}Se(Zn,Xn=z),Zn.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.")))},Zn.prototype.stop=function(){var e;null!=(e=this.publishingJob)&&e.cancel(),this.publishingJob=null,this.publish(!0),s.log.debug("PushMetricRegistry stopped.")},Zn.prototype.close=function(){this.stop()};var Xn,r=Zn;function Zn(e,t){var r=Xn.call(this)||this;return r.scheduler=e,r.pushIntervalMillis=t,r.publishingJob=null,r}ei.prototype.count=function(){return this.counterValue},ei.prototype.increment=function(e){this.counterValue+=null!=e?e:1},ei.prototype.measure=function(){return[new Yn("count",this.count.bind(this))]};var Qn=ei;function ei(e){this.counterValue=0,this.id=e}ri.prototype.flush=function(){var e=this.currentCounter;return this.currentCounter=new Qn(this.id),e},ri.prototype.count=function(){return this.currentCounter.count()},ri.prototype.increment=function(e){this.currentCounter.increment(e)},ri.prototype.measure=function(){return[new Yn("count",this.count.bind(this))]};var ti=ri;function ri(e){this.id=e,this.currentCounter=new Qn(e)}ii.prototype.count=function(){return this._count},ii.prototype.totalTime=function(e){return De.nanosToUnit(this._total,e)},ii.prototype.max=function(e){return De.nanosToUnit(this._max,e)},ii.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},ii.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))},ii.prototype.measure=function(){var e=this;return[new Yn("count",this.count.bind(this)),new Yn("total",function(){return e.totalTime("milliseconds")}),new Yn("max",function(){return e.max("milliseconds")}),new Yn("mean",function(){return e.mean("milliseconds")})]};var ni=ii;function ii(e){this._count=0,this._total=0,this._max=0,this.id=e}si.prototype.flush=function(){var e=this.currentTimer;return this.currentTimer=new ni(this.id),e},si.prototype.count=function(){return this.currentTimer.count()},si.prototype.totalTime=function(e){return this.currentTimer.totalTime(e)},si.prototype.max=function(e){return this.currentTimer.max(e)},si.prototype.record=function(e,t){this.currentTimer.record(e,t)},si.prototype.mean=function(e){return 0===this.count()?0:this.totalTime(e)/this.count()},si.prototype.measure=function(){var e=this;return[new Yn("count",this.count.bind(this)),new Yn("total",function(){return e.totalTime("milliseconds")}),new Yn("max",function(){return e.max("milliseconds")}),new Yn("mean",function(){return e.mean("milliseconds")})]};var oi=si;function si(e){this.id=e,this.currentTimer=new ni(e)}Se(ui,ai=r),ui.prototype.createCounter=function(e){return new ti(e)},ui.prototype.createTimer=function(e){return new oi(e)},ui.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 ai,e=ui;function ui(e,t){return ai.call(this,e,t)||this}li.prototype.count=function(){return 0},li.prototype.increment=function(e){},li.prototype.measure=function(){return[new Yn("count",this.count.bind(this))]};var ci=li;function li(e){this.id=e}Object.defineProperty(fi.prototype,"counters",{get:function(){return Array.from(this._counters.values())},enumerable:!1,configurable:!0}),fi.prototype.add=function(e){this._counters.add(e,e.registerCounter(this.id))},fi.prototype.count=function(){return(this.counters[0]||this.noopCounter).count()},fi.prototype.increment=function(t){this.counters.forEach(function(e){e.increment(t)})},fi.prototype.measure=function(){return[new Yn("count",this.count.bind(this))]};var pi=fi;function fi(e){this._counters=new Kn(function(e,t){return e.id===t.id}),this.id=e,this.noopCounter=new ci(e)}di.prototype.measure=function(){var e=this;return[new Yn("count",this.count.bind(this)),new Yn("total",function(){return e.totalTime("milliseconds")}),new Yn("max",function(){return e.max("milliseconds")}),new Yn("mean",function(){return e.mean("milliseconds")})]},di.prototype.count=function(){return 0},di.prototype.totalTime=function(e){return 0},di.prototype.max=function(e){return 0},di.prototype.mean=function(e){return 0},di.prototype.record=function(e,t){};var hi=di;function di(e){this.id=e}Object.defineProperty(yi.prototype,"firstTimer",{get:function(){return this.timers[0]||this.noopTimer},enumerable:!1,configurable:!0}),yi.prototype.totalTime=function(e){return this.firstTimer.totalTime(e)},yi.prototype.max=function(e){return this.firstTimer.max(e)},yi.prototype.mean=function(e){return this.firstTimer.mean(e)},yi.prototype.record=function(t,r){this.timers.forEach(function(e){e.record(t,r)})},Object.defineProperty(yi.prototype,"timers",{get:function(){return Array.from(this._timers.values())},enumerable:!1,configurable:!0}),yi.prototype.add=function(e){this._timers.add(e,e.registerTimer(this.id))},yi.prototype.count=function(){return this.firstTimer.count()},yi.prototype.measure=function(){var e=this;return[new Yn("count",this.count.bind(this)),new Yn("total",function(){return e.totalTime("milliseconds")}),new Yn("max",function(){return e.max("milliseconds")}),new Yn("mean",function(){return e.mean("milliseconds")})]};var vi=yi;function yi(e){this._timers=new Kn(function(e,t){return e.id===t.id}),this.id=e,this.noopTimer=new hi(e)}Se(mi,gi=z),mi.prototype.createCounter=function(e){e=new pi(e);return this.addRegistry(e),e},mi.prototype.createTimer=function(e){e=new vi(e);return this.addRegistry(e),e},mi.prototype.addRegistry=function(t){this.registries.forEach(function(e){return t.add(e)})},mi.prototype.add=function(r){r instanceof mi||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)}))},mi.prototype.close=function(){this.registries.forEach(function(e){e.close()})};var gi,i=mi;function mi(){var e=null!==gi&&gi.apply(this,arguments)||this;return e.registries=new Kn(function(e,t){return e.id===t.id}),e}wi.counter=function(e,t){return wi.globalRegistry.counter(e,t)},wi.timer=function(e,t){return wi.globalRegistry.timer(e,t)},wi.addRegistry=function(e){wi.globalRegistry.add(e),s.log.debug("MetricRegistry added ".concat(e.name))},wi.globalRegistry=new i;var Ei=wi;function wi(){}Ti.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},Ti.isNotEmptyString=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var bi=Ti;function Ti(){}Ii.builder=function(){return new Ai},Ii.get=function(e){return Ii.builder().url(e).build()},Ii.prototype.toBuilder=function(){return new Ai(this)};var _i=Ii;function Ii(e,t,r,n,i){this.url=e,this.method=t,this.body=r,this.headers=n,this.options=i}Oi.prototype.url=function(e){return this._url=e,this},Oi.prototype.method=function(e){return this._method=e,this},Oi.prototype.body=function(e){return this._body=e,this},Oi.prototype.addHeader=function(e,t){return this._headers.add(e,t),this},Oi.prototype.timeoutMillis=function(e){return this._timeoutMillis=e,this},Oi.prototype.build=function(){if(null===this._url)throw new Error("url is null");var e={timeoutMillis:this._timeoutMillis};return new _i(this._url,this._method,this._body,this._headers.build(),e)};var Ai=Oi;function Oi(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:Ri.builder(),this._timeoutMillis=null!=(e=null==(t=null==e?void 0:e.options)?void 0:t.timeoutMillis)?e:null}Si.ok=function(e,t){return Si.of(200,e,t)},Si.of=function(e,t,r){return new Si(e,null!=t?t:null,null!=r?r:Ri.empty())},Si.prototype.isSuccessful=function(){return 200<=this.statusCode&&this.statusCode<300},Si.prototype.isClientError=function(){return 400<=this.statusCode&&this.statusCode<500},Si.prototype.isNotModified=function(){return 304===this.statusCode};var Ni=Si;function Si(e,t,r){this.statusCode=e,this.body=t,this.headers=r}Ci.empty=function(){return new Ci(new Map)},Ci.builder=function(){return new Mi(new Map)},Ci.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(bi.equalsIgnoreCase(i,e))return n}return null},Ci.prototype.getOrDefault=function(e,t){return null!=(e=this.get(e))?e:t},Ci.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},{})},Ci.prototype.toBuilder=function(){return new Mi(this.headers)},Ci.IF_MODIFIED_SINCE="If-Modified-Since",Ci.LAST_MODIFIED="Last-Modified";var Ri=Ci;function Ci(e){this.headers=e}xi.prototype.add=function(e,t){return this.headers.set(e,t),this},xi.prototype.build=function(){return new Ri(this.headers)};var Mi=xi;function xi(e){this.headers=e}Se(Ui,Pi=e),Ui.prototype.flushMetrics=function(e,t){var r=this;p.chunked(e.filter(this.isDispatchTarget.bind(this)),qe).forEach(function(e){r.dispatch(e,t)})},Ui.prototype.isDispatchTarget=function(e){return("COUNTER"===e.id.type||"TIMER"===e.id.type)&&0<e.count()},Ui.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))})},Ui.prototype.createRequest=function(e){return _i.builder().url(this.url).method("POST").body(JSON.stringify(this.batch(e))).addHeader("Content-Type","application/json").build()},Ui.prototype.execute=function(e,t){return(t?this.synchronousTransport:this.transport).send(e)},Ui.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(p.associate(e.measure(),function(e){return[e.field,e.value]}))}})}},Ui.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 Pi,ki=Ui;function Ui(e,t,r,n,i){n=Pi.call(this,n,i)||this;return n.url=e,n.transport=t,n.synchronousTransport=r,n.start(),n}Di.experiment=function(e,t,r){t=Ei.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},Di.featureFlag=function(e,t,r){t=Ei.timer("feature.flag.decision",{key:String(t),on:String(r.isOn),reason:String(r.reason)});e.stop(t)},Di.remoteConfig=function(e,t,r){t=Ei.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)},Di.inAppMessage=function(e,t,r){t=Ei.timer("iam.decision",{key:String(t),show:String(r.isShow()),reason:String(r.reason)});e.stop(t)};var Li=Di;function Di(){}ji.record=function(e,t,r){e=Ei.timer("api.call",{operation:e,success:ji.success(r)});t.stop(e)},ji.success=function(e){return null===e?"false":String(e.isSuccessful()||e.isNotModified())};var Fi=ji;function ji(){}Hi.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)}},Hi.decision=function(e,t,r,n,i){return u.isNullOrUndefined(t)?mt.of(n,f.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var Vi=Hi;function Hi(){}var Bi=s.log,zi=(Gi.prototype.get=function(t,r){var n,e=Hn.start();try{n=this.decide(t,r)}catch(e){Bi.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=mt.of(r,f.EXCEPTION)}return Li.remoteConfig(e,t,n),n.value},Gi.prototype.decide=function(e,t){var r=this.userManager.resolve(this.user);return Vi.decide(this.core,e,t,r)},Gi);function Gi(e,t,r){this.core=e,this.userManager=t,this.user=r}Yi.prototype.contains=function(e){return this._properties.has(e)},Yi.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},Yi.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)},Yi.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=ke.sanitizeValue(e,t);return u.isNullOrUndefined(r)||this._properties.set(e,r),this},Yi.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},Yi.prototype.build=function(){return this._properties};var Ki,Ji=Yi;function Yi(){this._properties=new Map,this.MAX_PROPERTIES_COUNT=128,this.MAX_PROPERTY_KEY_LENGTH=128}(Q=Ki=Ki||{}).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";Wi.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Ji).addProperties(e).addProperties(t).build()};var qi=Wi;function Wi(){}Xi.prototype.operate=function(e,t){return 0===e.size?t:0===t.size?e:(new Ji).addProperties(e).addProperties(t,!0).build()};var $i=Xi;function Xi(){}Qi.prototype.operate=function(e,t){return 0===e.size?new Map:0===t.size?e:(new Ji).addProperties(e).remove(t).build()};var Zi=Qi;function Qi(){}to.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Ji;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.increment(e,t)})}),n.build()},to.prototype.increment=function(e,t){return"number"!=typeof t?e:"number"!=typeof e?null==e?t:e:e+t};var eo=to;function to(){}ro.prototype.operate=function(e,t){var r=this;if(0===t.size)return e;var n=new Ji;return n.addProperties(e),t.forEach(function(t,e){n.compute(e,function(e){return r.compute(e,t)})}),n.build()},ro.prototype.compute=function(e,t){e=this.toArray(e),t=this.toArray(t);return this.operateArray(e,t)},ro.prototype.toArray=function(e){return null==e?[]:Array.isArray(e)?e:[e]},ro.prototype.contains=function(e,t){return e.includes(t)},ro.prototype.prepend=function(e,t,r){return(r=void 0===r?!1:r)&&this.contains(t,e)?t:Re([e],t,!0)},ro.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=ro;function ro(){}Se(oo,no=t),oo.prototype.operateArray=function(e,t){var r=this;return t.reduce(function(e,t){return r.append.bind(r)(e,t)},e)};var no,io=oo;function oo(){return null!==no&&no.apply(this,arguments)||this}Se(uo,so=t),uo.prototype.operateArray=function(e,t){return t.reduce(this.appendOnce.bind(this),e)},uo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)};var so,ao=uo;function uo(){return null!==so&&so.apply(this,arguments)||this}Se(po,co=t),po.prototype.operateArray=function(e,t){var r=this;return t.reduceRight(function(e,t){return r.prepend.bind(r)(t,e)},e)};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.reduce(this.appendOnce.bind(this),[]).reduceRight(function(e,t){return r.prependOnce.bind(r)(t,e)},e)},vo.prototype.appendOnce=function(e,t){return this.append(e,t,!0)},vo.prototype.prependOnce=function(e,t){return this.prepend(e,t,!0)};var fo,ho=vo;function vo(){return null!==fo&&fo.apply(this,arguments)||this}Se(mo,yo=t),mo.prototype.operateArray=function(e,t){return t.reduce(this.remove.bind(this),e)},mo.prototype.remove=function(e,t){return e.filter(function(e){return e!==t})};var yo,go=mo;function mo(){return null!==yo&&yo.apply(this,arguments)||this}wo.prototype.operate=function(e,t){return new Map};var Eo=wo;function wo(){}To.get=function(e){switch(e){case Ki.SET:return new qi;case Ki.SET_ONCE:return new $i;case Ki.UNSET:return new Zi;case Ki.INCREMENT:return new eo;case Ki.APPEND:return new io;case Ki.APPEND_ONCE:return new ao;case Ki.PREPEND:return new lo;case Ki.PREPEND_ONCE:return new ho;case Ki.CLEAR_ALL:return new Eo;case Ki.REMOVE:return new go}};var bo=To;function To(){}Io.prototype.set=function(e,t){return this.add(Ki.SET,e,t)},Io.prototype.setOnce=function(e,t){return this.add(Ki.SET_ONCE,e,t)},Io.prototype.unset=function(e){return this.add(Ki.UNSET,e,"-")},Io.prototype.increment=function(e,t){return this.add(Ki.INCREMENT,e,t)},Io.prototype.append=function(e,t){return this.add(Ki.APPEND,e,t)},Io.prototype.appendOnce=function(e,t){return this.add(Ki.APPEND_ONCE,e,t)},Io.prototype.prepend=function(e,t){return this.add(Ki.PREPEND,e,t)},Io.prototype.prependOnce=function(e,t){return this.add(Ki.PREPEND_ONCE,e,t)},Io.prototype.remove=function(e,t){return this.add(Ki.REMOVE,e,t)},Io.prototype.clearAll=function(){return this.add(Ki.CLEAR_ALL,"clearAll","-")},Io.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))},Io.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},Io.prototype.add=function(e,t,r){if(this.containsKey(t))return this;this.operations.has(e)||this.operations.set(e,new Ji);e=this.operations.get(e);return null!=e&&e.add(t,r),this};var _o=Io;function Io(){this.operations=new Map}Oo.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=bo.get(t).operate(r,e)}),r},Oo.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]),ke.sanitize(u.fromMap(e))),r))}),i},Oo.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=Oo;function Oo(e){this.operations=null!=e?e:new Map}So.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 No=So;function So(){}Co.prototype.isEquals=function(e){return this.url===e.url},Object.defineProperty(Co.prototype,"pageTitle",{get:function(){return"undefined"==typeof window||"undefined"==typeof document?"":window.document.title},enumerable:!1,configurable:!0}),Co.createWithCurrentPage=function(){return"undefined"==typeof window||"undefined"==typeof document?new Co:new Co(window.location.pathname,window.location.host,window.location.hostname,window.location.href,window.document.referrer,window.location.search,window.location.protocol)},Co.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 Ro=Co;function Co(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}var Mo=s.log,xo=(Po.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]),Mo.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),Mo.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),Mo.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},Po.prototype.getSessionId=function(){return this.sessionManager.sessionId},Po.prototype.getUser=function(){return this.userManager.currentUser},Po.prototype.setUser=function(e){try{var t=Kt(e);if(!t)return Mo.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Mo.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},Po.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 Mo.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return Mo.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},Po.prototype.setDeviceId=function(e){try{var t=Me.sanitizeValue(e);if(!t)return Mo.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Mo.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},Po.prototype.setUserProperty=function(e,t){e=(new _o).set(e,t).build();return this.updateUserProperties(e)},Po.prototype.setUserProperties=function(e){try{var t=ke.sanitize(e),r=new _o;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 Mo.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},Po.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 Mo.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},Po.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new _o).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return Mo.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},Po.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},Po.prototype.variationDetail=function(r,n,e){var i=e||"A",e=Hn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.experiment(r,t,i)}catch(e){return Mo.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),Tt.of(i,f.EXCEPTION)}}(this);return Li.experiment(e,r,t),t},Po.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},Po.prototype.featureFlagDetail=function(r,n){var e=Hn.start(),t=function(e){try{var t=e.userManager.resolve(n);return e.core.featureFlag(r,t)}catch(e){return Mo.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),It.off(f.EXCEPTION)}}(this);return Li.featureFlag(e,r,t),t},Po.prototype.track=function(e,t){try{Mo.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){Mo.error("Unexpected exception while tracking event: ".concat(e))}},Po.prototype.trackPageView=function(e){var t=Ro.createWithCurrentPage();this.pageEventTracker.track(t)},Po.prototype.remoteConfig=function(e){return new zi(this.core,this.userManager,e)},Po.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},Po.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,No.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(),Mo.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},Po.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},Po.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(Mo.debug("UserExplorer opened."),Ei.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):Mo.error("UserExplorer is not provided")},Po.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():Mo.warn("There is no active HackleDevtools.")},Po.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},Po.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},Po.prototype.close=function(){Mo.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},Po);function Po(e,t,r,n,i,o,s,a){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.fetchThrottler=i,this.pageEventTracker=o,this.inAppMessageUi=s,this.devTools=a,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.initialization=this.initialize()}var ko=s.log,Uo=(Lo.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 ko.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},Lo);function Lo(e,t){this.invocationProcessor=e,this.user=t}Fo.tryParse=function(e){try{return new URL(e)}catch(e){return}},Fo.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:Fo.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},Fo.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},Fo.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},Fo.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},Fo.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var Do=Fo;function Fo(){}Vo.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]:""},Vo.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=Do.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},Vo.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},Vo.prototype.setItem=function(e,t,r){var r=c(c({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=Vo.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},Vo.prototype.removeItem=function(e,t){this.setItem(e,"",c(c({},t),{days:-1}))},Vo.prototype.getOptions=function(){return this.options},Vo.getInstance=function(e){return void 0===e&&(e={days:Xe,isCrossSubdomain:!0}),Vo.storage=Vo.storage?Vo.storage:new Vo(e)};var jo=Vo;function Vo(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}Bo.prototype.initialize=function(){jo.getInstance().getItem(Ze)||Ko()},Bo.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return Go();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var Ho=Bo;function Bo(){}function zo(){var e=jo.getInstance(),t=e.getItem(Qe);if(t)return t;t=e.getItem(Ze);return t||Ko()}function Go(){jo.getInstance().removeItem(Qe)}function Ko(){var e=B();return jo.getInstance().setItem(Ze,e),e}var Jo,Yo=s.log;(r=Jo=Jo||{}).native="native",r.web_view_wrapper="web_view_wrapper";d.prototype.getSessionId=function(){try{var e=this.invocationProcessor.process({command:"getSessionId"});return null!=e?e:zo()}catch(e){return Yo.error("Unexpected exception while get sessionId: ".concat(e)),zo()}},d.prototype.getUser=function(){var e;try{var t=this.invocationProcessor.process({command:"getUser"});return null!=(e=Kt(t))?e:this.defaultUser()}catch(e){return Yo.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},d.prototype.setUser=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Kt(n)))return Yo.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t}},this.invocationProcessor.process(r)}catch(e){Yo.error("Unexpected exception while set user: ".concat(e))}return[2]})})},d.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 Yo.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t}},this.invocationProcessor.process(r)}catch(e){Yo.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},d.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 Yo.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t}},this.invocationProcessor.process(r)}catch(e){Yo.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},d.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){Yo.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},d.prototype.setUserProperties=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{t=ke.sanitize(n),r=new _o,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){Yo.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},d.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){Yo.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},d.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){Yo.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},d.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 Yo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},d.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 Be(new Map(Object.entries(null!=(n=o.config.parameters)?n:{}))))}catch(e){return Yo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),Tt.of(r,f.EXCEPTION)}},d.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 Yo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},d.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 It(i.isOn,i.reason,new Be(new Map(Object.entries(null!=(r=i.config.parameters)?r:{}))),void 0)}catch(e){return Yo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),It.off(f.EXCEPTION)}},d.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){Yo.error("Unexpected exception while tracking event: ".concat(e))}},d.prototype.trackPageView=function(e){Yo.info("Web to app integration feature is not support 'trackPageView' method")},d.prototype.remoteConfig=function(e){return new Uo(this.invocationProcessor,this.convertUser(e))},d.prototype.onReady=function(e,t){e()},d.prototype.showUserExplorer=function(){try{this.invocationProcessor.process({command:"showUserExplorer"})}catch(e){Yo.error("Unexpected exception while show userExplorer: ".concat(e))}},d.prototype.hideUserExplorer=function(){Yo.info("Web to app integration feature is not support 'hideUserExplorer' method")},d.prototype.setInAppMessageListener=function(e){Yo.info("Web to app integration feature is not support 'setInAppMessageListener' method")},d.prototype.fetch=function(){return Promise.resolve()},d.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},d.prototype.close=function(){Yo.info("Web to app integration feature is not support 'close' method")},d.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},d.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=Kt(e))?e:void 0},d.prototype.defaultUser=function(){return{deviceId:zo()}};var qo=d;function d(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)}$o.prototype.getSessionId=function(){return this.browser.getSessionId()},$o.prototype.getUser=function(){return this.browser.getUser()},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.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]}})})},$o.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},$o.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},$o.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},$o.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},$o.prototype.track=function(e,t){return this.browser.track(e,t)},$o.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},$o.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},$o.prototype.onReady=function(e,t){this.browser.onReady(e,t)},$o.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},$o.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},$o.prototype.fetch=function(){return this.browser.fetch()},$o.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},$o.prototype.close=function(){this.browser.close()},$o.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)};var Wo=$o;function $o(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)}function Xo(e){return e&&e.Math==Math&&e}function Zo(e){try{return!!e()}catch(e){return!0}}function Qo(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function es(e){return Ds(Ls(e),8,-1)}function ts(e){if(null==e)throw Hs("Can't call method on "+e);return e}function rs(e){return Bs(zs(e))}function ns(e){return"function"==typeof e}function is(e){return"object"==typeof e?null!==e:Gs(e)}function os(e,t){return arguments.length<2?(r=Ks[e],Js(r)?r:void 0):Ks[e]&&Ks[e][t];var r}function ss(e){try{return ta(e)}catch(e){return"Object"}}function as(e){if(ra(e))return e;throw ia(na(e)+" is not a function")}function us(e,t){return null==(e=e[t])?void 0:oa(e)}function cs(t,r){try{pa(la,t,{value:r,configurable:!0,writable:!0})}catch(e){la[t]=r}return r}function ls(e){return va(da(e))}function ps(e){return"Symbol("+(void 0===e?"":e)+")_"+ba(++Ea+wa,36)}function fs(e){var t;return _a(Na,e)&&(Aa||"string"==typeof Na[e])||(t="Symbol."+e,Aa&&_a(Sa,e)?Na[e]=Sa[e]:Na[e]=(Oa&&Ra?Ra:Ca)(t)),Na[e]}function hs(e){return e=Fa(e,"string"),ja(e)?e:e+""}function ds(e){return Ha?Va.createElement(e):{}}function vs(e){if(Xa(e))return e;throw Qa(Za(e)+" is not an object")}function ys(e){return du[e]||(du[e]=hu(e))}function gs(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(xu(r)&&ku(r,o,n),n.global)i?e[t]=r:Uu(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Pu.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function ms(e){return(e=+e)!=e||0==e?0:Fu(e)}function Es(e,t){return(e=ju(e))<0?Vu(e+t,0):Hu(e,t)}function v(e){return Gu(e.length)}function ws(a){return function(e,t,r){var n,i=Ku(e),o=Yu(i),s=Ju(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 bs(e,t){var r,n=Wu(e),i=0,o=[];for(r in n)!qu(Xu,r)&&qu(n,r)&&Zu(o,r);for(;t.length>i;)!qu(n,r=t[i++])||~$u(o,r)||Zu(o,r);return o}function Ts(e,t,r){for(var n=sc(t),i=uc.f,o=ac.f,s=0;s<n.length;s++){var a=n[s];oc(e,a)||r&&oc(r,a)||i(e,a,o(t,a))}}function _s(e,t){return(e=hc[fc(e)])==vc||e!=dc&&(lc(t)?cc(t):!!t)}function y(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?yc:a?yc[o]||wc(o,{}):(yc[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=gc(u,r))&&i.value:u[r],!Tc(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;bc(n,i)}(e.sham||i&&i.sham)&&mc(n,"sham",!0),Ec(u,r,n,e)}}var Is,As,Os,Ns,Ss,Rs,Cs,Ms,z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=Xo("object"==typeof globalThis&&globalThis)||Xo("object"==typeof window&&window)||Xo("object"==typeof self&&self)||Xo("object"==typeof z&&z)||function(){return this}()||Function("return this")(),e={},Q=!Zo(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),t=!Zo(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),xs=Function.prototype.call,r=t?xs.bind(xs):function(){return xs.apply(xs,arguments)},z={},g={}.propertyIsEnumerable,Ps=Object.getOwnPropertyDescriptor,m=Ps&&!g.call({1:2},1),m=(z.f=m?function(e){e=Ps(this,e);return!!e&&e.enumerable}:g,t),g=Function.prototype,E=g.bind,ks=g.call,Us=m&&E.bind(ks,ks),g=m?function(e){return e&&Us(e)}:function(e){return e&&function(){return ks.apply(e,arguments)}},E=g,Ls=E({}.toString),Ds=E("".slice),m=Zo,Fs=es,js=Object,Vs=g("".split),E=m(function(){return!js("z").propertyIsEnumerable(0)})?function(e){return"String"==Fs(e)?Vs(e,""):js(e)}:js,Hs=TypeError,Bs=E,zs=ts,Gs=ns,Ks=i,Js=ns,m=g({}.isPrototypeOf),Ys=os("navigator","userAgent")||"",w=Ys,qs=i.process,Ws=i.Deno,qs=qs&&qs.versions||Ws&&Ws.version,Ws=qs&&qs.v8,qs=T=!(T=Ws?0<(b=Ws.split("."))[0]&&b[0]<4?1:+(b[0]+b[1]):T)&&w&&(!(b=w.match(/Edge\/(\d+)/))||74<=b[1])&&(b=w.match(/Chrome\/(\d+)/))?+b[1]:T,$s=qs,Ws=Zo,w=!!Object.getOwnPropertySymbols&&!Ws(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&$s&&$s<41}),b=w&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Xs=os,Zs=ns,Qs=m,ea=Object,T=b?function(e){return"symbol"==typeof e}:function(e){var t=Xs("Symbol");return Zs(t)&&Qs(t.prototype,ea(e))},ta=String,ra=ns,na=ss,ia=TypeError,oa=as,sa=r,aa=ns,ua=is,ca=TypeError,Ws={exports:{}},la=i,pa=Object.defineProperty,fa=cs,_="__core-js_shared__",fa=i[_]||fa(_,{}),ha=fa,da=((Ws.exports=function(e,t){return ha[e]||(ha[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"}),ts),va=Object,ya=ls,ga=g({}.hasOwnProperty),_=Object.hasOwn||function(e,t){return ga(ya(e),t)},ma=g,Ea=0,wa=Math.random(),ba=ma(1..toString),ma=i,Ta=Ws.exports,_a=_,Ia=ps,Aa=w,Oa=b,Na=Ta("wks"),Sa=ma.Symbol,Ra=Sa&&Sa.for,Ca=Oa?Sa:Sa&&Sa.withoutSetter||Ia,Ma=r,xa=is,Pa=T,ka=us,Ua=function(e,t){var r,n;if("string"===t&&aa(r=e.toString)&&!ua(n=sa(r,e)))return n;if(aa(r=e.valueOf)&&!ua(n=sa(r,e)))return n;if("string"!==t&&aa(r=e.toString)&&!ua(n=sa(r,e)))return n;throw ca("Can't convert object to primitive value")},La=TypeError,Da=fs("toPrimitive"),Fa=function(e,t){if(!xa(e)||Pa(e))return e;var r=ka(e,Da);if(r){if(r=Ma(r,e,t=void 0===t?"default":t),!xa(r)||Pa(r))return r;throw La("Can't convert object to primitive value")}return Ua(e,t=void 0===t?"number":t)},ja=T,w=is,Va=i.document,Ha=w(Va)&&w(Va.createElement),Ba=ds,b=!Q&&!Zo(function(){return 7!=Object.defineProperty(Ba("div"),"a",{get:function(){return 7}}).a}),za=r,Ga=z,Ka=Qo,Ja=rs,Ya=hs,qa=_,Wa=b,$a=Object.getOwnPropertyDescriptor,Ta=(e.f=Q?$a:function(e,t){if(e=Ja(e),t=Ya(t),Wa)try{return $a(e,t)}catch(e){}if(qa(e,t))return Ka(!za(Ga.f,e,t),e[t])},{}),ma=Q&&Zo(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Xa=is,Za=String,Qa=TypeError,eu=b,tu=vs,ru=hs,nu=TypeError,iu=Object.defineProperty,ou=Object.getOwnPropertyDescriptor,su="enumerable",au="configurable",uu="writable",Ia=(Ta.f=Q?ma?function(e,t,r){var n;return tu(e),t=ru(t),tu(r),"function"==typeof e&&"prototype"===t&&"value"in r&&uu in r&&!r[uu]&&((n=ou(e,t))&&n[uu]&&(e[t]=r.value,r={configurable:(au in r?r:n)[au],enumerable:(su in r?r:n)[su],writable:!1})),iu(e,t,r)}:iu:function(e,t,r){if(tu(e),t=ru(t),tu(r),eu)try{return iu(e,t,r)}catch(e){}if("get"in r||"set"in r)throw nu("Accessors not supported");return"value"in r&&(e[t]=r.value),e},Q),cu=Ta,lu=Qo,T=Ia?function(e,t,r){return cu.f(e,t,lu(1,r))}:function(e,t,r){return e[t]=r,e},w={exports:{}},z=Q,b=_,Ia=Function.prototype,I=z&&Object.getOwnPropertyDescriptor,b=b(Ia,"name"),b={EXISTS:b,PROPER:b&&"something"===function(){}.name,CONFIGURABLE:b&&(!z||I(Ia,"name").configurable)},z=ns,I=fa,pu=g(Function.toString),Ia=(z(I.inspectSource)||(I.inspectSource=function(e){return pu(e)}),I.inspectSource),z=ns,I=Ia,fu=i.WeakMap,z=z(fu)&&/native code/.test(I(fu)),I=Ws.exports,hu=ps,du=I("keys"),fu={},Ws=g,vu=is,yu=T,gu=_,I=fa,mu=ys,Eu=fu,wu="Object already initialized",bu=i.TypeError,A=i.WeakMap,z=(Cs=z||I.state?(Is=I.state||(I.state=new A),As=Ws(Is.get),Os=Ws(Is.has),Ns=Ws(Is.set),Ss=function(e,t){if(Os(Is,e))throw new bu(wu);return t.facade=e,Ns(Is,e,t),t},Rs=function(e){return As(Is,e)||{}},function(e){return Os(Is,e)}):(Eu[Ms=mu("state")]=!0,Ss=function(e,t){if(gu(e,Ms))throw new bu(wu);return t.facade=e,yu(e,Ms,t),t},Rs=function(e){return gu(e,Ms)?e[Ms]:{}},function(e){return gu(e,Ms)}),{set:Ss,get:Rs,has:Cs,enforce:function(e){return Cs(e)?Rs(e):Ss(e,{})},getterFor:function(t){return function(e){if(vu(e)&&(e=Rs(e)).type===t)return e;throw bu("Incompatible receiver, "+t+" required")}}}),I=Zo,Tu=ns,_u=_,Iu=Q,Au=b.CONFIGURABLE,Ou=Ia,Nu=z.enforce,Su=z.get,Ru=Object.defineProperty,Cu=Iu&&!I(function(){return 8!==Ru(function(){},"length",{value:8}).length}),Mu=String(String).split("String"),A=w.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),(!_u(e,"name")||Au&&e.name!==t)&&(Iu?Ru(e,"name",{value:t,configurable:!0}):e.name=t),Cu&&r&&_u(r,"arity")&&e.length!==r.arity&&Ru(e,"length",{value:r.arity});try{r&&_u(r,"constructor")&&r.constructor?Iu&&Ru(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=Nu(e);return _u(r,"source")||(r.source=Mu.join("string"==typeof t?t:"")),e},xu=(Function.prototype.toString=A(function(){return Tu(this)&&Su(this).source||Ou(this)},"toString"),ns),Pu=Ta,ku=w.exports,Uu=cs,Ws={},Lu=Math.ceil,Du=Math.floor,Fu=Math.trunc||function(e){e=+e;return(0<e?Du:Lu)(e)},ju=ms,Vu=Math.max,Hu=Math.min,Bu=ms,zu=Math.min,Gu=function(e){return 0<e?zu(Bu(e),9007199254740991):0},Ku=rs,Ju=Es,Yu=v,Eu={includes:ws(!0),indexOf:ws(!1)},mu=g,qu=_,Wu=rs,$u=Eu.indexOf,Xu=fu,Zu=mu([].push),I=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Qu=bs,ec=I.concat("length","prototype"),A=(Ws.f=Object.getOwnPropertyNames||function(e){return Qu(e,ec)},{}),mu=(A.f=Object.getOwnPropertySymbols,os),tc=Ws,rc=A,nc=vs,ic=g([].concat),A=mu("Reflect","ownKeys")||function(e){var t=tc.f(nc(e)),r=rc.f;return r?ic(t,r(e)):t},oc=_,sc=A,ac=e,uc=Ta,cc=Zo,lc=ns,pc=/#|\.prototype\./,fc=_s.normalize=function(e){return String(e).replace(pc,".").toLowerCase()},hc=_s.data={},dc=_s.NATIVE="N",vc=_s.POLYFILL="P",mu=_s,yc=i,gc=e.f,mc=T,Ec=gs,wc=cs,bc=Ts,Tc=mu,A=!Zo(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),_c=_,Ic=ns,Ac=ls,Oc=ys("IE_PROTO"),Nc=Object,Sc=Nc.prototype,A=A?Nc.getPrototypeOf:function(e){e=Ac(e);if(_c(e,Oc))return e[Oc];var t=e.constructor;return Ic(t)&&e instanceof t?t.prototype:e instanceof Nc?Sc:null},Rc=ns,Cc=String,Mc=TypeError,xc=g,Pc=vs,kc=function(e){if("object"==typeof e||Rc(e))return e;throw Mc("Can't set "+Cc(e)+" as a prototype")},Uc=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=xc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return Pc(e),kc(t),n?r(e,t):e.__proto__=t,e}}():void 0),Lc={},Dc=bs,Fc=I,O=Object.keys||function(e){return Dc(e,Fc)},jc=Ta,Vc=vs,Hc=rs,Bc=O;Lc.f=Q&&!ma?Object.defineProperties:function(e,t){Vc(e);for(var r,n=Hc(t),i=Bc(t),o=i.length,s=0;s<o;)jc.f(e,r=i[s++],n[r]);return e};function zc(){}function Gc(e){e.write(pl("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Kc(e,t){return El(e),void 0===t?e:wl?bl(e,t):function(){return e.apply(t,arguments)}}function Jc(e){return void 0!==e&&(Tl.Array===e||Il[_l]===e)}function Yc(e){if(null!=e)return Ml(e,Pl)||Ml(e,"@@iterator")||xl[Cl(e)]}function qc(e,t){if(t=arguments.length<2?Fl(e):t,Ul(t))return Ll(kl(t,e));throw jl(Dl(e)+" is not iterable")}function Wc(e,t,r){var n,i;Hl(e);try{if(!(n=Bl(e,"return"))){if("throw"===t)throw r;return r}n=Vl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Hl(n),r}function $c(e,t){this.stopped=e,this.result=t}function Xc(e,t,r){function n(e){return o&&Zl(o,"normal",e),new $c(!0,e)}function i(e){return f?(Kl(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=zl(t,p);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=Xl(e)))throw Ql(Jl(e)+" is not iterable");if(Yl(r)){for(s=0,a=ql(e);s<a;s++)if((u=i(e[s]))&&Wl(ep,u))return u;return new $c(!1)}o=$l(e,r)}for(c=(h?e:o).next;!(l=Gl(c,o)).done;){try{u=i(l.value)}catch(e){Zl(o,"throw",e)}if("object"==typeof u&&u&&Wl(ep,u))return u}return new $c(!1)}function Zc(e){if("Symbol"===tp(e))throw TypeError("Cannot convert a Symbol value to a string");return rp(e)}function Qc(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=op(Ep,this);return ap?r=ap(new gp,i?sp(this):Ep):(r=i?this:up(Ep),cp(r,yp,"Error")),void 0!==t&&cp(r,"message",dp(t)),vp&&cp(r,"stack",pp(r.stack,1)),fp(r,n),hp(e,mp,{that:i=[]}),cp(r,"errors",i),r}function el(e){bp[wp][e]=!0}var tl,rl,O=os("document","documentElement"),nl=vs,il=Lc,ol=I,ma=fu,sl=O,al=ds,ul="prototype",cl="script",ll=ys("IE_PROTO"),pl=function(e){return"<"+cl+">"+e+"</"+cl+">"},fl=function(){try{tl=new ActiveXObject("htmlfile")}catch(e){}fl="undefined"==typeof document||document.domain&&tl?Gc(tl):(e=al("iframe"),t="java"+cl+":",e.style.display="none",sl.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(pl("document.F=Object")),t.close(),t.F);for(var e,t,r=ol.length;r--;)delete fl[ul][ol[r]];return fl()},Lc=(ma[ll]=!0,Object.create||function(e,t){var r;return null!==e?(zc[ul]=nl(e),r=new zc,zc[ul]=null,r[ll]=e):r=fl(),void 0===t?r:il.f(r,t)}),hl=Error,dl=g("".replace),I=String(hl("zxcasd").stack),vl=/\n\s*at [^:]*:[^\n]*/,yl=vl.test(I),gl=is,ml=T,El=as,wl=t,bl=g(g.bind),ma={},Tl=ma,_l=fs("iterator"),Il=Array.prototype,I={},I=(I[fs("toStringTag")]="z","[object z]"===String(I)),N=I,Al=ns,Ol=es,Nl=fs("toStringTag"),Sl=Object,Rl="Arguments"==Ol(function(){return arguments}()),N=N?Ol: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=Sl(e),Nl))?t:Rl?Ol(e):"Object"==(t=Ol(e))&&Al(e.callee)?"Arguments":t},Cl=N,Ml=us,xl=ma,Pl=fs("iterator"),kl=r,Ul=as,Ll=vs,Dl=ss,Fl=Yc,jl=TypeError,Vl=r,Hl=vs,Bl=us,zl=Kc,Gl=r,Kl=vs,Jl=ss,Yl=Jc,ql=v,Wl=m,$l=qc,Xl=Yc,Zl=Wc,Ql=TypeError,ep=$c.prototype,tp=N,rp=String,np=Zc,ip=Qo,S=!Zo(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",ip(1,7)),7!==e.stack)}),R=y,op=m,sp=A,ap=Uc,C=Ts,up=Lc,cp=T,lp=Qo,pp=function(e,t){if(yl&&"string"==typeof e&&!hl.prepareStackTrace)for(;t--;)e=dl(e,vl,"");return e},fp=function(e,t){gl(t)&&"cause"in t&&ml(e,"cause",t.cause)},hp=Xc,dp=function(e,t){return void 0===e?arguments.length<2?"":t:np(e)},vp=S,yp=fs("toStringTag"),gp=Error,mp=[].push,Ep=(ap?ap(Qc,gp):C(Qc,gp,{name:!0}),Qc.prototype=up(gp.prototype,{constructor:lp(1,Qc),message:lp(1,""),name:lp(1,"AggregateError")})),S=(R({global:!0,constructor:!0,arity:2},{AggregateError:Qc}),fs),C=Lc,lp=Ta.f,wp=S("unscopables"),bp=Array.prototype,R=(null==bp[wp]&&lp(bp,wp,{configurable:!0,value:C(null)}),Zo),S=ns,lp=A,C=gs,Tp=fs("iterator"),_p=!1;[].keys&&("next"in(M=[].keys())?(lp=lp(lp(M)))!==Object.prototype&&(rl=lp):_p=!0);function Ip(e,t,r){(e=e&&!r?e.prototype:e)&&!Rp(e,Cp)&&Sp(e,Cp,{configurable:!0,value:t})}function Ap(){return this}function Op(){return this}function Np(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!Wp&&e in p)return p[e];switch(e){case"keys":case Xp:case Zp: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[$p]||p["@@iterator"]||i&&p[i],h=!Wp&&f||a(i),d="Array"==t&&p.entries||f;if(d&&(d=Vp(d.call(new e)))!==Object.prototype&&d.next&&(Vp(d)!==qp&&(Hp?Hp(d,qp):Fp(d[$p])||Gp(d,$p,Op)),Bp(d,n,!0)),Jp&&i==Xp&&f&&f.name!==Xp&&(Yp?zp(p,"name",Xp):(l=!0,h=function(){return Dp(f,this)})),i)if(u={values:a(Xp),keys:o?h:a("keys"),entries:a(Zp)},s)for(c in u)!Wp&&!l&&c in p||Gp(p,c,u[c]);else Lp({target:t,proto:!0,forced:Wp||l},u);return p[$p]!==h&&Gp(p,$p,h,{name:i}),Kp[t]=h,u}S((rl=null==rl||R(function(){var e={};return rl[Tp].call(e)!==e})?{}:rl)[Tp])||C(rl,Tp,function(){return this});var M={IteratorPrototype:rl,BUGGY_SAFARI_ITERATORS:_p},Sp=Ta.f,Rp=_,Cp=fs("toStringTag"),Mp=M.IteratorPrototype,xp=Lc,Pp=Qo,kp=Ip,Up=ma,Lp=y,Dp=r,Fp=ns,jp=function(e,t,r,n){t+=" Iterator";return e.prototype=xp(Mp,{next:Pp(+!n,r)}),kp(e,t,!1),Up[t]=Ap,e},Vp=A,Hp=Uc,Bp=Ip,zp=T,Gp=gs,lp=fs,Kp=ma,Jp=b.PROPER,Yp=b.CONFIGURABLE,qp=M.IteratorPrototype,Wp=M.BUGGY_SAFARI_ITERATORS,$p=lp("iterator"),Xp="values",Zp="entries",Qp=rs,S=el,R=ma,C=z,_p=Ta.f,b=Np,M=Q,ef="Array Iterator",tf=C.set,rf=C.getterFor(ef),lp=b(Array,"Array",function(e,t){tf(this,{type:ef,target:Qp(e),index:0,kind:t})},function(){var e=rf(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"),ma=R.Arguments=R.Array;if(S("keys"),S("values"),S("entries"),M&&"values"!==ma.name)try{_p(ma,"name",{value:"values"})}catch(e){}var nf=N;I||gs(Object.prototype,"toString",I?{}.toString:function(){return"[object "+nf(this)+"]"},{unsafe:!0});function of(e){var e=hf(e),t=df.f;vf&&e&&!e[yf]&&t(e,yf,{configurable:!0,get:function(){return this}})}function sf(e,t){if(gf(t,e))return e;throw mf("Incorrect invocation")}function af(){}function uf(e){if(!Ef(e))return!1;try{return _f(af,Tf,e),!0}catch(e){return!1}}function cf(e){if(!Ef(e))return!1;switch(wf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Of||!!Af(If,bf(e))}catch(e){return!0}}function lf(e,t){return void 0===(e=Cf(e).constructor)||null==(e=Cf(e)[xf])?t:Mf(e)}var pf,ff,C="process"==es(i.process),hf=os,df=Ta,vf=Q,yf=fs("species"),gf=m,mf=TypeError,b=g,R=Zo,Ef=ns,wf=N,bf=Ia,Tf=[],_f=os("Reflect","construct"),If=/^\s*(?:class|function)\b/,Af=b(If.exec),Of=!If.exec(af),S=(cf.sham=!0,!_f||R(function(){var e;return uf(uf.call)||!uf(Object)||!uf(function(){e=!0})||e})?cf:uf),Nf=S,Sf=ss,Rf=TypeError,Cf=vs,Mf=function(e){if(Nf(e))return e;throw Rf(Sf(e)+" is not a constructor")},xf=fs("species"),M=Function.prototype,Pf=M.apply,kf=M.call,_p="object"==typeof Reflect&&Reflect.apply||(t?kf.bind(Pf):function(){return kf.apply(Pf,arguments)}),ma=g([].slice),Uf=TypeError,I=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ys),Lf=i,Df=_p,m=Kc,Ff=ns,jf=_,N=Zo,Vf=O,Hf=ma,Bf=ds,zf=function(e,t){if(e<t)throw Uf("Not enough arguments");return e},b=I,R=C,M=Lf.setImmediate,t=Lf.clearImmediate,Gf=Lf.process,Kf=Lf.Dispatch,Jf=Lf.Function,O=Lf.MessageChannel,Yf=Lf.String,qf=0,Wf={},$f="onreadystatechange";try{pf=Lf.location}catch(e){}function Xf(e){return function(){dh(e)}}function Zf(e){dh(e.data)}function Qf(e){Lf.postMessage(Yf(e),pf.protocol+"//"+pf.host)}function eh(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function th(){this.head=null,this.tail=null}function rh(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=Nh(r),this.reject=Nh(n)}function nh(e,t){var r,n,i,o,s=t.value,a=t.state==rd,u=a?e.ok:e.fail,c=e.resolve,l=e.reject,p=e.domain;try{u?(a||(t.rejection===od&&(o=t,Ch(Lh,Rh,function(){var e=o.facade;Sh?$h.emit("rejectionHandled",e):ud(td,e,o.value)})),t.rejection=id),!0===u?r=s:(p&&p.enter(),r=u(s),p&&(p.exit(),i=!0)),r===e.promise?l(qh("Promise-chain cycle")):(n=sd(r))?Ch(n,r,c,l):c(r)):l(s)}catch(e){p&&!i&&p.exit(),l(e)}}var ih,oh,sh,ah,uh,ch,lh,ph,fh,hh,dh=function(e){var t;jf(Wf,e)&&(t=Wf[e],delete Wf[e],t())},O=(M&&t||(M=function(e){zf(arguments.length,1);var t=Ff(e)?e:Jf(e),r=Hf(arguments,1);return Wf[++qf]=function(){Df(t,void 0,r)},ff(qf),qf},t=function(e){delete Wf[e]},R?ff=function(e){Gf.nextTick(Xf(e))}:Kf&&Kf.now?ff=function(e){Kf.now(Xf(e))}:O&&!b?(b=(R=new O).port2,R.port1.onmessage=Zf,ff=m(b.postMessage,b)):Lf.addEventListener&&Ff(Lf.postMessage)&&!Lf.importScripts&&pf&&"file:"!==pf.protocol&&!N(Qf)?(ff=Qf,Lf.addEventListener("message",Zf,!1)):ff=$f in Bf("script")?function(e){Vf.appendChild(Bf("script"))[$f]=function(){Vf.removeChild(this),dh(e)}}:function(e){setTimeout(Xf(e),0)}),{set:M,clear:t}),R=i,m=/ipad|iphone|ipod/i.test(Ys)&&void 0!==R.Pebble,b=/web0s(?!.*chrome)/i.test(Ys),N=i,M=Kc,t=e.f,vh=O.set,R=I,e=m,I=b,yh=C,m=N.MutationObserver||N.WebKitMutationObserver,b=N.document,gh=N.process,x=N.Promise,t=t(N,"queueMicrotask"),t=t&&t.value,I=(t||(ih=function(){var e,t;for(yh&&(e=gh.domain)&&e.exit();oh;){t=oh.fn,oh=oh.next;try{t()}catch(e){throw oh?ah():sh=void 0,e}}sh=void 0,e&&e.enter()},ah=R||yh||I||!m||!b?!e&&x&&x.resolve?((R=x.resolve(void 0)).constructor=x,lh=M(R.then,R),function(){lh(ih)}):yh?function(){gh.nextTick(ih)}:(vh=M(vh,N),function(){vh(ih)}):(uh=!0,ch=b.createTextNode(""),new m(ih).observe(ch,{characterData:!0}),function(){ch.data=uh=!uh})),t||function(e){e={fn:e,next:void 0};sh&&(sh.next=e),oh||(oh=e,ah()),sh=e}),mh=i,e=(th.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}},th),x=i.Promise,R="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,M=!R&&!C&&"object"==typeof window&&"object"==typeof document,N=i,Eh=x,b=ns,m=mu,wh=Ia,t=fs,bh=M,Th=R,_h=qs,Ih=(Eh&&Eh.prototype,t("species")),Ah=!1,Oh=b(N.PromiseRejectionEvent),Ia={CONSTRUCTOR:m("Promise",function(){var e=wh(Eh),t=e!==String(Eh);if(!t&&66===_h)return!0;if(!_h||_h<51||!/native code/.test(e)){var e=new Eh(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[Ih]=r,!(Ah=e.then(function(){})instanceof r))return!0}return!t&&(bh||Th)&&!Oh}),REJECTION_EVENT:Oh,SUBCLASSING:Ah},M={},Nh=as,R=(M.f=function(e){return new rh(e)},y),Sh=C,Rh=i,Ch=r,t=gs,b=Uc,N=Ip,m=of,Mh=as,xh=ns,Ph=is,kh=sf,Uh=lf,Lh=O.set,Dh=I,Fh=function(e,t){var r=mh.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},jh=eh,Vh=e,O=z,I=x,e=M,Hh="Promise",Bh=Ia.CONSTRUCTOR,zh=Ia.REJECTION_EVENT,P=Ia.SUBCLASSING,Gh=O.getterFor(Hh),Kh=O.set,O=I&&I.prototype,Jh=I,Yh=O,qh=Rh.TypeError,Wh=Rh.document,$h=Rh.process,Xh=e.f,Zh=Xh,Qh=!!(Wh&&Wh.createEvent&&Rh.dispatchEvent),ed="unhandledrejection",td="rejectionhandled",rd=1,nd=2,id=1,od=2,sd=function(e){var t;return!(!Ph(e)||!xh(t=e.then))&&t},ad=function(r,i){r.notified||(r.notified=!0,Dh(function(){for(var e,n,t=r.reactions;e=t.get();)nh(e,r);r.notified=!1,i&&!r.rejection&&(n=r,Ch(Lh,Rh,function(){var e=n.facade,t=n.value,r=cd(n);if(r&&(r=jh(function(){Sh?$h.emit("unhandledRejection",t,e):ud(ed,e,t)}),n.rejection=Sh||cd(n)?od:id,r.error))throw r.value}))}))},ud=function(e,t,r){var n;Qh?((n=Wh.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Rh.dispatchEvent(n)):n={promise:t,reason:r},!zh&&(t=Rh["on"+e])?t(n):e===ed&&Fh("Unhandled promise rejection",r)},cd=function(e){return e.rejection!==id&&!e.parent},ld=function(t,r,n){return function(e){t(r,e,n)}},pd=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=nd,ad(e,!0))},fd=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw qh("Promise can't be resolved itself");var n=sd(e);n?Dh(function(){var t={done:!1};try{Ch(n,e,ld(fd,t,r),ld(pd,t,r))}catch(e){pd(t,e,r)}}):(r.value=e,r.state=rd,ad(r,!1))}catch(e){pd({done:!1},e,r)}}};if(Bh&&(Yh=(Jh=function(e){kh(this,Yh),Mh(e),Ch(ph,this);var t=Gh(this);try{e(ld(fd,t),ld(pd,t))}catch(e){pd(t,e)}}).prototype,(ph=function(e){Kh(this,{type:Hh,done:!1,notified:!1,parent:!1,reactions:new Vh,rejection:!1,state:0,value:void 0})}).prototype=t(Yh,"then",function(e,t){var r=Gh(this),n=Xh(Uh(this,Jh));return r.parent=!0,n.ok=!xh(e)||e,n.fail=xh(t)&&t,n.domain=Sh?$h.domain:void 0,0==r.state?r.reactions.add(n):Dh(function(){nh(n,r)}),n.promise}),fh=function(){var e=new ph,t=Gh(e);this.promise=e,this.resolve=ld(fd,t),this.reject=ld(pd,t)},e.f=Xh=function(e){return e===Jh||void 0===e?new fh:Zh(e)},xh(I)&&O!==Object.prototype)){hh=O.then,P||t(O,"then",function(e,t){var r=this;return new Jh(function(e,t){Ch(hh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}b&&b(O,Yh)}R({global:!0,constructor:!0,wrap:!0,forced:Bh},{Promise:Jh}),N(Jh,Hh,!1),m(Hh);var hd=fs("iterator"),dd=!1;try{var vd=0,yd={next:function(){return{done:!!vd++}},return:function(){dd=!0}};yd[hd]=function(){return this},Array.from(yd,function(){throw 2})}catch(e){}function gd(e,t){if(!t&&!dd)return!1;var r=!1;try{var n={};n[hd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var md=x,e=gd,I=Ia.CONSTRUCTOR||!e(function(e){md.all(e).then(void 0,function(){})}),Ed=r,wd=as,bd=M,Td=eh,_d=Xc,P=(y({target:"Promise",stat:!0,forced:I},{all:function(e){var a=this,t=bd.f(a),u=t.resolve,c=t.reject,r=Td(function(){var n=wd(a.resolve),i=[],o=0,s=1;_d(e,function(e){var t=o++,r=!1;s++,Ed(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}}),y),t=x,b=os,O=ns,R=gs,Bh=t&&t.prototype;P({target:"Promise",proto:!0,forced:Ia.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),O(t)&&(N=b("Promise").prototype.catch,Bh.catch!==N&&R(Bh,"catch",N,{unsafe:!0}));var Id=r,Ad=as,Od=M,Nd=eh,Sd=Xc;y({target:"Promise",stat:!0,forced:I},{race:function(e){var r=this,n=Od.f(r),i=n.reject,t=Nd(function(){var t=Ad(r.resolve);Sd(e,function(e){Id(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function Rd(e,t){return xd(e),Pd(t)&&t.constructor===e?t:((0,(e=kd.f(e)).resolve)(t),e.promise)}var Cd=r,Md=M,xd=(y({target:"Promise",stat:!0,forced:Ia.CONSTRUCTOR},{reject:function(e){var t=Md.f(this);return Cd(t.reject,void 0,e),t.promise}}),vs),Pd=is,kd=M,m=y,yd=os,e=Ia.CONSTRUCTOR,Ud=Rd;yd("Promise"),m({target:"Promise",stat:!0,forced:e},{resolve:function(e){return Ud(this,e)}});var Ld=r,Dd=as,Fd=M,jd=eh,Vd=Xc;y({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=Fd.f(a),u=t.resolve,r=t.reject,n=jd(function(){var n=Dd(a.resolve),i=[],o=0,s=1;Vd(e,function(e){var t=o++,r=!1;s++,Ld(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 Hd(i){return function(e,t){var r,e=tv(rv(e)),t=ev(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=iv(e,t))<55296||56319<r||t+1===n||(n=iv(e,t+1))<56320||57343<n?i?nv(e,t):r:i?ov(e,t,t+2):n-56320+(r-55296<<10)+65536}}var Bd=r,zd=as,Gd=os,Kd=M,Jd=eh,Yd=Xc,qd="No one promise resolved",P=(y({target:"Promise",stat:!0},{any:function(e){var u=this,c=Gd("AggregateError"),t=Kd.f(u),l=t.resolve,p=t.reject,r=Jd(function(){var n=zd(u.resolve),i=[],o=0,s=1,a=!1;Yd(e,function(e){var t=o++,r=!1;s++,Bd(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,qd)))})}),--s||p(new c(i,qd))});return r.error&&p(r.value),t.promise}}),y),O=x,t=Zo,Wd=os,$d=ns,Xd=lf,Zd=Rd,b=gs,Qd=O&&O.prototype,Bh=(P({target:"Promise",proto:!0,real:!0,forced:!!O&&t(function(){Qd.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=Xd(this,Wd("Promise")),e=$d(t);return this.then(e?function(e){return Zd(r,t()).then(function(){return e})}:t,e?function(e){return Zd(r,t()).then(function(){throw e})}:t)}}),$d(O)&&(R=Wd("Promise").prototype.finally,Qd.finally!==R&&b(Qd,"finally",R,{unsafe:!0})),g),ev=ms,tv=Zc,rv=ts,nv=Bh("".charAt),iv=Bh("".charCodeAt),ov=Bh("".slice),sv={codeAt:Hd(!1),charAt:Hd(!0)}.charAt,av=Zc,N=z,I=Np,uv="String Iterator",cv=N.set,lv=N.getterFor(uv);I(String,"String",function(e){cv(this,{type:uv,string:av(e),index:0})},function(){var e=lv(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=sv(t,r),e.index+=t.length,{value:t,done:!1})});function pv(t,e){if(t){if(t[gv]!==Ev)try{yv(t,gv,Ev)}catch(e){t[gv]=Ev}if(t[mv]||yv(t,mv,e),dv[e])for(var r in vv)if(t[r]!==vv[r])try{yv(t,r,vv[r])}catch(e){t[r]=vv[r]}}}var fv,Ia=i,yd=Ia.Promise,m=ds("span").classList,e=m&&m.constructor&&m.constructor.prototype,x=e===Object.prototype?void 0:e,hv=i,dv={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},P=x,vv=lp,yv=T,t=fs,gv=t("iterator"),mv=t("toStringTag"),Ev=vv.values;for(fv in dv)pv(hv[fv]&&hv[fv].prototype,fv);pv(P,"DOMTokenList");var O,b,R=b=O=yd,Bh,wv=M,bv=eh,Tv=((Bh=y)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=wv.f(this),e=bv(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),vs),_v=Wc,Iv=hs,Av=Ta,Ov=Qo,N,Nv=Kc,Sv=r,Rv=ls,Cv=function(t,e,r,n){try{return n?e(Tv(r)[0],r[1]):e(r)}catch(e){_v(t,"throw",e)}},Mv=Jc,xv=S,Pv=v,kv=N=function(e,t,r){t=Iv(t);t in e?Av.f(e,t,Ov(0,r)):e[t]=r},Uv=qc,Lv=Yc,Dv=Array,I,m=function(e){var t,r,n,i,o,s,a=Rv(e),e=xv(this),u=arguments.length,c=1<u?arguments[1]:void 0,l=void 0!==c,u=(l&&(c=Nv(c,2<u?arguments[2]:void 0)),Lv(a)),p=0;if(!u||this===Dv&&Mv(u))for(t=Pv(a),r=e?new this(t):Dv(t);p<t;p++)s=l?c(a[p],p):a[p],kv(r,p,s);else for(o=(i=Uv(a,u)).next,r=e?new this:[];!(n=Sv(o,i)).done;p++)s=l?Cv(i,c,[n.value,p],!0):n.value,kv(r,p,s);return r.length=p,r},e,x,Fv=((I=y)({target:"Array",stat:!0,forced:x=!(e=gd)(function(e){Array.from(e)})},{from:m}),es),lp=Array.isArray||function(e){return"Array"==Fv(e)},T,t,P=((T=y)({target:"Array",stat:!0},{isArray:t=lp}),y),yd=Zo,jv=S,Vv=N,Hv=Array,O=yd(function(){function e(){}return!(Hv.of.call(e)instanceof e)}),Bv=(P({target:"Array",stat:!0,forced:O},{of:function(){for(var e=0,t=arguments.length,r=new(jv(this)?this:Hv)(t);e<t;)Vv(r,e,arguments[e++]);return r.length=t,r}}),ls),zv=v,Gv=ms,b=el,Kv=(y({target:"Array",proto:!0},{at:function(e){var t=Bv(this),r=zv(t),e=Gv(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),b("at"),TypeError),R=function(e){if(9007199254740991<e)throw Kv("Maximum allowed index exceeded");return e},Jv=lp,Yv=S,qv=is,Wv=fs("species"),$v=Array,Xv=function(e){var t;return Jv(e)&&(t=e.constructor,(Yv(t)&&(t===$v||Jv(t.prototype))||qv(t)&&null===(t=t[Wv]))&&(t=void 0)),void 0===t?$v:t},M=function(e,t){return new(Xv(e))(0===t?0:t)},Zv=Zo,Qv=qs,ey=fs("species"),Bh,e=y,I=Zo,ty=lp,ry=is,ny=ls,iy=v,oy=R,sy=N,ay=M,x=Bh=function(t){return 51<=Qv||!Zv(function(){var e=[];return(e.constructor={})[ey]=function(){return{foo:1}},1!==e[t](Boolean).foo})},m=qs,uy=fs("isConcatSpreadable"),T=51<=m||!I(function(){var e=[];return e[uy]=!1,e.concat()[0]!==e}),t=x("concat"),cy=(e({target:"Array",proto:!0,arity:1,forced:!T||!t},{concat:function(e){for(var t,r,n,i=ny(this),o=ay(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!ry(e))return!1;var t=e[uy];return void 0!==t?!!t:ty(e)}(n=-1===a?i:arguments[a]))for(r=iy(n),oy(s+r),t=0;t<r;t++,s++)t in n&&sy(o,s,n[t]);else oy(s+1),sy(o,s++,n);return o.length=s,o}}),ss),ly=TypeError,yd,py=ls,fy=Es,hy=v,dy=yd=function(e,t){if(!delete e[t])throw ly("Cannot delete property "+cy(t)+" of "+cy(e))},vy=Math.min,P=el,yy=(y({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=py(this),n=hy(r),i=fy(e,n),o=fy(t,n),e=2<arguments.length?arguments[2]:void 0,s=vy((void 0===e?n:fy(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]:dy(r,i),i+=a,o+=a;return r}}),P("copyWithin"),Kc),gy=E,my=ls,Ey=v,wy=M,by=g([].push),O,b={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=my(e),a=gy(s),u=yy(t,r),c=Ey(a),l=0,t=n||wy,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:by(p,i)}else switch(f){case 4:return!1;case 7:by(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)},Ty=Zo,m=function(e,t){var r=[][e];return!!r&&Ty(function(){r.call(null,t||function(){return 1},1)})},I=y,_y=b.every,Iy=(I({target:"Array",proto:!0,forced:!m("every")},{every:function(e){return _y(this,e,1<arguments.length?arguments[1]:void 0)}}),ls),Ay=Es,Oy=v,x=el,e=(y({target:"Array",proto:!0},{fill:function(e){for(var t=Iy(this),r=Oy(t),n=arguments.length,i=Ay(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:Ay(n,r);i<o;)t[i++]=e;return t}}),x("fill"),y),Ny=b.filter,T=(e({target:"Array",proto:!0,forced:!Bh("filter")},{filter:function(e){return Ny(this,e,1<arguments.length?arguments[1]:void 0)}}),y),Sy=b.find,t=el,P,Ry=!0,O=((P="find")in[]&&Array(1)[P](function(){Ry=!1}),T({target:"Array",proto:!0,forced:Ry},{find:function(e){return Sy(this,e,1<arguments.length?arguments[1]:void 0)}}),t(P),y),Cy=b.findIndex,I=el,x,My=!0,xy=((x="findIndex")in[]&&Array(1)[x](function(){My=!1}),O({target:"Array",proto:!0,forced:My},{findIndex:function(e){return Cy(this,e,1<arguments.length?arguments[1]:void 0)}}),I(x),Kc),Py=E,ky=ls,Uy=v,e,T={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=ky(e),o=Py(i),s=xy(t,r),a=Uy(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=y,Ly=T.findLast,P=el,O=(t({target:"Array",proto:!0},{findLast:function(e){return Ly(this,e,1<arguments.length?arguments[1]:void 0)}}),P("findLast"),y),Dy=T.findLastIndex,I=el,Fy=(O({target:"Array",proto:!0},{findLastIndex:function(e){return Dy(this,e,1<arguments.length?arguments[1]:void 0)}}),I("findLastIndex"),lp),jy=v,Vy=R,Hy=Kc,By=function(e,t,r,n,i,o,s,a){for(var u,c,l=i,p=0,f=!!s&&Hy(s,a);p<n;)p in r&&(u=f?f(r[p],p,t):r[p],0<o&&Fy(u)?(c=jy(u),l=By(e,t,u,c,l,o-1)-1):(Vy(l+1),e[l]=u),l++),p++;return l},x,zy=x=By,Gy=ls,Ky=v,Jy=ms,Yy=M;y({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Gy(this),r=Ky(t),n=Yy(t,0);return n.length=zy(n,t,t,r,0,void 0===e?1:Jy(e)),n}});function qy(c){return function(e,t,r,n){wg(t);var i=bg(e),o=Tg(i),s=_g(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 Ig("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 Wy(e,t,r){for(var n=Bg(e),i=Hg(t,n),o=Hg(void 0===r?n:r,n),s=Gg(Kg(o-i,0)),a=0;i<o;i++,a++)zg(s,a,e[i]);return s.length=a,s}function $y(e,t){var r=e.length,n=Yg(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=$y(Jg(e,0,n),t),f=$y(Jg(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 Xy=x,Zy=as,Qy=ls,eg=v,tg=M,rg=(y({target:"Array",proto:!0},{flatMap:function(e){var t,r=Qy(this),n=eg(r);return Zy(e),(t=tg(r,0)).length=Xy(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),b.forEach),e=m("forEach")?[].forEach:function(e){return rg(this,e,1<arguments.length?arguments[1]:void 0)},t=(y({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),y),ng=Eu.includes,P=el,T=(t({target:"Array",proto:!0,forced:Zo(function(){return!Array(1).includes()})},{includes:function(e){return ng(this,e,1<arguments.length?arguments[1]:void 0)}}),P("includes"),y),O=g,ig=Eu.indexOf,I=m,og=O([].indexOf),sg=!!og&&1/og([1],1,-0)<0,x=I("indexOf"),e=(T({target:"Array",proto:!0,forced:sg||!x},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return sg?og(this,e,t)||0:ig(this,e,t)}}),y),t=E,ag=rs,P=m,ug=g([].join),Eu=t!=Object,O=P("join",","),cg=(e({target:"Array",proto:!0,forced:Eu||!O},{join:function(e){return ug(ag(this),void 0===e?",":e)}}),_p),lg=rs,pg=ms,fg=v,I=m,hg=Math.min,dg=[].lastIndexOf,vg=!!dg&&1/[1].lastIndexOf(1,-0)<0,T=I("lastIndexOf"),x=vg||!T?function(e){if(vg)return cg(dg,this,arguments)||0;var t=lg(this),r=fg(t),n=r-1;for((n=1<arguments.length?hg(n,pg(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:dg,t=(y({target:"Array",proto:!0,forced:x!==[].lastIndexOf},{lastIndexOf:x}),y),yg=b.map,P=(t({target:"Array",proto:!0,forced:!Bh("map")},{map:function(e){return yg(this,e,1<arguments.length?arguments[1]:void 0)}}),y),gg=ls,mg=v,Eg=R,e=Zo(function(){return 4294967297!==[].push.call({length:4294967296},1)}),Eu=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),wg=(P({target:"Array",proto:!0,arity:1,forced:e||Eu},{push:function(e){var t=gg(this),r=mg(t),n=arguments.length;Eg(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),as),bg=ls,Tg=E,_g=v,Ig=TypeError,O={left:qy(!1),right:qy(!0)},_p=y,Ag=O.left,I=qs,T=C,x=(_p({target:"Array",proto:!0,forced:!m("reduce")||!T&&79<I&&I<83},{reduce:function(e){var t=arguments.length;return Ag(this,e,t,1<t?arguments[1]:void 0)}}),y),Og=O.right,t=qs,P=C,e=(x({target:"Array",proto:!0,forced:!m("reduceRight")||!P&&79<t&&t<83},{reduceRight:function(e){return Og(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),y),Ng=lp,Sg=g([].reverse),Eu=[1,2],_p=(e({target:"Array",proto:!0,forced:String(Eu)===String(Eu.reverse())},{reverse:function(){return Ng(this)&&(this.length=this.length),Sg(this)}}),y),Rg=lp,Cg=S,Mg=is,xg=Es,Pg=v,kg=rs,Ug=N,T=fs,Lg=ma,I=Bh("slice"),Dg=T("species"),Fg=Array,jg=Math.max,O=(_p({target:"Array",proto:!0,forced:!I},{slice:function(e,t){var r,n,i,o=kg(this),s=Pg(o),a=xg(e,s),u=xg(void 0===t?s:t,s);if(Rg(o)&&(r=o.constructor,(r=Cg(r)&&(r===Fg||Rg(r.prototype))||Mg(r)&&null===(r=r[Dg])?void 0:r)===Fg||void 0===r))return Lg(o,a,u);for(n=new(void 0===r?Fg:r)(jg(u-a,0)),i=0;a<u;a++,i++)a in o&&Ug(n,i,o[a]);return n.length=i,n}}),y),Vg=b.some,Hg=(O({target:"Array",proto:!0,forced:!m("some")},{some:function(e){return Vg(this,e,1<arguments.length?arguments[1]:void 0)}}),Es),Bg=v,zg=N,Gg=Array,Kg=Math.max,Jg=Wy,Yg=Math.floor,C=$y,x=Ys.match(/firefox\/(\d+)/i),P=!!x&&+x[1],t=/MSIE|Trident/.test(Ys),e=Ys.match(/AppleWebKit\/(\d+)\./),Eu=!!e&&+e[1],ma=y,T=g,qg=as,Wg=ls,$g=v,Xg=yd,Zg=Zc,_p=Zo,Qg=C,I=m,em=P,tm=t,rm=qs,nm=Eu,im=[],om=T(im.sort),sm=T(im.push),O=_p(function(){im.sort(void 0)}),x=_p(function(){im.sort(null)}),Ys=I("sort"),am=!_p(function(){if(rm)return rm<70;if(!(em&&3<em)){if(tm)return!0;if(nm)return nm<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++)im.push({k:e+r,v:t})}for(im.sort(function(e,t){return t.v-e.v}),r=0;r<im.length;r++)e=im[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});ma({target:"Array",proto:!0,forced:O||!x||!Ys||!am},{sort:function(e){void 0!==e&&qg(e);var t=Wg(this);if(am)return void 0===e?om(t):om(t,e);for(var r,n,i=[],o=$g(t),s=0;s<o;s++)s in t&&sm(i,t[s]);for(Qg(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:Zg(e)>Zg(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)Xg(t,s++);return t}});of("Array");var e=y,um=ls,cm=Es,lm=ms,pm=v,fm=R,hm=M,dm=N,vm=yd,C=Bh("splice"),ym=Math.max,gm=Math.min;e({target:"Array",proto:!0,forced:!C},{splice:function(e,t){var r,n,i,o,s,a,u=um(this),c=pm(u),l=cm(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-l):(r=e-2,gm(ym(lm(t),0),c-l)),fm(c+r-n),i=hm(u,n),o=0;o<n;o++)(s=l+o)in u&&dm(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]:vm(u,a);for(o=c;c-n+r<o;o--)vm(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]:vm(u,a);for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}}),el("flat");el("flatMap");var P=y,mm=ls,Em=v,wm=yd,bm=R,t=1!==[].unshift(0),qs=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();P({target:"Array",proto:!0,arity:1,forced:t||qs},{unshift:function(e){var t=mm(this),r=Em(t),n=arguments.length;if(n){bm(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:wm(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});Ia.Array;var Eu={exports:{}},T={},Tm=es,_m=rs,Im=Ws.f,Am=Wy,Om="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];T.f=function(e){if(!Om||"Window"!=Tm(e))return Im(_m(e));try{return Im(e)}catch(e){return Am(Om)}};function Nm(e){jm(e,Km,{value:{objectID:"O"+Jm++,weakData:{}}})}function Sm(e,t,r){for(var n in t)pE(e,n,t[n],r);return e}function Rm(e,t){for(var r=0,n=IE(t),i=new e(n);r<n;)i[r]=t[r++];return i}function Cm(e,t,r,n){for(var i,o,s,a=NE(e),u=OE(a),c=AE(t,r),l=CE(null),p=RE(u),f=0;f<p;f++)s=u[f],(o=SE(c(s,f,a)))in l?PE(l[o],s):l[o]=[s];if(n&&(i=n(a))!==xE)for(o in l)l[o]=ME(i,l[o]);return l}var I=Zo(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),_p=Zo,Mm=is,xm=es,Pm=I,km=Object.isExtensible,ma=_p(function(){km(1)})||Pm?function(e){return!!Mm(e)&&((!Pm||"ArrayBuffer"!=xm(e))&&(!km||km(e)))}:km,O=!Zo(function(){return Object.isExtensible(Object.preventExtensions({}))}),Um=y,Lm=g,x=fu,Dm=is,Fm=_,jm=Ta.f,Vm=Ws,Hm=T,Bm=ma,zm=O,Gm=!1,Km=ps("meta"),Jm=0,Ym=Eu.exports={enable:function(){Ym.enable=function(){},Gm=!0;var i=Vm.f,o=Lm([].splice),e={};e[Km]=1,i(e).length&&(Vm.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===Km){o(t,r,1);break}return t},Um({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Hm.f}))},fastKey:function(e,t){if(!Dm(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Fm(e,Km)){if(!Bm(e))return"F";if(!t)return"E";Nm(e)}return e[Km].objectID},getWeakData:function(e,t){if(!Fm(e,Km)){if(!Bm(e))return!0;if(!t)return!1;Nm(e)}return e[Km].weakData},onFreeze:function(e){return zm&&Gm&&Bm(e)&&!Fm(e,Km)&&Nm(e),e}},qm=(x[Km]=!0,ns),Wm=is,$m=Uc,Xm=y,Zm=i,Qm=g,eE=mu,tE=gs,rE=Eu.exports,nE=Xc,iE=sf,oE=ns,sE=is,aE=Zo,uE=gd,cE=Ip,lE=function(e,t,r){return $m&&qm(t=t.constructor)&&t!==r&&Wm(t=t.prototype)&&t!==r.prototype&&$m(e,t),e},pE=gs,fE=Ta.f,hE=Lc,dE=Sm,vE=Kc,yE=sf,gE=Xc,mE=Np,EE=of,wE=Q,bE=Eu.exports.fastKey,TE=z.set,_E=z.getterFor,IE=(function(e,t,r){function n(e){var r=Qm(h[e]);tE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(l&&!sE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return l&&!sE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(l&&!sE(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=Zm[e],h=f&&f.prototype,d=f,v={};return eE(e,!oE(f)||!(l||h.forEach&&!aE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,p),rE.enable()):eE(e,!0)&&(o=(i=new d)[p](l?{}:-0,1)!=i,s=aE(function(){i.has(1)}),a=uE(function(e){new f(e)}),u=!l&&aE(function(){for(var e=new f,t=5;t--;)e[p](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){iE(e,h);e=lE(new f,e,d);return null!=t&&nE(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,Xm({global:!0,constructor:!0,forced:d!=f},v),cE(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=bE(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),wE?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=bE(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){yE(e,a),TE(e,{type:r,index:hE(null),first:void 0,last:void 0,size:0}),wE||(e.size=0),null!=t&&gE(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=_E(r);return dE(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,wE?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),wE?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=vE(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)}}),dE(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)}}),wE&&fE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=_E(t),o=_E(n);mE(e,t,function(e,t){TE(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),EE(t)}}),v),AE=Kc,OE=E,NE=ls,SE=hs,RE=v,CE=Lc,ME=Rm,xE=Array,PE=g([].push),kE=Cm,Ys=el;y({target:"Array",proto:!0},{group:function(e){return kE(this,e,1<arguments.length?arguments[1]:void 0)}}),Ys("group");var UE=Cm,N=el;y({target:"Array",proto:!0,forced:!m("groupBy")},{groupBy:function(e){return UE(this,e,1<arguments.length?arguments[1]:void 0)}}),N("groupBy");function LE(e){for(var t,r,n=jE(this),i=FE(n),o=DE(e,1<arguments.length?arguments[1]:void 0),s=new HE,a=VE(i),u=0;u<a;u++)t=o(r=i[u],u,n),zE(s,t)?KE(BE(s,t),r):GE(s,t,[r]);return s}var DE=Kc,Bh=g,FE=E,jE=ls,VE=v,HE=os("Map"),e=HE.prototype,BE=Bh(e.get),zE=Bh(e.has),GE=Bh(e.set),KE=Bh([].push),C=el,yd=LE;y({target:"Array",proto:!0,name:"groupToMap",forced:!m("groupByToMap")},{groupByToMap:yd}),C("groupByToMap");function JE(e){return XE[e].prototype}var P=el,YE=(y({target:"Array",proto:!0},{groupToMap:LE}),P("groupToMap"),v),qE=function(e,t){for(var r=YE(e),n=new t(r),i=0;i<r;i++)n[i]=e[r-i-1];return n},WE=rs,t=el,$E=Array,XE=(y({target:"Array",proto:!0},{toReversed:function(){return qE(WE(this),$E)}}),t("toReversed"),i),qs=y,ZE=as,QE=rs,ew=Rm,Ia=el,tw=Array,rw=g(JE("Array").sort),I=(qs({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&ZE(e);var t=QE(this),t=ew(tw,t);return rw(t,e)}}),Ia("toSorted"),y),_p=el,nw=R,iw=v,ow=Es,sw=rs,aw=ms,uw=Array,cw=Math.max,lw=Math.min,pw=(I({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=sw(this),a=iw(s),u=ow(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,lw(cw(aw(t),0),a-u)),i=nw(a+r-n),o=uw(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}}),_p("toSpliced"),v),fw=ms,hw=RangeError,dw=function(e,t,r,n){var i=pw(e),r=fw(r),o=r<0?i+r:r;if(i<=o||o<0)throw hw("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},vw=rs,yw=Array;y({target:"Array",proto:!0},{with:function(e,t){return dw(vw(this),yw,e,t)}});fu=i,_=fa,Ws=ns,T=A,ma=gs,O="USE_FUNCTION_CONSTRUCTOR",x=fs("asyncIterator"),Uc=fu.AsyncIterator,mu=_.AsyncIteratorPrototype;if(mu)Lb=mu;else if(Ws(Uc))Lb=Uc.prototype;else if(_[O]||fu[O])try{Nb=T(T(T(Function("return async function*(){}()")()))),T(Nb)===Object.prototype&&(Lb=Nb)}catch(e){}Ws((Lb=Lb||{})[x])||ma(Lb,x,function(){return this});function gw(e,t,r){var n=e.done;Aw.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function mw(e){Nw(this,{type:Ow,iterator:_w(e),next:e.next})}function Ew(e){var f=0==e,h=1==e,d=2==e,v=3==e;return function(e,s,a){var e=Kw(e),u=Gw("Promise"),c=e.iterator,t=e.next,l=0,p=void 0!==s;return!p&&f||Hw(s),new u(function(r,n){var i=function(e){Jw(c,n,e,n)},o=function(){try{if(f&&p)try{zw(l)}catch(e){i(e)}u.resolve(Bw(Vw(t,c))).then(function(e){try{if(Bw(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():Jw(c,r,!1,n);else if(f)try{a[l++]=e,o()}catch(e){i(e)}else e?Jw(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 ww(e,t){if(!u0||!a0(e)||!u0(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 bw(e,t,r){return r.get&&c0(r.get,t,{getter:!0}),r.set&&c0(r.set,t,{setter:!0}),l0.f(e,t,r)}var Tw=r,_w=vs,Eu=Lc,Iw=us,Ys=Sm,N=z,E=Lb,Aw=os("Promise"),Ow="AsyncFromSyncIterator",Nw=N.set,Sw=N.getterFor(Ow),e=(mw.prototype=Ys(Eu(E),{next:function(){var n=Sw(this);return new Aw(function(e,t){var r=_w(Tw(n.next,n.iterator));gw(r,e,t)})},return:function(){var n=Sw(this).iterator;return new Aw(function(e,t){var r=Iw(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=_w(Tw(r,n));gw(r,e,t)})}}),mw),Rw=r,Cw=e,Mw=vs,xw=qc,Pw=us,kw=fs("asyncIterator"),Uw=as,Lw=vs,Dw=r,Fw=os,jw=us,Vw=r,Hw=as,Bw=vs,zw=R,Gw=os,Kw=function(e){return{iterator:e,next:Uw(Lw(e).next)}},Jw=function(e,t,r,n){try{var i=jw(e,"return");if(i)return Fw("Promise").resolve(Dw(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},Bh={toArray:Ew(0),forEach:Ew(1),every:Ew(2),some:Ew(3),find:Ew(4)},Yw=Kc,qw=ls,Ww=S,$w=function(e,t){t=arguments.length<2?Pw(e,kw):t;return t?Mw(Rw(t,e)):new Cw(xw(e))},Xw=qc,Zw=Yc,Qw=us,m=JE,e0=os,yd=fs,t0=e,r0=Bh.toArray,n0=yd("asyncIterator"),i0=m("Array").values,C=(y({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(e0("Promise"))(function(e){var t=qw(o),r=(void 0!==a&&(a=Yw(a,u)),Qw(t,n0)),n=r?void 0:Zw(t)||i0,i=Ww(s)?new s:[],r=r?$w(t,r):new t0(Xw(t,n));e(r0(r,a,i))})}}),y),o0=b.filterReject,P=el,t=(C({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return o0(this,e,1<arguments.length?arguments[1]:void 0)}}),P("filterOut"),y),s0=b.filterReject,qs=el,Ia=(t({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return s0(this,e,1<arguments.length?arguments[1]:void 0)}}),qs("filterReject"),y),a0=lp,u0=Object.isFrozen,c0=(Ia({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!ww(e,!0))return!1;var t=e.raw;return t.length===e.length&&ww(t,!1)}}),w.exports),l0=Ta,I=el,p0=ls,f0=v;Q&&(bw(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=p0(this),t=f0(e);return 0==t?void 0:e[t-1]},set:function(e){var t=p0(this),r=f0(t);return t[0==r?0:r-1]=e}}),I("lastItem"));var _p=el,h0=ls,d0=v;Q&&(bw(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=h0(this),e=d0(e);return 0==e?0:e-1}}),_p("lastIndex"));var i=g,v0=as,y0=v,g0=ls,m0=M,E0=os("Map"),fa=E0.prototype,w0=i(fa.forEach),b0=i(fa.has),T0=i(fa.set),_0=i([].push),A=el;y({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=g0(this),i=y0(n),o=m0(n,0),s=new E0,a=null!=e?v0(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),b0(s,r)||T0(s,r,t);return w0(s,function(e){_0(o,e)}),o}}),A("uniqueBy");A0.exposure=function(e,t,r,n){return new N0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},A0.track=function(e,t,r,n){return new C0(n,r,e,t)},A0.remoteConfig=function(e,t,r,n){return new P0(n,e,t.parameter,t.valueId,t.reason,r)},A0.isExposureEvent=function(e){return void 0!==e.experiment},A0.isTrackEvent=function(e){return void 0!==e.eventType},A0.isRemoteConfigEvent=function(e){return void 0!==e.parameter},A0.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},A0.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},A0.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},A0.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[Vt.ID],identifiers:this.user.identifiers,userProperties:ke.sanitize(this.user.properties),hackleProperties:ke.sanitize(this.user.hackleProperties)}};var I0=A0;function A0(e,t,r){void 0===r&&(r=B()),this.timestamp=e,this.user=t,this.insertId=r}Se(S0,O0=I0),S0.prototype.copyWithUser=function(e){return new S0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},S0.prototype.toDto=function(){return c(c({},O0.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 O0,N0=S0;function S0(e,t,r,n,i,o,s,a){e=O0.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}Se(M0,R0=I0),M0.prototype.copyWithUser=function(e){return new M0(this.timestamp,e,this.eventType,this.event,this.insertId)},M0.prototype.toDto=function(){return c(c({},R0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:ke.sanitize(this.event.properties)})};var R0,C0=M0;function M0(e,t,r,n,i){e=R0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}Se(k0,x0=I0),k0.prototype.copyWithUser=function(e){return new k0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},k0.prototype.toDto=function(){return c(c({},x0.prototype.toDto.call(this)),{parameterId:this.parameter.id,parameterKey:this.parameter.key,parameterType:this.parameter.type,valueId:this.valueId,decisionReason:this.decisionReason.toString(),properties:ke.sanitize(this.properties)})};var x0,P0=k0;function k0(e,t,r,n,i,o,s){e=x0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}L0.isSessionEvent=function(e){return!!I0.isTrackEvent(e)&&(e.event.key===L0.SESSION_START_EVENT_NAME||e.event.key===L0.SESSION_END_EVENT_NAME)},L0.prototype.onSessionStarted=function(e,t,r){this.track(L0.SESSION_START_EVENT_NAME,e,t,r)},L0.prototype.onSessionEnded=function(e,t,r){this.track(L0.SESSION_END_EVENT_NAME,e,t,r)},L0.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)},L0.prototype.decorateSession=function(e,t){t=(new zt).add(Vt.SESSION,t).addIdentifiers(e.identifiers).build();return c(c({},e),{identifiers:t})},L0.SESSION_START_EVENT_NAME="$session_start",L0.SESSION_END_EVENT_NAME="$session_end";var U0=L0;function L0(e,t){this.userManager=e,this.core=t}F0.prototype.process=function(e){var t;U0.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[Vt.SESSION]?e:e.copyWithUser(c(c({},e.user),{identifiers:c(c({},e.user.identifiers),((e={})[Vt.SESSION]=t.sessionId,e))})),this.delegate.process(t))},F0.prototype.flush=function(e){this.delegate.flush(e)},F0.prototype.close=function(){this.delegate.close()},F0.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 D0=F0;function F0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n}V0.toEvent=function(e){var t;return{key:V0.EVENT_KEY,properties:{level:V0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:V0._stacktrace(e)}}},V0._stacktrace=function(e){return u.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,V0.STACK_TRACK_LIMIT).join("\n")},V0.EVENT_KEY="$trace",V0.LEVEL_ERROR="error",V0.STACK_TRACK_LIMIT=30;var j0=V0;function V0(){}H0.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)}};mu=H0;function H0(){}z0.prototype.with=function(e){return new z0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},z0.of=function(e,t,r,n){var i=this.config(e.workspace,r);return new z0(n,t.targetEvaluations,e.experiment,r.id,r.key,i)},z0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return u.isNotNullOrUndefined(n)?this.of(e,t,n,r):new z0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)},z0.config=function(e,t){if(!u.isNullOrUndefined(t.parameterConfigurationId))return u.requiredNotNullOrUndefined(e.getParameterConfigurationOrNull(t.parameterConfigurationId),function(){return"ParameterConfiguration[".concat(t.parameterConfigurationId,"]")})};var B0=z0;function z0(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(J0,G0=mu),J0.prototype.supports=function(e){return void 0!==e.experiment},J0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:B0.ofDefault(e,t,f.TRAFFIC_NOT_ALLOCATED)};var G0,K0=J0;function J0(e){var t=G0.call(this)||this;return t.evaluationFlowFactory=e,t}q0.of=function(e,t,r,n,i,o){return o.returnValue=ke.truncateStringValue(n),new q0(i,t.targetEvaluations,e.parameter,r,n,o)},q0.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var Y0=q0;function q0(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(X0,W0=mu),X0.prototype.supports=function(e){return void 0!==e.parameter},X0.prototype.evaluateInternal=function(e,t){var r={};if(r.requestValueType=e.requiredType,r.requestDefaultValue=ke.truncateStringValue(e.defaultValue),u.isNullOrUndefined(e.user.identifiers[e.parameter.identifierType]))return Y0.ofDefault(e,t,f.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,f.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,f.DEFAULT_RULE,r)},X0.prototype.evaluation=function(e,t,r,n,i){return"UNKNOWN"===e.requiredType||"NULL"!==e.requiredType&&typeof e.defaultValue!=typeof r.rawValue?Y0.ofDefault(e,t,f.TYPE_MISMATCH,i):Y0.of(e,t,r.id,r.rawValue,n,i)};var W0,$0=X0;function X0(e){var t=W0.call(this)||this;return t.targetRuleDeterminer=e,t}Q0.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var Z0=Q0;function Q0(e,t){this.type=e,this.id=t}tb.create=function(){return new tb},Object.defineProperty(tb.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(tb.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(tb.prototype,"properties",{get:function(){return ke.sanitize(this._properties)},enumerable:!1,configurable:!0}),tb.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},tb.prototype.addRequest=function(e){this._stack.push(e)},tb.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},tb.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof B0&&e.experiment.id===t.id})},tb.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},tb.prototype.setProperty=function(e,t){this._properties[e]=t};var eb=tb;function tb(){this._stack=[],this._targetEvaluations=[],this._properties={}}nb.of=function(e,t,r,n){return new nb(e,t,r,n)},nb.by=function(e,t){return new nb(e.workspace,e.user,t,"A")},nb.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var rb=nb;function nb(e,t,r,n){this.key=new Z0("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}ob.of=function(e,t,r,n,i){return new ob(e,t,r,n,i)},ob.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var ib=ob;function ob(e,t,r,n,i){this.key=new Z0("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}ab.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();default:return}},ab.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},ab.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var sb=ab;function ab(){}cb.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 ub=cb;function cb(e){this.storages=e}pb.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},pb.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return sb.asNumber(e)},pb.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=sb.asNumber(t),e=sb.asNumber(e);u.isNullOrUndefined(t)||t<0||u.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},pb.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},pb.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},pb.prototype.clear=function(){this.listStorage.clear()};var lb=pb;function pb(e){this.listStorage=e}hb.prototype.add=function(e){this.evaluators.push(e)},hb.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 fb=hb;function hb(){this.evaluators=new Array}vb.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},vb.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},vb.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var db=vb;function vb(e){this.conditionMatcherFactory=e}gb.prototype.decorate=function(e){return e};var yb=gb;function gb(){}Eb.prototype.decorate=function(e){return"string"==typeof e?Do.decodeURIOrOriginal(e):e};var mb=Eb;function Eb(){}bb.prototype.matches=function(e,t,r){void 0===r&&(r=new yb);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)},bb.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)},bb.prototype.singleMatches=function(t,e,r,n,i){return e.values.some(function(e){return r.matches(n,i.decorate(t),i.decorate(e))})},bb.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},bb.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var wb=bb;function bb(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}Tb.prototype.booleanMatches=function(e,t){return e===t},Tb.prototype.numberMatches=function(e,t){return e===t},Tb.prototype.stringMatches=function(e,t){return e===t},Tb.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},Tb.prototype.urlMatches=function(e,t){return Do.decodeURIOrOriginal(Do.removePathnameTrailingSlash(e))===Do.decodeURIOrOriginal(Do.removePathnameTrailingSlash(t))};Uc=Tb;function Tb(){}_b.prototype.booleanMatches=function(e,t){return!1},_b.prototype.numberMatches=function(e,t){return!1},_b.prototype.stringMatches=function(e,t){return e.includes(t)},_b.prototype.versionMatches=function(e,t){return!1},_b.prototype.urlMatches=function(e,t){e=Do.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))};_=_b;function _b(){}Ib.prototype.booleanMatches=function(e,t){return!1},Ib.prototype.numberMatches=function(e,t){return!1},Ib.prototype.stringMatches=function(e,t){return e.startsWith(t)},Ib.prototype.versionMatches=function(e,t){return!1},Ib.prototype.urlMatches=function(e,t){e=Do.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))};fu=Ib;function Ib(){}Ab.prototype.booleanMatches=function(e,t){return!1},Ab.prototype.numberMatches=function(e,t){return!1},Ab.prototype.stringMatches=function(e,t){return e.endsWith(t)},Ab.prototype.versionMatches=function(e,t){return!1},Ab.prototype.urlMatches=function(e,t){return!1};O=Ab;function Ab(){}Ob.prototype.booleanMatches=function(e,t){return!1},Ob.prototype.numberMatches=function(e,t){return t<e},Ob.prototype.stringMatches=function(e,t){return t<e},Ob.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},Ob.prototype.urlMatches=function(e,t){return!1};T=Ob;function Ob(){}Sb.prototype.booleanMatches=function(e,t){return!1},Sb.prototype.numberMatches=function(e,t){return t<=e},Sb.prototype.stringMatches=function(e,t){return t<=e},Sb.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},Sb.prototype.urlMatches=function(e,t){return!1};var Nb=Sb;function Sb(){}Rb.prototype.booleanMatches=function(e,t){return!1},Rb.prototype.numberMatches=function(e,t){return e<t},Rb.prototype.stringMatches=function(e,t){return e<t},Rb.prototype.versionMatches=function(e,t){return e.isLessThan(t)},Rb.prototype.urlMatches=function(e,t){return!1};Ws=Rb;function Rb(){}Cb.prototype.booleanMatches=function(e,t){return!1},Cb.prototype.numberMatches=function(e,t){return e<=t},Cb.prototype.stringMatches=function(e,t){return e<=t},Cb.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},Cb.prototype.urlMatches=function(e,t){return!1};ma=Cb;function Cb(){}xb.prototype.getMatcher=function(e){switch(e){case"IN":return xb.IN_MATCHER;case"CONTAINS":return xb.CONTAINS_MATCHER;case"STARTS_WITH":return xb.STARTS_WITH_MATCHER;case"ENDS_WITH":return xb.ENDS_WITH_MATCHER;case"GT":return xb.GT_MATCHER;case"GTE":return xb.GTE_MATCHER;case"LT":return xb.LT_MATCHER;case"LTE":return xb.LTE_MATCHER}},xb.IN_MATCHER=new Uc,xb.CONTAINS_MATCHER=new _,xb.STARTS_WITH_MATCHER=new fu,xb.ENDS_WITH_MATCHER=new O,xb.GT_MATCHER=new T,xb.GTE_MATCHER=new Nb,xb.LT_MATCHER=new Ws,xb.LTE_MATCHER=new ma;var Mb=xb;function xb(){}Pb.prototype.matches=function(e,t,r){t=sb.asString(t),r=sb.asString(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.stringMatches(t,r)};x=Pb;function Pb(){}kb.prototype.matches=function(e,t,r){t=sb.asNumber(t),r=sb.asNumber(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.numberMatches(t,r)};Lc=kb;function kb(){}Ub.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)};z=Ub;function Ub(){}Db.prototype.matches=function(e,t,r){t=yr.tryParse(t),r=yr.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)};var Lb=Db;function Db(){}Fb.prototype.matches=function(e,t,r){t=Do.tryParse(t),r=sb.asString(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.urlMatches(t,r)};N=Fb;function Fb(){}jb.prototype.matches=function(e,t,r){return!1};Ys=jb;function jb(){}Hb.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return Hb.STRING_MATCHER;case"NUMBER":return Hb.NUMBER_MATCHER;case"BOOLEAN":return Hb.BOOLEAN_MATCHER;case"VERSION":return Hb.VERSION_MATCHER;case"URL":return Hb.URL_MATCHER;case"NULL":case"UNKNOWN":return Hb.NULL_MATCHER}},Hb.STRING_MATCHER=new x,Hb.NUMBER_MATCHER=new Lc,Hb.BOOLEAN_MATCHER=new z,Hb.VERSION_MATCHER=new Lb,Hb.URL_MATCHER=new N,Hb.NULL_MATCHER=new Ys;var Vb=Hb;function Hb(){}zb.prototype.matches=function(e,t,r){e=this.userValueResolver.resolveOrNull(e.user,r.key);if(u.isNullOrUndefined(e))return!1;var n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},zb.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?mb:yb)};var Bb=zb;function zb(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}Kb.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];case"SEGMENT":case"AB_TEST":case"FEATURE_FLAG":case"EVENT_PROPERTY":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}};var Gb=Kb;function Kb(){}Yb.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}},Yb.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 Jb=Yb;function Yb(e){this.segmentMatcher=e}Wb.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},Wb.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var qb=Wb;function Wb(e){this.userConditionMatcher=e}Xb.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);case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":case"EVENT_PROPERTY":case"SEGMENT":case"COHORT":throw new Error("Unsupported TargetKeyType [".concat(r.key.type,"]"))}};var $b=Xb;function Xb(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}Zb.prototype.matches=function(e,t,r){var n=u.requiredNotNullOrUndefined(sb.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)},Zb.prototype.evaluate=function(e,t,r){r=rb.by(e,r),r=this.evaluator.evaluate(r,t),e=this.resolve(e,r);return t.addEvaluation(e),e};Eu=Zb;function Zb(e,t){this.evaluator=e,this.valueOperatorMatcher=t}Se(tT,Qb=Eu),tT.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},tT.prototype.resolve=function(e,t){return e instanceof rb&&t.reason===f.TRAFFIC_ALLOCATED?t.with(f.TRAFFIC_ALLOCATED_BY_TARGETING):t},tT.prototype.evaluationMatches=function(e,t){return!!tT.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},tT.AB_TEST_MATCHED_REASONS=[f.OVERRIDDEN,f.TRAFFIC_ALLOCATED,f.EXPERIMENT_COMPLETED,f.TRAFFIC_ALLOCATED_BY_TARGETING];var Qb,eT=tT;function tT(e,t){return Qb.call(this,e,t)||this}Se(iT,rT=Eu),iT.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},iT.prototype.resolve=function(e,t){return t},iT.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var rT,nT=iT;function iT(e,t){return rT.call(this,e,t)||this}sT.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return!u.isNullOrUndefined(e)&&this.valueOperatorMatcher.matches(e,r.match)},sT.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var oT=sT;function sT(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}uT.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,"]"))}},uT.prototype.properties=function(e){return I0.isTrackEvent(e)?e.event.properties:I0.isExposureEvent(e)||I0.isRemoteConfigEvent(e)?e.properties:void 0};var aT=uT;function uT(){}lT.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 cT=lT;function lT(e){this.valueOperatorMatcher=e}fT.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}};var pT=fT;function fT(e){var t=new wb(new Vb,new Mb);this.userConditionMatcher=new Bb(new Gb,t),this.eventConditionMatcher=new oT(new aT,t),this.segmentConditionMatcher=new Jb(new qb(this.userConditionMatcher)),this.experimentConditionMatcher=new $b(new eT(e,t),new nT(e,t)),this.cohortConditionMatcher=new cT(t)}dT.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},dT.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},dT.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 hT=dT;function dT(e){this.bucketer=e}var vT={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}},yT=(gT.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},gT.prototype.calculateSlotNumber=function(e,t,r){r=vT.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},gT);function gT(){}ET.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},ET.end=function(){return new ET(void 0,void 0)},ET.decision=function(e,t){return new ET(e,t)},ET.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 mT=ET;function ET(e,t){this.flowEvaluator=e,this.nextFlow=t}bT.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 B0.of(e,t,n,f.OVERRIDDEN);case"FEATURE_FLAG":return B0.of(e,t,n,f.INDIVIDUAL_TARGET_MATCH)}};var wT=bT;function bT(e){this.overrideResolver=e}_T.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?B0.ofDefault(e,t,f.EXPERIMENT_DRAFT):r.evaluate(e,t)};var TT=_T;function _T(){}AT.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return B0.ofDefault(e,t,f.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return B0.ofDefault(e,t,f.FEATURE_FLAG_INACTIVE)}};var IT=AT;function AT(){}NT.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return B0.of(e,t,r,f.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var OT=NT;function NT(){}RT.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):B0.ofDefault(e,t,f.NOT_IN_EXPERIMENT_TARGET)};var ST=RT;function RT(e){this.experimentTargetDeterminer=e}MT.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?B0.ofDefault(e,t,f.VARIATION_DROPPED):B0.of(e,t,n,f.TRAFFIC_ALLOCATED):B0.ofDefault(e,t,f.TRAFFIC_NOT_ALLOCATED)};var CT=MT;function MT(e){this.actionResolver=e}PT.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 B0.of(e,t,r,f.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var xT=PT;function PT(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}UT.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 B0.ofDefault(e,t,f.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return B0.of(e,t,n,f.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var kT=UT;function UT(e){this.actionResolver=e}DT.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):B0.ofDefault(e,t,f.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var LT=DT;function DT(e){this.containerResolver=e}jT.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):B0.ofDefault(e,t,f.IDENTIFIER_NOT_FOUND)};var FT=jT;function jT(){}HT.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 VT=HT;function HT(e){this.targetMatcher=e}zT.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var BT=zT;function zT(e){this.targetMatcher=e}KT.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},KT.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},KT.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)}},KT.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 GT=KT;function KT(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}YT.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 JT=YT;function YT(e){this.bucketer=e}WT.of=function(e,t,r,n){return new WT(r,t.targetEvaluations,e.inAppMessage,n,t.properties)};var qT=WT;function WT(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.message=n,this.properties=i}XT.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):qT.of(e,t,f.UNSUPPORTED_PLATFORM)};var $T=XT;function XT(){}QT.prototype.evaluate=function(e,t,r){var n;return this.userOverrideMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),qT.of(e,t,f.OVERRIDDEN,n)):r.evaluate(e,t)};var ZT=QT;function QT(e,t){this.userOverrideMatcher=e,this.inAppMessageResolver=t}t_.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?qT.of(e,t,f.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var e_=t_;function t_(){}n_.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?qT.of(e,t,f.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var r_=n_;function n_(){}o_.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):qT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_PERIOD)};var i_=o_;function o_(){}a_.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?qT.of(e,t,f.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var s_=a_;function a_(e){this.hiddenMatcher=e}c_.prototype.evaluate=function(e,t,r){var n;return this.targetMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),qT.of(e,t,f.IN_APP_MESSAGE_TARGET,n)):qT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_TARGET)};var u_=c_;function c_(e,t){this.targetMatcher=e,this.inAppMessageResolver=t}p_.prototype.resolve=function(e,t){return null!=(t=this.resolveExperiment(e,t))?t:this.resolveDefault(e)},p_.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=rb.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})},p_.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)},p_.prototype.resolveDefault=function(e){var t=e.inAppMessage.messageContext.defaultLang;return this.resolveMessage(e,function(e){return e.lang===t})},p_.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 l_=p_;function p_(e){this.evaluator=e}h_.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},h_.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!u.isNullOrUndefined(e)&&t.identifiers.includes(e)};var f_=h_;function h_(){}v_.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 d_=v_;function v_(e){this.targetMatcher=e}g_.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var y_=g_;function g_(e){this.storage=e}E_.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},E_.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 m_=E_;function E_(e,t){this.targetMatcher=e,this.bucketer=t}b_.get=function(e){return u.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},b_.getOrNull=function(e){return b_.instances.get(e)},b_.register=function(e,t){return b_.instances.set(e,t),t},b_.instances=new Map;var w_=b_;function b_(){}__.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},__.prototype.getInAppMessageFlow=function(){return this.inAppMessageFlow};var T_=__;function __(e,t,r){var n=new yT,i=w_.register("targetMatcher",new db(new pT(e))),o=new hT(n),t=new GT(t,i,o),s=new JT(n),s=(this.abTestFlow=mT.of(new wT(t),new FT,new LT(s),new ST(new VT(i)),new TT,new IT,new OT,new CT(o)),this.featureFlagFlow=mT.of(new TT,new IT,new OT,new wT(t),new FT,new xT(new BT(i),o),new kT(o)),new l_(e));this.inAppMessageFlow=mT.of(new $T,new ZT(new f_,s),new e_,new r_,new i_,new s_(new y_(r)),new u_(new d_(i),s)),this.remoteConfigParameterTargetRuleDeterminer=new m_(i,n)}A_.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={})[A_.ROOT_TYPE]=r.key.type,t[A_.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},A_.prototype.createEvent=function(e,t,r,n){var i;if(t instanceof B0)return n[A_.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[A_.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[A_.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,I0.exposure(e.user,t,n,r);if(t instanceof Y0)return I0.remoteConfig(e.user,t,c(c({},n),t.properties),r);if(t instanceof qT)return null;throw new Error("Unsupported Evaluation [".concat(typeof t,"]"))},A_.ROOT_TYPE="$targetingRootType",A_.ROOT_ID="$targetingRootId",A_.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",A_.EXPERIMENT_VERSION_KEY="$experiment_version",A_.EXECUTION_VERSION_KEY="$execution_version";var I_=A_;function A_(e){this.clock=e}Se(S_,O_=mu),S_.prototype.supports=function(e){return void 0!==e.inAppMessage},S_.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getInAppMessageFlow().evaluate(e,t))?r:qT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_TARGET)};var O_,N_=S_;function S_(e){var t=O_.call(this)||this;return t.evaluationFlowFactory=e,t}C_.of=function(e,t,r,n){return new C_(e,t,r,n)},C_.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var R_=C_;function C_(e,t,r,n){this.key=new Z0("IN_APP_MESSAGE",r.id),this.workspace=e,this.user=t,this.inAppMessage=r,this.timestamp=n}var M_=s.log,x_=(P_.create=function(e,t,r,n){var i=new fb,r=new ub(r),r=new T_(i,r,n),n=new K0(r),o=new $0(r.remoteConfigParameterTargetRuleDeterminer),r=new N_(r);return i.add(n),i.add(o),new P_(n,o,r,e,new I_(Fe.instance),t,new k_,Fe.instance)},P_.prototype.experiment=function(e,t,r){var n=this;if(!e)return M_.error("experimentKey must not be empty"),Tt.of(r,f.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return M_.warn("SDK not ready."),Tt.of(r,f.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return M_.warn("Experiment does not exist."),Tt.of(r,f.EXPERIMENT_NOT_FOUND);i=rb.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},P_.prototype.experiments=function(r){var n=this,i=new Kn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getExperiments().forEach(function(e){var t=rb.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},P_.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,eb.create()),t=null!=(t=e.config)?t:new Ve;return[e,Tt.of(e.variationKey,e.reason,t,e.experiment)]},P_.prototype.featureFlag=function(e,t){var r=this;if(!e)return M_.error("featureKey must not be empty"),It.off(f.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return M_.warn("SDK not ready."),It.off(f.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return M_.warn("FeatureFlag does not exist."),It.off(f.FEATURE_FLAG_NOT_FOUND);n=rb.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},P_.prototype.featureFlags=function(r){var n=this,i=new Kn(function(e,t){return e.id===t.id}),o=this.workspaceFetcher.get();return o&&o.getFeatureFlags().forEach(function(e){var t=rb.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},P_.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,eb.create()),t=null!=(t=e.config)?t:new Ve;return[e,"A"===e.variationKey?It.off(e.reason,t,e.experiment):It.on(e.reason,t,e.experiment)]},P_.prototype.inAppMessage=function(e,t){var r=this,n=this.workspaceFetcher.get();if(!n)return M_.warn("SDK not ready."),wt.of(f.SDK_NOT_READY);e=n.getInAppMessageOrNull(e);if(!e)return M_.warn("In app message does not exist."),wt.of(f.IN_APP_MESSAGE_NOT_FOUND);n=R_.of(n,t,e,this.clock.currentMillis()),t=this.inAppMessageEvaluator.evaluate(n,eb.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)},P_.prototype.tryInAppMessage=function(t,e){var r,n=Hn.start();try{r=this.inAppMessage(t,e)}catch(e){M_.error("Unexpected error while deciding in app message [".concat(t,"]: ").concat(e)),r=wt.of(f.EXCEPTION)}return Li.inAppMessage(n,t,r),r},P_.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?M_.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(I0.track(n,e,t,r))):M_.warn("Event key must be not null. or event key must be string type."):M_.warn("event must not be null.")},P_.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=j0.toEvent(e),this.flush(),this.track(e,t),this.flush())},P_.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},P_.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(u.isNullOrUndefined(o))return M_.warn("SDK not ready."),mt.of(n,f.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(u.isNullOrUndefined(e))return M_.warn("Remote config parameter does not exist."),mt.of(n,f.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=ib.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,eb.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),mt.of(t.value,t.reason)},P_.prototype.close=function(){this.eventProcessor.close()},P_);function P_(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}U_.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},U_.prototype._isSameError=function(e,t){return!u.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var k_=U_;function U_(){}D_.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},D_.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var L_=D_;function D_(){this._installed=[],this._installations={onerror:V_,onunhandledrejection:H_}}var F_,j_=null;function V_(o,s){j_=window.onerror,window.onerror=function(e,t,r,n,i){u.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),j_&&j_.apply(this,arguments)}}function H_(r,n){F_=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()),F_&&F_.apply(this,arguments)}}z_.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,[]]})})},z_.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])})})},z_.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]}})})},z_.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]}})})},z_.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},z_.prototype.clear=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var B_=z_;function z_(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}var G_=function(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)},K_=(J_.builder=function(){return new Y_},J_.empty=function(){return J_.builder().build()},J_.from=function(e){return new J_(e)},J_.fromDto=function(e){for(var t=J_.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(J_.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),J_.prototype.get=function(e){return this.cohorts.get(e)},J_.prototype.filterBy=function(e){var r=Bt(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return J_.from(e)},J_.prototype.asArray=function(){return this.cohorts.values()},J_.prototype.asComparable=function(){return this.cohorts},J_.prototype.toBuilder=function(){return new Y_(this)},J_);function J_(e){this.cohorts=e}q_.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},q_.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},q_.prototype.build=function(){return new K_(this.cohorts)};var Y_=q_;function q_(e){this.cohorts=new Kn(Me.isEqual),e&&this.putAll(e)}var E="model",r="name",R="type",S="vendor",e="version",Bh="architecture",yd="console",m="mobile",C="tablet",P="smarttv",b="wearable",W_=(k.parse=function(e){return{browser:k.getBrowser(e),cpu:k.getCPU(e),device:k.getDevice(e),engine:k.getEngine(e),os:k.getOS(e)}},k.getBrowser=function(e){var t={name:void 0,version:void 0,major:void 0};return k.mapper.rgx.call(t,e,k.regexes.browser),t.major=k.util.major(t.version),t},k.getCPU=function(e){var t={architecture:void 0};return k.mapper.rgx.call(t,e,k.regexes.cpu),t},k.getDevice=function(e){var t={model:void 0,type:void 0,vendor:void 0};return k.mapper.rgx.call(t,e,k.regexes.device),t},k.getEngine=function(e){var t={name:void 0,version:void 0};return k.mapper.rgx.call(t,e,k.regexes.os),t},k.getOS=function(e){var t={name:void 0,version:void 0};return k.mapper.rgx.call(t,e,k.regexes.os),t},k.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,"")}},k.regexes={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[r,e],[/(opios)[\/\s]+([\w\.]+)/i],[[r,"Opera Mini"],e],[/\s(opr)\/([\w\.]+)/i],[[r,"Opera"],e],[/(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],[r,e],[/(konqueror)\/([\w\.]+)/i],[[r,"Konqueror"],e],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[r,"IE"],e],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[r,"Edge"],e],[/(yabrowser)\/([\w\.]+)/i],[[r,"Yandex"],e],[/(Avast)\/([\w\.]+)/i],[[r,"Avast Secure Browser"],e],[/(AVG)\/([\w\.]+)/i],[[r,"AVG Secure Browser"],e],[/(puffin)\/([\w\.]+)/i],[[r,"Puffin"],e],[/(focus)\/([\w\.]+)/i],[[r,"Firefox Focus"],e],[/(opt)\/([\w\.]+)/i],[[r,"Opera Touch"],e],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[r,"UCBrowser"],e],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],e],[/(windowswechat qbcore)\/([\w\.]+)/i],[[r,"WeChat(Win) Desktop"],e],[/(micromessenger)\/([\w\.]+)/i],[[r,"WeChat"],e],[/(brave)\/([\w\.]+)/i],[[r,"Brave"],e],[/(whale)\/([\w\.]+)/i],[[r,"Whale"],e],[/(qqbrowserlite)\/([\w\.]+)/i],[r,e],[/(QQ)\/([\d\.]+)/i],[r,e],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[r,e],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[r,e],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[r,e],[/(MetaSr)[\/\s]?([\w\.]+)/i],[r],[/(LBBROWSER)/i],[r],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[e,[r,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[e,[r,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[r,e],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[e,[r,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[r,/(.+)/,"$1 WebView"],e],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[r,/(.+(?:g|us))(.+)/,"$1 $2"],e],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[r,"Chrome Mobile"],e],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[e,[r,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[r,"Sailfish Browser"],e],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[r,e],[/(dolfin)\/([\w\.]+)/i],[[r,"Dolphin"],e],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[r,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[r,"Opera Coast"],e],[/fxios\/([\w\.-]+)/i],[e,[r,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[e,[r,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[e,r],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[r,"GSA"],e],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[r,[e,(k.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(k.util.has(t[r][n],e))return"?"===r?void 0:r}else if(k.util.has(t[r],e))return"?"===r?void 0:r;return e}}).str,(k.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],[r,e],[/(navigator|netscape)\/([\w\.-]+)/i],[[r,"Netscape"],e],[/(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],[r,e]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[Bh,"amd64"]],[/(ia32(?=;))/i],[[Bh,k.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[Bh,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[Bh,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[Bh,/ower/,"",k.util.lowerize]],[/(sun4\w)[;\)]/i],[[Bh,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[Bh,k.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[E,S,[R,C]],[/applecoremedia\/[\w\.]+ \((ipad)/],[E,[S,"Apple"],[R,C]],[/(apple\s{0,1}tv)/i],[[E,"Apple TV"],[S,"Apple"],[R,P]],[/(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],[S,E,[R,C]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[E,[S,"Amazon"],[R,C]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[E,k.mapper.str,k.maps.device.amazon.model],[S,"Amazon"],[R,m]],[/android.+aft([bms])\sbuild/i],[E,[S,"Amazon"],[R,P]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[E,S,[R,m]],[/\((ip[honed|\s\w*]+);/i],[E,[S,"Apple"],[R,m]],[/(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],[S,E,[R,m]],[/\(bb10;\s(\w+)/i],[E,[S,"BlackBerry"],[R,m]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[E,[S,"Asus"],[R,C]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[S,"Sony"],[E,"Xperia Tablet"],[R,C]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[S,"Sony"],[R,m]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[S,E,[R,yd]],[/android.+;\s(shield)\sbuild/i],[E,[S,"Nvidia"],[R,yd]],[/(playstation\s[34portablevi]+)/i],[E,[S,"Sony"],[R,yd]],[/(sprint\s(\w+))/i],[[S,k.mapper.str,k.maps.device.sprint.vendor],[E,k.mapper.str,k.maps.device.sprint.model],[R,m]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[S,[E,/_/g," "],[R,m]],[/(nexus\s9)/i],[E,[S,"HTC"],[R,C]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[E,[S,"Huawei"],[R,m]],[/android.+(bah2?-a?[lw]\d{2})/i],[E,[S,"Huawei"],[R,C]],[/(microsoft);\s(lumia[\s\w]+)/i],[S,E,[R,m]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[E,[S,"Microsoft"],[R,yd]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[S,"Microsoft"],[R,m]],[/\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],[E,[S,"Motorola"],[R,m]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[E,[S,"Motorola"],[R,C]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[S,k.util.trim],[E,k.util.trim],[R,P]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[S,"Samsung"],[R,P]],[/\(dtv[\);].+(aquos)/i],[E,[S,"Sharp"],[R,P]],[/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],[[S,"Samsung"],E,[R,C]],[/smart-tv.+(samsung)/i],[S,[R,P],E],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[S,"Samsung"],E,[R,m]],[/sie-(\w*)/i],[E,[S,"Siemens"],[R,m]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[S,"Nokia"],E,[R,m]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[E,[S,"Acer"],[R,C]],[/android.+([vl]k\-?\d{3})\s+build/i],[E,[S,"LG"],[R,C]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[S,"LG"],E,[R,C]],[/(lg) netcast\.tv/i],[S,E,[R,P]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[E,[S,"LG"],[R,m]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[S,E,[R,C]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[E,[S,"Lenovo"],[R,C]],[/(lenovo)[_\s-]?([\w-]+)/i],[S,E,[R,m]],[/linux;.+((jolla));/i],[S,E,[R,m]],[/((pebble))app\/[\d\.]+\s/i],[S,E,[R,b]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[S,E,[R,m]],[/crkey/i],[[E,"Chromecast"],[S,"Google"],[R,P]],[/android.+;\s(glass)\s\d/i],[E,[S,"Google"],[R,b]],[/android.+;\s(pixel c)[\s)]/i],[E,[S,"Google"],[R,C]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[E,[S,"Google"],[R,m]],[/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],[[E,/_/g," "],[S,"Xiaomi"],[R,m]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[E,/_/g," "],[S,"Xiaomi"],[R,C]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[E,[S,"Meizu"],[R,m]],[/(mz)-([\w-]{2,})/i],[[S,"Meizu"],E,[R,m]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[E,[S,"OnePlus"],[R,m]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[E,[S,"RCA"],[R,C]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[E,[S,"Dell"],[R,C]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[E,[S,"Verizon"],[R,C]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[S,"Barnes & Noble"],E,[R,C]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[E,[S,"NuVision"],[R,C]],[/android.+;\s(k88)\sbuild/i],[E,[S,"ZTE"],[R,C]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[E,[S,"Swiss"],[R,m]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[E,[S,"Swiss"],[R,C]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[E,[S,"Zeki"],[R,C]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[S,"Dragon Touch"],E,[R,C]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[E,[S,"Insignia"],[R,C]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[E,[S,"NextBook"],[R,C]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[S,"Voice"],E,[R,m]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[S,"LvTel"],E,[R,m]],[/android.+;\s(PH-1)\s/i],[E,[S,"Essential"],[R,m]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[E,[S,"Envizen"],[R,C]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[S,E,[R,C]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[E,[S,"MachSpeed"],[R,C]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[S,E,[R,C]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[E,[S,"Rotor"],[R,C]],[/android.+(KS(.+))\s+build/i],[E,[S,"Amazon"],[R,C]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[S,E,[R,C]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[R,k.util.lowerize],S,E],[/[\s\/\(](smart-?tv)[;\)]/i],[[R,P]],[/(android[\w\.\s\-]{0,9});.+build/i],[E,[S,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[e,[r,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[e,[r,"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],[r,e],[/rv\:([\w\.]{1,9}).+(gecko)/i],[e,r]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[r,e],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[r,k.mapper.str,k.maps.os.windows],[e,k.mapper.str,k.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[r,"Windows"],[e,k.mapper.str,k.maps.os.windows.version]],[/\((bb)(10);/i],[[r,"BlackBerry"],e],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[r,e],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[r,"Symbian"],e],[/\((series40);/i],[r],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[r,"Firefox OS"],e],[/(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],[[r,"Linux"],e],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[r,"Chromium OS"],e],[/(sunos)\s?([\w\.\d]*)/i],[[r,"Solaris"],e],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[r,"Linux"],e],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[r,"iOS"],[e,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[r,"iOS"],[e,/_/g,"."]],[/(haiku)\s(\w+)/i],[r,e],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[e,/_/g,"."],[r,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[r,"Mac"],[e,/_/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],[r,e]]},k);function k(){}X_.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=W_.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 $_=X_;function X_(){}Q_.prototype.map=function(e){return new Q_(e(this.previous),e(this.current))};var Z_=Q_;function Q_(e,t){this.previous=e,this.current=t}tI.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return iI.of(sI(e,this.hackleDeviceId),K_.empty())},tI.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(tI.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),tI.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},tI.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},tI.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},tI.prototype.hackleUser=function(e){var t=(new zt).addIdentifiers(e.user.identifiers||{}).add(Vt.ID,e.user.id||this.hackleDeviceId).add(Vt.DEVICE,e.user.deviceId||this.hackleDeviceId).add(Vt.HACKLE_DEVICE,this.hackleDeviceId),t=(u.isNotNullOrUndefined(e.user.userId)&&t.add(Vt.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}},tI.prototype.hackleProperties=function(){var e;return(e="undefined"!=typeof window?c(c({},$_.generate(window)),this.pageManager.currentPage.toProperties()):e)||{}},tI.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},tI.prototype.setUserId=function(e){e=c(c({},this.context.user),{userId:e});return this.setUser(e)},tI.prototype.setDeviceId=function(e){e=c(c({},this.context.user),{deviceId:e});return this.setUser(e)},tI.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},tI.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},tI.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},tI.prototype.saveUser=function(e){this.storage.saveUser(e)},tI.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,G_(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new Z_(t,n)},tI.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=sI(r,n.hackleDeviceId),G_(e,t)?c(c({},t),{properties:c(c({},e.properties),t.properties)}):t;var t})},tI.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)})})},tI.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.cohortFetcher.fetch(this.currentUser)];case 1:return t=e.sent(),this.context=this.context.update(t),[3,3];case 2:return t=e.sent(),s.log.error("Failed to sync cohorts: ".concat(t)),[3,3];case 3:return[2]}})})},tI.prototype.syncIfNeeded=function(t){return a(this,void 0,void 0,function(){return l(this,function(e){return this.hasNewIdentifiers(t.previous,t.current)?[2,this.sync()]:[2]})})},tI.prototype.hasNewIdentifiers=function(e,t){var r=Bt(e),e=Bt(t);return Object.entries(e).some(function(e){var t=e[0],e=e[1];return r[t]!==e})},tI.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var eI=tI;function tI(e,t,r,n,i,o,s,a){this.hackleDeviceId=e,this.storage=t,this.cohortFetcher=r,this.campaignParser=n,this.pageManager=i,this.clock=o,this.userListeners=[],this.defaultUser={id:this.hackleDeviceId,deviceId:this.hackleDeviceId},this.context=this.initContext(s,a),this.storage.saveUser(this.context.user)}nI.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},nI.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(nI.prototype,"deviceId",{get:function(){return this.storage.getItem(it)},enumerable:!1,configurable:!0}),Object.defineProperty(nI.prototype,"userId",{get:function(){return this.storage.getItem(nt)},enumerable:!1,configurable:!0}),nI.prototype.setDeviceId=function(e){this.setId(it,e)},nI.prototype.setUserId=function(e){this.setId(nt,e)},nI.prototype.setId=function(e,t){u.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var rI=nI;function nI(e){this.storage=e}oI.of=function(e,t){return new oI(e,t.filterBy(e))},oI.prototype.with=function(e){return oI.of(e,this.cohorts.filterBy(e))},oI.prototype.update=function(e){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return oI.of(this.user,e)};var iI=oI;function oI(e,t){this.user=e,this.cohorts=t}var sI=function(e,t){return c(c({},e),{id:e.id||t,deviceId:e.deviceId||t})},aI=(Object.defineProperty(uI.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(uI.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:uI.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(uI.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),uI.prototype.addListener=function(e){this.sessionListeners.push(e)},uI.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},uI.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)},uI.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(rt,"".concat(e))},uI.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)})},uI.prototype.newSession=function(t,r){var n="".concat(r,".").concat(B().slice(0,8));return this.saveSession(n),this.updateLastEventTime(r),this.sessionListeners.forEach(function(e){e.onSessionStarted(n,t,r)}),n},uI.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(tt,e)},uI.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(tt)},uI.prototype.loadLastEventTime=function(){var e=this.storage.getItem(rt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},uI.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},uI.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}},uI.EMPTY_SESSION_ID="0.ffffffff",uI);function uI(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}lI.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},lI.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},lI.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},lI.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var cI=lI;function lI(){this.storage=window.localStorage}fI.postfix=function(e,t){return new fI(e,function(e){return"".concat(e).concat(t)})},fI.prefix=function(e,t){return new fI(e,function(e){return"".concat(t).concat(e)})},fI.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},fI.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},fI.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var pI=fI;function fI(e,t){this.delegate=e,this.transform=t}dI.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},dI.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},dI.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},dI.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}},dI.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[]}},dI.prototype.entries=function(){return this.getList().flatMap(Object.entries)},dI.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){}},dI.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]},dI.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){}},dI.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var hI=dI;function dI(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)}yI.prototype.currentUser=function(){return this.userManager.resolve()},yI.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},yI.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},yI.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},yI.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},yI.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},yI.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},yI.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},yI.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},yI.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},yI.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},yI.prototype.increment=function(e,t){Ei.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var vI=yI;function yI(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}mI.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},mI.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},mI.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},mI.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},mI.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},mI.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},mI.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},mI.monitoring=function(e){return"".concat(e,"/metrics")};var gI=mI;function mI(){}wI.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)},wI.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},wI.prototype.key=function(e){return"".concat(e.key)};var EI=wI;function wI(e){this.storage=e}TI.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var bI=TI;function TI(e){this.handlers=e}II.prototype.handle=function(e,t){e.close()},II.prototype.supports=function(e){return"CLOSE"===e.type};var _I=II;function II(){}OI.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))}},OI.prototype.supports=function(e){return"WEB_LINK"===e.type};var AI=OI;function OI(e){this.urlHandler=e}SI.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))}},SI.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var NI=SI;function SI(e){this.urlHandler=e}CI.prototype.handle=function(e,t){var r=this.clock.currentMillis()+864e5;this.storage.put(e.context.inAppMessage,r),e.close()},CI.prototype.supports=function(e){return"HIDDEN"===e.type};var RI=CI;function CI(e,t){this.storage=e,this.clock=t}xI.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))}},xI.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var MI=xI;function xI(e){this.urlHandler=e}kI.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))}},kI.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var PI=kI;function kI(e){this.urlHandler=e}LI.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))}},LI.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var UI=LI;function LI(e){this.urlHandler=e}FI.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))}},FI.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var DI=FI;function FI(e){this.urlHandler=e}VI.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},VI.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 jI=VI;function VI(e){this.core=e}BI.prototype.setListener=function(e){this.inAppMessageListener=e},BI.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 HI=BI;function BI(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}GI.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},GI.prototype.destroy=function(){this.userEventEmitter.off("event",this.onEvent)};var zI=GI;function GI(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 KI=function(e,t,r,n){this.inAppMessage=e,this.message=t,this.user=r,this.properties=n},JI=(YI.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}}},YI.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 KI(e.inAppMessage,e.message,t.user,ke.sanitize(r))},YI);function YI(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.core=r}WI.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(WI.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(WI.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(WI.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(WI.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]}})})},WI.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,")"))},WI.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(WI.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},WI.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},WI.prototype.destroy=function(){var e;window.removeEventListener(WI.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(WI.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"},WI.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(WI.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},WI.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},WI.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},WI.prototype.handleEvent=function(e){this.ui.eventHandler.handle(this,e)},WI.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",WI.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",WI.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",WI.CONTAINER_CLASS_NAME="hackle-iam",WI.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var qI=WI;function WI(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===WI.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))}}XI.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},XI.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},XI.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var $I=XI;function XI(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}QI.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},QI.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var ZI=QI;function QI(e){this.current=e=void 0===e?"CLOSED":e}tA.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},tA.prototype.register=function(e,t){var r=B(),e=this.resolveKey(e,r);return this.record[e]=t,r},tA.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 eA=tA;function tA(){this.record={}}nA.create=function(e){return new nA(e)},nA.prototype.create=function(e,t){var r=new $I,n=new ZI,i=new eA;switch(e.message.layout.displayType){case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new qI(this.scriptLoader,e,t,r,n,i);case"NONE":return null}};var rA=nA;function nA(e){this.scriptLoader=e}oA.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()]}})})},oA.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},oA.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 iA=oA;function oA(e){this.scriptUrl=e}aA.prototype.isTriggerTarget=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},aA.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=uA.of(e,t,r);return this.targetMatcher.anyMatches(e,eb.create(),n.targets)};var sA=aA;function aA(e){this.targetMatcher=e}cA.of=function(e,t,r){return new cA(new Z0("IN_APP_MESSAGE",r.id),e,t.user,t)};var uA=cA;function cA(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}pA.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},pA.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new fA(new dA(i)))}return e.durationCap&&t.push(new fA(new yA(e.durationCap))),t};var lA=pA;function pA(e){this.storage=e}hA.prototype.matches=function(e,t){return this.predicate.matches(e,t)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var fA=hA;function hA(e){this.matchCount=0,this.predicate=e}Object.defineProperty(vA.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),vA.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 dA=vA;function vA(e){this.identifierCap=e}Object.defineProperty(gA.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),gA.prototype.matches=function(e,t){return e.timestamp-t.timestamp<=this.durationCap.durationMillis};var yA=gA;function gA(e){this.durationCap=e}EA.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return u.isNullOrUndefined(e)?[]:JSON.parse(e)},EA.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var mA=EA;function EA(e){this.storage=e}bA.prototype.get=function(t){return this.processors.find(function(e){return e.supports(t)})};var wA=bA;function bA(e){this.processors=e}_A.prototype.process=function(e,t,r){this.saveImpression(e.context.inAppMessage,e.context.user,r)},_A.prototype.saveImpression=function(e,t,r){var n=this.impressionStorage.get(e),t={identifiers:t.identifiers,timestamp:r};n.push(t),n.length>_A.IMPRESSION_MAX_SIZE&&n.splice(0,n.length-_A.IMPRESSION_MAX_SIZE),this.impressionStorage.set(e,n)},_A.prototype.supports=function(e){return"IMPRESSION"===e.type},_A.IMPRESSION_MAX_SIZE=100;var TA=_A;function _A(e){this.impressionStorage=e}AA.prototype.process=function(e,t,r){},AA.prototype.supports=function(e){return"CLOSE"===e.type};var IA=AA;function AA(){}NA.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)},NA.prototype.supports=function(e){return"ACTION"===e.type};var OA=NA;function NA(e){this.actionHandlerFactory=e}RA.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 SA=RA;function RA(e,t,r){this.clock=e,this.eventTracker=t,this.eventProcessorFactory=r}MA.prototype.matches=function(e,t,r){return!!I0.isTrackEvent(r)&&(!!this.ruleDeterminer.isTriggerTarget(e,t,r)&&this.frequencyCapDeterminer.isTriggerTarget(e,t,r))};var CA=MA;function MA(e,t){this.ruleDeterminer=e,this.frequencyCapDeterminer=t}PA.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var xA=PA;function PA(e){this.handlers=e}UA.prototype.handle=function(e,t){e.close()},UA.prototype.supports=function(e){return"CLOSE"===e.type};var kA=UA;function UA(){}DA.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.eventHandler.handle(e,t)},DA.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},DA.prototype.supports=function(e){return"ACTION"===e.type};var LA=DA;function DA(e){this.eventHandler=e}jA.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.eventHandler.handle(e,t)},jA.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var FA=jA;function jA(e){this.eventHandler=e}HA.prototype.open=function(e){window.location.href=e.href};var VA=HA;function HA(){}zA.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var BA=zA;function zA(){}KA.prototype.open=function(e){window.open(e.href)};var GA=KA;function KA(){}YA.prototype.open=function(e){window.location.replace(e)};var JA=YA;function YA(){}function qA(e,t,r){return null===e||(!XA(t,WA)||r.current!==r.referrer)&&!XA(e,t)}var WA={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},$A={current:void 0,referrer:void 0},XA=function(t,r){return Object.keys(WA).every(function(e){return t[e]===r[e]})},ZA=(QA.prototype.startNewCampaign=function(e,t,r){for(var t=c(c({},WA),t),n=new _o,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)},QA.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();qA(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},QA.prototype.onSessionEnded=function(e,t,r){},QA.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},QA);function QA(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}tO.prototype.get=function(){var e=this.storage.getItem(ot);return e?JSON.parse(e):null},tO.prototype.set=function(e){this.storage.setItem(ot,JSON.stringify(e))};var eO=tO;function tO(e){this.storage=e}nO.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},nO.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=Do.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var rO=nO;function nO(e){this.search=e}oO.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},oO.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,oO.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var iO=oO;function oO(){}aO.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},aO.prototype.params=function(e){e=u.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new rO(e).getQueryParams(aO.CAMPAIGN_QUERY_CONDITION)},aO.prototype.resolve=function(e){return{utm_campaign:e[uO],utm_content:e[cO],utm_id:e[lO],utm_medium:e[pO],utm_source:e[fO],utm_term:e[hO],gclid:e[dO],fbclid:e[vO]}},aO.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return $A;return{current:iO.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,iO.extractDomain(e)}()}},aO.CAMPAIGN_QUERY_CONDITION=function(e,t){return bi.isNotEmptyString(t)};var sO=aO;function aO(e){this.pageManager=e}var uO="utm_campaign",cO="utm_content",lO="utm_id",pO="utm_medium",fO="utm_source",hO="utm_term",dO="gclid",vO="fbclid",yO=(gO.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},gO.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))}},gO);function gO(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()}EO.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!I0.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==f.TRAFFIC_ALLOCATED?null:e};var mO=EO;function EO(e){this.workspaceFetcher=e}var wO={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.38.0",IAM_RENDERER_VERSION_HEADER:"0.0.9"},bO=(TO.config=function(e){return c(c(c({},wO),e),{automaticPageTracking:TO.resolveAutomaticPageTracking(e)})},TO.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?wO.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},TO.logging=function(e){s.initCounter(function(e){return Ei.counter("log",{level:e})}),s.setLogLevel(_e.INFO),e.log_disabled?s.setLogLevel(_e.DISABLE):e.debug&&s.setLogLevel(_e.DEBUG)},TO.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}},TO.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&s.log.debug("support sendBeacon API"),e},TO.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,3e4)},TO.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},TO);function TO(){}IO.prototype.add=function(e){this.synchronizers.push(e)},IO.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]}})})},IO.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]}})})},IO.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 _O=IO;function IO(){this.synchronizers=[]}OO.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]}})})},OO.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()}))},OO.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},OO.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 AO=OO;function OO(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}SO.prototype.schedule=function(e,t){e=new RO(e,t);return e.start(),e},SO.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new MO(e,t,r);break;case"setInterval":n=new PO(e,t,r)}return n.start(),n};var NO=SO;function SO(e){this.scheduleType=e}CO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.task()},this.delayMillis)},CO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var RO=CO;function CO(e,t){this.delayMillis=e,this.task=t,this.timeout=null}xO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},xO.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)},xO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var MO=xO;function xO(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}kO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},kO.prototype.run=function(){try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}},kO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var PO=kO;function kO(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}LO.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)]}})})},LO.prototype.createRequest=function(e){var t=_i.builder().url(this.url).method("GET");return null!==e&&t.addHeader(Ri.IF_MODIFIED_SINCE,e),t.build()},LO.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=Hn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Fi.record("get.workspace",t,r),[2,r];case 3:throw r=e.sent(),Fi.record("get.workspace",t,null),r;case 4:return[2]}})})},LO.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(Ri.LAST_MODIFIED)}};var UO=LO;function LO(e,t){this.url=e,this.transport=t}FO.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)]}})})},FO.prototype.createRequest=function(e){e={identifiers:Bt(e)},e=we.encodeURL(JSON.stringify(e));return _i.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},FO.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=Hn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Fi.record("get.cohorts",t,r),[2,r];case 3:throw r=e.sent(),Fi.record("get.cohorts",t,null),r;case 4:return[2]}})})},FO.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 K_.fromDto(e)};var DO=FO;function FO(e,t){this.url=e,this.transport=t}VO.prototype.getExperiments=function(){return Array.from(this.experiments.values())},VO.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},VO.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},VO.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},VO.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},VO.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},VO.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},VO.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},VO.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},VO.prototype.getContainerOrNull=function(e){return this.containers.get(e)},VO.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},VO.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},VO.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},VO.prototype.getAttributes=function(){return this.attributes},VO.from=function(e){return new VO(p.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e)}),p.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),p.mapNotNullOrUndefined(e.featureFlags,function(e){return Mt.fromJson("FEATURE_FLAG",e)}),e.buckets.map(kt.fromJson),e.events.map(Ft.fromJson),p.mapNotNullOrUndefined(e.segments,ir.fromJson),e.containers.map(sr.fromJson),e.parameterConfigurations.map(St.fromJson),p.mapNotNullOrUndefined(e.remoteConfigParameters,lr.fromJson),p.mapNotNullOrUndefined(e.inAppMessages,Vr.fromJson),e.workspace.attributes)};var jO=VO;function VO(e,t,r,n,i,o,s,a,u,c,l){this.experiments=p.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=p.associateBy(t,function(e){return e.key}),this.featureFlags=p.associateBy(r,function(e){return e.key}),this.buckets=p.associateBy(n,function(e){return e.id}),this.eventTypes=p.associateBy(i,function(e){return e.key}),this.segments=p.associateBy(o,function(e){return e.key}),this.containers=p.associateBy(s,function(e){return e.id}),this.parameterConfigurations=p.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=p.associateBy(u,function(e){return e.key}),this.inAppMessages=p.associateBy(c,function(e){return e.key}),this.attributes=l}BO.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},BO.prototype.setWorkspace=function(e){try{this.workspace=jO.from(e.config)}catch(e){s.log.error("Failed to set workspace: ".concat(e))}},BO.prototype.get=function(){return this.workspace},BO.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]}})})},BO.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var HO=BO;function BO(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}GO.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},GO.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]}})})},GO.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 zO=GO;function GO(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}JO.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},JO.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof I0?I0.isExposureEvent(e)?t.push(e.toDto()):I0.isTrackEvent(e)?r.push(e.toDto()):I0.isRemoteConfigEvent(e)&&n.push(e.toDto()):I0.isExposureEventDto(e)?t.push(e):I0.isTrackEventDto(e)?r.push(e):I0.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return _i.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},JO.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=Hn.start(),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transport.send(n)];case 2:return r=e.sent(),Fi.record("post.events",t,r),[2,r];case 3:throw r=e.sent(),Fi.record("post.events",t,null),r;case 4:return[2]}})})};var KO=JO;function JO(e,t){this.url=e,this.transport=t}qO.prototype.add=function(e){return this.repository.add(e)},qO.prototype.delete=function(e){return this.repository.delete(e)},qO.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]}})})},qO.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 YO=qO;function qO(e,t){this.repository=e,this.transport=t}function WO(){this.listeners={}}WO.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},WO.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},WO.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Se(XO,$O=WO);var $O,t=XO;function XO(){return null!==$O&&$O.apply(this,arguments)||this}Se(eN,ZO=t),eN.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},eN.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},eN.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},eN.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=[])},eN.prototype.close=function(){this.flush(!0)};var ZO,QO=eN;function eN(e,t,r,n){var i=ZO.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}rN.prototype.send=function(e){e=e.toBuilder().addHeader(Ge,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 tN=rN;function rN(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}iN.intercept=function(e,t){return t instanceof tN?t:new tN(e,Fe.instance,t)};var nN=iN;function iN(){}sN.create=function(){return new sN},sN.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 Ni(n.status,n.responseText,function(e){var t=Ri.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 oN=sN;function sN(){}uN.create=function(){return new uN},uN.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(Ni.ok())})},uN.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(Ge),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 aN=uN;function uN(){}lN.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var cN=lN;function lN(e){this.invocationResponseResolver=e}hN.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 pN,fN=hN;function hN(e){this.invocationResponseResolver=e}(qs=pN=pN||{}).prompt="prompt",qs.function="function";vN.prototype.getInvocator=function(e,t){return e===pN.prompt?new cN(t):e===pN.function?new fN(t):null};var dN=vN;function vN(){}gN.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},gN.prototype.onPageEnded=function(e,t){};var yN=gN;function gN(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var mN=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},EN=(wN.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 mN(t,o,i,e)}return null},wN);function wN(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}TN.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=_N.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,eb.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,eb.create(),t.includeTargets))};var bN=TN;function TN(e){this.targetMatcher=e}IN.of=function(e,t){return new IN(new Z0("SPLIT_URL",B()),t,e)};var _N=IN;function IN(e,t,r){this.key=e,this.user=t,this.workspace=r}ON.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var AN=ON;function ON(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}SN.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(SN.SPLIT_URL_CONFIG_KEY,"")),r=Un.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},SN.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},SN.prototype.resolveManualRedirectUrl=function(e,t){e=Do.tryParse(e);return e?this.decorateCampaign(e,t):null},SN.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(bi.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];bi.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},SN.SPLIT_URL_CONFIG_KEY="redirectUrl";var NN=SN;function SN(e){this.campaignParser=e}CN.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return u.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},CN.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},CN.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var RN=CN;function CN(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}xN.prototype.setNeedDispatch=function(e){this.needDispatch=e},xN.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(xN.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},xN.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var MN=xN;function xN(){this.needDispatch=!0}kN.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}},kN.prototype.set=function(e){e=c(c({},e),{version:this.sdk.version});this.storage.setItem(ft,JSON.stringify(e))},kN.prototype.clear=function(){this.storage.removeItem(ft)};var PN=kN;function kN(e,t){this.sdk=e,this.storage=t}var UN=s.log,LN=(DN.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")}),DN.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)&&UN.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)&&UN.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&UN.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&UN.error(e)}var r,n},DN.prototype.addListener=function(e){this.listeners.push(e)},DN.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},DN.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},DN.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},DN.isSafariBrowser=function(e){return!u.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},DN);function DN(e){void 0===e&&(e=Fe.instance),this.clock=e,this.listeners=[],this._initialized=!1}jN.create=function(e,t,r){return void 0===r&&(r=Fe.instance),new jN(new VN(r,e,t))},jN.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var FN=jN;function jN(e){this.limiter=e}HN.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},HN.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new BN(e+this.intervalMillis,this.limit)),this.currentScope};var VN=HN;function HN(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}zN.prototype.isExpired=function(e){return this.expirationTime<e},zN.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var BN=zN;function zN(e,t){this.expirationTime=e,this.token=t}KN.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var GN=KN;function KN(e){this.determiners=e}JN.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)};lp=JN;function JN(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}Se(WN,YN=lp),WN.prototype.supports=function(e){return I0.isRemoteConfigEvent(e)},WN.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var YN,qN=WN;function WN(e,t){return void 0===t&&(t=Fe.instance),YN.call(this,e,t)||this}Se(ZN,$N=lp),ZN.prototype.supports=function(e){return I0.isExposureEvent(e)},ZN.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var $N,XN=ZN;function ZN(e,t){return void 0===t&&(t=Fe.instance),$N.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 QN=eS;function eS(){}rS.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters}}},rS.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var tS=rS;function rS(e){this.invocator=e}var nS=s.log,iS=(oS.prototype.onPageStarted=function(e,t){this.track(e,t)},oS.prototype.onPageEnded=function(e,t){},oS.prototype.track=function(e,t){nS.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(aS.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:Ro.createWithCurrentPage()},enumerable:!1,configurable:!0}),aS.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))},aS.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},aS.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},aS.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=Ro.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},aS.prototype.addListener=function(e){this.listeners.push(e)};var sS=aS;function aS(){this.listeners=[],this._currentPage=null}var uS=s.log,cS=(Object.defineProperty(lS.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),lS.prototype.startEngagement=function(e){uS.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},lS.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))},lS.prototype.publish=function(e,t,r){uS.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)},lS.prototype.onPageStarted=function(e,t){this.startEngagement(t)},lS.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},lS.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}},lS.prototype.addListener=function(e){this.listeners.push(e)},lS);function lS(e,t,r){this.userManager=e,this.pageManager=t,this.minimumEngagementDurationMillis=r,this.listeners=[],this._lastEngagementTime=null}fS.prototype.onEngagement=function(e,t,r){var n,e={key:fS.ENGAGEMENT_EVENT_KEY,properties:((n={})[iS.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,n[fS.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,n)};this.core.track(e,t,r)},fS.ENGAGEMENT_EVENT_KEY="$engagement",fS.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var pS=fS;function fS(e){this.core=e}var hS=s.log,dS=null;function vS(e,t){var r,t=bO.config(t);bO.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 dN).getInvocator(o.getInvocationType(),new QN);if(null===s)throw new Error("Failed to get invocator with invocationType:".concat(o.getInvocationType()));if(s=new tS(s),s=new qo(s),!o.getAppMode)return s;if((o=o.getAppMode().toLowerCase())===Jo.native)return s;if(o!==Jo.web_view_wrapper)throw new Error("Unsupported HackleAppMode: ".concat(o));return o=yS(n,i),(n=new Wo(o,s)).syncUser(),n}}catch(e){hS.error("Unexpected exception while check WebApp client: ".concat(e))}return yS(e,t)}function yS(e,t){var r=bO.sdk(e,t);if(dS)return hS.debug("use already exists hackleClient"),dS;var n=new Ho,i=(n.initialize(),new cI),o=jo.getInstance({days:Xe,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),s=bO.isBeaconSupported(),a=nN.intercept(r,oN.create()),u=nN.intercept(r,aN.create()),c=a,l=(s&&(c=u),new _O),p=new AO(l,new NO("setTimeout"),bO.pollingIntervalMillis(t)),f=new PN(r,pI.postfix(i,"_".concat(e.slice(0,8)))),h=new UO(gI.clientFetch(t.sdkUrl,r.key),a),f=new HO(f,h),h=(l.add(f),new sS),d=new DO(gI.userCohorts(t.sdkUrl),a),v=new sO(h),y=new rI(pI.postfix(o,"_".concat(e))),g=y.getUser(),m=t.user||null,y=new eI(zo(),y,d,v,h,Fe.instance,g,m),d=(l.add(y),new aI(t.sessionTimeoutMillis,pI.postfix(o,"_".concat(e.slice(8))))),m=(y.addListener(d),new B_(i,"".concat(et,"_").concat(e),qe)),l=new KO(gI.clientDispatch(t.eventUrl),a),E=l,s=(s&&(E=new KO(gI.beaconDispatch(t.eventUrl,r.key),u)),new YO(m,l)),r=new zO(l,E,s),u=new GN([new qN(bO.dedupIntervalMillis(t)),new XN(bO.dedupIntervalMillis(t))]),m=new QO(r,qe,new NO("setTimeout"),$e),l=new D0(m,u,d,y),w=new MN,E=new lb(new hI(o,"".concat(st,"_").concat(e.slice(0,8)))),r=new lb(new hI(o,"".concat(at,"_").concat(e.slice(0,8)))),u=new EI(pI.prefix(i,"".concat(ut,"_").concat(e.slice(0,8),"_"))),i=new mA(pI.prefix(i,"".concat(ct,"_").concat(e.slice(0,8),"_"))),b=x_.create(f,l,[E,r],u),e=new ZA(new eO(pI.postfix(o,"_".concat(e.slice(0,8)))),v,b,y),T=new U0(y,b),T=(d.addListener(e),d.addListener(T),new jI(b)),u=new bI([new _I,new AI(new VA),new NI(new VA),new RI(u,Fe.instance),new MI(new BA),new PI(new BA),new UI(new GA),new DI(new GA)]),u=new wA([new TA(i),new OA(u),new IA]),T=new SA(Fe.instance,T,u),u=new xA([new kA,new LA(T),new FA(T)]),_=new iA(gI.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),_=new HI(rA.create(_),T,u),T=new CA(new sA(w_.get("targetMatcher")),new lA(i)),u=new JI(f,T,b),i=(new zI(m,u,_),new mO(f)),T=(new yO(m,i),new cS(y,h,dt)),u=(h.addListener(T),new pS(b)),m=(T.addListener(u),new iS(b,y)),i=(t.automaticPageTracking&&h.addListener(m),new bN(w_.get("targetMatcher"))),u=new RN(o,lt,{days:pt}),o=new EN(f,i,u,b),f=new AN(new NN(v),new JA,u,w),i=new yN(o,f,y,b),v=(h.addListener(i),new vI(b,y,E,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,E=new ki(gI.monitoring(t.monitoringUrl),a,c,new NO("setTimeout"),We),I=(Ei.addRegistry(E),new LN),r=(I.addListener(h),I.addListener(T),I.addListener(d),I.addListener(n),I.addListener(s),I.addListener(l),I.addListener(E),p.start(),FN.create(ht,1)),A=new xo(b,p,d,y,r,m,_,i),u=(dS=A,(new L_).install(b,y),y.resolve().hackleProperties.browserName);return I.install("string"==typeof u?u:null),o=Date.now(),f=y.currentUser,v=d.currentSessionId,(G_(g,f)?d.startNewSessionIfNeeded(f,o):d.startNewSession(g,f,o))===v&&e.startNewCampaignIfNeeded(f,o),A.onReady(function(){t.autoOpenDevTool&&(t.devTool?A.showUserExplorer():hS.error("DevTool is not provided")),I.initialize(),w.dispatchDoneEventIfNeeded()}),A}var gS=function(e,t){return(gS=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 mS=function(){return(mS=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 ES(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}wS.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},wS.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},wS.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Ia=wS;function wS(){this.listeners={}}TS.arePropertiesEqual=function(e,t){var r=TS.coerceUnknownToProperties(e),n=TS.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]})},TS.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var bS=TS;function TS(){}IS.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)&&bS.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&bS.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var _S=IS;function IS(){}var AS=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=vS(e,mS(mS({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.38.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 gS(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(mS(mS({},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){_S.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}(Ia);var U={exports:{}},w={},OS=Object.getOwnPropertySymbols,NS=Object.prototype.hasOwnProperty,SS=Object.prototype.propertyIsEnumerable;var Ta=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]))NS.call(r,o)&&(n[o]=r[o]);if(OS)for(var s=OS(r),a=0;a<s.length;a++)SS.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},RS=Ta,I="function"==typeof Symbol&&Symbol.for,CS=I?Symbol.for("react.element"):60103,MS=I?Symbol.for("react.portal"):60106,Q=I?Symbol.for("react.fragment"):60107,_p=I?Symbol.for("react.strict_mode"):60108,g=I?Symbol.for("react.profiler"):60114,xS=I?Symbol.for("react.provider"):60109,PS=I?Symbol.for("react.context"):60110,kS=I?Symbol.for("react.forward_ref"):60112,M=I?Symbol.for("react.suspense"):60113,US=I?Symbol.for("react.memo"):60115,LS=I?Symbol.for("react.lazy"):60116,DS="function"==typeof Symbol&&Symbol.iterator;function FS(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 jS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},VS={};function HS(e,t,r){this.props=e,this.context=t,this.refs=VS,this.updater=r||jS}function BS(){}function zS(e,t,r){this.props=e,this.context=t,this.refs=VS,this.updater=r||jS}HS.prototype.isReactComponent={},HS.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(FS(85));this.updater.enqueueSetState(this,e,t,"setState")},HS.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},BS.prototype=HS.prototype;var fa=zS.prototype=new BS,GS=(fa.constructor=zS,RS(fa,HS.prototype),fa.isPureReactComponent=!0,{current:null}),KS=Object.prototype.hasOwnProperty,JS={key:!0,ref:!0,__self:!0,__source:!0};function YS(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)KS.call(t,n)&&!JS.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:CS,type:e,key:o,ref:s,props:i,_owner:GS.current}}function qS(e){return"object"==typeof e&&null!==e&&e.$$typeof===CS}var WS=/\/+/g,$S=[];function XS(e,t,r,n){var i;return $S.length?((i=$S.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 ZS(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,$S.length<10&&$S.push(e)}function QS(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 CS:case MS:o=!0}}if(o)return n(i,t,""===r?"."+eR(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+eR(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=DS&&t[DS]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+eR(a,s++),n,i);else if("object"===a)throw n=""+t,Error(FS(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function eR(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 rR(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?nR(e,n,r,function(e){return e}):null!=e&&(qS(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(WS,"$&/")+"/")+r,e={$$typeof:CS,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function nR(e,t,r,n,i){var o="";QS(e,rR,t=XS(t,o=null!=r?(""+r).replace(WS,"$&/")+"/":o,n,i)),ZS(t)}var iR={current:null};function oR(){var e=iR.current;if(null===e)throw Error(FS(321));return e}var sR,aR,uR,i={ReactCurrentDispatcher:iR,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:GS,IsSomeRendererActing:{current:!1},assign:RS},A=(w.Children={map:function(e,t,r){if(null==e)return e;var n=[];return nR(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;QS(e,tR,t=XS(null,null,t,r)),ZS(t)},count:function(e){return QS(e,function(){return null},null)},toArray:function(e){var t=[];return nR(e,t,null,function(e){return e}),t},only:function(e){if(qS(e))return e;throw Error(FS(143))}},w.Component=HS,w.Fragment=Q,w.Profiler=g,w.PureComponent=zS,w.StrictMode=_p,w.Suspense=M,w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i,w.cloneElement=function(e,t,r){if(null==e)throw Error(FS(267,e));var n=RS({},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=GS.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)KS.call(t,a)&&!JS.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:CS,type:e.type,key:i,ref:o,props:n,_owner:s}},w.createContext=function(e,t){return(e={$$typeof:PS,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:xS,_context:e},e.Consumer=e},w.createElement=YS,w.createFactory=function(e){var t=YS.bind(null,e);return t.type=e,t},w.createRef=function(){return{current:null}},w.forwardRef=function(e){return{$$typeof:kS,render:e}},w.isValidElement=qS,w.lazy=function(e){return{$$typeof:LS,_ctor:e,_status:-1,_result:null}},w.memo=function(e,t){return{$$typeof:US,type:e,compare:void 0===t?null:t}},w.useCallback=function(e,t){return oR().useCallback(e,t)},w.useContext=function(e,t){return oR().useContext(e,t)},w.useDebugValue=function(){},w.useEffect=function(e,t){return oR().useEffect(e,t)},w.useImperativeHandle=function(e,t,r){return oR().useImperativeHandle(e,t,r)},w.useLayoutEffect=function(e,t){return oR().useLayoutEffect(e,t)},w.useMemo=function(e,t){return oR().useMemo(e,t)},w.useReducer=function(e,t,r){return oR().useReducer(e,t,r)},w.useRef=function(e){return oR().useRef(e)},w.useState=function(e){return oR().useState(e)},w.version="16.14.0",{}),Uc=Function.call.bind(Object.prototype.hasOwnProperty),cR=function(){};function lR(e,t,r,n,i){if("production"!==production)for(var o in e)if(uR(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,sR)}catch(e){s=e}!s||s instanceof Error||cR((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 aR)&&(aR[s.message]=!0,o=i?i():"",cR("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(sR="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aR={},uR=Uc,cR=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),lR.resetWarningCache=function(){"production"!==production&&(aR={})},"production"!==production){var pR=Ta,fR=lR,_="function"==typeof Symbol&&Symbol.for,hR=_?Symbol.for("react.element"):60103,dR=_?Symbol.for("react.portal"):60106,vR=_?Symbol.for("react.fragment"):60107,yR=_?Symbol.for("react.strict_mode"):60108,gR=_?Symbol.for("react.profiler"):60114,mR=_?Symbol.for("react.provider"):60109,ER=_?Symbol.for("react.context"):60110,wR=_?Symbol.for("react.concurrent_mode"):60111,bR=_?Symbol.for("react.forward_ref"):60112,TR=_?Symbol.for("react.suspense"):60113,_R=_?Symbol.for("react.suspense_list"):60120,IR=_?Symbol.for("react.memo"):60115,AR=_?Symbol.for("react.lazy"):60116,OR=_?Symbol.for("react.block"):60121,NR=_?Symbol.for("react.fundamental"):60117,SR=_?Symbol.for("react.responder"):60118,RR=_?Symbol.for("react.scope"):60119,CR="function"==typeof Symbol&&Symbol.iterator,MR="@@iterator";function xR(e){if(null===e||"object"!=typeof e)return null;e=CR&&e[CR]||e[MR];return"function"==typeof e?e:null}var PR={current:null},kR={current:null},UR=/^(.*)[\\\/]/,LR=1;function DR(e){if(null==e)return null;if("number"==typeof e.tag&&zR("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 vR:return"Fragment";case dR:return"Portal";case gR:return"Profiler";case yR:return"StrictMode";case TR:return"Suspense";case _R:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ER:return"Context.Consumer";case mR:return"Context.Provider";case bR:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case IR:return DR(e.type);case OR:return DR(e.render);case AR:r=(t=e)._status===LR?t._result:null;if(r)return DR(r)}var t,r;return null}var FR={},jR=null;function VR(e){jR=e}FR.getCurrentStack=null,FR.getStackAddendum=function(){var e,t,r,n,i,o="",s=(jR&&(e=DR(jR.type),r=jR._owner,o+=(e=e,t=jR._source,r=r&&DR(r.type),i="",t?(n=(s=t.fileName).replace(UR,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match(UR))&&(s=s[1])?s.replace(UR,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),FR.getCurrentStack);return s&&(o+=s()||""),o};var HR={ReactCurrentDispatcher:PR,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:kR,IsSomeRendererActing:{current:!1},assign:pR};function BR(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];GR("warn",e,r)}function zR(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];GR("error",e,r)}function GR(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=HR.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){}}pR(HR,{ReactDebugCurrentFrame:FR,ReactComponentTreeHook:{}});var KR={};function JR(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;KR[r]||(zR("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),KR[r]=!0)}var YR={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){JR(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){JR(e,"replaceState")},enqueueSetState:function(e,t,r,n){JR(e,"setState")}},qR={};function WR(e,t,r){this.props=e,this.context=t,this.refs=qR,this.updater=r||YR}Object.freeze(qR),WR.prototype.isReactComponent={},WR.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")},WR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var $R,XR={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($R in XR)XR.hasOwnProperty($R)&&!function(e,t){Object.defineProperty(WR.prototype,e,{get:function(){BR("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}($R,XR[$R]);function ZR(){}function QR(e,t,r){this.props=e,this.context=t,this.refs=qR,this.updater=r||YR}ZR.prototype=WR.prototype,(_=QR.prototype=new ZR).constructor=QR,pR(_,WR.prototype),_.isPureReactComponent=!0;var eC,tC,rC=Object.prototype.hasOwnProperty,nC={key:!0,ref:!0,__self:!0,__source:!0};function iC(e){if(rC.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function oC(e){if(rC.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var sC={},aC=function(e,t,r,n,i,o,s){e={$$typeof:hR,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 uC(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in iC(t)&&(s=t.ref,"string"==typeof(c=t).ref&&kR.current&&c.__self&&kR.current.stateNode!==c.__self&&(p=DR(kR.current.type),sC[p]||(zR('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',DR(kR.current.type),c.ref),sC[p]=!0))),oC(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)rC.call(t,n)&&!nC.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(){tC||(tC=!0,zR("%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(){eC||(eC=!0,zR("%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}))),aC(e,o,s,a,u,kR.current,i)}function cC(e){return"object"==typeof e&&null!==e&&e.$$typeof===hR}var lC=".",pC=":",fC=!1,hC=/\/+/g;function dC(e){return(""+e).replace(hC,"$&/")}var vC=10,yC=[];function gC(e,t,r,n){var i;return yC.length?((i=yC.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 mC(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,yC.length<vC&&yC.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 hR:case dR:a=!0}}if(a)return n(i,t,""===r?lC+wC(t,0):r),1;var u=0,c=""===r?lC:r+pC;if(Array.isArray(t))for(var l=0;l<t.length;l++)u+=e(o=t[l],c+wC(o,l),n,i);else if("function"==typeof(r=xR(t))){r===t.entries&&(fC||BR("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."),fC=!0);for(var p,f=r.call(t),h=0;!(p=f.next()).done;)u+=e(o=p.value,c+wC(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+FR.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 wC(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 bC(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function TC(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)?_C(o,n,r,function(e){return e}):null!=o&&(cC(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":dC(o.key)+"/")+r,o=aC(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function _C(e,t,r,n,i){var o="",t=gC(t,o=null!=r?dC(r)+"/":o,n,i);EC(e,TC,t),mC(t)}function IC(e){return"string"==typeof e||"function"==typeof e||e===vR||e===wR||e===gR||e===yR||e===TR||e===_R||"object"==typeof e&&null!==e&&(e.$$typeof===AR||e.$$typeof===IR||e.$$typeof===mR||e.$$typeof===ER||e.$$typeof===bR||e.$$typeof===NR||e.$$typeof===SR||e.$$typeof===RR||e.$$typeof===OR)}function AC(){var e=PR.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 OC(){if(kR.current){var e=DR(kR.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var NC=!1,SC={};function RC(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=OC())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),SC[t=r]||(SC[t]=!0,r="",e&&e._owner&&e._owner!==kR.current&&(r=" It was passed a child from "+DR(e._owner.type)+"."),VR(e),zR('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),VR(null)))}function CC(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];cC(n)&&RC(n,t)}else if(cC(e))e._store&&(e._store.validated=!0);else if(e){var i=xR(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)cC(o.value)&&RC(o.value,t)}}function MC(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=DR(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==bR&&t.$$typeof!==IR)return;r=t.propTypes}r?(VR(e),fR(r,e.props,"prop",n,FR.getStackAddendum),VR(null)):void 0===t.PropTypes||NC||(NC=!0,zR("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||zR("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function xC(e,t,r){var n,i=IC(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+".":"")||OC(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===hR?(s="<"+(DR(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,zR("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)),uC.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)CC(arguments[o],e);if(e===vR){var s=t;VR(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){zR("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&zR("Invalid attribute `ref` supplied to `React.Fragment`."),VR(null)}else MC(t);return t}var PC=!1;try{var kC=Object.freeze({}),UC=new Map([[kC,null]]),LC=new Set([kC]);UC.set(0,0),LC.add(0)}catch(e){}function DC(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=pR({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,l=e._owner;if(null!=t)for(n in iC(t)&&(a=t.ref,l=kR.current),oC(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)rC.call(t,n)&&!nC.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 aC(e.type,s,a,u,c,l,o)}.apply(this,arguments),i=2;i<arguments.length;i++)CC(arguments[i],n.type);return MC(n),n}function FC(e){var t=xC.bind(null,e);return t.type=e,PC||(PC=!0,BR("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 BR("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}_=xC,A.Children={map:function(e,t,r){if(null==e)return e;var n=[];return _C(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=gC(null,null,t,r),EC(e,bC,t),mC(t)},count:function(e){return EC(e,function(){return null},null)},toArray:function(e){var t=[];return _C(e,t,null,function(e){return e}),t},only:function(e){if(cC(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},A.Component=WR,A.Fragment=vR,A.Profiler=gR,A.PureComponent=QR,A.StrictMode=yR,A.Suspense=TR,A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HR,A.cloneElement=DC,A.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&zR("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:ER,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:mR,_context:r}),i=!1,t={$$typeof:ER,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,zR("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,zR("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},A.createElement=_,A.createFactory=FC,A.createRef=function(){var e={current:null};return Object.seal(e),e},A.forwardRef=function(e){return null!=e&&e.$$typeof===IR?zR("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?zR("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&zR("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||zR("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:bR,render:e}},A.isValidElement=cC,A.lazy=function(e){var t,r,n={$$typeof:AR,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){zR("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){zR("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},A.memo=function(e,t){return IC(e)||zR("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:IR,type:e,compare:void 0===t?null:t}},A.useCallback=function(e,t){return AC().useCallback(e,t)},A.useContext=function(e,t){var r,n=AC();return void 0!==t&&zR("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?zR("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&&zR("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},A.useDebugValue=function(e,t){return AC().useDebugValue(e,t)},A.useEffect=function(e,t){return AC().useEffect(e,t)},A.useImperativeHandle=function(e,t,r){return AC().useImperativeHandle(e,t,r)},A.useLayoutEffect=function(e,t){return AC().useLayoutEffect(e,t)},A.useMemo=function(e,t){return AC().useMemo(e,t)},A.useReducer=function(e,t,r){return AC().useReducer(e,t,r)},A.useRef=function(e){return AC().useRef(e)},A.useState=function(e){return AC().useState(e)},A.version="16.14.0"}"production"===production?U.exports=w:U.exports=A;var jC=U.exports,VC=U.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),fu=VC.Consumer,HC=VC.Provider;var BC=s.log;function zC(e,t){e=GC(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function GC(e,t){void 0===t&&(t="A");var r=U.exports.useContext(VC),n=r.hackle,i=r.userVersion,o=r.initialized,s=U.exports.useCallback(function(){return o?(null==n?void 0:n.variationDetail(e))||Tt.of(t,f.EXCEPTION):Tt.of(t,f.SDK_NOT_READY)},[t,e,n,o]),r=ES(U.exports.useState(function(){return n?s():(BC.error("HackleClient is not existed"),Tt.of(t,f.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=ES(U.exports.useState(i),2),c=u[0],u=u[1];return YC(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function KC(e){e=JC(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function JC(e){var t=U.exports.useContext(VC),r=t.hackle,n=t.userVersion,i=t.initialized,o=U.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||It.off(f.EXCEPTION):It.off(f.SDK_NOT_READY)},[e,r,i]),t=ES(U.exports.useState(function(){return r?o():(BC.error("HackleClient is not existed"),It.off(f.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=ES(U.exports.useState(n),2),u=a[0],a=a[1];return YC(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function YC(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function qC(e){var t,r=e.experimentKey,e=e.children,n=(r=zC(r)).isLoading,i=r.variation;return n?null:e&&"function"==typeof e?e(i):(U.exports.Children.forEach(e,function(e){U.exports.isValidElement(e)&&(e.props.variation?i===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?U.exports.cloneElement(t,{variation:i}):null)}function WC(e){return e.variation,e=e.children,U.exports.createElement(U.exports.Fragment,null,e)}function $C(e){var t=(r=KC(e.featureKey)).isLoading,r=r.isOn;return t?null:jC.createElement(jC.Fragment,null,e.children(r))}n.Bucket=kt,n.Cohort=kn,n.Container=sr,n.ContainerGroup=ur,n.CoreVersion=mr,n.Decision=Tt,n.DecisionReason=f,n.EXPERIMENT_IMPLEMENTATION_TYPE=Ct,n.EmptyHackleRemoteConfig=Ot,n.EmptyParameterConfig=Ve,n.EventType=Ft,n.Experiment=Mt,n.FeatureFlagDecision=It,n.HackleContext=VC,n.HackleContextConsumer=fu,n.HackleContextProvider=HC,n.HackleExperiment=qC,n.HackleFeature=$C,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=ES(U.exports.useState({hackle:t,initialized:!1,userVersion:0}),2),s=o[0],a=o[1];return U.exports.useEffect(function(){null!=r&&t.setUser(r)},[r]),U.exports.useEffect(function(){function e(){a(function(e){return mS(mS({},e),{userVersion:e.userVersion+1})})}return t.on("user-updated",e),function(){t.off("user-updated",e)}},[t]),U.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(function(e){return mS(mS({},e),{initialized:!0})})},function(){a(function(e){return mS(mS({},e),{initialized:!0})})}).catch(function(){a(function(e){return mS(mS({},e),{initialized:!0})})})},[t]),i||s.initialized?jC.createElement(HC,{value:s},e):null},n.HackleVariation=WC,n.IAM_ACTION_AREA=["BUTTON","IMAGE","MESSAGE","X_BUTTON"],n.IAM_ACTION_TYPE=Dr,n.IAM_BEHAVIOR=Lr,n.IAM_DISPLAY_TYPE=Pr,n.IAM_HORIZONTAL_ALIGNMENT=jr,n.IAM_LAYOUT_TYPE=kr,n.IAM_ORIENTATION=Ur,n.IAM_PLATFORM_TYPE=Mr,n.IAM_STATUS=Cr,n.IAM_TIMEUNIT=xr,n.IAM_VERTICAL_ALIGNMENT=Fr,n.IdentifierType=Vt,n.IdentifiersBuilder=zt,n.InAppMessage=Vr,n.InAppMessageAction=Cn,n.InAppMessageAlignment=hn,n.InAppMessageBackground=Rn,n.InAppMessageButton=In,n.InAppMessageButtonStyle=Sn,n.InAppMessageContext=sn,n.InAppMessageContextLayout=pn,n.InAppMessageContextMessage=cn,n.InAppMessageDecision=wt,n.InAppMessageDurationCap=Qr,n.InAppMessageEventFrequencyCap=Wr,n.InAppMessageEventTrigger=Jr,n.InAppMessageEventTriggerRule=Yr,n.InAppMessageExperimentContext=un,n.InAppMessageIdentifierCap=Xr,n.InAppMessageImage=vn,n.InAppMessageImageAutoScroll=gn,n.InAppMessagePeriodAlways=Br,n.InAppMessagePeriodCustom=Gr,n.InAppMessagePositionalButton=On,n.InAppMessageTargetContext=tn,n.InAppMessageText=En,n.InAppMessageTextAttribute=bn,n.InAppMessageTextStyle=_n,n.InAppMessageUserOverride=nn,n.Logger=s,n.MATCH_OPERATORS=Ir,n.MATCH_TYPES=Tr,n.MATCH_VALUE_TYPES=_r,n.MetaVersion=wr,n.ParameterConfiguration=St,n.PropertyOperations=Ao,n.PropertyOperationsBuilder=_o,n.RemoteConfigDecision=mt,n.RemoteConfigParameter=lr,n.RemoteConfigParameterValue=dr,n.RemoteConfigTargetRule=fr,n.SEGMENT_TYPES=Nr,n.Segment=ir,n.Slot=Lt,n.SplitUrlConfig=Un,n.SplitUrlTargets=Dn,n.TARGET_ACTION_TYPES=Ar,n.TARGET_KEY_TYPES=Or,n.Target=Jt,n.TargetAction=er,n.TargetCondition=qt,n.TargetKey=$t,n.TargetMatch=Zt,n.TargetRule=rr,n.TargetingType=Sr,n.Variation=Pt,n.Version=yr,n.createInstance=function(e,t){return new AS(e,t)},n.getUserId=zo,n.removeUserId=Go,n.resolveIdentifiers=Bt,n.sanitizeUser=Kt,n.setUserId=function(e){jo.getInstance().setItem(Qe,e)},n.useFeature=function(e){var t=(n=U.exports.useContext(VC)).hackle,r=n.userVersion,n=n.initialized,i=U.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e))||!1},[e,t,n]),o=(s=ES(U.exports.useState(function(){return t?i():("undefined"!=typeof window&&BC.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=ES(U.exports.useState(r),2))[0],n=n[1];return YC(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=U.exports.useContext(VC)).hackle,r=n.userVersion,n=n.initialized,i=U.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||It.off(f.EXCEPTION)},[e,t,n]),o=(s=ES(U.exports.useState(function(){return t?i():("undefined"!=typeof window&&BC.error("HackleClient is not existed"),It.off(f.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=ES(U.exports.useState(r),2))[0],n=n[1];return YC(a,r)||(n(r),s(i())),o},n.useLoadableFeature=KC,n.useLoadableFeatureDetail=JC,n.useLoadableRemoteConfig=function(){var e=(o=U.exports.useContext(VC)).hackle,t=o.userVersion,r=o.initialized,n=U.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new Ot},[e,r]),i=(o=ES(U.exports.useState(function(){return e||BC.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=ES(U.exports.useState(t),2))[0],a=a[1];return YC(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=zC,n.useLoadableVariationDetail=GC,n.useRemoteConfig=function(){var e=(r=U.exports.useContext(VC)).hackle,t=r.userVersion,r=r.initialized,n=U.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new Ot},[e,r]),i=(o=ES(U.exports.useState(function(){return e||BC.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=ES(U.exports.useState(t),2))[0],r=r[1];return YC(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=U.exports.useContext(VC).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(BC.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=U.exports.useContext(VC)).hackle,n=a.userVersion,i=a.initialized,o=U.exports.useCallback(function(){return i&&(null==r?void 0:r.variation(e))||t},[t,e,r,i]),s=(a=ES(U.exports.useState(function(){return r?o():("undefined"!=typeof window&&BC.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=ES(U.exports.useState(n),2))[0],c=c[1];return YC(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=U.exports.useContext(VC)).hackle,n=i.userVersion,i=i.initialized,o=U.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||Tt.of(t,f.EXCEPTION)},[t,e,r,i]),s=(a=ES(U.exports.useState(function(){return r?o():("undefined"!=typeof window&&BC.error("HackleClient is not existed"),Tt.of(t,f.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=ES(U.exports.useState(n),2))[0],i=i[1];return YC(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",z="function"==typeof atob,t="function"==typeof btoa,r="function"==typeof Buffer;const G="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=z?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"):G?e=>G.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()}};_e.isNotNullOrUndefined=function(e){return null!=e},_e.isNullOrUndefined=function(e){return null==e},_e.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},_e.fromMap=function(e){var r={};return e.forEach(function(e,t){r[t]=e}),r};var u=_e;function _e(){}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.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 p=be;function be(){}var Te={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},s=(Ie.setLogLevel=function(e){this.logLevel=e=void 0===e?Te.INFO:e},Ie.initCounter=function(t){this.counters=p.associate(Object.keys(Te),function(e){return[e,t(e)]})},Ie._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)Ae.log(e,r,t.message,t);else try{Ae.log(e,r,t)}catch(e){}},Ie.increment=function(e){var t;null!=(t=null==(t=Ie.counters)?void 0:t.get(e))&&t.increment()},Ie.logLevel=Te.INFO,Ie.log={error:function(e){Te.ERROR<=Ie.logLevel&&(Ie._log("ERROR",e),Ie.increment("ERROR"))},warn:function(e){Te.WARN<=Ie.logLevel&&(Ie._log("WARN",e),Ie.increment("WARN"))},info:function(e){Te.INFO<=Ie.logLevel&&(Ie._log("INFO",e),Ie.increment("INFO"))},debug:function(e){Te.DEBUG<=Ie.logLevel&&(Ie._log("DEBUG",e),Ie.increment("DEBUG"))}},Ie);function Ie(){}Oe.log=function(e,t,r,n){try{console.log("%c[".concat(e,"] Hackle: ").concat(r),"color: ".concat(t))}catch(e){}};var Ae=Oe;function Oe(){}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 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}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 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 Ce=s.log,Me=(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)?Ce.debug("Invalid identifier value. The identifier type value be a string of 512 characters or less. [".concat(o,"]")):t[o]=i):Ce.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(){}ze.prototype.get=function(e,t){e=this.parameters.get(e);return!u.isNullOrUndefined(e)&&(u.isNullOrUndefined(t)||typeof e==typeof t)?e:t};var He=ze;function ze(e){this.parameters=e}var Ge="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}_t.prototype.isShow=function(){return u.isNotNullOrUndefined(this.inAppMessage)&&u.isNotNullOrUndefined(this.message)},_t.of=function(e,t,r,n){return new _t(t,r,e,n=void 0===n?{}:n)};var wt=_t;function _t(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 je:r,n=void 0===n?void 0:n)},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}At.on=function(e,t,r){return new At(!0,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},At.off=function(e,t,r){return new At(!1,e,t=void 0===t?new je:t,r=void 0===r?void 0:r)},At.prototype.get=function(e,t){return this.config.get(e,t)};var It=At;function At(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 Ot=Nt;function Nt(){}Rt.fromJson=function(e){return new Rt(e.id,new He(p.associate(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";var f=h;function h(){}var Ct=["DEFAULT","SPLIT_URL","IN_APP_MESSAGE"],Mt=(xt.fromJson=function(e,t){var r=xt.experimentStatusOrNull(t.execution.status),n=t.variations.map(function(e){return new Pt(e.id,e.key,"DROPPED"===e.status,e.parameterConfigurationId)}),i=p.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),o=p.mapNotNullOrUndefined(t.execution.segmentOverrides,function(e){return rr.fromJson(e,Sr.IDENTIFIER)}),s=p.mapNotNullOrUndefined(t.execution.targetAudiences,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),a=Ln.fromJson(t.execution.targetUrls),u=yt(Ct,t.implementationType),c=p.mapNotNullOrUndefined(t.execution.targetRules,function(e){return rr.fromJson(e,Sr.PROPERTY)}),l=er.fromJson(t.execution.defaultRule);return r&&u&&l&&new xt(t.id,t.key,e,t.identifierType,r,t.version,t.execution.version,n,i,o,s,a,c,l,t.containerId,u,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}var Pt=function(e,t,r,n){this.id=e,this.key=t,this.isDropped=r,this.parameterConfigurationId=n},Ut=(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)}))},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()}Gt.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},Gt.prototype.add=function(e,t){var r=Me.sanitizeValue(t);return Me.isValidType(e)&&r?this.identifiers[e]=t:vt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},Gt.prototype.build=function(){return this.identifiers};var zt=Gt;function Gt(){this.identifiers={}}function Kt(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=Ue.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(p.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(Or,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(br,e.type),r=yt(Ir,e.operator),n=yt(Tr,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(Ar,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(Nr,e.type);return t&&new or(e.id,e.key,t,p.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(Tr,e.type),r=p.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}vr.fromJson=function(e){return new vr(e.id,e.value)};var dr=vr;function vr(e,t){this.id=e,this.rawValue=t}gr.tryParse=function(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 yr=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}_r.parse=function(e){return e?new _r(e.split(".")):_r.EMPTY},_r.prototype.isEmpty=function(){return 0===this.identifiers.length},_r.prototype.isNotEmpty=function(){return!this.isEmpty()},_r.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},_r.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=_r.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},_r.compareIdentifiers=function(e,t){return _r.numericIdentifierRegExp.test(e)&&_r.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},_r.EMPTY=new _r([]),_r.numericIdentifierRegExp=/^(0|[1-9]\d*)$/;var wr=_r;function _r(e){this.identifiers=e}var br=["MATCH","NOT_MATCH"],Tr=["STRING","NUMBER","BOOLEAN","VERSION","JSON","URL","NULL","UNKNOWN"],Ir=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ar=["VARIATION","BUCKET"],Or=["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"],Nr=["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 Cr=["ACTIVE","DRAFT","PAUSE"],Mr=["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(Cr,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 Gr(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"}Kr.prototype.within=function(e){return this.startMillisInclusive<=e&&e<this.endMillisExclusive};var Gr=Kr;function Kr(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,p.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(De,e.durationUnit.timeUnit);return t?new en(Le.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),p.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)),gt(Mr,e.platformTypes));if(!u.isNullOrUndefined(r)){var n=gt(kr,e.orientations);if(!u.isNullOrUndefined(n)){var i=p.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=p.mapOrUndefined(e.images,vn.fromJson);if(!u.isNullOrUndefined(r)){var n=void 0;if(!u.isNotNullOrUndefined(e.imageAutoScroll)||(n=gn.fromJson(e.imageAutoScroll),!u.isNullOrUndefined(n))){var i=p.mapOrUndefined(e.buttons,In.fromJson);if(!u.isNullOrUndefined(i)){var o=void 0;if(!u.isNotNullOrUndefined(e.closeButton)||(o=In.fromJson2(e.closeButton),!u.isNullOrUndefined(o))){var s=p.mapOrUndefined(e.outerButtons,On.fromJson),a=p.mapOrUndefined(e.innerButtons,On.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?Cn.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}yn.fromJson=function(e){var t=yt(kr,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 yn(t,e.imagePath,r)}},yn.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 vn=yn;function yn(e,t,r){this.orientation=e,this.imagePath=t,this.action=r}mn.fromJson=function(e){var t=yt(De,e.interval.timeUnit);if(t)return new mn(Le.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(_n.fromJson(e.title),_n.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}bn.fromJson=function(e){return new bn(e.text,new Tn(e.style.textColor))};var _n=bn;function bn(e,t){this.text=e,this.style=t}var Tn=function(e){this.color=e},In=(An.fromJson=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new An(e.text,new Sn(e.style.textColor,e.style.bgColor,e.style.borderColor),t)},An.fromJson2=function(e){var t=Cn.fromJson(e.action);if(!u.isNullOrUndefined(t))return new An("✕",new Sn(e.style.color,"#FFFFFF","#FFFFFF"),t)},An.prototype.toJson=function(){return{text:this.text,action:this.action.toJson(),style:{textColor:this.style.textColor,bgColor:this.style.backgroundColor,borderColor:this.style.borderColor}}},An.prototype.toCloseButtonJson=function(){return{action:this.action.toJson(),style:{color:this.style.textColor}}},An);function An(e,t,r){this.text=e,this.style=t,this.action=r}Nn.fromJson=function(e){var t=In.fromJson(e.button);if(!u.isNullOrUndefined(t)){e=hn.fromJson(e.alignment);if(!u.isNullOrUndefined(e))return new Nn(t,e)}},Nn.prototype.toJson=function(){return{button:this.button.toJson(),alignment:this.alignment.toJson()}};var On=Nn;function Nn(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},Cn=(Mn.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 Mn(t,r,null!=(t=e.value)?t:void 0)}},Mn.prototype.toJson=function(){var e;return{behavior:this.behavior,type:this.type,value:null!=(e=this.value)?e:null}},Mn);function Mn(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(p.mapNotNullOrUndefined(e.match,function(e){return Jt.fromJson(e,Sr.PROPERTY)}),p.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 p.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}Gn.start=function(e){return new Gn(e=void 0===e?Gn.defaultClock:e)},Gn.prototype.stop=function(e){var t=this._clock.tick()-this.startTime;e.record(t,"microseconds")},Gn.defaultClock=new Fe;var zn=Gn;function Gn(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 Kn=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 Kn(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)}Se(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 Le.nanosToUnit(this._total,e)},si.prototype.max=function(e){return Le.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=Le.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)}Se(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)}yi.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")})]},yi.prototype.count=function(){return 0},yi.prototype.totalTime=function(e){return 0},yi.prototype.max=function(e){return 0},yi.prototype.mean=function(e){return 0},yi.prototype.record=function(e,t){};var vi=yi;function yi(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 vi(e)}Se(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,i=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}bi.counter=function(e,t){return bi.globalRegistry.counter(e,t)},bi.timer=function(e,t){return bi.globalRegistry.timer(e,t)},bi.addRegistry=function(e){bi.globalRegistry.add(e),s.log.debug("MetricRegistry added ".concat(e.name))},bi.globalRegistry=new i;var _i=bi;function bi(){}Ii.equalsIgnoreCase=function(e,t){return e.toLowerCase()===t.toLowerCase()},Ii.isNotEmptyString=function(e){return!u.isNullOrUndefined(e)&&("string"==typeof e&&0<e.length)};var Ti=Ii;function Ii(){}Oi.builder=function(){return new Ni},Oi.get=function(e){return Oi.builder().url(e).build()},Oi.prototype.toBuilder=function(){return new Ni(this)};var Ai=Oi;function Oi(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 Ai(this._url,this._method,this._body,this._headers.build(),e)};var Ni=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:Mi.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:Mi.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 Ri=Ci;function Ci(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(Ti.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 Mi=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 Mi(this.headers)};var Pi=Ui;function Ui(e){this.headers=e}Se(Li,ki=e),Li.prototype.flushMetrics=function(e,t){var r=this;p.chunked(e.filter(this.isDispatchTarget.bind(this)),We).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 Ai.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(p.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=_i.timer("experiment.decision",{key:String(t),variation:r.variation,reason:String(r.reason)});e.stop(t)},Vi.featureFlag=function(e,t,r){t=_i.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=_i.timer("remote.config.decision",{key:String(t),reason:String(r.reason)});e.stop(t)},Vi.inAppMessage=function(e,t,r){t=_i.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=_i.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)?mt.of(n,f.INVALID_INPUT):e.remoteConfig(t,i,r,n)};var Hi=zi;function zi(){}var Gi=s.log,Ki=(Ji.prototype.get=function(t,r){var n,e=zn.start();try{n=this.decide(t,r)}catch(e){Gi.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),n=mt.of(r,f.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=Ue.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}(Q=Yi=Yi||{}).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";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:Re([e],t,!0)},io.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=io;function io(){}Se(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}Se(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}Se(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}Se(go,vo=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 vo,yo=go;function go(){return null!==vo&&vo.apply(this,arguments)||this}Se(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}bo.prototype.operate=function(e,t){return new Map};var _o=bo;function bo(){}Io.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 yo;case Yi.CLEAR_ALL:return new _o;case Yi.REMOVE:return new Eo}};var To=Io;function Io(){}Oo.prototype.set=function(e,t){return this.add(Yi.SET,e,t)},Oo.prototype.setOnce=function(e,t){return this.add(Yi.SET_ONCE,e,t)},Oo.prototype.unset=function(e){return this.add(Yi.UNSET,e,"-")},Oo.prototype.increment=function(e,t){return this.add(Yi.INCREMENT,e,t)},Oo.prototype.append=function(e,t){return this.add(Yi.APPEND,e,t)},Oo.prototype.appendOnce=function(e,t){return this.add(Yi.APPEND_ONCE,e,t)},Oo.prototype.prepend=function(e,t){return this.add(Yi.PREPEND,e,t)},Oo.prototype.prependOnce=function(e,t){return this.add(Yi.PREPEND_ONCE,e,t)},Oo.prototype.remove=function(e,t){return this.add(Yi.REMOVE,e,t)},Oo.prototype.clearAll=function(){return this.add(Yi.CLEAR_ALL,"clearAll","-")},Oo.prototype.build=function(){var e=Array.from(this.operations.entries()).map(function(e){return[e[0],e[1].build()]});return new No(new Map(e))},Oo.prototype.containsKey=function(t){return Array.from(this.operations.entries()).some(function(e){return e[0],e[1].contains(t)})},Oo.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 Ao=Oo;function Oo(){this.operations=new Map}So.prototype.operate=function(e){var r=e;return this.operations.forEach(function(e,t){r=To.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]),Ue.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 No=So;function So(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 Ro=Co;function Co(){}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 Mo=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}var Po=s.log,Uo=(ko.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]),Po.debug("HackleClient initializing"),[4,this.synchronizer.sync()];case 1:return e.sent(),Po.debug("HackleClient initialized"),[3,4];case 2:throw t=e.sent(),Po.error("HackleClient initialize failed: ".concat(t)),t;case 3:return this.initialized=!0,[7];case 4:return[2]}})})},ko.prototype.getSessionId=function(){return this.sessionManager.sessionId},ko.prototype.getUser=function(){return this.userManager.currentUser},ko.prototype.setUser=function(e){try{var t=Kt(e);if(!t)return Po.warn("invalid user"),Promise.resolve();var r=this.userManager.setUser(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Po.error("Unexpected exception while set user: ".concat(e)),Promise.resolve()}},ko.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 Po.warn("Invalid userId. [userId=".concat(e,"]")),Promise.resolve();t=this.userManager.setUserId(r)}return this.userManager.syncIfNeeded(t).catch(function(){})}catch(e){return Po.error("Unexpected exception while set userId: ".concat(e)),Promise.resolve()}},ko.prototype.setDeviceId=function(e){try{var t=Me.sanitizeValue(e);if(!t)return Po.warn("Invalid deviceId. [deviceId=".concat(e,"]")),Promise.resolve();var r=this.userManager.setDeviceId(t);return this.userManager.syncIfNeeded(r).catch(function(){})}catch(e){return Po.error("Unexpected exception while set deviceId: ".concat(e)),Promise.resolve()}},ko.prototype.setUserProperty=function(e,t){e=(new Ao).set(e,t).build();return this.updateUserProperties(e)},ko.prototype.setUserProperties=function(e){try{var t=Ue.sanitize(e),r=new Ao;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 Po.error("Unexpected exception while set userProperties: ".concat(e)),Promise.resolve()}},ko.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 Po.error("Unexpected exception while update userProperties: ".concat(e)),Promise.resolve()}},ko.prototype.resetUser=function(){try{var e=this.userManager.resetUser(),t=(new Ao).clearAll().build();return this.track(t.toEvent()),this.userManager.syncIfNeeded(e).catch(function(){})}catch(e){return Po.error("Unexpected exception while reset user: ".concat(e)),Promise.resolve()}},ko.prototype.variation=function(e,t,r){return this.variationDetail(e,t,r).variation},ko.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 Po.error("Unexpected exception while deciding variation for experiment[".concat(r,"]. Returning default variation[").concat(i,"] : ").concat(e)),bt.of(i,f.EXCEPTION)}}(this);return Fi.experiment(e,r,t),t},ko.prototype.isFeatureOn=function(e,t){return this.featureFlagDetail(e,t).isOn},ko.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 Po.error("Unexpected exception while deciding feature flag[".concat(r,"]. Returning default value[false] : ").concat(e)),It.off(f.EXCEPTION)}}(this);return Fi.featureFlag(e,r,t),t},ko.prototype.track=function(e,t){try{Po.debug("track event : ".concat(JSON.stringify(e)));var r=this._convertEvent(e),n=this.userManager.resolve(t);this.core.track(r,n)}catch(e){Po.error("Unexpected exception while tracking event: ".concat(e))}},ko.prototype.trackPageView=function(e){var t=Mo.createWithCurrentPage();this.pageEventTracker.track(t)},ko.prototype.remoteConfig=function(e){return new Ki(this.core,this.userManager,e)},ko.prototype.onReady=function(e,t){this.onInitialized({timeout:t=void 0===t?3e3:t}).finally(function(){return e()})},ko.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(),Po.error("Failed to onInitialized: ".concat(t)),[2,{success:!1}];case 4:return[2]}})})},ko.prototype._convertEvent=function(e){return"string"==typeof e?{key:e}:e},ko.prototype.showUserExplorer=function(){var e;null!=(e=this.devTools)&&e.userExplorer?(Po.debug("UserExplorer opened."),_i.counter("user.explorer.show",{}).increment(),this.devTools.manager.userExplorer(this.devTools.userExplorer)):Po.error("UserExplorer is not provided")},ko.prototype.hideUserExplorer=function(){this.devTools?this.devTools.manager.close():Po.warn("There is no active HackleDevtools.")},ko.prototype.fetch=function(){var e=this;return this.fetchThrottler.execute(function(){return e.synchronizer.sync()},function(){return Promise.resolve()})},ko.prototype.setInAppMessageListener=function(e){this.inAppMessageUi.setListener(e)},ko.prototype.close=function(){Po.debug("HackleClient closing"),this.core.close(),this.synchronizer.close()},ko);function ko(e,t,r,n,i,o,s,a){this.core=e,this.synchronizer=t,this.sessionManager=r,this.userManager=n,this.fetchThrottler=i,this.pageEventTracker=o,this.inAppMessageUi=s,this.devTools=a,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.initialization=this.initialize()}var Do=s.log,Lo=(Fo.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 Do.error("Unexpected exception while deciding remote config parameter[".concat(t,"]. Returning default value. : ").concat(e)),r}},Fo);function Fo(e,t){this.invocationProcessor=e,this.user=t}jo.tryParse=function(e){try{return new URL(e)}catch(e){return}},jo.removePathnameTrailingSlash=function(e){var t=e instanceof URL?e:jo.tryParse(e);return t?(t.pathname.endsWith("/")&&(t.pathname=t.pathname.replace(/\/+$/,"")),t.href):String(e)},jo.tryDecodeURI=function(e){try{return decodeURI(e)}catch(e){return}},jo.tryDecodeURIComponent=function(e){try{return decodeURIComponent(e)}catch(e){return}},jo.decodeURIOrOriginal=function(t){try{return decodeURI(t)}catch(e){return t}},jo.decodeURIComponentOrOriginal=function(t){try{return decodeURIComponent(t)}catch(e){return t}};var Vo=jo;function jo(){}Ho.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]:""},Ho.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=Vo.tryDecodeURIComponent(o.substring(r.length,o.length)))?t:null}return null},Ho.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},Ho.prototype.setItem=function(e,t,r){var r=c(c({},this.options),r),n="",i="",o="",s="",a=(r.isCrossSubdomain&&(n=(a=Ho.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},Ho.prototype.removeItem=function(e,t){this.setItem(e,"",c(c({},t),{days:-1}))},Ho.prototype.getOptions=function(){return this.options},Ho.getInstance=function(e){return void 0===e&&(e={days:Xe,isCrossSubdomain:!0}),Ho.storage=Ho.storage?Ho.storage:new Ho(e)};var Bo=Ho;function Ho(e){this.options=e=void 0===e?{days:0,isCrossSubdomain:!1,isSecure:!1}:e}Go.prototype.initialize=function(){Bo.getInstance().getItem(Ze)||Yo()},Go.prototype.onLifecycleChanged=function(e,t){switch(e){case"hidden":case"pagehide":return Jo();case"blur":case"focus":case"locationChange":case"visible":case"pageshow":return}};var zo=Go;function Go(){}function Ko(){var e=Bo.getInstance(),t=e.getItem(Qe);if(t)return t;t=e.getItem(Ze);return t||Yo()}function Jo(){Bo.getInstance().removeItem(Qe)}function Yo(){var e=H();return Bo.getInstance().setItem(Ze,e),e}var Wo,qo=s.log;(r=Wo=Wo||{}).native="native",r.web_view_wrapper="web_view_wrapper";d.prototype.getSessionId=function(){try{var e=this.invocationProcessor.process({command:"getSessionId"});return null!=e?e:Ko()}catch(e){return qo.error("Unexpected exception while get sessionId: ".concat(e)),Ko()}},d.prototype.getUser=function(){var e;try{var t=this.invocationProcessor.process({command:"getUser"});return null!=(e=Kt(t))?e:this.defaultUser()}catch(e){return qo.error("Unexpected exception while get user: ".concat(e)),this.defaultUser()}},d.prototype.setUser=function(n){return a(this,void 0,void 0,function(){var t,r;return l(this,function(e){try{if(!(t=Kt(n)))return qo.warn("invalid user"),[2];r={command:"setUser",parameters:{user:t}},this.invocationProcessor.process(r)}catch(e){qo.error("Unexpected exception while set user: ".concat(e))}return[2]})})},d.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 qo.warn("Invalid userId. [userId=".concat(n,"]")),[2];r={command:"setUserId",parameters:{userId:t}},this.invocationProcessor.process(r)}catch(e){qo.error("Unexpected exception while set userId: ".concat(e))}return[2]})})},d.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 qo.warn("Invalid deviceId. [deviceId=".concat(n,"]")),[2];r={command:"setDeviceId",parameters:{deviceId:t}},this.invocationProcessor.process(r)}catch(e){qo.error("Unexpected exception while set deviceId: ".concat(e))}return[2]})})},d.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){qo.error("Unexpected exception while set userProperty: ".concat(e))}return[2]})})},d.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 Ao,Object.entries(t).forEach(function(e){var t=e[0],e=e[1];r.set(t,e)}),this.updateUserProperties(r.build())}catch(e){qo.error("Unexpected exception while set userProperties: ".concat(e))}return[2]})})},d.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){qo.error("Unexpected exception while update userProperties: ".concat(e))}return[2]})})},d.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){qo.error("Unexpected exception while reset user: ".concat(e))}return[2]})})},d.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 qo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),r}},d.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 He(new Map(Object.entries(null!=(n=o.config.parameters)?n:{}))))}catch(e){return qo.error("Unexpected exception while deciding variation for experiment[".concat(t,"]. Returning default variation[").concat(r,"] : ").concat(e)),bt.of(r,f.EXCEPTION)}},d.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 qo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),!1}},d.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 It(i.isOn,i.reason,new He(new Map(Object.entries(null!=(r=i.config.parameters)?r:{}))),void 0)}catch(e){return qo.error("Unexpected exception while deciding feature flag[".concat(t,"]. Returning default value[false] : ").concat(e)),It.off(f.EXCEPTION)}},d.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){qo.error("Unexpected exception while tracking event: ".concat(e))}},d.prototype.trackPageView=function(e){qo.info("Web to app integration feature is not support 'trackPageView' method")},d.prototype.remoteConfig=function(e){return new Lo(this.invocationProcessor,this.convertUser(e))},d.prototype.onReady=function(e,t){e()},d.prototype.showUserExplorer=function(){try{this.invocationProcessor.process({command:"showUserExplorer"})}catch(e){qo.error("Unexpected exception while show userExplorer: ".concat(e))}},d.prototype.hideUserExplorer=function(){qo.info("Web to app integration feature is not support 'hideUserExplorer' method")},d.prototype.setInAppMessageListener=function(e){qo.info("Web to app integration feature is not support 'setInAppMessageListener' method")},d.prototype.fetch=function(){return Promise.resolve()},d.prototype.onInitialized=function(e){return Promise.resolve({success:!0})},d.prototype.close=function(){qo.info("Web to app integration feature is not support 'close' method")},d.prototype.convertEvent=function(e){return"string"==typeof e?{key:e}:e},d.prototype.convertUser=function(e){return"string"==typeof e||e&&null!=(e=Kt(e))?e:void 0},d.prototype.defaultUser=function(){return{deviceId:Ko()}};var $o=d;function d(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)}Zo.prototype.getSessionId=function(){return this.browser.getSessionId()},Zo.prototype.getUser=function(){return this.browser.getUser()},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.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]}})})},Zo.prototype.variation=function(e,t,r){return this.browser.variation(e,t,r=void 0===r?"A":r)},Zo.prototype.variationDetail=function(e,t,r){return this.browser.variationDetail(e,t,r=void 0===r?"A":r)},Zo.prototype.isFeatureOn=function(e,t){return this.browser.isFeatureOn(e,t)},Zo.prototype.featureFlagDetail=function(e,t){return this.browser.featureFlagDetail(e,t)},Zo.prototype.track=function(e,t){return this.browser.track(e,t)},Zo.prototype.trackPageView=function(e){return this.browser.trackPageView(e)},Zo.prototype.remoteConfig=function(e){return this.browser.remoteConfig(e)},Zo.prototype.onReady=function(e,t){this.browser.onReady(e,t)},Zo.prototype.showUserExplorer=function(){this.browser.showUserExplorer()},Zo.prototype.hideUserExplorer=function(){this.browser.hideUserExplorer()},Zo.prototype.fetch=function(){return this.browser.fetch()},Zo.prototype.onInitialized=function(e){return this.browser.onInitialized(e)},Zo.prototype.close=function(){this.browser.close()},Zo.prototype.setInAppMessageListener=function(e){this.browser.setInAppMessageListener(e)};var Xo=Zo;function Zo(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)}function Qo(e){return e&&e.Math==Math&&e}function es(e){try{return!!e()}catch(e){return!0}}function ts(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function rs(e){return Vs(Fs(e),8,-1)}function ns(e){if(null==e)throw zs("Can't call method on "+e);return e}function is(e){return Gs(Ks(e))}function os(e){return"function"==typeof e}function ss(e){return"object"==typeof e?null!==e:Js(e)}function as(e,t){return arguments.length<2?(r=Ys[e],Ws(r)?r:void 0):Ys[e]&&Ys[e][t];var r}function us(e){try{return na(e)}catch(e){return"Object"}}function cs(e){if(ia(e))return e;throw sa(oa(e)+" is not a function")}function ls(e,t){return null==(e=e[t])?void 0:aa(e)}function ps(t,r){try{ha(fa,t,{value:r,configurable:!0,writable:!0})}catch(e){fa[t]=r}return r}function fs(e){return ga(ya(e))}function hs(e){return"Symbol("+(void 0===e?"":e)+")_"+Ta(++_a+ba,36)}function ds(e){var t;return Aa(Ra,e)&&(Na||"string"==typeof Ra[e])||(t="Symbol."+e,Na&&Aa(Ca,e)?Ra[e]=Ca[e]:Ra[e]=(Sa&&Ma?Ma:xa)(t)),Ra[e]}function vs(e){return e=ja(e,"string"),Ba(e)?e:e+""}function ys(e){return za?Ha.createElement(e):{}}function gs(e){if(Qa(e))return e;throw tu(eu(e)+" is not an object")}function ms(e){return yu[e]||(yu[e]=vu(e))}function Es(e,t,r,n){var i=(n=n||{}).enumerable,o=void 0!==n.name?n.name:t;if(Uu(r)&&Du(r,o,n),n.global)i?e[t]=r:Lu(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:ku.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e}function ws(e){return(e=+e)!=e||0==e?0:ju(e)}function _s(e,t){return(e=Bu(e))<0?Hu(e+t,0):zu(e,t)}function v(e){return Ju(e.length)}function bs(a){return function(e,t,r){var n,i=Yu(e),o=qu(i),s=Wu(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 Ts(e,t){var r,n=Xu(e),i=0,o=[];for(r in n)!$u(Qu,r)&&$u(n,r)&&ec(o,r);for(;t.length>i;)!$u(n,r=t[i++])||~Zu(o,r)||ec(o,r);return o}function Is(e,t,r){for(var n=uc(t),i=lc.f,o=cc.f,s=0;s<n.length;s++){var a=n[s];ac(e,a)||r&&ac(r,a)||i(e,a,o(t,a))}}function As(e,t){return(e=vc[dc(e)])==gc||e!=yc&&(fc(t)?pc(t):!!t)}function y(e,t){var r,n,i,o=e.target,s=e.global,a=e.stat,u=s?mc:a?mc[o]||bc(o,{}):(mc[o]||{}).prototype;if(u)for(r in t){if(n=t[r],i=e.dontCallGetSet?(i=Ec(u,r))&&i.value:u[r],!Ic(s?r:o+(a?".":"#")+r,e.forced)&&void 0!==i){if(typeof n==typeof i)continue;Tc(n,i)}(e.sham||i&&i.sham)&&wc(n,"sham",!0),_c(u,r,n,e)}}var Os,Ns,Ss,Rs,Cs,Ms,xs,Ps,z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i=Qo("object"==typeof globalThis&&globalThis)||Qo("object"==typeof window&&window)||Qo("object"==typeof self&&self)||Qo("object"==typeof z&&z)||function(){return this}()||Function("return this")(),e={},Q=!es(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),t=!es(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),Us=Function.prototype.call,r=t?Us.bind(Us):function(){return Us.apply(Us,arguments)},z={},g={}.propertyIsEnumerable,ks=Object.getOwnPropertyDescriptor,m=ks&&!g.call({1:2},1),m=(z.f=m?function(e){e=ks(this,e);return!!e&&e.enumerable}:g,t),g=Function.prototype,E=g.bind,Ds=g.call,Ls=m&&E.bind(Ds,Ds),g=m?function(e){return e&&Ls(e)}:function(e){return e&&function(){return Ds.apply(e,arguments)}},E=g,Fs=E({}.toString),Vs=E("".slice),m=es,js=rs,Bs=Object,Hs=g("".split),E=m(function(){return!Bs("z").propertyIsEnumerable(0)})?function(e){return"String"==js(e)?Hs(e,""):Bs(e)}:Bs,zs=TypeError,Gs=E,Ks=ns,Js=os,Ys=i,Ws=os,m=g({}.isPrototypeOf),qs=as("navigator","userAgent")||"",w=qs,$s=i.process,Xs=i.Deno,$s=$s&&$s.versions||Xs&&Xs.version,Xs=$s&&$s.v8,$s=b=!(b=Xs?0<(_=Xs.split("."))[0]&&_[0]<4?1:+(_[0]+_[1]):b)&&w&&(!(_=w.match(/Edge\/(\d+)/))||74<=_[1])&&(_=w.match(/Chrome\/(\d+)/))?+_[1]:b,Zs=$s,Xs=es,w=!!Object.getOwnPropertySymbols&&!Xs(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Zs&&Zs<41}),_=w&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Qs=as,ea=os,ta=m,ra=Object,b=_?function(e){return"symbol"==typeof e}:function(e){var t=Qs("Symbol");return ea(t)&&ta(t.prototype,ra(e))},na=String,ia=os,oa=us,sa=TypeError,aa=cs,ua=r,ca=os,la=ss,pa=TypeError,Xs={exports:{}},fa=i,ha=Object.defineProperty,da=ps,T="__core-js_shared__",da=i[T]||da(T,{}),va=da,ya=((Xs.exports=function(e,t){return va[e]||(va[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"}),ns),ga=Object,ma=fs,Ea=g({}.hasOwnProperty),T=Object.hasOwn||function(e,t){return Ea(ma(e),t)},wa=g,_a=0,ba=Math.random(),Ta=wa(1..toString),wa=i,Ia=Xs.exports,Aa=T,Oa=hs,Na=w,Sa=_,Ra=Ia("wks"),Ca=wa.Symbol,Ma=Ca&&Ca.for,xa=Sa?Ca:Ca&&Ca.withoutSetter||Oa,Pa=r,Ua=ss,ka=b,Da=ls,La=function(e,t){var r,n;if("string"===t&&ca(r=e.toString)&&!la(n=ua(r,e)))return n;if(ca(r=e.valueOf)&&!la(n=ua(r,e)))return n;if("string"!==t&&ca(r=e.toString)&&!la(n=ua(r,e)))return n;throw pa("Can't convert object to primitive value")},Fa=TypeError,Va=ds("toPrimitive"),ja=function(e,t){if(!Ua(e)||ka(e))return e;var r=Da(e,Va);if(r){if(r=Pa(r,e,t=void 0===t?"default":t),!Ua(r)||ka(r))return r;throw Fa("Can't convert object to primitive value")}return La(e,t=void 0===t?"number":t)},Ba=b,w=ss,Ha=i.document,za=w(Ha)&&w(Ha.createElement),Ga=ys,_=!Q&&!es(function(){return 7!=Object.defineProperty(Ga("div"),"a",{get:function(){return 7}}).a}),Ka=r,Ja=z,Ya=ts,Wa=is,qa=vs,$a=T,Xa=_,Za=Object.getOwnPropertyDescriptor,Ia=(e.f=Q?Za:function(e,t){if(e=Wa(e),t=qa(t),Xa)try{return Za(e,t)}catch(e){}if($a(e,t))return Ya(!Ka(Ja.f,e,t),e[t])},{}),wa=Q&&es(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Qa=ss,eu=String,tu=TypeError,ru=_,nu=gs,iu=vs,ou=TypeError,su=Object.defineProperty,au=Object.getOwnPropertyDescriptor,uu="enumerable",cu="configurable",lu="writable",Oa=(Ia.f=Q?wa?function(e,t,r){var n;return nu(e),t=iu(t),nu(r),"function"==typeof e&&"prototype"===t&&"value"in r&&lu in r&&!r[lu]&&((n=au(e,t))&&n[lu]&&(e[t]=r.value,r={configurable:(cu in r?r:n)[cu],enumerable:(uu in r?r:n)[uu],writable:!1})),su(e,t,r)}:su:function(e,t,r){if(nu(e),t=iu(t),nu(r),ru)try{return su(e,t,r)}catch(e){}if("get"in r||"set"in r)throw ou("Accessors not supported");return"value"in r&&(e[t]=r.value),e},Q),pu=Ia,fu=ts,b=Oa?function(e,t,r){return pu.f(e,t,fu(1,r))}:function(e,t,r){return e[t]=r,e},w={exports:{}},z=Q,_=T,Oa=Function.prototype,I=z&&Object.getOwnPropertyDescriptor,_=_(Oa,"name"),_={EXISTS:_,PROPER:_&&"something"===function(){}.name,CONFIGURABLE:_&&(!z||I(Oa,"name").configurable)},z=os,I=da,hu=g(Function.toString),Oa=(z(I.inspectSource)||(I.inspectSource=function(e){return hu(e)}),I.inspectSource),z=os,I=Oa,du=i.WeakMap,z=z(du)&&/native code/.test(I(du)),I=Xs.exports,vu=hs,yu=I("keys"),du={},Xs=g,gu=ss,mu=b,Eu=T,I=da,wu=ms,_u=du,bu="Object already initialized",Tu=i.TypeError,A=i.WeakMap,z=(xs=z||I.state?(Os=I.state||(I.state=new A),Ns=Xs(Os.get),Ss=Xs(Os.has),Rs=Xs(Os.set),Cs=function(e,t){if(Ss(Os,e))throw new Tu(bu);return t.facade=e,Rs(Os,e,t),t},Ms=function(e){return Ns(Os,e)||{}},function(e){return Ss(Os,e)}):(_u[Ps=wu("state")]=!0,Cs=function(e,t){if(Eu(e,Ps))throw new Tu(bu);return t.facade=e,mu(e,Ps,t),t},Ms=function(e){return Eu(e,Ps)?e[Ps]:{}},function(e){return Eu(e,Ps)}),{set:Cs,get:Ms,has:xs,enforce:function(e){return xs(e)?Ms(e):Cs(e,{})},getterFor:function(t){return function(e){if(gu(e)&&(e=Ms(e)).type===t)return e;throw Tu("Incompatible receiver, "+t+" required")}}}),I=es,Iu=os,Au=T,Ou=Q,Nu=_.CONFIGURABLE,Su=Oa,Ru=z.enforce,Cu=z.get,Mu=Object.defineProperty,xu=Ou&&!I(function(){return 8!==Mu(function(){},"length",{value:8}).length}),Pu=String(String).split("String"),A=w.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),(!Au(e,"name")||Nu&&e.name!==t)&&(Ou?Mu(e,"name",{value:t,configurable:!0}):e.name=t),xu&&r&&Au(r,"arity")&&e.length!==r.arity&&Mu(e,"length",{value:r.arity});try{r&&Au(r,"constructor")&&r.constructor?Ou&&Mu(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=Ru(e);return Au(r,"source")||(r.source=Pu.join("string"==typeof t?t:"")),e},Uu=(Function.prototype.toString=A(function(){return Iu(this)&&Cu(this).source||Su(this)},"toString"),os),ku=Ia,Du=w.exports,Lu=ps,Xs={},Fu=Math.ceil,Vu=Math.floor,ju=Math.trunc||function(e){e=+e;return(0<e?Vu:Fu)(e)},Bu=ws,Hu=Math.max,zu=Math.min,Gu=ws,Ku=Math.min,Ju=function(e){return 0<e?Ku(Gu(e),9007199254740991):0},Yu=is,Wu=_s,qu=v,_u={includes:bs(!0),indexOf:bs(!1)},wu=g,$u=T,Xu=is,Zu=_u.indexOf,Qu=du,ec=wu([].push),I=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tc=Ts,rc=I.concat("length","prototype"),A=(Xs.f=Object.getOwnPropertyNames||function(e){return tc(e,rc)},{}),wu=(A.f=Object.getOwnPropertySymbols,as),nc=Xs,ic=A,oc=gs,sc=g([].concat),A=wu("Reflect","ownKeys")||function(e){var t=nc.f(oc(e)),r=ic.f;return r?sc(t,r(e)):t},ac=T,uc=A,cc=e,lc=Ia,pc=es,fc=os,hc=/#|\.prototype\./,dc=As.normalize=function(e){return String(e).replace(hc,".").toLowerCase()},vc=As.data={},yc=As.NATIVE="N",gc=As.POLYFILL="P",wu=As,mc=i,Ec=e.f,wc=b,_c=Es,bc=ps,Tc=Is,Ic=wu,A=!es(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ac=T,Oc=os,Nc=fs,Sc=ms("IE_PROTO"),Rc=Object,Cc=Rc.prototype,A=A?Rc.getPrototypeOf:function(e){e=Nc(e);if(Ac(e,Sc))return e[Sc];var t=e.constructor;return Oc(t)&&e instanceof t?t.prototype:e instanceof Rc?Cc:null},Mc=os,xc=String,Pc=TypeError,Uc=g,kc=gs,Dc=function(e){if("object"==typeof e||Mc(e))return e;throw Pc("Can't set "+xc(e)+" as a prototype")},Lc=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=Uc(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return kc(e),Dc(t),n?r(e,t):e.__proto__=t,e}}():void 0),Fc={},Vc=Ts,jc=I,O=Object.keys||function(e){return Vc(e,jc)},Bc=Ia,Hc=gs,zc=is,Gc=O;Fc.f=Q&&!wa?Object.defineProperties:function(e,t){Hc(e);for(var r,n=zc(t),i=Gc(t),o=i.length,s=0;s<o;)Bc.f(e,r=i[s++],n[r]);return e};function Kc(){}function Jc(e){e.write(hl("")),e.close();var t=e.parentWindow.Object;return e=null,t}function Yc(e,t){return _l(e),void 0===t?e:bl?Tl(e,t):function(){return e.apply(t,arguments)}}function Wc(e){return void 0!==e&&(Il.Array===e||Ol[Al]===e)}function qc(e){if(null!=e)return Pl(e,kl)||Pl(e,"@@iterator")||Ul[xl(e)]}function $c(e,t){if(t=arguments.length<2?jl(e):t,Ll(t))return Fl(Dl(t,e));throw Bl(Vl(e)+" is not iterable")}function Xc(e,t,r){var n,i;zl(e);try{if(!(n=Gl(e,"return"))){if("throw"===t)throw r;return r}n=Hl(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return zl(n),r}function Zc(e,t){this.stopped=e,this.result=t}function Qc(e,t,r){function n(e){return o&&ep(o,"normal",e),new Zc(!0,e)}function i(e){return f?(Yl(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=Kl(t,p);if(h)o=e.iterator;else if(d)o=e;else{if(!(r=Ql(e)))throw tp(Wl(e)+" is not iterable");if(ql(r)){for(s=0,a=$l(e);s<a;s++)if((u=i(e[s]))&&Xl(rp,u))return u;return new Zc(!1)}o=Zl(e,r)}for(c=(h?e:o).next;!(l=Jl(c,o)).done;){try{u=i(l.value)}catch(e){ep(o,"throw",e)}if("object"==typeof u&&u&&Xl(rp,u))return u}return new Zc(!1)}function el(e){if("Symbol"===np(e))throw TypeError("Cannot convert a Symbol value to a string");return ip(e)}function tl(e,t){var r,n=2<arguments.length?arguments[2]:void 0,i=ap(_p,this);return cp?r=cp(new Ep,i?up(this):_p):(r=i?this:lp(_p),pp(r,mp,"Error")),void 0!==t&&pp(r,"message",yp(t)),gp&&pp(r,"stack",hp(r.stack,1)),dp(r,n),vp(e,wp,{that:i=[]}),pp(r,"errors",i),r}function rl(e){Tp[bp][e]=!0}var nl,il,O=as("document","documentElement"),ol=gs,sl=Fc,al=I,wa=du,ul=O,cl=ys,ll="prototype",pl="script",fl=ms("IE_PROTO"),hl=function(e){return"<"+pl+">"+e+"</"+pl+">"},dl=function(){try{nl=new ActiveXObject("htmlfile")}catch(e){}dl="undefined"==typeof document||document.domain&&nl?Jc(nl):(e=cl("iframe"),t="java"+pl+":",e.style.display="none",ul.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(hl("document.F=Object")),t.close(),t.F);for(var e,t,r=al.length;r--;)delete dl[ll][al[r]];return dl()},Fc=(wa[fl]=!0,Object.create||function(e,t){var r;return null!==e?(Kc[ll]=ol(e),r=new Kc,Kc[ll]=null,r[fl]=e):r=dl(),void 0===t?r:sl.f(r,t)}),vl=Error,yl=g("".replace),I=String(vl("zxcasd").stack),gl=/\n\s*at [^:]*:[^\n]*/,ml=gl.test(I),El=ss,wl=b,_l=cs,bl=t,Tl=g(g.bind),wa={},Il=wa,Al=ds("iterator"),Ol=Array.prototype,I={},I=(I[ds("toStringTag")]="z","[object z]"===String(I)),N=I,Nl=os,Sl=rs,Rl=ds("toStringTag"),Cl=Object,Ml="Arguments"==Sl(function(){return arguments}()),N=N?Sl: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=Cl(e),Rl))?t:Ml?Sl(e):"Object"==(t=Sl(e))&&Nl(e.callee)?"Arguments":t},xl=N,Pl=ls,Ul=wa,kl=ds("iterator"),Dl=r,Ll=cs,Fl=gs,Vl=us,jl=qc,Bl=TypeError,Hl=r,zl=gs,Gl=ls,Kl=Yc,Jl=r,Yl=gs,Wl=us,ql=Wc,$l=v,Xl=m,Zl=$c,Ql=qc,ep=Xc,tp=TypeError,rp=Zc.prototype,np=N,ip=String,op=el,sp=ts,S=!es(function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",sp(1,7)),7!==e.stack)}),R=y,ap=m,up=A,cp=Lc,C=Is,lp=Fc,pp=b,fp=ts,hp=function(e,t){if(ml&&"string"==typeof e&&!vl.prepareStackTrace)for(;t--;)e=yl(e,gl,"");return e},dp=function(e,t){El(t)&&"cause"in t&&wl(e,"cause",t.cause)},vp=Qc,yp=function(e,t){return void 0===e?arguments.length<2?"":t:op(e)},gp=S,mp=ds("toStringTag"),Ep=Error,wp=[].push,_p=(cp?cp(tl,Ep):C(tl,Ep,{name:!0}),tl.prototype=lp(Ep.prototype,{constructor:fp(1,tl),message:fp(1,""),name:fp(1,"AggregateError")})),S=(R({global:!0,constructor:!0,arity:2},{AggregateError:tl}),ds),C=Fc,fp=Ia.f,bp=S("unscopables"),Tp=Array.prototype,R=(null==Tp[bp]&&fp(Tp,bp,{configurable:!0,value:C(null)}),es),S=os,fp=A,C=Es,Ip=ds("iterator"),Ap=!1;[].keys&&("next"in(M=[].keys())?(fp=fp(fp(M)))!==Object.prototype&&(il=fp):Ap=!0);function Op(e,t,r){(e=e&&!r?e.prototype:e)&&!Mp(e,xp)&&Cp(e,xp,{configurable:!0,value:t})}function Np(){return this}function Sp(){return this}function Rp(e,t,r,n,i,o,s){function a(e){if(e===i&&h)return h;if(!Xp&&e in p)return p[e];switch(e){case"keys":case Qp:case ef:return function(){return new r(this,e)}}return function(){return new r(this)}}Bp(r,t,n);var u,c,n=t+" Iterator",l=!1,p=e.prototype,f=p[Zp]||p["@@iterator"]||i&&p[i],h=!Xp&&f||a(i),d="Array"==t&&p.entries||f;if(d&&(d=Hp(d.call(new e)))!==Object.prototype&&d.next&&(Hp(d)!==$p&&(zp?zp(d,$p):jp(d[Zp])||Jp(d,Zp,Sp)),Gp(d,n,!0)),Wp&&i==Qp&&f&&f.name!==Qp&&(qp?Kp(p,"name",Qp):(l=!0,h=function(){return Vp(f,this)})),i)if(u={values:a(Qp),keys:o?h:a("keys"),entries:a(ef)},s)for(c in u)!Xp&&!l&&c in p||Jp(p,c,u[c]);else Fp({target:t,proto:!0,forced:Xp||l},u);return p[Zp]!==h&&Jp(p,Zp,h,{name:i}),Yp[t]=h,u}S((il=null==il||R(function(){var e={};return il[Ip].call(e)!==e})?{}:il)[Ip])||C(il,Ip,function(){return this});var M={IteratorPrototype:il,BUGGY_SAFARI_ITERATORS:Ap},Cp=Ia.f,Mp=T,xp=ds("toStringTag"),Pp=M.IteratorPrototype,Up=Fc,kp=ts,Dp=Op,Lp=wa,Fp=y,Vp=r,jp=os,Bp=function(e,t,r,n){t+=" Iterator";return e.prototype=Up(Pp,{next:kp(+!n,r)}),Dp(e,t,!1),Lp[t]=Np,e},Hp=A,zp=Lc,Gp=Op,Kp=b,Jp=Es,fp=ds,Yp=wa,Wp=_.PROPER,qp=_.CONFIGURABLE,$p=M.IteratorPrototype,Xp=M.BUGGY_SAFARI_ITERATORS,Zp=fp("iterator"),Qp="values",ef="entries",tf=is,S=rl,R=wa,C=z,Ap=Ia.f,_=Rp,M=Q,rf="Array Iterator",nf=C.set,of=C.getterFor(rf),fp=_(Array,"Array",function(e,t){nf(this,{type:rf,target:tf(e),index:0,kind:t})},function(){var e=of(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"),wa=R.Arguments=R.Array;if(S("keys"),S("values"),S("entries"),M&&"values"!==wa.name)try{Ap(wa,"name",{value:"values"})}catch(e){}var sf=N;I||Es(Object.prototype,"toString",I?{}.toString:function(){return"[object "+sf(this)+"]"},{unsafe:!0});function af(e){var e=vf(e),t=yf.f;gf&&e&&!e[mf]&&t(e,mf,{configurable:!0,get:function(){return this}})}function uf(e,t){if(Ef(t,e))return e;throw wf("Incorrect invocation")}function cf(){}function lf(e){if(!_f(e))return!1;try{return Af(cf,If,e),!0}catch(e){return!1}}function pf(e){if(!_f(e))return!1;switch(bf(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sf||!!Nf(Of,Tf(e))}catch(e){return!0}}function ff(e,t){return void 0===(e=xf(e).constructor)||null==(e=xf(e)[Uf])?t:Pf(e)}var hf,df,C="process"==rs(i.process),vf=as,yf=Ia,gf=Q,mf=ds("species"),Ef=m,wf=TypeError,_=g,R=es,_f=os,bf=N,Tf=Oa,If=[],Af=as("Reflect","construct"),Of=/^\s*(?:class|function)\b/,Nf=_(Of.exec),Sf=!Of.exec(cf),S=(pf.sham=!0,!Af||R(function(){var e;return lf(lf.call)||!lf(Object)||!lf(function(){e=!0})||e})?pf:lf),Rf=S,Cf=us,Mf=TypeError,xf=gs,Pf=function(e){if(Rf(e))return e;throw Mf(Cf(e)+" is not a constructor")},Uf=ds("species"),M=Function.prototype,kf=M.apply,Df=M.call,Ap="object"==typeof Reflect&&Reflect.apply||(t?Df.bind(kf):function(){return Df.apply(kf,arguments)}),wa=g([].slice),Lf=TypeError,I=/(?:ipad|iphone|ipod).*applewebkit/i.test(qs),Ff=i,Vf=Ap,m=Yc,jf=os,Bf=T,N=es,Hf=O,zf=wa,Gf=ys,Kf=function(e,t){if(e<t)throw Lf("Not enough arguments");return e},_=I,R=C,M=Ff.setImmediate,t=Ff.clearImmediate,Jf=Ff.process,Yf=Ff.Dispatch,Wf=Ff.Function,O=Ff.MessageChannel,qf=Ff.String,$f=0,Xf={},Zf="onreadystatechange";try{hf=Ff.location}catch(e){}function Qf(e){return function(){yh(e)}}function eh(e){yh(e.data)}function th(e){Ff.postMessage(qf(e),hf.protocol+"//"+hf.host)}function rh(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}function nh(){this.head=null,this.tail=null}function ih(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=Rh(r),this.reject=Rh(n)}function oh(e,t){var r,n,i,o,s=t.value,a=t.state==id,u=a?e.ok:e.fail,c=e.resolve,l=e.reject,p=e.domain;try{u?(a||(t.rejection===ad&&(o=t,xh(Fh,Mh,function(){var e=o.facade;Ch?Zh.emit("rejectionHandled",e):ld(nd,e,o.value)})),t.rejection=sd),!0===u?r=s:(p&&p.enter(),r=u(s),p&&(p.exit(),i=!0)),r===e.promise?l($h("Promise-chain cycle")):(n=ud(r))?xh(n,r,c,l):c(r)):l(s)}catch(e){p&&!i&&p.exit(),l(e)}}var sh,ah,uh,ch,lh,ph,fh,hh,dh,vh,yh=function(e){var t;Bf(Xf,e)&&(t=Xf[e],delete Xf[e],t())},O=(M&&t||(M=function(e){Kf(arguments.length,1);var t=jf(e)?e:Wf(e),r=zf(arguments,1);return Xf[++$f]=function(){Vf(t,void 0,r)},df($f),$f},t=function(e){delete Xf[e]},R?df=function(e){Jf.nextTick(Qf(e))}:Yf&&Yf.now?df=function(e){Yf.now(Qf(e))}:O&&!_?(_=(R=new O).port2,R.port1.onmessage=eh,df=m(_.postMessage,_)):Ff.addEventListener&&jf(Ff.postMessage)&&!Ff.importScripts&&hf&&"file:"!==hf.protocol&&!N(th)?(df=th,Ff.addEventListener("message",eh,!1)):df=Zf in Gf("script")?function(e){Hf.appendChild(Gf("script"))[Zf]=function(){Hf.removeChild(this),yh(e)}}:function(e){setTimeout(Qf(e),0)}),{set:M,clear:t}),R=i,m=/ipad|iphone|ipod/i.test(qs)&&void 0!==R.Pebble,_=/web0s(?!.*chrome)/i.test(qs),N=i,M=Yc,t=e.f,gh=O.set,R=I,e=m,I=_,mh=C,m=N.MutationObserver||N.WebKitMutationObserver,_=N.document,Eh=N.process,x=N.Promise,t=t(N,"queueMicrotask"),t=t&&t.value,I=(t||(sh=function(){var e,t;for(mh&&(e=Eh.domain)&&e.exit();ah;){t=ah.fn,ah=ah.next;try{t()}catch(e){throw ah?ch():uh=void 0,e}}uh=void 0,e&&e.enter()},ch=R||mh||I||!m||!_?!e&&x&&x.resolve?((R=x.resolve(void 0)).constructor=x,fh=M(R.then,R),function(){fh(sh)}):mh?function(){Eh.nextTick(sh)}:(gh=M(gh,N),function(){gh(sh)}):(lh=!0,ph=_.createTextNode(""),new m(sh).observe(ph,{characterData:!0}),function(){ph.data=lh=!lh})),t||function(e){e={fn:e,next:void 0};uh&&(uh.next=e),ah||(ah=e,ch()),uh=e}),wh=i,e=(nh.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}},nh),x=i.Promise,R="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,M=!R&&!C&&"object"==typeof window&&"object"==typeof document,N=i,_h=x,_=os,m=wu,bh=Oa,t=ds,Th=M,Ih=R,Ah=$s,Oh=(_h&&_h.prototype,t("species")),Nh=!1,Sh=_(N.PromiseRejectionEvent),Oa={CONSTRUCTOR:m("Promise",function(){var e=bh(_h),t=e!==String(_h);if(!t&&66===Ah)return!0;if(!Ah||Ah<51||!/native code/.test(e)){var e=new _h(function(e){e(1)}),r=function(e){e(function(){},function(){})};if((e.constructor={})[Oh]=r,!(Nh=e.then(function(){})instanceof r))return!0}return!t&&(Th||Ih)&&!Sh}),REJECTION_EVENT:Sh,SUBCLASSING:Nh},M={},Rh=cs,R=(M.f=function(e){return new ih(e)},y),Ch=C,Mh=i,xh=r,t=Es,_=Lc,N=Op,m=af,Ph=cs,Uh=os,kh=ss,Dh=uf,Lh=ff,Fh=O.set,Vh=I,jh=function(e,t){var r=wh.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},Bh=rh,Hh=e,O=z,I=x,e=M,zh="Promise",Gh=Oa.CONSTRUCTOR,Kh=Oa.REJECTION_EVENT,P=Oa.SUBCLASSING,Jh=O.getterFor(zh),Yh=O.set,O=I&&I.prototype,Wh=I,qh=O,$h=Mh.TypeError,Xh=Mh.document,Zh=Mh.process,Qh=e.f,ed=Qh,td=!!(Xh&&Xh.createEvent&&Mh.dispatchEvent),rd="unhandledrejection",nd="rejectionhandled",id=1,od=2,sd=1,ad=2,ud=function(e){var t;return!(!kh(e)||!Uh(t=e.then))&&t},cd=function(r,i){r.notified||(r.notified=!0,Vh(function(){for(var e,n,t=r.reactions;e=t.get();)oh(e,r);r.notified=!1,i&&!r.rejection&&(n=r,xh(Fh,Mh,function(){var e=n.facade,t=n.value,r=pd(n);if(r&&(r=Bh(function(){Ch?Zh.emit("unhandledRejection",t,e):ld(rd,e,t)}),n.rejection=Ch||pd(n)?ad:sd,r.error))throw r.value}))}))},ld=function(e,t,r){var n;td?((n=Xh.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),Mh.dispatchEvent(n)):n={promise:t,reason:r},!Kh&&(t=Mh["on"+e])?t(n):e===rd&&jh("Unhandled promise rejection",r)},pd=function(e){return e.rejection!==sd&&!e.parent},fd=function(t,r,n){return function(e){t(r,e,n)}},hd=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=od,cd(e,!0))},dd=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw $h("Promise can't be resolved itself");var n=ud(e);n?Vh(function(){var t={done:!1};try{xh(n,e,fd(dd,t,r),fd(hd,t,r))}catch(e){hd(t,e,r)}}):(r.value=e,r.state=id,cd(r,!1))}catch(e){hd({done:!1},e,r)}}};if(Gh&&(qh=(Wh=function(e){Dh(this,qh),Ph(e),xh(hh,this);var t=Jh(this);try{e(fd(dd,t),fd(hd,t))}catch(e){hd(t,e)}}).prototype,(hh=function(e){Yh(this,{type:zh,done:!1,notified:!1,parent:!1,reactions:new Hh,rejection:!1,state:0,value:void 0})}).prototype=t(qh,"then",function(e,t){var r=Jh(this),n=Qh(Lh(this,Wh));return r.parent=!0,n.ok=!Uh(e)||e,n.fail=Uh(t)&&t,n.domain=Ch?Zh.domain:void 0,0==r.state?r.reactions.add(n):Vh(function(){oh(n,r)}),n.promise}),dh=function(){var e=new hh,t=Jh(e);this.promise=e,this.resolve=fd(dd,t),this.reject=fd(hd,t)},e.f=Qh=function(e){return e===Wh||void 0===e?new dh:ed(e)},Uh(I)&&O!==Object.prototype)){vh=O.then,P||t(O,"then",function(e,t){var r=this;return new Wh(function(e,t){xh(vh,r,e,t)}).then(e,t)},{unsafe:!0});try{delete O.constructor}catch(e){}_&&_(O,qh)}R({global:!0,constructor:!0,wrap:!0,forced:Gh},{Promise:Wh}),N(Wh,zh,!1),m(zh);var vd=ds("iterator"),yd=!1;try{var gd=0,md={next:function(){return{done:!!gd++}},return:function(){yd=!0}};md[vd]=function(){return this},Array.from(md,function(){throw 2})}catch(e){}function Ed(e,t){if(!t&&!yd)return!1;var r=!1;try{var n={};n[vd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r}var wd=x,e=Ed,I=Oa.CONSTRUCTOR||!e(function(e){wd.all(e).then(void 0,function(){})}),_d=r,bd=cs,Td=M,Id=rh,Ad=Qc,P=(y({target:"Promise",stat:!0,forced:I},{all:function(e){var a=this,t=Td.f(a),u=t.resolve,c=t.reject,r=Id(function(){var n=bd(a.resolve),i=[],o=0,s=1;Ad(e,function(e){var t=o++,r=!1;s++,_d(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}}),y),t=x,_=as,O=os,R=Es,Gh=t&&t.prototype;P({target:"Promise",proto:!0,forced:Oa.CONSTRUCTOR,real:!0},{catch:function(e){return this.then(void 0,e)}}),O(t)&&(N=_("Promise").prototype.catch,Gh.catch!==N&&R(Gh,"catch",N,{unsafe:!0}));var Od=r,Nd=cs,Sd=M,Rd=rh,Cd=Qc;y({target:"Promise",stat:!0,forced:I},{race:function(e){var r=this,n=Sd.f(r),i=n.reject,t=Rd(function(){var t=Nd(r.resolve);Cd(e,function(e){Od(t,r,e).then(n.resolve,i)})});return t.error&&i(t.value),n.promise}});function Md(e,t){return Ud(e),kd(t)&&t.constructor===e?t:((0,(e=Dd.f(e)).resolve)(t),e.promise)}var xd=r,Pd=M,Ud=(y({target:"Promise",stat:!0,forced:Oa.CONSTRUCTOR},{reject:function(e){var t=Pd.f(this);return xd(t.reject,void 0,e),t.promise}}),gs),kd=ss,Dd=M,m=y,md=as,e=Oa.CONSTRUCTOR,Ld=Md;md("Promise"),m({target:"Promise",stat:!0,forced:e},{resolve:function(e){return Ld(this,e)}});var Fd=r,Vd=cs,jd=M,Bd=rh,Hd=Qc;y({target:"Promise",stat:!0},{allSettled:function(e){var a=this,t=jd.f(a),u=t.resolve,r=t.reject,n=Bd(function(){var n=Vd(a.resolve),i=[],o=0,s=1;Hd(e,function(e){var t=o++,r=!1;s++,Fd(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 zd(i){return function(e,t){var r,e=nv(iv(e)),t=rv(t),n=e.length;return t<0||n<=t?i?"":void 0:(r=sv(e,t))<55296||56319<r||t+1===n||(n=sv(e,t+1))<56320||57343<n?i?ov(e,t):r:i?av(e,t,t+2):n-56320+(r-55296<<10)+65536}}var Gd=r,Kd=cs,Jd=as,Yd=M,Wd=rh,qd=Qc,$d="No one promise resolved",P=(y({target:"Promise",stat:!0},{any:function(e){var u=this,c=Jd("AggregateError"),t=Yd.f(u),l=t.resolve,p=t.reject,r=Wd(function(){var n=Kd(u.resolve),i=[],o=0,s=1,a=!1;qd(e,function(e){var t=o++,r=!1;s++,Gd(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,$d)))})}),--s||p(new c(i,$d))});return r.error&&p(r.value),t.promise}}),y),O=x,t=es,Xd=as,Zd=os,Qd=ff,ev=Md,_=Es,tv=O&&O.prototype,Gh=(P({target:"Promise",proto:!0,real:!0,forced:!!O&&t(function(){tv.finally.call({then:function(){}},function(){})})},{finally:function(t){var r=Qd(this,Xd("Promise")),e=Zd(t);return this.then(e?function(e){return ev(r,t()).then(function(){return e})}:t,e?function(e){return ev(r,t()).then(function(){throw e})}:t)}}),Zd(O)&&(R=Xd("Promise").prototype.finally,tv.finally!==R&&_(tv,"finally",R,{unsafe:!0})),g),rv=ws,nv=el,iv=ns,ov=Gh("".charAt),sv=Gh("".charCodeAt),av=Gh("".slice),uv={codeAt:zd(!1),charAt:zd(!0)}.charAt,cv=el,N=z,I=Rp,lv="String Iterator",pv=N.set,fv=N.getterFor(lv);I(String,"String",function(e){pv(this,{type:lv,string:cv(e),index:0})},function(){var e=fv(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=uv(t,r),e.index+=t.length,{value:t,done:!1})});function hv(t,e){if(t){if(t[Ev]!==_v)try{mv(t,Ev,_v)}catch(e){t[Ev]=_v}if(t[wv]||mv(t,wv,e),yv[e])for(var r in gv)if(t[r]!==gv[r])try{mv(t,r,gv[r])}catch(e){t[r]=gv[r]}}}var dv,Oa=i,md=Oa.Promise,m=ys("span").classList,e=m&&m.constructor&&m.constructor.prototype,x=e===Object.prototype?void 0:e,vv=i,yv={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},P=x,gv=fp,mv=b,t=ds,Ev=t("iterator"),wv=t("toStringTag"),_v=gv.values;for(dv in yv)hv(vv[dv]&&vv[dv].prototype,dv);hv(P,"DOMTokenList");var O,_,R=_=O=md,Gh,bv=M,Tv=rh,Iv=((Gh=y)({target:"Promise",stat:!0,forced:!0},{try:function(e){var t=bv.f(this),e=Tv(e);return(e.error?t.reject:t.resolve)(e.value),t.promise}}),gs),Av=Xc,Ov=vs,Nv=Ia,Sv=ts,N,Rv=Yc,Cv=r,Mv=fs,xv=function(t,e,r,n){try{return n?e(Iv(r)[0],r[1]):e(r)}catch(e){Av(t,"throw",e)}},Pv=Wc,Uv=S,kv=v,Dv=N=function(e,t,r){t=Ov(t);t in e?Nv.f(e,t,Sv(0,r)):e[t]=r},Lv=$c,Fv=qc,Vv=Array,I,m=function(e){var t,r,n,i,o,s,a=Mv(e),e=Uv(this),u=arguments.length,c=1<u?arguments[1]:void 0,l=void 0!==c,u=(l&&(c=Rv(c,2<u?arguments[2]:void 0)),Fv(a)),p=0;if(!u||this===Vv&&Pv(u))for(t=kv(a),r=e?new this(t):Vv(t);p<t;p++)s=l?c(a[p],p):a[p],Dv(r,p,s);else for(o=(i=Lv(a,u)).next,r=e?new this:[];!(n=Cv(o,i)).done;p++)s=l?xv(i,c,[n.value,p],!0):n.value,Dv(r,p,s);return r.length=p,r},e,x,jv=((I=y)({target:"Array",stat:!0,forced:x=!(e=Ed)(function(e){Array.from(e)})},{from:m}),rs),fp=Array.isArray||function(e){return"Array"==jv(e)},b,t,P=((b=y)({target:"Array",stat:!0},{isArray:t=fp}),y),md=es,Bv=S,Hv=N,zv=Array,O=md(function(){function e(){}return!(zv.of.call(e)instanceof e)}),Gv=(P({target:"Array",stat:!0,forced:O},{of:function(){for(var e=0,t=arguments.length,r=new(Bv(this)?this:zv)(t);e<t;)Hv(r,e,arguments[e++]);return r.length=t,r}}),fs),Kv=v,Jv=ws,_=rl,Yv=(y({target:"Array",proto:!0},{at:function(e){var t=Gv(this),r=Kv(t),e=Jv(e),e=0<=e?e:r+e;return e<0||r<=e?void 0:t[e]}}),_("at"),TypeError),R=function(e){if(9007199254740991<e)throw Yv("Maximum allowed index exceeded");return e},Wv=fp,qv=S,$v=ss,Xv=ds("species"),Zv=Array,Qv=function(e){var t;return Wv(e)&&(t=e.constructor,(qv(t)&&(t===Zv||Wv(t.prototype))||$v(t)&&null===(t=t[Xv]))&&(t=void 0)),void 0===t?Zv:t},M=function(e,t){return new(Qv(e))(0===t?0:t)},ey=es,ty=$s,ry=ds("species"),Gh,e=y,I=es,ny=fp,iy=ss,oy=fs,sy=v,ay=R,uy=N,cy=M,x=Gh=function(t){return 51<=ty||!ey(function(){var e=[];return(e.constructor={})[ry]=function(){return{foo:1}},1!==e[t](Boolean).foo})},m=$s,ly=ds("isConcatSpreadable"),b=51<=m||!I(function(){var e=[];return e[ly]=!1,e.concat()[0]!==e}),t=x("concat"),py=(e({target:"Array",proto:!0,arity:1,forced:!b||!t},{concat:function(e){for(var t,r,n,i=oy(this),o=cy(i,0),s=0,a=-1,u=arguments.length;a<u;a++)if(function(e){if(!iy(e))return!1;var t=e[ly];return void 0!==t?!!t:ny(e)}(n=-1===a?i:arguments[a]))for(r=sy(n),ay(s+r),t=0;t<r;t++,s++)t in n&&uy(o,s,n[t]);else ay(s+1),uy(o,s++,n);return o.length=s,o}}),us),fy=TypeError,md,hy=fs,dy=_s,vy=v,yy=md=function(e,t){if(!delete e[t])throw fy("Cannot delete property "+py(t)+" of "+py(e))},gy=Math.min,P=rl,my=(y({target:"Array",proto:!0},{copyWithin:[].copyWithin||function(e,t){var r=hy(this),n=vy(r),i=dy(e,n),o=dy(t,n),e=2<arguments.length?arguments[2]:void 0,s=gy((void 0===e?n:dy(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]:yy(r,i),i+=a,o+=a;return r}}),P("copyWithin"),Yc),Ey=E,wy=fs,_y=v,by=M,Ty=g([].push),O,_={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=wy(e),a=Ey(s),u=my(t,r),c=_y(a),l=0,t=n||by,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:Ty(p,i)}else switch(f){case 4:return!1;case 7:Ty(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)},Iy=es,m=function(e,t){var r=[][e];return!!r&&Iy(function(){r.call(null,t||function(){return 1},1)})},I=y,Ay=_.every,Oy=(I({target:"Array",proto:!0,forced:!m("every")},{every:function(e){return Ay(this,e,1<arguments.length?arguments[1]:void 0)}}),fs),Ny=_s,Sy=v,x=rl,e=(y({target:"Array",proto:!0},{fill:function(e){for(var t=Oy(this),r=Sy(t),n=arguments.length,i=Ny(1<n?arguments[1]:void 0,r),n=2<n?arguments[2]:void 0,o=void 0===n?r:Ny(n,r);i<o;)t[i++]=e;return t}}),x("fill"),y),Ry=_.filter,b=(e({target:"Array",proto:!0,forced:!Gh("filter")},{filter:function(e){return Ry(this,e,1<arguments.length?arguments[1]:void 0)}}),y),Cy=_.find,t=rl,P,My=!0,O=((P="find")in[]&&Array(1)[P](function(){My=!1}),b({target:"Array",proto:!0,forced:My},{find:function(e){return Cy(this,e,1<arguments.length?arguments[1]:void 0)}}),t(P),y),xy=_.findIndex,I=rl,x,Py=!0,Uy=((x="findIndex")in[]&&Array(1)[x](function(){Py=!1}),O({target:"Array",proto:!0,forced:Py},{findIndex:function(e){return xy(this,e,1<arguments.length?arguments[1]:void 0)}}),I(x),Yc),ky=E,Dy=fs,Ly=v,e,b={findLast:(e=function(u){var c=1==u;return function(e,t,r){for(var n,i=Dy(e),o=ky(i),s=Uy(t,r),a=Ly(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=y,Fy=b.findLast,P=rl,O=(t({target:"Array",proto:!0},{findLast:function(e){return Fy(this,e,1<arguments.length?arguments[1]:void 0)}}),P("findLast"),y),Vy=b.findLastIndex,I=rl,jy=(O({target:"Array",proto:!0},{findLastIndex:function(e){return Vy(this,e,1<arguments.length?arguments[1]:void 0)}}),I("findLastIndex"),fp),By=v,Hy=R,zy=Yc,Gy=function(e,t,r,n,i,o,s,a){for(var u,c,l=i,p=0,f=!!s&&zy(s,a);p<n;)p in r&&(u=f?f(r[p],p,t):r[p],0<o&&jy(u)?(c=By(u),l=Gy(e,t,u,c,l,o-1)-1):(Hy(l+1),e[l]=u),l++),p++;return l},x,Ky=x=Gy,Jy=fs,Yy=v,Wy=ws,qy=M;y({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Jy(this),r=Yy(t),n=qy(t,0);return n.length=Ky(n,t,t,r,0,void 0===e?1:Wy(e)),n}});function $y(c){return function(e,t,r,n){bg(t);var i=Tg(e),o=Ig(i),s=Ag(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 Og("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 Xy(e,t,r){for(var n=Gg(e),i=zg(t,n),o=zg(void 0===r?n:r,n),s=Jg(Yg(o-i,0)),a=0;i<o;i++,a++)Kg(s,a,e[i]);return s.length=a,s}function Zy(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=Zy(Wg(e,0,n),t),f=Zy(Wg(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 Qy=x,eg=cs,tg=fs,rg=v,ng=M,ig=(y({target:"Array",proto:!0},{flatMap:function(e){var t,r=tg(this),n=rg(r);return eg(e),(t=ng(r,0)).length=Qy(t,r,r,n,0,1,e,1<arguments.length?arguments[1]:void 0),t}}),_.forEach),e=m("forEach")?[].forEach:function(e){return ig(this,e,1<arguments.length?arguments[1]:void 0)},t=(y({target:"Array",proto:!0,forced:[].forEach!=e},{forEach:e}),y),og=_u.includes,P=rl,b=(t({target:"Array",proto:!0,forced:es(function(){return!Array(1).includes()})},{includes:function(e){return og(this,e,1<arguments.length?arguments[1]:void 0)}}),P("includes"),y),O=g,sg=_u.indexOf,I=m,ag=O([].indexOf),ug=!!ag&&1/ag([1],1,-0)<0,x=I("indexOf"),e=(b({target:"Array",proto:!0,forced:ug||!x},{indexOf:function(e){var t=1<arguments.length?arguments[1]:void 0;return ug?ag(this,e,t)||0:sg(this,e,t)}}),y),t=E,cg=is,P=m,lg=g([].join),_u=t!=Object,O=P("join",","),pg=(e({target:"Array",proto:!0,forced:_u||!O},{join:function(e){return lg(cg(this),void 0===e?",":e)}}),Ap),fg=is,hg=ws,dg=v,I=m,vg=Math.min,yg=[].lastIndexOf,gg=!!yg&&1/[1].lastIndexOf(1,-0)<0,b=I("lastIndexOf"),x=gg||!b?function(e){if(gg)return pg(yg,this,arguments)||0;var t=fg(this),r=dg(t),n=r-1;for((n=1<arguments.length?vg(n,hg(arguments[1])):n)<0&&(n=r+n);0<=n;n--)if(n in t&&t[n]===e)return n||0;return-1}:yg,t=(y({target:"Array",proto:!0,forced:x!==[].lastIndexOf},{lastIndexOf:x}),y),mg=_.map,P=(t({target:"Array",proto:!0,forced:!Gh("map")},{map:function(e){return mg(this,e,1<arguments.length?arguments[1]:void 0)}}),y),Eg=fs,wg=v,_g=R,e=es(function(){return 4294967297!==[].push.call({length:4294967296},1)}),_u=!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}(),bg=(P({target:"Array",proto:!0,arity:1,forced:e||_u},{push:function(e){var t=Eg(this),r=wg(t),n=arguments.length;_g(r+n);for(var i=0;i<n;i++)t[r]=arguments[i],r++;return t.length=r}}),cs),Tg=fs,Ig=E,Ag=v,Og=TypeError,O={left:$y(!1),right:$y(!0)},Ap=y,Ng=O.left,I=$s,b=C,x=(Ap({target:"Array",proto:!0,forced:!m("reduce")||!b&&79<I&&I<83},{reduce:function(e){var t=arguments.length;return Ng(this,e,t,1<t?arguments[1]:void 0)}}),y),Sg=O.right,t=$s,P=C,e=(x({target:"Array",proto:!0,forced:!m("reduceRight")||!P&&79<t&&t<83},{reduceRight:function(e){return Sg(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}}),y),Rg=fp,Cg=g([].reverse),_u=[1,2],Ap=(e({target:"Array",proto:!0,forced:String(_u)===String(_u.reverse())},{reverse:function(){return Rg(this)&&(this.length=this.length),Cg(this)}}),y),Mg=fp,xg=S,Pg=ss,Ug=_s,kg=v,Dg=is,Lg=N,b=ds,Fg=wa,I=Gh("slice"),Vg=b("species"),jg=Array,Bg=Math.max,O=(Ap({target:"Array",proto:!0,forced:!I},{slice:function(e,t){var r,n,i,o=Dg(this),s=kg(o),a=Ug(e,s),u=Ug(void 0===t?s:t,s);if(Mg(o)&&(r=o.constructor,(r=xg(r)&&(r===jg||Mg(r.prototype))||Pg(r)&&null===(r=r[Vg])?void 0:r)===jg||void 0===r))return Fg(o,a,u);for(n=new(void 0===r?jg:r)(Bg(u-a,0)),i=0;a<u;a++,i++)a in o&&Lg(n,i,o[a]);return n.length=i,n}}),y),Hg=_.some,zg=(O({target:"Array",proto:!0,forced:!m("some")},{some:function(e){return Hg(this,e,1<arguments.length?arguments[1]:void 0)}}),_s),Gg=v,Kg=N,Jg=Array,Yg=Math.max,Wg=Xy,qg=Math.floor,C=Zy,x=qs.match(/firefox\/(\d+)/i),P=!!x&&+x[1],t=/MSIE|Trident/.test(qs),e=qs.match(/AppleWebKit\/(\d+)\./),_u=!!e&&+e[1],wa=y,b=g,$g=cs,Xg=fs,Zg=v,Qg=md,em=el,Ap=es,tm=C,I=m,rm=P,nm=t,im=$s,om=_u,sm=[],am=b(sm.sort),um=b(sm.push),O=Ap(function(){sm.sort(void 0)}),x=Ap(function(){sm.sort(null)}),qs=I("sort"),cm=!Ap(function(){if(im)return im<70;if(!(rm&&3<rm)){if(nm)return!0;if(om)return om<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++)sm.push({k:e+r,v:t})}for(sm.sort(function(e,t){return t.v-e.v}),r=0;r<sm.length;r++)e=sm[r].k.charAt(0),n.charAt(n.length-1)!==e&&(n+=e);return"DGBEFHACIJK"!==n}});wa({target:"Array",proto:!0,forced:O||!x||!qs||!cm},{sort:function(e){void 0!==e&&$g(e);var t=Xg(this);if(cm)return void 0===e?am(t):am(t,e);for(var r,n,i=[],o=Zg(t),s=0;s<o;s++)s in t&&um(i,t[s]);for(tm(i,(n=e,function(e,t){return void 0===t?-1:void 0===e?1:void 0!==n?+n(e,t)||0:em(e)>em(t)?1:-1})),r=i.length,s=0;s<r;)t[s]=i[s++];for(;s<o;)Qg(t,s++);return t}});af("Array");var e=y,lm=fs,pm=_s,fm=ws,hm=v,dm=R,vm=M,ym=N,gm=md,C=Gh("splice"),mm=Math.max,Em=Math.min;e({target:"Array",proto:!0,forced:!C},{splice:function(e,t){var r,n,i,o,s,a,u=lm(this),c=hm(u),l=pm(e,c),e=arguments.length;for(0===e?r=n=0:n=1===e?(r=0,c-l):(r=e-2,Em(mm(fm(t),0),c-l)),dm(c+r-n),i=vm(u,n),o=0;o<n;o++)(s=l+o)in u&&ym(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]:gm(u,a);for(o=c;c-n+r<o;o--)gm(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]:gm(u,a);for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}}),rl("flat");rl("flatMap");var P=y,wm=fs,_m=v,bm=md,Tm=R,t=1!==[].unshift(0),$s=!function(){try{Object.defineProperty([],"length",{writable:!1}).unshift()}catch(e){return e instanceof TypeError}}();P({target:"Array",proto:!0,arity:1,forced:t||$s},{unshift:function(e){var t=wm(this),r=_m(t),n=arguments.length;if(n){Tm(r+n);for(var i=r;i--;){var o=i+n;i in t?t[o]=t[i]:bm(t,o)}for(var s=0;s<n;s++)t[s]=arguments[s]}return t.length=r+n}});Oa.Array;var _u={exports:{}},b={},Im=rs,Am=is,Om=Xs.f,Nm=Xy,Sm="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];b.f=function(e){if(!Sm||"Window"!=Im(e))return Om(Am(e));try{return Om(e)}catch(e){return Nm(Sm)}};function Rm(e){Bm(e,Ym,{value:{objectID:"O"+Wm++,weakData:{}}})}function Cm(e,t,r){for(var n in t)hE(e,n,t[n],r);return e}function Mm(e,t){for(var r=0,n=OE(t),i=new e(n);r<n;)i[r]=t[r++];return i}function xm(e,t,r,n){for(var i,o,s,a=RE(e),u=SE(a),c=NE(t,r),l=xE(null),p=ME(u),f=0;f<p;f++)s=u[f],(o=CE(c(s,f,a)))in l?kE(l[o],s):l[o]=[s];if(n&&(i=n(a))!==UE)for(o in l)l[o]=PE(i,l[o]);return l}var I=es(function(){var e;"function"==typeof ArrayBuffer&&(e=new ArrayBuffer(8),Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8}))}),Ap=es,Pm=ss,Um=rs,km=I,Dm=Object.isExtensible,wa=Ap(function(){Dm(1)})||km?function(e){return!!Pm(e)&&((!km||"ArrayBuffer"!=Um(e))&&(!Dm||Dm(e)))}:Dm,O=!es(function(){return Object.isExtensible(Object.preventExtensions({}))}),Lm=y,Fm=g,x=du,Vm=ss,jm=T,Bm=Ia.f,Hm=Xs,zm=b,Gm=wa,Km=O,Jm=!1,Ym=hs("meta"),Wm=0,qm=_u.exports={enable:function(){qm.enable=function(){},Jm=!0;var i=Hm.f,o=Fm([].splice),e={};e[Ym]=1,i(e).length&&(Hm.f=function(e){for(var t=i(e),r=0,n=t.length;r<n;r++)if(t[r]===Ym){o(t,r,1);break}return t},Lm({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:zm.f}))},fastKey:function(e,t){if(!Vm(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!jm(e,Ym)){if(!Gm(e))return"F";if(!t)return"E";Rm(e)}return e[Ym].objectID},getWeakData:function(e,t){if(!jm(e,Ym)){if(!Gm(e))return!0;if(!t)return!1;Rm(e)}return e[Ym].weakData},onFreeze:function(e){return Km&&Jm&&Gm(e)&&!jm(e,Ym)&&Rm(e),e}},$m=(x[Ym]=!0,os),Xm=ss,Zm=Lc,Qm=y,eE=i,tE=g,rE=wu,nE=Es,iE=_u.exports,oE=Qc,sE=uf,aE=os,uE=ss,cE=es,lE=Ed,pE=Op,fE=function(e,t,r){return Zm&&$m(t=t.constructor)&&t!==r&&Xm(t=t.prototype)&&t!==r.prototype&&Zm(e,t),e},hE=Es,dE=Ia.f,vE=Fc,yE=Cm,gE=Yc,mE=uf,EE=Qc,wE=Rp,_E=af,bE=Q,TE=_u.exports.fastKey,IE=z.set,AE=z.getterFor,OE=(function(e,t,r){function n(e){var r=tE(h[e]);nE(h,e,"add"==e?function(e){return r(this,0===e?0:e),this}:"delete"==e?function(e){return!(l&&!uE(e))&&r(this,0===e?0:e)}:"get"==e?function(e){return l&&!uE(e)?void 0:r(this,0===e?0:e)}:"has"==e?function(e){return!(l&&!uE(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=eE[e],h=f&&f.prototype,d=f,v={};return rE(e,!aE(f)||!(l||h.forEach&&!cE(function(){(new f).entries().next()})))?(d=r.getConstructor(t,e,c,p),iE.enable()):rE(e,!0)&&(o=(i=new d)[p](l?{}:-0,1)!=i,s=cE(function(){i.has(1)}),a=lE(function(e){new f(e)}),u=!l&&cE(function(){for(var e=new f,t=5;t--;)e[p](t,t);return!e.has(-0)}),a||(((d=t(function(e,t){sE(e,h);e=fE(new f,e,d);return null!=t&&oE(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,Qm({global:!0,constructor:!0,forced:d!=f},v),pE(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=TE(t,!0),key:t,value:r,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=o),t&&(t.next=o),bE?i.size++:e.size++,"F"!==n&&(i.index[n]=o)),e}function s(e,t){var r,e=u(e),n=TE(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){mE(e,a),IE(e,{type:r,index:vE(null),first:void 0,last:void 0,size:0}),bE||(e.size=0),null!=t&&EE(t,e[i],{that:e,AS_ENTRIES:n})}),a=e.prototype,u=AE(r);return yE(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,bE?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),bE?n.size--:this.size--),!!e},forEach:function(e){for(var t,r=u(this),n=gE(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)}}),yE(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)}}),bE&&dE(a,"size",{get:function(){return u(this).size}}),e},setStrong:function(e,t,r){var n=t+" Iterator",i=AE(t),o=AE(n);wE(e,t,function(e,t){IE(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),_E(t)}}),v),NE=Yc,SE=E,RE=fs,CE=vs,ME=v,xE=Fc,PE=Mm,UE=Array,kE=g([].push),DE=xm,qs=rl;y({target:"Array",proto:!0},{group:function(e){return DE(this,e,1<arguments.length?arguments[1]:void 0)}}),qs("group");var LE=xm,N=rl;y({target:"Array",proto:!0,forced:!m("groupBy")},{groupBy:function(e){return LE(this,e,1<arguments.length?arguments[1]:void 0)}}),N("groupBy");function FE(e){for(var t,r,n=BE(this),i=jE(n),o=VE(e,1<arguments.length?arguments[1]:void 0),s=new zE,a=HE(i),u=0;u<a;u++)t=o(r=i[u],u,n),KE(s,t)?YE(GE(s,t),r):JE(s,t,[r]);return s}var VE=Yc,Gh=g,jE=E,BE=fs,HE=v,zE=as("Map"),e=zE.prototype,GE=Gh(e.get),KE=Gh(e.has),JE=Gh(e.set),YE=Gh([].push),C=rl,md=FE;y({target:"Array",proto:!0,name:"groupToMap",forced:!m("groupByToMap")},{groupByToMap:md}),C("groupByToMap");function WE(e){return QE[e].prototype}var P=rl,qE=(y({target:"Array",proto:!0},{groupToMap:FE}),P("groupToMap"),v),$E=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},XE=is,t=rl,ZE=Array,QE=(y({target:"Array",proto:!0},{toReversed:function(){return $E(XE(this),ZE)}}),t("toReversed"),i),$s=y,ew=cs,tw=is,rw=Mm,Oa=rl,nw=Array,iw=g(WE("Array").sort),I=($s({target:"Array",proto:!0},{toSorted:function(e){void 0!==e&&ew(e);var t=tw(this),t=rw(nw,t);return iw(t,e)}}),Oa("toSorted"),y),Ap=rl,ow=R,sw=v,aw=_s,uw=is,cw=ws,lw=Array,pw=Math.max,fw=Math.min,hw=(I({target:"Array",proto:!0},{toSpliced:function(e,t){var r,n,i,o,s=uw(this),a=sw(s),u=aw(e,a),e=arguments.length,c=0;for(0===e?r=n=0:n=1===e?(r=0,a-u):(r=e-2,fw(pw(cw(t),0),a-u)),i=ow(a+r-n),o=lw(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}}),Ap("toSpliced"),v),dw=ws,vw=RangeError,yw=function(e,t,r,n){var i=hw(e),r=dw(r),o=r<0?i+r:r;if(i<=o||o<0)throw vw("Incorrect index");for(var s=new t(i),a=0;a<i;a++)s[a]=a===o?n:e[a];return s},gw=is,mw=Array;y({target:"Array",proto:!0},{with:function(e,t){return yw(gw(this),mw,e,t)}});du=i,T=da,Xs=os,b=A,wa=Es,O="USE_FUNCTION_CONSTRUCTOR",x=ds("asyncIterator"),Lc=du.AsyncIterator,wu=T.AsyncIteratorPrototype;if(wu)F_=wu;else if(Xs(Lc))F_=Lc.prototype;else if(T[O]||du[O])try{R_=b(b(b(Function("return async function*(){}()")()))),b(R_)===Object.prototype&&(F_=R_)}catch(e){}Xs((F_=F_||{})[x])||wa(F_,x,function(){return this});function Ew(e,t,r){var n=e.done;Nw.resolve(e.value).then(function(e){t({done:n,value:e})},r)}function ww(e){Rw(this,{type:Sw,iterator:Aw(e),next:e.next})}function _w(e){var f=0==e,h=1==e,d=2==e,v=3==e;return function(e,s,a){var e=Yw(e),u=Jw("Promise"),c=e.iterator,t=e.next,l=0,p=void 0!==s;return!p&&f||zw(s),new u(function(r,n){var i=function(e){Ww(c,n,e,n)},o=function(){try{if(f&&p)try{Kw(l)}catch(e){i(e)}u.resolve(Gw(Hw(t,c))).then(function(e){try{if(Gw(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():Ww(c,r,!1,n);else if(f)try{a[l++]=e,o()}catch(e){i(e)}else e?Ww(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 bw(e,t){if(!l0||!c0(e)||!l0(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 Tw(e,t,r){return r.get&&p0(r.get,t,{getter:!0}),r.set&&p0(r.set,t,{setter:!0}),f0.f(e,t,r)}var Iw=r,Aw=gs,_u=Fc,Ow=ls,qs=Cm,N=z,E=F_,Nw=as("Promise"),Sw="AsyncFromSyncIterator",Rw=N.set,Cw=N.getterFor(Sw),e=(ww.prototype=qs(_u(E),{next:function(){var n=Cw(this);return new Nw(function(e,t){var r=Aw(Iw(n.next,n.iterator));Ew(r,e,t)})},return:function(){var n=Cw(this).iterator;return new Nw(function(e,t){var r=Ow(n,"return");if(void 0===r)return e({done:!0,value:void 0});r=Aw(Iw(r,n));Ew(r,e,t)})}}),ww),Mw=r,xw=e,Pw=gs,Uw=$c,kw=ls,Dw=ds("asyncIterator"),Lw=cs,Fw=gs,Vw=r,jw=as,Bw=ls,Hw=r,zw=cs,Gw=gs,Kw=R,Jw=as,Yw=function(e){return{iterator:e,next:Lw(Fw(e).next)}},Ww=function(e,t,r,n){try{var i=Bw(e,"return");if(i)return jw("Promise").resolve(Vw(i,e)).then(function(){t(r)},function(e){n(e)})}catch(e){return n(e)}t(r)},Gh={toArray:_w(0),forEach:_w(1),every:_w(2),some:_w(3),find:_w(4)},qw=Yc,$w=fs,Xw=S,Zw=function(e,t){t=arguments.length<2?kw(e,Dw):t;return t?Pw(Mw(t,e)):new xw(Uw(e))},Qw=$c,e0=qc,t0=ls,m=WE,r0=as,md=ds,n0=e,i0=Gh.toArray,o0=md("asyncIterator"),s0=m("Array").values,C=(y({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(r0("Promise"))(function(e){var t=$w(o),r=(void 0!==a&&(a=qw(a,u)),t0(t,o0)),n=r?void 0:e0(t)||s0,i=Xw(s)?new s:[],r=r?Zw(t,r):new n0(Qw(t,n));e(i0(r,a,i))})}}),y),a0=_.filterReject,P=rl,t=(C({target:"Array",proto:!0,forced:!0},{filterOut:function(e){return a0(this,e,1<arguments.length?arguments[1]:void 0)}}),P("filterOut"),y),u0=_.filterReject,$s=rl,Oa=(t({target:"Array",proto:!0,forced:!0},{filterReject:function(e){return u0(this,e,1<arguments.length?arguments[1]:void 0)}}),$s("filterReject"),y),c0=fp,l0=Object.isFrozen,p0=(Oa({target:"Array",stat:!0,sham:!0,forced:!0},{isTemplateObject:function(e){if(!bw(e,!0))return!1;var t=e.raw;return t.length===e.length&&bw(t,!1)}}),w.exports),f0=Ia,I=rl,h0=fs,d0=v;Q&&(Tw(Array.prototype,"lastItem",{configurable:!0,get:function(){var e=h0(this),t=d0(e);return 0==t?void 0:e[t-1]},set:function(e){var t=h0(this),r=d0(t);return t[0==r?0:r-1]=e}}),I("lastItem"));var Ap=rl,v0=fs,y0=v;Q&&(Tw(Array.prototype,"lastIndex",{configurable:!0,get:function(){var e=v0(this),e=y0(e);return 0==e?0:e-1}}),Ap("lastIndex"));var i=g,g0=cs,m0=v,E0=fs,w0=M,_0=as("Map"),da=_0.prototype,b0=i(da.forEach),T0=i(da.has),I0=i(da.set),A0=i([].push),A=rl;y({target:"Array",proto:!0,forced:!0},{uniqueBy:function(e){for(var t,r,n=E0(this),i=m0(n),o=w0(n,0),s=new _0,a=null!=e?g0(e):function(e){return e},u=0;u<i;u++)r=a(t=n[u]),T0(s,r)||I0(s,r,t);return b0(s,function(e){A0(o,e)}),o}}),A("uniqueBy");N0.exposure=function(e,t,r,n){return new R0(n,e,t.experiment,t.variationId,t.variationKey,t.reason,r)},N0.track=function(e,t,r,n){return new x0(n,r,e,t)},N0.remoteConfig=function(e,t,r,n){return new k0(n,e,t.parameter,t.valueId,t.reason,r)},N0.isExposureEvent=function(e){return void 0!==e.experiment},N0.isTrackEvent=function(e){return void 0!==e.eventType},N0.isRemoteConfigEvent=function(e){return void 0!==e.parameter},N0.isExposureEventDto=function(e){return"experimentId"in e&&void 0!==e.experimentId},N0.isTrackEventDto=function(e){return"eventTypeId"in e&&void 0!==e.eventTypeId},N0.isRemoteConfigEventDto=function(e){return"parameterId"in e&&void 0!==e.parameterId},N0.prototype.toDto=function(){return{insertId:this.insertId,timestamp:this.timestamp,userId:this.user.identifiers[jt.ID],identifiers:this.user.identifiers,userProperties:Ue.sanitize(this.user.properties),hackleProperties:Ue.sanitize(this.user.hackleProperties)}};var O0=N0;function N0(e,t,r){void 0===r&&(r=H()),this.timestamp=e,this.user=t,this.insertId=r}Se(C0,S0=O0),C0.prototype.copyWithUser=function(e){return new C0(this.timestamp,e,this.experiment,this.variationId,this.variationKey,this.decisionReason,this.properties,this.insertId)},C0.prototype.toDto=function(){return c(c({},S0.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 S0,R0=C0;function C0(e,t,r,n,i,o,s,a){e=S0.call(this,e,t,a)||this;return e.experiment=r,e.variationId=n,e.variationKey=i,e.decisionReason=o,e.properties=s,e}Se(P0,M0=O0),P0.prototype.copyWithUser=function(e){return new P0(this.timestamp,e,this.eventType,this.event,this.insertId)},P0.prototype.toDto=function(){return c(c({},M0.prototype.toDto.call(this)),{eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Ue.sanitize(this.event.properties)})};var M0,x0=P0;function P0(e,t,r,n,i){e=M0.call(this,e,t,i)||this;return e.eventType=r,e.event=n,e}Se(D0,U0=O0),D0.prototype.copyWithUser=function(e){return new D0(this.timestamp,e,this.parameter,this.valueId,this.decisionReason,this.properties,this.insertId)},D0.prototype.toDto=function(){return c(c({},U0.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 U0,k0=D0;function D0(e,t,r,n,i,o,s){e=U0.call(this,e,t,s)||this;return e.parameter=r,e.valueId=n,e.decisionReason=i,e.properties=o,e}F0.isSessionEvent=function(e){return!!O0.isTrackEvent(e)&&(e.event.key===F0.SESSION_START_EVENT_NAME||e.event.key===F0.SESSION_END_EVENT_NAME)},F0.prototype.onSessionStarted=function(e,t,r){this.track(F0.SESSION_START_EVENT_NAME,e,t,r)},F0.prototype.onSessionEnded=function(e,t,r){this.track(F0.SESSION_END_EVENT_NAME,e,t,r)},F0.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)},F0.prototype.decorateSession=function(e,t){t=(new zt).add(jt.SESSION,t).addIdentifiers(e.identifiers).build();return c(c({},e),{identifiers:t})},F0.SESSION_START_EVENT_NAME="$session_start",F0.SESSION_END_EVENT_NAME="$session_end";var L0=F0;function F0(e,t){this.userManager=e,this.core=t}j0.prototype.process=function(e){var t;L0.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))},j0.prototype.flush=function(e){this.delegate.flush(e)},j0.prototype.close=function(){this.delegate.close()},j0.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 V0=j0;function j0(e,t,r,n){this.delegate=e,this.eventDedupDeterminer=t,this.sessionManager=r,this.userManager=n}H0.toEvent=function(e){var t;return{key:H0.EVENT_KEY,properties:{level:H0.LEVEL_ERROR,type:e.name,message:null!=(t=e.message)?t:"",$stacktrace:H0._stacktrace(e)}}},H0._stacktrace=function(e){return u.isNullOrUndefined(e.stack)?"":e.stack.split("\n").slice(0,H0.STACK_TRACK_LIMIT).join("\n")},H0.EVENT_KEY="$trace",H0.LEVEL_ERROR="error",H0.STACK_TRACK_LIMIT=30;var B0=H0;function H0(){}z0.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)}};wu=z0;function z0(){}K0.prototype.with=function(e){return new K0(e,this.targetEvaluations,this.experiment,this.variationId,this.variationKey,this.config)},K0.of=function(e,t,r,n){var i=this.config(e.workspace,r);return new K0(n,t.targetEvaluations,e.experiment,r.id,r.key,i)},K0.ofDefault=function(e,t,r){var n=e.experiment._getVariationByKeyOrNull(e.defaultVariationKey);return u.isNotNullOrUndefined(n)?this.of(e,t,n,r):new K0(r,t.targetEvaluations,e.experiment,void 0,e.defaultVariationKey,void 0)},K0.config=function(e,t){if(!u.isNullOrUndefined(t.parameterConfigurationId))return u.requiredNotNullOrUndefined(e.getParameterConfigurationOrNull(t.parameterConfigurationId),function(){return"ParameterConfiguration[".concat(t.parameterConfigurationId,"]")})};var G0=K0;function K0(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(W0,J0=wu),W0.prototype.supports=function(e){return void 0!==e.experiment},W0.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getExperimentFlow(e.experiment.type).evaluate(e,t))?r:G0.ofDefault(e,t,f.TRAFFIC_NOT_ALLOCATED)};var J0,Y0=W0;function W0(e){var t=J0.call(this)||this;return t.evaluationFlowFactory=e,t}$0.of=function(e,t,r,n,i,o){return o.returnValue=Ue.truncateStringValue(n),new $0(i,t.targetEvaluations,e.parameter,r,n,o)},$0.ofDefault=function(e,t,r,n){return this.of(e,t,void 0,e.defaultValue,r,n)};var q0=$0;function $0(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(Q0,X0=wu),Q0.prototype.supports=function(e){return void 0!==e.parameter},Q0.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,f.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,f.TARGET_RULE_MATCH,r)):this.evaluation(e,t,e.parameter.defaultValue,f.DEFAULT_RULE,r)},Q0.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,f.TYPE_MISMATCH,i):q0.of(e,t,r.id,r.rawValue,n,i)};var X0,Z0=Q0;function Q0(e){var t=X0.call(this)||this;return t.targetRuleDeterminer=e,t}t_.prototype.isEquals=function(e){return this.type===e.type&&this.id===e.id};var e_=t_;function t_(e,t){this.type=e,this.id=t}n_.create=function(){return new n_},Object.defineProperty(n_.prototype,"stack",{get:function(){return Array.from(this._stack)},enumerable:!1,configurable:!0}),Object.defineProperty(n_.prototype,"targetEvaluations",{get:function(){return Array.from(this._targetEvaluations)},enumerable:!1,configurable:!0}),Object.defineProperty(n_.prototype,"properties",{get:function(){return Ue.sanitize(this._properties)},enumerable:!1,configurable:!0}),n_.prototype.contains=function(t){return this._stack.some(function(e){return e.key.isEquals(t.key)})},n_.prototype.addRequest=function(e){this._stack.push(e)},n_.prototype.removeRequest=function(e){e=this._stack.indexOf(e,0);-1<e&&this._stack.splice(e,1)},n_.prototype.getEvaluation=function(t){return this._targetEvaluations.find(function(e){return e instanceof G0&&e.experiment.id===t.id})},n_.prototype.addEvaluation=function(e){this._targetEvaluations.push(e)},n_.prototype.setProperty=function(e,t){this._properties[e]=t};var r_=n_;function n_(){this._stack=[],this._targetEvaluations=[],this._properties={}}o_.of=function(e,t,r,n){return new o_(e,t,r,n)},o_.by=function(e,t){return new o_(e.workspace,e.user,t,"A")},o_.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.experiment.type,", key=").concat(this.experiment.key,")")};var i_=o_;function o_(e,t,r,n){this.key=new e_("EXPERIMENT",r.id),this.workspace=e,this.user=t,this.experiment=r,this.defaultVariationKey=n}a_.of=function(e,t,r,n,i){return new a_(e,t,r,n,i)},a_.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.parameter.key,")")};var s_=a_;function a_(e,t,r,n,i){this.key=new e_("REMOTE_CONFIG",r.id),this.workspace=e,this.user=t,this.parameter=r,this.requiredType=n,this.defaultValue=i}c_.asString=function(e){switch(typeof e){case"string":return e;case"number":return e.toString();case"boolean":return e?"true":"false";default:return}},c_.asNumber=function(e){switch(typeof e){case"number":return this.asActualNumber(e);case"string":return this.asActualNumber(Number(e));default:return}},c_.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}},c_.asActualNumber=function(e){if(!isNaN(e)&&isFinite(e))return e};var u_=c_;function c_(){}p_.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 l_=p_;function p_(e){this.storages=e}h_.prototype.getVariation=function(e,t){var r=this.get(e);if(r)return e._getVariationByIdOrNull(r)},h_.prototype.get=function(e){e=this.listStorage.getItem(e.id.toString());return u_.asNumber(e)},h_.prototype.getAll=function(){var r=new Map;return this.listStorage.entries().forEach(function(e){var t=e[0],e=e[1],t=u_.asNumber(t),e=u_.asNumber(e);u.isNullOrUndefined(t)||t<0||u.isNullOrUndefined(e)||t<0||r.set(t,e)}),r},h_.prototype.set=function(e,t){this.listStorage.setItem(e.id.toString(),t.toString())},h_.prototype.remove=function(e){this.listStorage.removeItem(e.id.toString())},h_.prototype.clear=function(){this.listStorage.clear()};var f_=h_;function h_(e){this.listStorage=e}v_.prototype.add=function(e){this.evaluators.push(e)},v_.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 d_=v_;function v_(){this.evaluators=new Array}g_.prototype.matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n._matches(t,r,e)})},g_.prototype.anyMatches=function(t,r,e){var n=this;return!e.length||e.some(function(e){return n.matches(t,r,e)})},g_.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(r.key.type).matches(e,t,r)};var y_=g_;function g_(e){this.conditionMatcherFactory=e}E_.prototype.decorate=function(e){return e};var m_=E_;function E_(){}__.prototype.decorate=function(e){return"string"==typeof e?Vo.decodeURIOrOriginal(e):e};var w_=__;function __(){}T_.prototype.matches=function(e,t,r){void 0===r&&(r=new m_);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)},T_.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)},T_.prototype.singleMatches=function(t,e,r,n,i){return e.values.some(function(e){return r.matches(n,i.decorate(t),i.decorate(e))})},T_.prototype.arrayMatches=function(e,t,r,n,i){var o=this;return e.some(function(e){return o.singleMatches(e,t,r,n,i)})},T_.prototype.typeMatches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}};var b_=T_;function T_(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}I_.prototype.booleanMatches=function(e,t){return e===t},I_.prototype.numberMatches=function(e,t){return e===t},I_.prototype.stringMatches=function(e,t){return e===t},I_.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},I_.prototype.urlMatches=function(e,t){return Vo.decodeURIOrOriginal(Vo.removePathnameTrailingSlash(e))===Vo.decodeURIOrOriginal(Vo.removePathnameTrailingSlash(t))};Lc=I_;function I_(){}A_.prototype.booleanMatches=function(e,t){return!1},A_.prototype.numberMatches=function(e,t){return!1},A_.prototype.stringMatches=function(e,t){return e.includes(t)},A_.prototype.versionMatches=function(e,t){return!1},A_.prototype.urlMatches=function(e,t){e=Vo.decodeURIOrOriginal(e.href);return e.includes(t)||e.includes(encodeURI(t))};T=A_;function A_(){}O_.prototype.booleanMatches=function(e,t){return!1},O_.prototype.numberMatches=function(e,t){return!1},O_.prototype.stringMatches=function(e,t){return e.startsWith(t)},O_.prototype.versionMatches=function(e,t){return!1},O_.prototype.urlMatches=function(e,t){e=Vo.decodeURIOrOriginal(e.href);return e.startsWith(t)||e.startsWith(encodeURI(t))};du=O_;function O_(){}N_.prototype.booleanMatches=function(e,t){return!1},N_.prototype.numberMatches=function(e,t){return!1},N_.prototype.stringMatches=function(e,t){return e.endsWith(t)},N_.prototype.versionMatches=function(e,t){return!1},N_.prototype.urlMatches=function(e,t){return!1};O=N_;function N_(){}S_.prototype.booleanMatches=function(e,t){return!1},S_.prototype.numberMatches=function(e,t){return t<e},S_.prototype.stringMatches=function(e,t){return t<e},S_.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},S_.prototype.urlMatches=function(e,t){return!1};b=S_;function S_(){}C_.prototype.booleanMatches=function(e,t){return!1},C_.prototype.numberMatches=function(e,t){return t<=e},C_.prototype.stringMatches=function(e,t){return t<=e},C_.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},C_.prototype.urlMatches=function(e,t){return!1};var R_=C_;function C_(){}M_.prototype.booleanMatches=function(e,t){return!1},M_.prototype.numberMatches=function(e,t){return e<t},M_.prototype.stringMatches=function(e,t){return e<t},M_.prototype.versionMatches=function(e,t){return e.isLessThan(t)},M_.prototype.urlMatches=function(e,t){return!1};Xs=M_;function M_(){}x_.prototype.booleanMatches=function(e,t){return!1},x_.prototype.numberMatches=function(e,t){return e<=t},x_.prototype.stringMatches=function(e,t){return e<=t},x_.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},x_.prototype.urlMatches=function(e,t){return!1};wa=x_;function x_(){}U_.prototype.getMatcher=function(e){switch(e){case"IN":return U_.IN_MATCHER;case"CONTAINS":return U_.CONTAINS_MATCHER;case"STARTS_WITH":return U_.STARTS_WITH_MATCHER;case"ENDS_WITH":return U_.ENDS_WITH_MATCHER;case"GT":return U_.GT_MATCHER;case"GTE":return U_.GTE_MATCHER;case"LT":return U_.LT_MATCHER;case"LTE":return U_.LTE_MATCHER}},U_.IN_MATCHER=new Lc,U_.CONTAINS_MATCHER=new T,U_.STARTS_WITH_MATCHER=new du,U_.ENDS_WITH_MATCHER=new O,U_.GT_MATCHER=new b,U_.GTE_MATCHER=new R_,U_.LT_MATCHER=new Xs,U_.LTE_MATCHER=new wa;var P_=U_;function U_(){}k_.prototype.matches=function(e,t,r){t=u_.asString(t),r=u_.asString(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.stringMatches(t,r)};x=k_;function k_(){}D_.prototype.matches=function(e,t,r){t=u_.asNumber(t),r=u_.asNumber(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.numberMatches(t,r)};Fc=D_;function D_(){}L_.prototype.matches=function(e,t,r){t=u_.asBoolean(t),r=u_.asBoolean(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.booleanMatches(t,r)};z=L_;function L_(){}V_.prototype.matches=function(e,t,r){t=yr.tryParse(t),r=yr.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)};var F_=V_;function V_(){}j_.prototype.matches=function(e,t,r){t=Vo.tryParse(t),r=u_.asString(r);return!u.isNullOrUndefined(t)&&!u.isNullOrUndefined(r)&&e.urlMatches(t,r)};N=j_;function j_(){}B_.prototype.matches=function(e,t,r){return!1};qs=B_;function B_(){}z_.prototype.getMatcher=function(e){switch(e){case"STRING":case"JSON":return z_.STRING_MATCHER;case"NUMBER":return z_.NUMBER_MATCHER;case"BOOLEAN":return z_.BOOLEAN_MATCHER;case"VERSION":return z_.VERSION_MATCHER;case"URL":return z_.URL_MATCHER;case"NULL":case"UNKNOWN":return z_.NULL_MATCHER}},z_.STRING_MATCHER=new x,z_.NUMBER_MATCHER=new Fc,z_.BOOLEAN_MATCHER=new z,z_.VERSION_MATCHER=new F_,z_.URL_MATCHER=new N,z_.NULL_MATCHER=new qs;var H_=z_;function z_(){}K_.prototype.matches=function(e,t,r){e=this.userValueResolver.resolveOrNull(e.user,r.key);if(u.isNullOrUndefined(e))return!1;var n=this.valueDecorator(r.key);return this.valueOperatorMatcher.matches(e,r.match,n)},K_.prototype.valueDecorator=function(e){return new("HACKLE_PROPERTY"===e.type&&this.URL_HACKLE_PROPERTY_KEY_NAMES.includes(e.name)?w_:m_)};var G_=K_;function K_(e,t){this.URL_HACKLE_PROPERTY_KEY_NAMES=["pagePath","host","url","queryParameter"],this.userValueResolver=e,this.valueOperatorMatcher=t}Y_.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 J_=Y_;function Y_(){}q_.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}},q_.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 W_=q_;function q_(e){this.segmentMatcher=e}X_.prototype.matches=function(t,r,e){var n=this;return e.targets.some(function(e){return n._matches(t,r,e)})},X_.prototype._matches=function(t,r,e){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(t,r,e)})};var $_=X_;function X_(e){this.userConditionMatcher=e}Q_.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 Z_=Q_;function Q_(e,t){this.abTestMatcher=e,this.featureFlagMatcher=t}eb.prototype.matches=function(e,t,r){var n=u.requiredNotNullOrUndefined(u_.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)},eb.prototype.evaluate=function(e,t,r){r=i_.by(e,r),r=this.evaluator.evaluate(r,t),e=this.resolve(e,r);return t.addEvaluation(e),e};_u=eb;function eb(e,t){this.evaluator=e,this.valueOperatorMatcher=t}Se(nb,tb=_u),nb.prototype.experiment=function(e,t){return e.workspace.getExperimentOrNull(t)},nb.prototype.resolve=function(e,t){return e instanceof i_&&t.reason===f.TRAFFIC_ALLOCATED?t.with(f.TRAFFIC_ALLOCATED_BY_TARGETING):t},nb.prototype.evaluationMatches=function(e,t){return!!nb.AB_TEST_MATCHED_REASONS.includes(e.reason)&&this.valueOperatorMatcher.matches(e.variationKey,t.match)},nb.AB_TEST_MATCHED_REASONS=[f.OVERRIDDEN,f.TRAFFIC_ALLOCATED,f.EXPERIMENT_COMPLETED,f.TRAFFIC_ALLOCATED_BY_TARGETING];var tb,rb=nb;function nb(e,t){return tb.call(this,e,t)||this}Se(sb,ib=_u),sb.prototype.experiment=function(e,t){return e.workspace.getFeatureFlagOrNull(t)},sb.prototype.resolve=function(e,t){return t},sb.prototype.evaluationMatches=function(e,t){e="A"!==e.variationKey;return this.valueOperatorMatcher.matches(e,t.match)};var ib,ob=sb;function sb(e,t){return ib.call(this,e,t)||this}ub.prototype.matches=function(e,t,r){if(!this.isEventEvaluatorRequest(e))return!1;e=this.eventValueResolver.resolveOrNull(e.event,r.key);return!u.isNullOrUndefined(e)&&this.valueOperatorMatcher.matches(e,r.match)},ub.prototype.isEventEvaluatorRequest=function(e){return void 0!==e.event};var ab=ub;function ub(e,t){this.eventValueResolver=e,this.valueOperatorMatcher=t}lb.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,"]"))}},lb.prototype.properties=function(e){return O0.isTrackEvent(e)?e.event.properties:O0.isExposureEvent(e)||O0.isRemoteConfigEvent(e)?e.properties:void 0};var cb=lb;function lb(){}fb.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 pb=fb;function fb(e){this.valueOperatorMatcher=e}db.prototype.supports=function(e){return"NUMBER_OF_EVENTS_IN_DAYS"===e||"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS"===e},db.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 gb(this.valueOperatorMatcher,this.clock).matches(e,o,r);case"NUMBER_OF_EVENTS_WITH_PROPERTY_IN_DAYS":return new wb(this.valueOperatorMatcher,this.clock).matches(e,o,r);default:return i}};var hb=db;function db(e,t){this.valueOperatorMatcher=e,this.clock=t}function vb(){}Se(mb,yb=vb),mb.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=p.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},mb.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&null===e.property},mb.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var yb,gb=mb;function mb(e,t){var r=yb.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}Se(_b,Eb=vb),_b.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=p.sum(t,function(e){return e.countWithinDays(o)});return this.valueOperatorMatcher.matches(t,r.match)},_b.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)},_b.prototype.expressionMatch=function(e,t){return e.eventKey===t.eventKey&&this.propertyMatch(e.property,t.propertyFilter)},_b.prototype.convertTargetConditionToExpression=function(e){try{return JSON.parse(e.key.name)}catch(e){throw new Error("Failed to parse UserTargetCondition. ".concat(e))}};var Eb,wb=_b;function _b(e,t){var r=Eb.call(this)||this;return r.valueOperatorMatcher=e,r.clock=t,r}Tb.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 bb=Tb;function Tb(e,t){var r=new b_(new H_,new P_);this.userConditionMatcher=new G_(new J_,r),this.eventConditionMatcher=new ab(new cb,r),this.segmentConditionMatcher=new W_(new $_(this.userConditionMatcher)),this.experimentConditionMatcher=new Z_(new rb(e,r),new ob(e,r)),this.cohortConditionMatcher=new pb(r),this.userTargetConditionMatcher=new hb(r,t)}Ab.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"VARIATION":return this.resolveVariation(e,r);case"BUCKET":return this.resolveBucket(e,r)}},Ab.prototype.resolveVariation=function(e,t){return e.experiment._getVariationByIdOrNull(t.variationId)},Ab.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 Ib=Ab;function Ab(e){this.bucketer=e}var Ob={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}},Nb=(Sb.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},Sb.prototype.calculateSlotNumber=function(e,t,r){r=Ob.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},Sb);function Sb(){}Cb.prototype.evaluate=function(e,t){if(this.flowEvaluator&&this.nextFlow)return this.flowEvaluator.evaluate(e,t,this.nextFlow)},Cb.end=function(){return new Cb(void 0,void 0)},Cb.decision=function(e,t){return new Cb(e,t)},Cb.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 Rb=Cb;function Cb(e,t){this.flowEvaluator=e,this.nextFlow=t}xb.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 G0.of(e,t,n,f.OVERRIDDEN);case"FEATURE_FLAG":return G0.of(e,t,n,f.INDIVIDUAL_TARGET_MATCH)}};var Mb=xb;function xb(e){this.overrideResolver=e}Ub.prototype.evaluate=function(e,t,r){return"DRAFT"===e.experiment.status?G0.ofDefault(e,t,f.EXPERIMENT_DRAFT):r.evaluate(e,t)};var Pb=Ub;function Ub(){}Db.prototype.evaluate=function(e,t,r){if("PAUSED"!==e.experiment.status)return r.evaluate(e,t);switch(e.experiment.type){case"AB_TEST":return G0.ofDefault(e,t,f.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return G0.ofDefault(e,t,f.FEATURE_FLAG_INACTIVE)}};var kb=Db;function Db(){}Fb.prototype.evaluate=function(e,t,r){if("COMPLETED"!==e.experiment.status)return r.evaluate(e,t);r=e.experiment._winnerVariationOrNull();if(r)return G0.of(e,t,r,f.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(e.experiment.id,"]"))};var Lb=Fb;function Fb(){}jb.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):G0.ofDefault(e,t,f.NOT_IN_EXPERIMENT_TARGET)};var Vb=jb;function jb(e){this.experimentTargetDeterminer=e}Hb.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?G0.ofDefault(e,t,f.VARIATION_DROPPED):G0.of(e,t,n,f.TRAFFIC_ALLOCATED):G0.ofDefault(e,t,f.TRAFFIC_NOT_ALLOCATED)};var Bb=Hb;function Hb(e){this.actionResolver=e}Gb.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 G0.of(e,t,r,f.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var zb=Gb;function Gb(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}Jb.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 G0.ofDefault(e,t,f.DEFAULT_RULE);var n=this.actionResolver.resolveOrNull(e,t,e.experiment.defaultRule);if(n)return G0.of(e,t,n,f.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(e.experiment.id,"]"))};var Kb=Jb;function Jb(e){this.actionResolver=e}Wb.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):G0.ofDefault(e,t,f.NOT_IN_MUTUAL_EXCLUSION_EXPERIMENT);throw new Error("container[".concat(n,"]"))};var Yb=Wb;function Wb(e){this.containerResolver=e}$b.prototype.evaluate=function(e,t,r){return e.user.identifiers[e.experiment.identifierType]?r.evaluate(e,t):G0.ofDefault(e,t,f.IDENTIFIER_NOT_FOUND)};var qb=$b;function $b(){}Zb.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 Xb=Zb;function Zb(e){this.targetMatcher=e}eT.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.experiment.targetRules.find(function(e){return n.targetMatcher.matches(t,r,e.target)})};var Qb=eT;function eT(e){this.targetMatcher=e}rT.prototype.resolveOrNull=function(e,t){var r;return null!=(r=null!=(r=this.resolveManualOverride(e))?r:this._resolveUserOverride(e))?r:this._resolveSegmentOverride(e,t)},rT.prototype.resolveManualOverride=function(e){return this.manualOverrideStorage.getVariation(e.experiment,e.user)},rT.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)}},rT.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 tT=rT;function rT(e,t,r){this.manualOverrideStorage=e,this.targetMatcher=t,this.actionResolver=r}iT.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 nT=iT;function iT(e){this.bucketer=e}sT.of=function(e,t,r,n){return new sT(r,t.targetEvaluations,e.inAppMessage,n,t.properties)};var oT=sT;function sT(e,t,r,n,i){this.reason=e,this.targetEvaluations=t,this.inAppMessage=r,this.message=n,this.properties=i}uT.prototype.evaluate=function(e,t,r){return e.inAppMessage.supports("WEB")?r.evaluate(e,t):oT.of(e,t,f.UNSUPPORTED_PLATFORM)};var aT=uT;function uT(){}lT.prototype.evaluate=function(e,t,r){var n;return this.userOverrideMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),oT.of(e,t,f.OVERRIDDEN,n)):r.evaluate(e,t)};var cT=lT;function lT(e,t){this.userOverrideMatcher=e,this.inAppMessageResolver=t}fT.prototype.evaluate=function(e,t,r){return"DRAFT"===e.inAppMessage.status?oT.of(e,t,f.IN_APP_MESSAGE_DRAFT):r.evaluate(e,t)};var pT=fT;function fT(){}dT.prototype.evaluate=function(e,t,r){return"PAUSE"===e.inAppMessage.status?oT.of(e,t,f.IN_APP_MESSAGE_PAUSED):r.evaluate(e,t)};var hT=dT;function dT(){}yT.prototype.evaluate=function(e,t,r){return e.inAppMessage.period.within(e.timestamp)?r.evaluate(e,t):oT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_PERIOD)};var vT=yT;function yT(){}mT.prototype.evaluate=function(e,t,r){return this.hiddenMatcher.matches(e,t)?oT.of(e,t,f.IN_APP_MESSAGE_HIDDEN):r.evaluate(e,t)};var gT=mT;function mT(e){this.hiddenMatcher=e}wT.prototype.evaluate=function(e,t,r){var n;return this.targetMatcher.matches(e,t)?(n=this.inAppMessageResolver.resolve(e,t),oT.of(e,t,f.IN_APP_MESSAGE_TARGET,n)):oT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_TARGET)};var ET=wT;function wT(e,t){this.targetMatcher=e,this.inAppMessageResolver=t}bT.prototype.resolve=function(e,t){return null!=(t=this.resolveExperiment(e,t))?t:this.resolveDefault(e)},bT.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=i_.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})},bT.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)},bT.prototype.resolveDefault=function(e){var t=e.inAppMessage.messageContext.defaultLang;return this.resolveMessage(e,function(e){return e.lang===t})},bT.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 _T=bT;function bT(e){this.evaluator=e}IT.prototype.matches=function(t,e){var r=this;return t.inAppMessage.targetContext.overrides.some(function(e){return r.isUserOverridden(t,e)})},IT.prototype.isUserOverridden=function(e,t){e=e.user.identifiers[t.identifierType];return!u.isNullOrUndefined(e)&&t.identifiers.includes(e)};var TT=IT;function IT(){}OT.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 AT=OT;function OT(e){this.targetMatcher=e}ST.prototype.matches=function(e,t){return this.storage.exist(e.inAppMessage,e.timestamp)};var NT=ST;function ST(e){this.storage=e}CT.prototype.determineTargetRuleOrNull=function(t,r){var n=this;return t.parameter.targetRules.find(function(e){return n.matches(t,r,e)})},CT.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 RT=CT;function CT(e,t){this.targetMatcher=e,this.bucketer=t}xT.get=function(e){return u.requiredNotNullOrUndefined(this.getOrNull(e),function(){return"Instance not registered [".concat(e,"]")})},xT.getOrNull=function(e){return xT.instances.get(e)},xT.register=function(e,t){return xT.instances.set(e,t),t},xT.instances=new Map;var MT=xT;function xT(){}UT.prototype.getExperimentFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},UT.prototype.getInAppMessageFlow=function(){return this.inAppMessageFlow};var PT=UT;function UT(e,t,r,n){var i=new Nb,n=MT.register("targetMatcher",new y_(new bb(e,n))),o=new Ib(i),t=new tT(t,n,o),s=new nT(i),s=(this.abTestFlow=Rb.of(new Mb(t),new qb,new Yb(s),new Vb(new Xb(n)),new Pb,new kb,new Lb,new Bb(o)),this.featureFlagFlow=Rb.of(new Pb,new kb,new Lb,new Mb(t),new qb,new zb(new Qb(n),o),new Kb(o)),new _T(e));this.inAppMessageFlow=Rb.of(new aT,new cT(new TT,s),new pT,new hT,new vT,new gT(new NT(r)),new ET(new AT(n),s)),this.remoteConfigParameterTargetRuleDeterminer=new RT(n,i)}DT.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={})[DT.ROOT_TYPE]=r.key.type,t[DT.ROOT_ID]=r.key.id;e=n.createEvent(r,e,i,t);e&&o.push(e)}),o},DT.prototype.createEvent=function(e,t,r,n){var i;if(t instanceof G0)return n[DT.CONFIG_ID_PROPERTY_KEY]=null==(i=t.config)?void 0:i.id,n[DT.EXPERIMENT_VERSION_KEY]=t.experiment.version,n[DT.EXECUTION_VERSION_KEY]=t.experiment.executionVersion,O0.exposure(e.user,t,n,r);if(t instanceof q0)return O0.remoteConfig(e.user,t,c(c({},n),t.properties),r);if(t instanceof oT)return null;throw new Error("Unsupported Evaluation [".concat(typeof t,"]"))},DT.ROOT_TYPE="$targetingRootType",DT.ROOT_ID="$targetingRootId",DT.CONFIG_ID_PROPERTY_KEY="$parameterConfigurationId",DT.EXPERIMENT_VERSION_KEY="$experiment_version",DT.EXECUTION_VERSION_KEY="$execution_version";var kT=DT;function DT(e){this.clock=e}Se(VT,LT=wu),VT.prototype.supports=function(e){return void 0!==e.inAppMessage},VT.prototype.evaluateInternal=function(e,t){var r;return null!=(r=this.evaluationFlowFactory.getInAppMessageFlow().evaluate(e,t))?r:oT.of(e,t,f.NOT_IN_IN_APP_MESSAGE_TARGET)};var LT,FT=VT;function VT(e){var t=LT.call(this)||this;return t.evaluationFlowFactory=e,t}BT.of=function(e,t,r,n){return new BT(e,t,r,n)},BT.prototype.toString=function(){return"EvaluatorRequest(type=".concat(this.key.type,", key=").concat(this.inAppMessage.key,")")};var jT=BT;function BT(e,t,r,n){this.key=new e_("IN_APP_MESSAGE",r.id),this.workspace=e,this.user=t,this.inAppMessage=r,this.timestamp=n}var HT=s.log,zT=(GT.create=function(e,t,r,n){var i=Fe.instance,o=new d_,r=new l_(r),r=new PT(o,r,n,i),n=new Y0(r),s=new Z0(r.remoteConfigParameterTargetRuleDeterminer),r=new FT(r);return o.add(n),o.add(s),new GT(n,s,r,e,new kT(i),t,new KT,i)},GT.prototype.experiment=function(e,t,r){var n=this;if(!e)return HT.error("experimentKey must not be empty"),bt.of(r,f.INVALID_INPUT);var i=this.workspaceFetcher.get();if(!i)return HT.warn("SDK not ready."),bt.of(r,f.SDK_NOT_READY);e=i.getExperimentOrNull(e);if(!e)return HT.warn("Experiment does not exist."),bt.of(r,f.EXPERIMENT_NOT_FOUND);i=i_.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},GT.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=i_.of(o,r,e,"A"),t=n.experimentInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},GT.prototype.experimentInternal=function(e){var e=this.experimentEvaluator.evaluate(e,r_.create()),t=null!=(t=e.config)?t:new je;return[e,bt.of(e.variationKey,e.reason,t,e.experiment)]},GT.prototype.featureFlag=function(e,t){var r=this;if(!e)return HT.error("featureKey must not be empty"),It.off(f.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return HT.warn("SDK not ready."),It.off(f.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return HT.warn("FeatureFlag does not exist."),It.off(f.FEATURE_FLAG_NOT_FOUND);n=i_.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},GT.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=i_.of(o,r,e,"A"),t=n.featureFlagInternal(t),t=(t[0],t[1]);i.add(e,t)}),i},GT.prototype.featureFlagInternal=function(e){var e=this.experimentEvaluator.evaluate(e,r_.create()),t=null!=(t=e.config)?t:new je;return[e,"A"===e.variationKey?It.off(e.reason,t,e.experiment):It.on(e.reason,t,e.experiment)]},GT.prototype.inAppMessage=function(e,t){var r=this,n=this.workspaceFetcher.get();if(!n)return HT.warn("SDK not ready."),wt.of(f.SDK_NOT_READY);e=n.getInAppMessageOrNull(e);if(!e)return HT.warn("In app message does not exist."),wt.of(f.IN_APP_MESSAGE_NOT_FOUND);n=jT.of(n,t,e,this.clock.currentMillis()),t=this.inAppMessageEvaluator.evaluate(n,r_.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)},GT.prototype.tryInAppMessage=function(t,e){var r,n=zn.start();try{r=this.inAppMessage(t,e)}catch(e){HT.error("Unexpected error while deciding in app message [".concat(t,"]: ").concat(e)),r=wt.of(f.EXCEPTION)}return Fi.inAppMessage(n,t,r),r},GT.prototype.track=function(e,t,r){var n;void 0===r&&(r=(new Date).getTime()),e?"object"!=typeof e?HT.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(O0.track(n,e,t,r))):HT.warn("Event key must be not null. or event key must be string type."):HT.warn("event must not be null.")},GT.prototype.trackException=function(e,t){this.errorDedupDeterminer.isDedupTarget(e)||(e=B0.toEvent(e),this.flush(),this.track(e,t),this.flush())},GT.prototype.flush=function(e){this.eventProcessor.flush(e=void 0===e?!1:e)},GT.prototype.remoteConfig=function(e,t,r,n){var i=this,o=this.workspaceFetcher.get();if(u.isNullOrUndefined(o))return HT.warn("SDK not ready."),mt.of(n,f.SDK_NOT_READY);e=o.getRemoteConfigParameterOrNull(e);if(u.isNullOrUndefined(e))return HT.warn("Remote config parameter does not exist."),mt.of(n,f.REMOTE_CONFIG_PARAMETER_NOT_FOUND);o=s_.of(o,t,e,r,n),t=this.remoteConfigEvaluator.evaluate(o,r_.create());return this.eventFactory.create(o,t).forEach(function(e){return i.eventProcessor.process(e)}),mt.of(t.value,t.reason)},GT.prototype.close=function(){this.eventProcessor.close()},GT);function GT(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}JT.prototype.isDedupTarget=function(e){return!!this._isSameError(e,this.previous)||(this.previous=e,!1)},JT.prototype._isSameError=function(e,t){return!u.isNullOrUndefined(t)&&(e.name===t.name&&e.message===t.message&&e.stack===t.stack)};var KT=JT;function JT(){}WT.prototype.install=function(e,t){this._install("onerror",e,t),this._install("onunhandledrejection",e,t)},WT.prototype._install=function(e,t,r){e in this._installed||((0,this._installations[e])(t,r),this._installed.push(e))};var YT=WT;function WT(){this._installed=[],this._installations={onerror:XT,onunhandledrejection:ZT}}var qT,$T=null;function XT(o,s){$T=window.onerror,window.onerror=function(e,t,r,n,i){u.isNotNullOrUndefined(i)&&o.trackException(i,s.resolve()),$T&&$T.apply(this,arguments)}}function ZT(r,n){qT=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()),qT&&qT.apply(this,arguments)}}eI.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,[]]})})},eI.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])})})},eI.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]}})})},eI.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]}})})},eI.prototype.isDeleteTarget=function(t,e){return e.some(function(e){return e.insertId===t.insertId})},eI.prototype.clear=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return this.storage.removeItem(this.storageKey),[2]})})};var QT=eI;function eI(e,t,r){this.storage=e,this.storageKey=t,this.maxSize=r}var tI=function(e,t){return null!==e&&(e.userId===t.userId&&e.deviceId===t.deviceId)},rI=(nI.builder=function(){return new iI},nI.empty=function(){return nI.builder().build()},nI.from=function(e){return new nI(e)},nI.fromDto=function(e){for(var t=nI.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(nI.prototype,"rawCohorts",{get:function(){return this.cohorts.values().flatMap(function(e){return e.cohorts})},enumerable:!1,configurable:!0}),nI.prototype.get=function(e){return this.cohorts.get(e)},nI.prototype.filterBy=function(e){var r=Ht(e),e=this.asComparable().filter(function(e,t){return r[e.type]===e.value});return nI.from(e)},nI.prototype.asArray=function(){return this.cohorts.values()},nI.prototype.asComparable=function(){return this.cohorts},nI.prototype.toBuilder=function(){return new iI(this)},nI);function nI(e){this.cohorts=e}oI.prototype.put=function(e){return this.cohorts.add(e.identifier,e),this},oI.prototype.putAll=function(e){var t=this;return e.asArray().forEach(function(e){return t.put(e)}),this},oI.prototype.build=function(){return new rI(this.cohorts)};var iI=oI;function oI(e){this.cohorts=new Yn(Me.isEqual),e&&this.putAll(e)}var E="model",r="name",R="type",S="vendor",e="version",Gh="architecture",md="console",m="mobile",C="tablet",P="smarttv",_="wearable",sI=(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],[r,e],[/(opios)[\/\s]+([\w\.]+)/i],[[r,"Opera Mini"],e],[/\s(opr)\/([\w\.]+)/i],[[r,"Opera"],e],[/(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],[r,e],[/(konqueror)\/([\w\.]+)/i],[[r,"Konqueror"],e],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[r,"IE"],e],[/(edge|edgios|edga|edg)\/((\d+)?[\w\.]+)/i],[[r,"Edge"],e],[/(yabrowser)\/([\w\.]+)/i],[[r,"Yandex"],e],[/(Avast)\/([\w\.]+)/i],[[r,"Avast Secure Browser"],e],[/(AVG)\/([\w\.]+)/i],[[r,"AVG Secure Browser"],e],[/(puffin)\/([\w\.]+)/i],[[r,"Puffin"],e],[/(focus)\/([\w\.]+)/i],[[r,"Firefox Focus"],e],[/(opt)\/([\w\.]+)/i],[[r,"Opera Touch"],e],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w\.]+)/i],[[r,"UCBrowser"],e],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],e],[/(windowswechat qbcore)\/([\w\.]+)/i],[[r,"WeChat(Win) Desktop"],e],[/(micromessenger)\/([\w\.]+)/i],[[r,"WeChat"],e],[/(brave)\/([\w\.]+)/i],[[r,"Brave"],e],[/(whale)\/([\w\.]+)/i],[[r,"Whale"],e],[/(qqbrowserlite)\/([\w\.]+)/i],[r,e],[/(QQ)\/([\d\.]+)/i],[r,e],[/m?(qqbrowser)[\/\s]?([\w\.]+)/i],[r,e],[/(baiduboxapp)[\/\s]?([\w\.]+)/i],[r,e],[/(2345Explorer)[\/\s]?([\w\.]+)/i],[r,e],[/(MetaSr)[\/\s]?([\w\.]+)/i],[r],[/(LBBROWSER)/i],[r],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[e,[r,"MIUI Browser"]],[/;fbav\/([\w\.]+);/i],[e,[r,"Facebook"]],[/safari\s(line)\/([\w\.]+)/i,/android.+(line)\/([\w\.]+)\/iab/i],[r,e],[/headlesschrome(?:\/([\w\.]+)|\s)/i],[e,[r,"Chrome Headless"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[r,/(.+)/,"$1 WebView"],e],[/((?:oculus|samsung)browser)\/([\w\.]+)/i],[[r,/(.+(?:g|us))(.+)/,"$1 $2"],e],[/((?:android.+)crmo|crios)\/([\w\.]+)/i,/android.+(chrome)\/([\w\.]+)\s+(?:mobile\s?safari)/i],[[r,"Chrome Mobile"],e],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[e,[r,"Android Browser"]],[/(sailfishbrowser)\/([\w\.]+)/i],[[r,"Sailfish Browser"],e],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i],[r,e],[/(dolfin)\/([\w\.]+)/i],[[r,"Dolphin"],e],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[r,"360 Browser"]],[/(coast)\/([\w\.]+)/i],[[r,"Opera Coast"],e],[/fxios\/([\w\.-]+)/i],[e,[r,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[e,[r,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[e,r],[/webkit.+?(gsa)\/([\w\.]+).+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[[r,"GSA"],e],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[r,[e,(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],[r,e],[/(navigator|netscape)\/([\w\.-]+)/i],[[r,"Netscape"],e],[/(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],[r,e]],cpu:[[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],[[Gh,"amd64"]],[/(ia32(?=;))/i],[[Gh,U.util.lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[Gh,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[Gh,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],[[Gh,/ower/,"",U.util.lowerize]],[/(sun4\w)[;\)]/i],[[Gh,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[Gh,U.util.lowerize]]],device:[[/\((ipad|playbook);[\w\s\),;-]+(rim|apple)/i],[E,S,[R,C]],[/applecoremedia\/[\w\.]+ \((ipad)/],[E,[S,"Apple"],[R,C]],[/(apple\s{0,1}tv)/i],[[E,"Apple TV"],[S,"Apple"],[R,P]],[/(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],[S,E,[R,C]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[E,[S,"Amazon"],[R,C]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[E,U.mapper.str,U.maps.device.amazon.model],[S,"Amazon"],[R,m]],[/android.+aft([bms])\sbuild/i],[E,[S,"Amazon"],[R,P]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[E,S,[R,m]],[/\((ip[honed|\s\w*]+);/i],[E,[S,"Apple"],[R,m]],[/(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],[S,E,[R,m]],[/\(bb10;\s(\w+)/i],[E,[S,"BlackBerry"],[R,m]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[E,[S,"Asus"],[R,C]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[S,"Sony"],[E,"Xperia Tablet"],[R,C]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[E,[S,"Sony"],[R,m]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[S,E,[R,md]],[/android.+;\s(shield)\sbuild/i],[E,[S,"Nvidia"],[R,md]],[/(playstation\s[34portablevi]+)/i],[E,[S,"Sony"],[R,md]],[/(sprint\s(\w+))/i],[[S,U.mapper.str,U.maps.device.sprint.vendor],[E,U.mapper.str,U.maps.device.sprint.model],[R,m]],[/(htc)[;_\s-]+([\w\s]+(?=\)|\sbuild)|\w+)/i,/(zte)-(\w*)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]*)/i],[S,[E,/_/g," "],[R,m]],[/(nexus\s9)/i],[E,[S,"HTC"],[R,C]],[/d\/huawei([\w\s-]+)[;\)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[E,[S,"Huawei"],[R,m]],[/android.+(bah2?-a?[lw]\d{2})/i],[E,[S,"Huawei"],[R,C]],[/(microsoft);\s(lumia[\s\w]+)/i],[S,E,[R,m]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[E,[S,"Microsoft"],[R,md]],[/(kin\.[onetw]{3})/i],[[E,/\./g," "],[S,"Microsoft"],[R,m]],[/\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],[E,[S,"Motorola"],[R,m]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[E,[S,"Motorola"],[R,C]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[S,U.util.trim],[E,U.util.trim],[R,P]],[/hbbtv.+maple;(\d+)/i],[[E,/^/,"SmartTV"],[S,"Samsung"],[R,P]],[/\(dtv[\);].+(aquos)/i],[E,[S,"Sharp"],[R,P]],[/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],[[S,"Samsung"],E,[R,C]],[/smart-tv.+(samsung)/i],[S,[R,P],E],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)/i,/sec-((sgh\w+))/i],[[S,"Samsung"],E,[R,m]],[/sie-(\w*)/i],[E,[S,"Siemens"],[R,m]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]*)/i],[[S,"Nokia"],E,[R,m]],[/android[x\d\.\s;]+\s([ab][1-7]\-?[0178a]\d\d?)/i],[E,[S,"Acer"],[R,C]],[/android.+([vl]k\-?\d{3})\s+build/i],[E,[S,"LG"],[R,C]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[S,"LG"],E,[R,C]],[/(lg) netcast\.tv/i],[S,E,[R,P]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w*)/i,/android.+lg(\-?[\d\w]+)\s+build/i],[E,[S,"LG"],[R,m]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[S,E,[R,C]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[E,[S,"Lenovo"],[R,C]],[/(lenovo)[_\s-]?([\w-]+)/i],[S,E,[R,m]],[/linux;.+((jolla));/i],[S,E,[R,m]],[/((pebble))app\/[\d\.]+\s/i],[S,E,[R,_]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[S,E,[R,m]],[/crkey/i],[[E,"Chromecast"],[S,"Google"],[R,P]],[/android.+;\s(glass)\s\d/i],[E,[S,"Google"],[R,_]],[/android.+;\s(pixel c)[\s)]/i],[E,[S,"Google"],[R,C]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[E,[S,"Google"],[R,m]],[/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],[[E,/_/g," "],[S,"Xiaomi"],[R,m]],[/android.+(mi[\s\-_]*(?:pad)(?:[\s_]*[\w\s]+))\s+build/i],[[E,/_/g," "],[S,"Xiaomi"],[R,C]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[E,[S,"Meizu"],[R,m]],[/(mz)-([\w-]{2,})/i],[[S,"Meizu"],E,[R,m]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[E,[S,"OnePlus"],[R,m]],[/android.+[;\/]\s*(RCT[\d\w]+)\s+build/i],[E,[S,"RCA"],[R,C]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[E,[S,"Dell"],[R,C]],[/android.+[;\/]\s*(Q[T|M][\d\w]+)\s+build/i],[E,[S,"Verizon"],[R,C]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.*)\s+build/i],[[S,"Barnes & Noble"],E,[R,C]],[/android.+[;\/]\s+(TM\d{3}.*\b)\s+build/i],[E,[S,"NuVision"],[R,C]],[/android.+;\s(k88)\sbuild/i],[E,[S,"ZTE"],[R,C]],[/android.+[;\/]\s*(gen\d{3})\s+build.*49h/i],[E,[S,"Swiss"],[R,m]],[/android.+[;\/]\s*(zur\d{3})\s+build/i],[E,[S,"Swiss"],[R,C]],[/android.+[;\/]\s*((Zeki)?TB.*\b)\s+build/i],[E,[S,"Zeki"],[R,C]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[\-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[S,"Dragon Touch"],E,[R,C]],[/android.+[;\/]\s*(NS-?\w{0,9})\sbuild/i],[E,[S,"Insignia"],[R,C]],[/android.+[;\/]\s*((NX|Next)-?\w{0,9})\s+build/i],[E,[S,"NextBook"],[R,C]],[/android.+[;\/]\s*(Xtreme\_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[S,"Voice"],E,[R,m]],[/android.+[;\/]\s*(LVTEL\-)?(V1[12])\s+build/i],[[S,"LvTel"],E,[R,m]],[/android.+;\s(PH-1)\s/i],[E,[S,"Essential"],[R,m]],[/android.+[;\/]\s*(V(100MD|700NA|7011|917G).*\b)\s+build/i],[E,[S,"Envizen"],[R,C]],[/android.+[;\/]\s*(Le[\s\-]+Pan)[\s\-]+(\w{1,9})\s+build/i],[S,E,[R,C]],[/android.+[;\/]\s*(Trio[\s\-]*.*)\s+build/i],[E,[S,"MachSpeed"],[R,C]],[/android.+[;\/]\s*(Trinity)[\-\s]*(T\d{3})\s+build/i],[S,E,[R,C]],[/android.+[;\/]\s*TU_(1491)\s+build/i],[E,[S,"Rotor"],[R,C]],[/android.+(KS(.+))\s+build/i],[E,[S,"Amazon"],[R,C]],[/android.+(Gigaset)[\s\-]+(Q\w{1,9})\s+build/i],[S,E,[R,C]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[R,U.util.lowerize],S,E],[/[\s\/\(](smart-?tv)[;\)]/i],[[R,P]],[/(android[\w\.\s\-]{0,9});.+build/i],[E,[S,"Generic"]]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[e,[r,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[e,[r,"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],[r,e],[/rv\:([\w\.]{1,9}).+(gecko)/i],[e,r]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[r,e],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s\w]*)/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[[r,U.mapper.str,U.maps.os.windows],[e,U.mapper.str,U.maps.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[r,"Windows"],[e,U.mapper.str,U.maps.os.windows.version]],[/\((bb)(10);/i],[[r,"BlackBerry"],e],[/(blackberry)\w*\/?([\w\.]*)/i,/(tizen|kaios)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w\.]*)/i],[r,e],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]*)/i],[[r,"Symbian"],e],[/\((series40);/i],[r],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[r,"Firefox OS"],e],[/(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],[[r,"Linux"],e],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[r,"Chromium OS"],e],[/(sunos)\s?([\w\.\d]*)/i],[[r,"Solaris"],e],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]*)/i],[[r,"Linux"],e],[/(iphone)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[r,"iOS"],[e,/_/g,"."]],[/(ipad)(?:.*os\s*([\w]*)\slike\smac|;\sopera)/i],[[r,"iOS"],[e,/_/g,"."]],[/(haiku)\s(\w+)/i],[r,e],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.*os\s([\w]+)\slike\smac|;\sopera)/i],[[e,/_/g,"."],[r,"iOS"]],[/(mac\sos\sx)\s?([\w\s\.]*)/i,/(macintosh|mac(?=_powerpc)\s)/i],[[r,"Mac"],[e,/_/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],[r,e]]},U);function U(){}uI.generate=function(e){var t,r,n,i,e=void 0===e?{navigator:{userAgent:"",vendor:"",languages:[]},screen:{width:"",height:""}}:e,o=sI.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 aI=uI;function uI(){}lI.prototype.map=function(e){return new lI(e(this.previous),e(this.current))};var cI=lI;function lI(e,t){this.previous=e,this.current=t}fI.empty=function(){return this.from([])},fI.from=function(e){return new fI(e)},fI.fromDto=function(e){return this.from(e.events.map(function(e){return Vn.fromJson(e)}))},Object.defineProperty(fI.prototype,"rawEvents",{get:function(){return this.events},enumerable:!1,configurable:!0});var pI=fI;function fI(e){this.events=e}dI.prototype.initContext=function(e,t){e=null!=(t=null!=t?t:e)?t:this.defaultUser;return gI.of(EI(e,this.hackleDeviceId),rI.empty(),pI.empty())},dI.prototype.addListener=function(e){this.userListeners.push(e)},Object.defineProperty(dI.prototype,"currentUser",{get:function(){return this.context.user},enumerable:!1,configurable:!0}),dI.prototype.resolve=function(e){e=this.resolveContext(e);return this.hackleUser(e)},dI.prototype.resolveContext=function(e){return void 0===e?this.context:("string"==typeof e?this.updateUser({id:e}):this.updateUser(e)).current},dI.prototype.toHackleUser=function(e){e=this.context.with(e);return this.hackleUser(e)},dI.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}},dI.prototype.hackleProperties=function(){var e;return(e="undefined"!=typeof window?c(c({},aI.generate(window)),this.pageManager.currentPage.toProperties()):e)||{}},dI.prototype.setUser=function(e){return this.updateUser(e).map(function(e){return e.user})},dI.prototype.setUserId=function(e){e=c(c({},this.context.user),{userId:e});return this.setUser(e)},dI.prototype.setDeviceId=function(e){e=c(c({},this.context.user),{deviceId:e});return this.setUser(e)},dI.prototype.updateUserProperties=function(e){return this.operateProperties(e).map(function(e){return e.user})},dI.prototype.resetUser=function(){var e=this;return this.updateContext(function(){return e.defaultUser}).map(function(e){return e.user})},dI.prototype.changeUser=function(t,r,n){this.userListeners.forEach(function(e){e.onUserUpdated(t,r,n)})},dI.prototype.saveUser=function(e){this.storage.saveUser(e)},dI.prototype.updateContext=function(e){var t=this.context,r=t.user,e=e(r),n=this.context.with(e);return this.context=n,tI(r,e)||(this.changeUser(r,e,this.clock.currentMillis()),this.saveUser(e)),new cI(t,n)},dI.prototype.updateUser=function(r){var n=this;return this.updateContext(function(e){return e=e,t=EI(r,n.hackleDeviceId),tI(e,t)?c(c({},t),{properties:c(c({},e.properties),t.properties)}):t;var t})},dI.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)})})},dI.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]}})})},dI.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 tI(t.previous,t.current)?[3,4]:[4,this.syncUserTarget()];case 3:e.sent(),e.label=4;case 4:return[2]}})})},dI.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]}})})},dI.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]}})})},dI.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})},dI.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var hI=dI;function dI(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)}yI.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},yI.prototype.saveUser=function(e){this.setDeviceId(e.deviceId||null),this.setUserId(e.userId||null)},Object.defineProperty(yI.prototype,"deviceId",{get:function(){return this.storage.getItem(it)},enumerable:!1,configurable:!0}),Object.defineProperty(yI.prototype,"userId",{get:function(){return this.storage.getItem(nt)},enumerable:!1,configurable:!0}),yI.prototype.setDeviceId=function(e){this.setId(it,e)},yI.prototype.setUserId=function(e){this.setId(nt,e)},yI.prototype.setId=function(e,t){u.isNotNullOrUndefined(t)?this.storage.setItem(e,t):this.storage.removeItem(e)};var vI=yI;function yI(e){this.storage=e}mI.of=function(e,t,r){return new mI(e,t.filterBy(e),r)},mI.prototype.with=function(e){return mI.of(e,this.cohorts.filterBy(e),this.targetEvents)},mI.prototype.update=function(e,t){e=e.filterBy(this.user),e=this.cohorts.toBuilder().putAll(e).build();return mI.of(this.user,e,t)};var gI=mI;function mI(e,t,r){this.user=e,this.cohorts=t,this.targetEvents=r}var EI=function(e,t){return c(c({},e),{id:e.id||t,deviceId:e.deviceId||t})},wI=(Object.defineProperty(_I.prototype,"currentSessionId",{get:function(){return this._currentSessionId},enumerable:!1,configurable:!0}),Object.defineProperty(_I.prototype,"sessionId",{get:function(){var e;return null!=(e=this._currentSessionId)?e:_I.EMPTY_SESSION_ID},enumerable:!1,configurable:!0}),Object.defineProperty(_I.prototype,"lastEventTime",{get:function(){return this._lastEventTime},enumerable:!1,configurable:!0}),_I.prototype.addListener=function(e){this.sessionListeners.push(e)},_I.prototype.startNewSession=function(e,t,r){return e&&this.endSession(e),this.newSession(t,r)},_I.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)},_I.prototype.updateLastEventTime=function(e){this._lastEventTime=e,this.storage.setItem(rt,"".concat(e))},_I.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)})},_I.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},_I.prototype.saveSession=function(e){this._currentSessionId=e,this.storage.setItem(tt,e)},_I.prototype.loadSession=function(){this._currentSessionId=this.storage.getItem(tt)},_I.prototype.loadLastEventTime=function(){var e=this.storage.getItem(rt);null!==e&&0<(e=Number.parseFloat(e))&&(this._lastEventTime=e)},_I.prototype.onUserUpdated=function(e,t,r){this.endSession(e),this.newSession(t,r)},_I.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}},_I.EMPTY_SESSION_ID="0.ffffffff",_I);function _I(e,t){this.sessionTimeoutMillis=e,this.storage=t,this.sessionListeners=[],this._currentSessionId=null,this._lastEventTime=null,this.loadSession(),this.loadLastEventTime()}TI.prototype.getItem=function(e){var t;return null!=(t=null==(t=this.storage)?void 0:t.getItem(e))?t:null},TI.prototype.removeItem=function(e){var t;null!=(t=this.storage)&&t.removeItem(e)},TI.prototype.setItem=function(e,t){var r;null!=(r=this.storage)&&r.setItem(e,t)},TI.prototype.clear=function(){var e;null!=(e=this.storage)&&e.clear()};var bI=TI;function TI(){this.storage=window.localStorage}AI.postfix=function(e,t){return new AI(e,function(e){return"".concat(e).concat(t)})},AI.prefix=function(e,t){return new AI(e,function(e){return"".concat(t).concat(e)})},AI.prototype.getItem=function(e){return this.delegate.getItem(this.transform(e))},AI.prototype.removeItem=function(e){this.delegate.removeItem(this.transform(e))},AI.prototype.setItem=function(e,t){this.delegate.setItem(this.transform(e),t)};var II=AI;function AI(e,t){this.delegate=e,this.transform=t}NI.prototype.isEqualItem=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},NI.prototype.getRemainListSize=function(){try{return this.maxLength-JSON.stringify(this.getList()).length}catch(e){return 0}},NI.prototype.isAddableItem=function(e){try{return this.getRemainListSize()>JSON.stringify(e).length}catch(e){return!1}},NI.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}},NI.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[]}},NI.prototype.entries=function(){return this.getList().flatMap(Object.entries)},NI.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){}},NI.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]},NI.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){}},NI.prototype.clear=function(){this.delegate.removeItem(this.listKey)};var OI=NI;function NI(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)}RI.prototype.currentUser=function(){return this.userManager.resolve()},RI.prototype.getAbTestDecisions=function(){return this.core.experiments(this.currentUser()).entries()},RI.prototype.getAbTestOverrides=function(){return this.abOverrideStorage.getAll()},RI.prototype.setAbTestOverride=function(e,t){this.abOverrideStorage.set(e,t),this.increment("AB_TEST","set")},RI.prototype.resetAbTestOverride=function(e){this.abOverrideStorage.remove(e),this.increment("AB_TEST","reset")},RI.prototype.resetAllAbTestOverride=function(){this.abOverrideStorage.clear(),this.increment("AB_TEST","reset.all")},RI.prototype.getFeatureFlagDecisions=function(){return this.core.featureFlags(this.currentUser()).entries()},RI.prototype.getFeatureFlagOverrides=function(){return this.ffOverrideStorage.getAll()},RI.prototype.setFeatureFlagOverride=function(e,t){this.ffOverrideStorage.set(e,t),this.increment("FEATURE_FLAG","set")},RI.prototype.resetFeatureFlagOverride=function(e){this.ffOverrideStorage.remove(e),this.increment("FEATURE_FLAG","reset")},RI.prototype.resetAllFeatureFlagOverride=function(){this.ffOverrideStorage.clear(),this.increment("FEATURE_FLAG","reset.all")},RI.prototype.increment=function(e,t){_i.counter("experiment.manual.override",{"experiment.type":e,operation:t}).increment()};var SI=RI;function RI(e,t,r,n){this.core=e,this.userManager=t,this.abOverrideStorage=r,this.ffOverrideStorage=n}MI.serverFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},MI.clientFetch=function(e,t){return"".concat(e,"/api/v2/workspaces/").concat(t,"/config")},MI.userCohorts=function(e){return"".concat(e,"/api/v1/cohorts")},MI.serverDispatch=function(e){return"".concat(e,"/api/v2/events")},MI.clientDispatch=function(e){return"".concat(e,"/api/v2/w/events")},MI.beaconDispatch=function(e,t){return"".concat(e,"/api/v2/w/").concat(t,"/events")},MI.inAppMessageRenderer=function(e,t){return"".concat(e,"/sdk/iam-renderer/").concat(t,"/iam-renderer.js")},MI.monitoring=function(e){return"".concat(e,"/metrics")},MI.userTargets=function(e){return"".concat(e,"/api/v1/user-targets")};var CI=MI;function MI(){}PI.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)},PI.prototype.put=function(e,t){this.storage.setItem(this.key(e),"".concat(t))},PI.prototype.key=function(e){return"".concat(e.key)};var xI=PI;function PI(e){this.storage=e}kI.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var UI=kI;function kI(e){this.handlers=e}LI.prototype.handle=function(e,t){e.close()},LI.prototype.supports=function(e){return"CLOSE"===e.type};var DI=LI;function LI(){}VI.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))}},VI.prototype.supports=function(e){return"WEB_LINK"===e.type};var FI=VI;function VI(e){this.urlHandler=e}BI.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))}},BI.prototype.supports=function(e){return"LINK_AND_CLOSE"===e.type};var jI=BI;function BI(e){this.urlHandler=e}zI.prototype.handle=function(e,t){var r=this.clock.currentMillis()+864e5;this.storage.put(e.context.inAppMessage,r),e.close()},zI.prototype.supports=function(e){return"HIDDEN"===e.type};var HI=zI;function zI(e,t){this.storage=e,this.clock=t}KI.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))}},KI.prototype.supports=function(e){return"LINK_NEW_WINDOW"===e.type};var GI=KI;function KI(e){this.urlHandler=e}YI.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))}},YI.prototype.supports=function(e){return"LINK_NEW_WINDOW_AND_CLOSE"===e.type};var JI=YI;function YI(e){this.urlHandler=e}qI.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))}},qI.prototype.supports=function(e){return"LINK_NEW_TAB"===e.type};var WI=qI;function qI(e){this.urlHandler=e}XI.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))}},XI.prototype.supports=function(e){return"LINK_NEW_TAB_AND_CLOSE"===e.type};var $I=XI;function XI(e){this.urlHandler=e}QI.prototype.track=function(e,t,r){t=this.createTrackEvent(t,e);this.core.track(t,e.user,r)},QI.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 ZI=QI;function QI(e){this.core=e}tA.prototype.setListener=function(e){this.inAppMessageListener=e},tA.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 eA=tA;function tA(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}nA.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},nA.prototype.destroy=function(){this.userEventEmitter.off("event",this.onEvent)};var rA=nA;function nA(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 iA=function(e,t,r,n){this.inAppMessage=e,this.message=t,this.user=r,this.properties=n},oA=(sA.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}}},sA.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 iA(e.inAppMessage,e.message,t.user,Ue.sanitize(r))},sA);function sA(e,t,r){this.workspaceFetcher=e,this.eventMatcher=t,this.core=r}uA.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(uA.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.addEventListener(uA.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(uA.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(uA.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]}})})},uA.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,")"))},uA.prototype.handleInAppMessageLifecycle=function(e,t,r){var n=this,i=this.lifecycleRegistry.register(e,t);window.dispatchEvent(new CustomEvent(uA.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE,{detail:{type:e,id:i}})),setTimeout(function(){void 0!==n.lifecycleRegistry.getAndRemove(e,i)&&r()},uA.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT)},uA.prototype.destroy=function(){var e;window.removeEventListener(uA.HACKLE_IAM_INTERACTION_EVENT_TYPE,this.handleInAppMessageInteraction),window.removeEventListener(uA.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"},uA.prototype.addContainer=function(){var e;return this.container||((e=document.createElement("div")).classList.add(uA.CONTAINER_CLASS_NAME),this.container=e),this.container.parentNode||document.body.appendChild(this.container),this.container},uA.prototype.removeContainer=function(){var e;this.container&&(null!=(e=this.container.parentNode)&&e.removeChild(this.container),this.container=null)},uA.prototype.handleInteraction=function(e){var t=this.ui.interactionHandlerFactory.get(e);t&&t.handle(this,e)},uA.prototype.handleEvent=function(e){this.ui.eventHandler.handle(this,e)},uA.HACKLE_IAM_INTERACTION_EVENT_TYPE="hackle-iam-interaction",uA.HACKLE_IAM_LIFECYCLE_START_EVENT_TYPE="hackle-iam-lifecycle-start",uA.HACKLE_IAM_LIFECYCLE_END_EVENT_TYPE="hackle-iam-lifecycle-end",uA.CONTAINER_CLASS_NAME="hackle-iam",uA.LIFE_CYCLE_EVENT_LISTEN_TIMEOUT=5e3;var aA=uA;function uA(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===uA.HACKLE_IAM_INTERACTION_EVENT_TYPE&&(e=e.detail,s.handleInteraction(e))}}lA.prototype.isMobileOS=function(e){e=e.user.hackleProperties.osName;return"string"==typeof e&&Boolean(e.match(this.mobileOSRegex))},lA.prototype.isMobileDeviceType=function(e){e=e.user.hackleProperties.deviceType;return"string"==typeof e&&Boolean(e.match(this.mobileDeviceRegex))},lA.prototype.resolve=function(e){return this.isMobileOS(e)||this.isMobileDeviceType(e)?"mobile":"pc"};var cA=lA;function lA(){this.mobileOSRegex=/(iOS|Android|iPad|iPhone)/g,this.mobileDeviceRegex=/(mobile|phone|tablet)/g}fA.prototype.canOpen=function(){return"OPENED"!==this.current&&"OPENING"!==this.current},fA.prototype.canClose=function(){return"CLOSED"!==this.current&&"CLOSING"!==this.current};var pA=fA;function fA(e){this.current=e=void 0===e?"CLOSED":e}dA.prototype.resolveKey=function(e,t){return"".concat(e,"_").concat(t)},dA.prototype.register=function(e,t){var r=H(),e=this.resolveKey(e,r);return this.record[e]=t,r},dA.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 hA=dA;function dA(){this.record={}}yA.create=function(e){return new yA(e)},yA.prototype.create=function(e,t){var r=new cA,n=new pA,i=new hA;switch(e.message.layout.displayType){case"MODAL":case"BANNER":case"BOTTOM_SHEET":return new aA(this.scriptLoader,e,t,r,n,i);case"NONE":return null}};var vA=yA;function yA(e){this.scriptLoader=e}mA.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()]}})})},mA.prototype.createScript=function(){var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.src=this.scriptUrl,e},mA.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 gA=mA;function mA(e){this.scriptUrl=e}wA.prototype.isTriggerTarget=function(t,r,n){var i=this;return r.eventTrigger.rules.some(function(e){return i.ruleMatches(t,n,r,e)})},wA.prototype.ruleMatches=function(e,t,r,n){if(t.event.key!==n.eventKey)return!1;e=_A.of(e,t,r);return this.targetMatcher.anyMatches(e,r_.create(),n.targets)};var EA=wA;function wA(e){this.targetMatcher=e}bA.of=function(e,t,r){return new bA(new e_("IN_APP_MESSAGE",r.id),e,t.user,t)};var _A=bA;function bA(e,t,r,n){this.key=e,this.workspace=t,this.user=r,this.event=n}IA.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},IA.prototype.createMatchContexts=function(e){for(var t=[],r=0,n=e.identifierCaps;r<n.length;r++){var i=n[r];t.push(new AA(new NA(i)))}return e.durationCap&&t.push(new AA(new RA(e.durationCap))),t};var TA=IA;function IA(e){this.storage=e}OA.prototype.matches=function(e,t){return this.predicate.matches(e,t)&&(this.matchCount+=1),this.matchCount>=this.predicate.thresholdCount};var AA=OA;function OA(e){this.matchCount=0,this.predicate=e}Object.defineProperty(SA.prototype,"thresholdCount",{get:function(){return this.identifierCap.count},enumerable:!1,configurable:!0}),SA.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 NA=SA;function SA(e){this.identifierCap=e}Object.defineProperty(CA.prototype,"thresholdCount",{get:function(){return this.durationCap.count},enumerable:!1,configurable:!0}),CA.prototype.matches=function(e,t){return e.timestamp-t.timestamp<=this.durationCap.durationMillis};var RA=CA;function CA(e){this.durationCap=e}xA.prototype.get=function(e){e=this.storage.getItem(e.id.toString());return u.isNullOrUndefined(e)?[]:JSON.parse(e)},xA.prototype.set=function(e,t){this.storage.setItem(e.id.toString(),JSON.stringify(t))};var MA=xA;function xA(e){this.storage=e}UA.prototype.get=function(t){return this.processors.find(function(e){return e.supports(t)})};var PA=UA;function UA(e){this.processors=e}DA.prototype.process=function(e,t,r){this.saveImpression(e.context.inAppMessage,e.context.user,r)},DA.prototype.saveImpression=function(e,t,r){var n=this.impressionStorage.get(e),t={identifiers:t.identifiers,timestamp:r};n.push(t),n.length>DA.IMPRESSION_MAX_SIZE&&n.splice(0,n.length-DA.IMPRESSION_MAX_SIZE),this.impressionStorage.set(e,n)},DA.prototype.supports=function(e){return"IMPRESSION"===e.type},DA.IMPRESSION_MAX_SIZE=100;var kA=DA;function DA(e){this.impressionStorage=e}FA.prototype.process=function(e,t,r){},FA.prototype.supports=function(e){return"CLOSE"===e.type};var LA=FA;function FA(){}jA.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)},jA.prototype.supports=function(e){return"ACTION"===e.type};var VA=jA;function jA(e){this.actionHandlerFactory=e}HA.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 BA=HA;function HA(e,t,r){this.clock=e,this.eventTracker=t,this.eventProcessorFactory=r}GA.prototype.matches=function(e,t,r){return!!O0.isTrackEvent(r)&&(!!this.ruleDeterminer.isTriggerTarget(e,t,r)&&this.frequencyCapDeterminer.isTriggerTarget(e,t,r))};var zA=GA;function GA(e,t){this.ruleDeterminer=e,this.frequencyCapDeterminer=t}JA.prototype.get=function(t){return this.handlers.find(function(e){return e.supports(t)})};var KA=JA;function JA(e){this.handlers=e}WA.prototype.handle=function(e,t){e.close()},WA.prototype.supports=function(e){return"CLOSE"===e.type};var YA=WA;function WA(){}$A.prototype.handle=function(e,t){t=this.eventOrNull(t);t&&this.eventHandler.handle(e,t)},$A.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},$A.prototype.supports=function(e){return"ACTION"===e.type};var qA=$A;function $A(e){this.eventHandler=e}ZA.prototype.handle=function(e,t){t={type:"IMAGE_IMPRESSION",imageUrl:t.imageUrl,imageOrder:t.imageOrder};this.eventHandler.handle(e,t)},ZA.prototype.supports=function(e){return"IMAGE_IMPRESSION"===e.type};var XA=ZA;function ZA(e){this.eventHandler=e}eO.prototype.open=function(e){window.location.href=e.href};var QA=eO;function eO(){}rO.prototype.open=function(e){window.open(e.href,"Hackle","resizable:true")};var tO=rO;function rO(){}iO.prototype.open=function(e){window.open(e.href)};var nO=iO;function iO(){}sO.prototype.open=function(e){window.location.replace(e)};var oO=sO;function sO(){}function aO(e,t,r){return null===e||(!lO(t,uO)||r.current!==r.referrer)&&!lO(e,t)}var uO={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},cO={current:void 0,referrer:void 0},lO=function(t,r){return Object.keys(uO).every(function(e){return t[e]===r[e]})},pO=(fO.prototype.startNewCampaign=function(e,t,r){for(var t=c(c({},uO),t),n=new Ao,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)},fO.prototype.startNewCampaignIfNeeded=function(e,t){var r=this.storage.get(),n=this.parser.parse(),i=this.parser.parseDomain();aO(r,n,i)&&(this.storage.set(n),this.startNewCampaign(e,n,t))},fO.prototype.onSessionEnded=function(e,t,r){},fO.prototype.onSessionStarted=function(e,t,r){this.startNewCampaignIfNeeded(t,r)},fO);function fO(e,t,r,n){this.storage=e,this.parser=t,this.core=r,this.userManager=n}dO.prototype.get=function(){var e=this.storage.getItem(ot);return e?JSON.parse(e):null},dO.prototype.set=function(e){this.storage.setItem(ot,JSON.stringify(e))};var hO=dO;function dO(e){this.storage=e}yO.prototype.getQueryParam=function(e){return this.getQueryParams(function(){return!0})[e]||""},yO.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=Vo.tryDecodeURIComponent(i))&&(t[o]=i)}return t};var vO=yO;function yO(e){this.search=e}mO.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},mO.DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,mO.SIMPLE_DOMAIN_MATCH_REGEX=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i;var gO=mO;function mO(){}wO.prototype.parse=function(e){e=this.params(e);return this.resolve(e)},wO.prototype.params=function(e){e=u.isNotNullOrUndefined(e)?e:this.pageManager.currentPage.queryParameter;return new vO(e).getQueryParams(wO.CAMPAIGN_QUERY_CONDITION)},wO.prototype.resolve=function(e){return{utm_campaign:e[_O],utm_content:e[bO],utm_id:e[TO],utm_medium:e[IO],utm_source:e[AO],utm_term:e[OO],gclid:e[NO],fbclid:e[SO]}},wO.prototype.parseDomain=function(){var t=this;if("undefined"==typeof window)return cO;return{current:gO.extractDomain(this.pageManager.currentPage.hostname),referrer:function(){var e=t.pageManager.currentPage.referrer;if(e)return e=new URL(e).hostname,gO.extractDomain(e)}()}},wO.CAMPAIGN_QUERY_CONDITION=function(e,t){return Ti.isNotEmptyString(t)};var EO=wO;function wO(e){this.pageManager=e}var _O="utm_campaign",bO="utm_content",TO="utm_id",IO="utm_medium",AO="utm_source",OO="utm_term",NO="gclid",SO="fbclid",RO=(CO.prototype.initialize=function(){this.userEventEmitter.on("event",this.onEvent)},CO.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))}},CO);function CO(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()}xO.prototype.determineTargetExposureOrNull=function(e){var t=this.workspaceFetcher.get();return!t||!t.getAttributes().integration_ga_experiment||!O0.isExposureEvent(e)||"RUNNING"!==e.experiment.status||e.decisionReason!==f.TRAFFIC_ALLOCATED?null:e};var MO=xO;function xO(e){this.workspaceFetcher=e}var PO={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.39.0",IAM_RENDERER_VERSION_HEADER:"0.0.9"},UO=(kO.config=function(e){return c(c(c({},PO),e),{automaticPageTracking:kO.resolveAutomaticPageTracking(e)})},kO.resolveAutomaticPageTracking=function(e){return"boolean"!=typeof(null==e?void 0:e.automaticPageTracking)&&"boolean"!=typeof(null==e?void 0:e.auto_track_page_view)?PO.automaticPageTracking:!!e.automaticPageTracking||!!e.auto_track_page_view},kO.logging=function(e){s.initCounter(function(e){return _i.counter("log",{level:e})}),s.setLogLevel(Te.INFO),e.log_disabled?s.setLogLevel(Te.DISABLE):e.debug&&s.setLogLevel(Te.DEBUG)},kO.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}},kO.isBeaconSupported=function(){var e=!1;return"undefined"!=typeof window&&(e=window&&window.navigator&&!!window.navigator.sendBeacon&&!0)&&s.log.debug("support sendBeacon API"),e},kO.pollingIntervalMillis=function(e){return void 0===e.pollingIntervalMillis||"number"!=typeof e.pollingIntervalMillis||e.pollingIntervalMillis<=0?-1:Math.max(e.pollingIntervalMillis,6e4)},kO.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},kO);function kO(){}LO.prototype.add=function(e){this.synchronizers.push(e)},LO.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]}})})},LO.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]}})})},LO.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 DO=LO;function LO(){this.synchronizers=[]}VO.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]}})})},VO.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()}))},VO.prototype.stop=function(){var e;-1!==this.intervalMillis&&(null!=(e=this.pollingJob)&&e.cancel(),this.pollingJob=null)},VO.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 FO=VO;function VO(e,t,r){this.delegate=e,this.scheduler=t,this.intervalMillis=r,this.pollingJob=null}BO.prototype.schedule=function(e,t){e=new HO(e,t);return e.start(),e},BO.prototype.schedulePeriodically=function(e,t,r){var n;switch(this.scheduleType){case"setTimeout":n=new GO(e,t,r);break;case"setInterval":n=new JO(e,t,r)}return n.start(),n};var jO=BO;function BO(e){this.scheduleType=e}zO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.task()},this.delayMillis)},zO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var HO=zO;function zO(e,t){this.delayMillis=e,this.task=t,this.timeout=null}KO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){return e.run()},this.delayMillis)},KO.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)},KO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)};var GO=KO;function KO(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null}YO.prototype.start=function(){var e=this;this.timeout=setTimeout(function(){e.run(),e.interval=setInterval(function(){return e.run()},e.intervalMillis)},this.delayMillis)},YO.prototype.run=function(){try{this.task()}catch(e){s.log.error("Failed to run task: ".concat(e))}},YO.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.interval&&(clearInterval(this.interval),this.interval=null)};var JO=YO;function YO(e,t,r){this.delayMillis=e,this.intervalMillis=t,this.task=r,this.timeout=null,this.interval=null}qO.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)]}})})},qO.prototype.createRequest=function(e){var t=Ai.builder().url(this.url).method("GET");return null!==e&&t.addHeader(Mi.IF_MODIFIED_SINCE,e),t.build()},qO.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]}})})},qO.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(Mi.LAST_MODIFIED)}};var WO=qO;function qO(e,t){this.url=e,this.transport=t}XO.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)]}})})},XO.prototype.createRequest=function(e){e={identifiers:Ht(e)},e=we.encodeURL(JSON.stringify(e));return Ai.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},XO.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]}})})},XO.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 rI.fromDto(e)};var $O=XO;function XO(e,t){this.url=e,this.transport=t}QO.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)]}})})},QO.prototype.createRequest=function(e){e={identifiers:Ht(e)},e=we.encodeURL(JSON.stringify(e));return Ai.builder().url(this.url).method("GET").addHeader("X-HACKLE-USER",e).build()},QO.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]}})})},QO.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 pI.fromDto(e)};var ZO=QO;function QO(e,t){this.url=e,this.transport=t}tN.prototype.getExperiments=function(){return Array.from(this.experiments.values())},tN.prototype.getSplitUrlExperiments=function(){return Array.from(this.splitUrlExperiments.values())},tN.prototype.getFeatureFlags=function(){return Array.from(this.featureFlags.values())},tN.prototype.getInAppMessages=function(){return Array.from(this.inAppMessages.values())},tN.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},tN.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},tN.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},tN.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},tN.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},tN.prototype.getContainerOrNull=function(e){return this.containers.get(e)},tN.prototype.getParameterConfigurationOrNull=function(e){return this.parameterConfigurations.get(e)},tN.prototype.getRemoteConfigParameterOrNull=function(e){return this.remoteConfigParameters.get(e)},tN.prototype.getInAppMessageOrNull=function(e){return this.inAppMessages.get(e)},tN.prototype.getAttributes=function(){return this.attributes},tN.from=function(e){return new tN(p.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e)}),p.mapNotNullOrUndefined(e.experiments,function(e){return Mt.fromJson("AB_TEST",e)}).filter(function(e){return"SPLIT_URL"===e.implementationType}),p.mapNotNullOrUndefined(e.featureFlags,function(e){return Mt.fromJson("FEATURE_FLAG",e)}),e.buckets.map(Ut.fromJson),e.events.map(Ft.fromJson),p.mapNotNullOrUndefined(e.segments,ir.fromJson),e.containers.map(sr.fromJson),e.parameterConfigurations.map(St.fromJson),p.mapNotNullOrUndefined(e.remoteConfigParameters,lr.fromJson),p.mapNotNullOrUndefined(e.inAppMessages,jr.fromJson),e.workspace.attributes)};var eN=tN;function tN(e,t,r,n,i,o,s,a,u,c,l){this.experiments=p.associateBy(e,function(e){return e.key}),this.splitUrlExperiments=p.associateBy(t,function(e){return e.key}),this.featureFlags=p.associateBy(r,function(e){return e.key}),this.buckets=p.associateBy(n,function(e){return e.id}),this.eventTypes=p.associateBy(i,function(e){return e.key}),this.segments=p.associateBy(o,function(e){return e.key}),this.containers=p.associateBy(s,function(e){return e.id}),this.parameterConfigurations=p.associateBy(a,function(e){return e.id}),this.remoteConfigParameters=p.associateBy(u,function(e){return e.key}),this.inAppMessages=p.associateBy(c,function(e){return e.key}),this.attributes=l}nN.prototype.setConfig=function(e){this.setWorkspace(e),this.lastModified=e.lastModified},nN.prototype.setWorkspace=function(e){try{this.workspace=eN.from(e.config)}catch(e){s.log.error("Failed to set workspace: ".concat(e))}},nN.prototype.get=function(){return this.workspace},nN.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]}})})},nN.prototype.close=function(){return a(this,void 0,void 0,function(){return l(this,function(e){return[2]})})};var rN=nN;function nN(e,t){this.workspaceConfigStorage=e,this.workspaceFetcher=t,this.workspace=null,this.lastModified=null;e=this.workspaceConfigStorage.get();e&&this.setConfig(e)}oN.prototype.dispatch=function(e,t){e=e.map(function(e){return e.toDto()});return t?this.dispatchEventsSynchronously(e):this.dispatchEvents(e)},oN.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]}})})},oN.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 iN=oN;function oN(e,t,r){this.transport=e,this.synchronousTransport=t,this.retryManager=r}aN.prototype.send=function(e){e=this.createRequest(e);return this.execute(e)},aN.prototype.createRequest=function(e){e=e,t=new Array,r=new Array,n=new Array,e.forEach(function(e){e instanceof O0?O0.isExposureEvent(e)?t.push(e.toDto()):O0.isTrackEvent(e)?r.push(e.toDto()):O0.isRemoteConfigEvent(e)&&n.push(e.toDto()):O0.isExposureEventDto(e)?t.push(e):O0.isTrackEventDto(e)?r.push(e):O0.isRemoteConfigEventDto(e)&&n.push(e)});var t,r,n,e={exposureEvents:t,trackEvents:r,remoteConfigEvents:n};return Ai.builder().url(this.url).method("POST").addHeader("Content-Type","application/json").body(JSON.stringify(e)).build()},aN.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 sN=aN;function aN(e,t){this.url=e,this.transport=t}cN.prototype.add=function(e){return this.repository.add(e)},cN.prototype.delete=function(e){return this.repository.delete(e)},cN.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]}})})},cN.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 uN=cN;function cN(e,t){this.repository=e,this.transport=t}function lN(){this.listeners={}}lN.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},lN.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},lN.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Se(fN,pN=lN);var pN,t=fN;function fN(){return null!==pN&&pN.apply(this,arguments)||this}Se(vN,hN=t),vN.prototype.process=function(e){this.enqueue(e),this.emit("event",e)},vN.prototype.enqueue=function(e){0===this.queue.length&&this.scheduleFlush(),this.queue.push(e),this.queue.length>=this.eventDispatchMaxSize&&this.flush()},vN.prototype.scheduleFlush=function(){var e,t=this;null!=(e=this.flushingJob)&&e.cancel(),this.flushingJob=this.flushScheduler.schedule(this.flushIntervalMillis,function(){return t.flush()})},vN.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=[])},vN.prototype.close=function(){this.flush(!0)};var hN,dN=vN;function vN(e,t,r,n){var i=hN.call(this)||this;return i.eventDispatcher=e,i.eventDispatchMaxSize=t,i.flushScheduler=r,i.flushIntervalMillis=n,i.queue=[],i.flushingJob=null,i}gN.prototype.send=function(e){e=e.toBuilder().addHeader(Ge,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 yN=gN;function gN(e,t,r){this.sdk=e,this.clock=t,this.delegate=r}EN.intercept=function(e,t){return t instanceof yN?t:new yN(e,Fe.instance,t)};var mN=EN;function EN(){}_N.create=function(){return new _N},_N.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=Mi.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 wN=_N;function _N(){}TN.create=function(){return new TN},TN.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())})},TN.prototype.createBody=function(e){var t=new URLSearchParams,r=e.headers.get(Ge),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 bN=TN;function TN(){}AN.prototype.invoke=function(e){e=window.prompt(JSON.stringify(e));return this.invocationResponseResolver.resolve(e)};var IN=AN;function AN(e){this.invocationResponseResolver=e}SN.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 ON,NN=SN;function SN(e){this.invocationResponseResolver=e}($s=ON=ON||{}).prompt="prompt",$s.function="function";CN.prototype.getInvocator=function(e,t){return e===ON.prompt?new IN(t):e===ON.function?new NN(t):null};var RN=CN;function CN(){}xN.prototype.onPageStarted=function(e,t){var r=this.userManager.resolve(),r=this.determiner.determineOrNull(r);r&&(this.core.flush(!0),this.redirector.redirect(r))},xN.prototype.onPageEnded=function(e,t){};var MN=xN;function xN(e,t,r,n){this.determiner=e,this.redirector=t,this.userManager=r,this.core=n}var PN=function(e,t,r,n){this.workspace=e,this.experiment=t,this.decision=r,this.user=n},UN=(kN.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 PN(t,o,i,e)}return null},kN);function kN(e,t,r,n){this.workspaceFetcher=e,this.splitUrlMatcher=t,this.splitUrlRedirectedCookieStorage=r,this.core=n}LN.prototype.matches=function(e,t,r){if("SPLIT_URL"!==t.implementationType)return!1;if(!t.splitUrlTargets)return!1;t=t.splitUrlTargets,e=FN.of(e,r);return!(0<t.excludeTargets.length&&this.targetMatcher.anyMatches(e,r_.create(),t.excludeTargets))&&(0<t.includeTargets.length&&this.targetMatcher.anyMatches(e,r_.create(),t.includeTargets))};var DN=LN;function LN(e){this.targetMatcher=e}VN.of=function(e,t){return new VN(new e_("SPLIT_URL",H()),t,e)};var FN=VN;function VN(e,t,r){this.key=e,this.user=t,this.workspace=r}BN.prototype.redirect=function(e){e=this.urlResolver.resolveOrNull(e);e&&(this.initializeEventDispatcher.setNeedDispatch(!1),this.splitUrlRedirectedCookieStorage.setRedirected(!0),this.urlHandler.open(e))};var jN=BN;function BN(e,t,r,n){this.urlResolver=e,this.urlHandler=t,this.splitUrlRedirectedCookieStorage=r,this.initializeEventDispatcher=n}zN.prototype.resolveOrNull=function(e){try{var t=JSON.parse(e.decision.get(zN.SPLIT_URL_CONFIG_KEY,"")),r=kn.fromDto(t);return r.needRedirect?this.resolveByRedirectType(r.redirectType,r.redirectUrl,e):null}catch(e){return null}},zN.prototype.resolveByRedirectType=function(e,t,r){return!t||e!==n.SplitUrlRedirectType.MANUAL?null:this.resolveManualRedirectUrl(t,r)},zN.prototype.resolveManualRedirectUrl=function(e,t){e=Vo.tryParse(e);return e?this.decorateCampaign(e,t):null},zN.prototype.decorateCampaign=function(e,t){t=t.user.hackleProperties.queryParameter;if(Ti.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];Ti.isNotEmptyString(o)&&r.searchParams.set(s,o)}return r}return e},zN.SPLIT_URL_CONFIG_KEY="redirectUrl";var HN=zN;function zN(e){this.campaignParser=e}KN.prototype.alreadyRedirected=function(){try{var e=this.storage.getItem(this.cookieKey);return u.isNullOrUndefined(e)?!1:Boolean(JSON.parse(e))}catch(e){return!1}},KN.prototype.clear=function(){this.storage.removeItem(this.cookieKey)},KN.prototype.setRedirected=function(e){this.storage.setItem(this.cookieKey,String(e),this.cookieStorageOptions)};var GN=KN;function KN(e,t,r){this.storage=e,this.cookieKey=t,this.cookieStorageOptions=r}YN.prototype.setNeedDispatch=function(e){this.needDispatch=e},YN.prototype.dispatchDoneEventIfNeeded=function(){this.needDispatch&&window.dispatchEvent(new CustomEvent(YN.HACKLE_INITIALIZE_DONE_EVENT_TYPE))},YN.HACKLE_INITIALIZE_DONE_EVENT_TYPE="hackle-initialize-done";var JN=YN;function YN(){this.needDispatch=!0}qN.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}},qN.prototype.set=function(e){e=c(c({},e),{version:this.sdk.version});this.storage.setItem(ft,JSON.stringify(e))},qN.prototype.clear=function(){this.storage.removeItem(ft)};var WN=qN;function qN(e,t){this.sdk=e,this.storage=t}var $N=s.log,XN=(ZN.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")}),ZN.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)&&$N.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)&&$N.error(e)}}),window.addEventListener("popstate",function(){try{t("locationChange")}catch(e){(e instanceof Error||"string"==typeof e)&&$N.error(e)}})}catch(e){(e instanceof Error||"string"==typeof e)&&$N.error(e)}var r,n},ZN.prototype.addListener=function(e){this.listeners.push(e)},ZN.prototype.initialize=function(){this._initialized=!0,this.changeLifecycle("pageshow")},ZN.prototype.changeLifecycle=function(e){this._initialized&&this.publish(e)},ZN.prototype.publish=function(t){var r=this.clock.currentMillis();this.listeners.forEach(function(e){e.onLifecycleChanged(t,r)})},ZN.isSafariBrowser=function(e){return!u.isNullOrUndefined(e)&&e.toLowerCase().includes("safari")},ZN);function ZN(e){void 0===e&&(e=Fe.instance),this.clock=e,this.listeners=[],this._initialized=!1}eS.create=function(e,t,r){return void 0===r&&(r=Fe.instance),new eS(new tS(r,e,t))},eS.prototype.execute=function(e,t){return(this.limiter.tryAcquire()?e:t)()};var QN=eS;function eS(e){this.limiter=e}rS.prototype.tryAcquire=function(){var e=this.clock.currentMillis();return this.refreshScopeIfNeeded(e).tryAcquire()},rS.prototype.refreshScopeIfNeeded=function(e){return null!=this.currentScope&&!this.currentScope.isExpired(e)||(this.currentScope=new nS(e+this.intervalMillis,this.limit)),this.currentScope};var tS=rS;function rS(e,t,r){this.clock=e,this.intervalMillis=t,this.limit=r,this.currentScope=null}iS.prototype.isExpired=function(e){return this.expirationTime<e},iS.prototype.tryAcquire=function(){return 0<this.token&&(--this.token,!0)};var nS=iS;function iS(e,t){this.expirationTime=e,this.token=t}sS.prototype.isDedupTarget=function(t){var e=this.determiners.find(function(e){return e.supports(t)});return!!e&&e.isDedupTarget(t)};var oS=sS;function sS(e){this.determiners=e}aS.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)};fp=aS;function aS(e,t){this.dedupIntervalMillis=e,this.clock=t,this.cache={},this.currentUser=null}Se(lS,uS=fp),lS.prototype.supports=function(e){return O0.isRemoteConfigEvent(e)},lS.prototype.cacheKey=function(e){return[e.parameter.id,e.valueId,e.decisionReason].join("-")};var uS,cS=lS;function lS(e,t){return void 0===t&&(t=Fe.instance),uS.call(this,e,t)||this}Se(hS,pS=fp),hS.prototype.supports=function(e){return O0.isExposureEvent(e)},hS.prototype.cacheKey=function(e){return[e.experiment.id,e.variationId,e.variationKey,e.decisionReason].join("-")};var pS,fS=hS;function hS(e,t){return void 0===t&&(t=Fe.instance),pS.call(this,e,t)||this}vS.prototype.isInvocatorResponse=function(e){return"object"==typeof e&&null!==e&&"success"in e&&"boolean"==typeof e.success&&"message"in e&&"string"==typeof e.message},vS.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 dS=vS;function vS(){}gS.prototype.createInvocationRequestDto=function(e){return{_hackle:{command:e.command,parameters:e.parameters}}},gS.prototype.process=function(e){var e=this.createInvocationRequestDto(e);return null!=(e=this.invocator.invoke(e).data)?e:null};var yS=gS;function gS(e){this.invocator=e}var mS=s.log,ES=(wS.prototype.onPageStarted=function(e,t){this.track(e,t)},wS.prototype.onPageEnded=function(e,t){},wS.prototype.track=function(e,t){mS.debug("tracking page view");var r,e={key:wS.PAGE_VIEW_EVENT_KEY,properties:((r={})[wS.PAGE_NAME_PROPERTY_KEY]=e.pageTitle,r)};this.core.track(e,this.userManager.resolve(),t)},wS.PAGE_VIEW_EVENT_KEY="$page_view",wS.PAGE_NAME_PROPERTY_KEY="$page_name",wS);function wS(e,t){this.core=e,this.userManager=t}Object.defineProperty(bS.prototype,"currentPage",{get:function(){var e;return null!=(e=this._currentPage)?e:Mo.createWithCurrentPage()},enumerable:!1,configurable:!0}),bS.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))},bS.prototype.publishStart=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageStarted(e,t)},bS.prototype.publishEnd=function(e,t){for(var r=0,n=this.listeners;r<n.length;r++)n[r].onPageEnded(e,t)},bS.prototype.onLifecycleChanged=function(e,t){switch(e){case"pageshow":case"locationChange":var r=Mo.createWithCurrentPage();return this.updatePage(r,t);case"visible":case"pagehide":case"blur":case"focus":case"hidden":return}},bS.prototype.addListener=function(e){this.listeners.push(e)};var _S=bS;function bS(){this.listeners=[],this._currentPage=null}var TS=s.log,IS=(Object.defineProperty(AS.prototype,"lastEngagementTime",{get:function(){return this._lastEngagementTime},enumerable:!1,configurable:!0}),AS.prototype.startEngagement=function(e){TS.debug("startEngagement timestamp:".concat(e,", page:").concat(this.pageManager.currentPage.url)),this._lastEngagementTime=e},AS.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))},AS.prototype.publish=function(e,t,r){TS.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)},AS.prototype.onPageStarted=function(e,t){this.startEngagement(t)},AS.prototype.onPageEnded=function(e,t){this.endEngagement(e,t)},AS.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}},AS.prototype.addListener=function(e){this.listeners.push(e)},AS);function AS(e,t,r){this.userManager=e,this.pageManager=t,this.minimumEngagementDurationMillis=r,this.listeners=[],this._lastEngagementTime=null}NS.prototype.onEngagement=function(e,t,r){var n,e={key:NS.ENGAGEMENT_EVENT_KEY,properties:((n={})[ES.PAGE_NAME_PROPERTY_KEY]=e.page.pageTitle,n[NS.ENGAGEMENT_TIME_PROPERTY_KEY]=e.durationMillis,n)};this.core.track(e,t,r)},NS.ENGAGEMENT_EVENT_KEY="$engagement",NS.ENGAGEMENT_TIME_PROPERTY_KEY="$engagement_time_ms";var OS=NS;function NS(e){this.core=e}var SS=s.log,RS=null;function CS(e,t){var r,t=UO.config(t);UO.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 RN).getInvocator(o.getInvocationType(),new dS);if(null===s)throw new Error("Failed to get invocator with invocationType:".concat(o.getInvocationType()));if(s=new yS(s),s=new $o(s),!o.getAppMode)return s;if((o=o.getAppMode().toLowerCase())===Wo.native)return s;if(o!==Wo.web_view_wrapper)throw new Error("Unsupported HackleAppMode: ".concat(o));return o=MS(n,i),(n=new Xo(o,s)).syncUser(),n}}catch(e){SS.error("Unexpected exception while check WebApp client: ".concat(e))}return MS(e,t)}function MS(e,t){var r=UO.sdk(e,t);if(RS)return SS.debug("use already exists hackleClient"),RS;var n=new zo,i=(n.initialize(),new bI),o=Bo.getInstance({days:Xe,isCrossSubdomain:!0,sameSite:t.sameSiteCookie,isSecure:t.secureCookie}),s=UO.isBeaconSupported(),a=mN.intercept(r,wN.create()),u=mN.intercept(r,bN.create()),c=a,l=(s&&(c=u),new DO),p=new FO(l,new jO("setTimeout"),UO.pollingIntervalMillis(t)),f=new WN(r,II.postfix(i,"_".concat(e.slice(0,8)))),h=new WO(CI.clientFetch(t.sdkUrl,r.key),a),f=new rN(f,h),h=(l.add(f),new _S),d=new ZO(CI.userTargets(t.sdkUrl),a),v=new $O(CI.userCohorts(t.sdkUrl),a),y=new EO(h),g=new vI(II.postfix(o,"_".concat(e))),m=g.getUser(),E=t.user||null,g=new hI(Ko(),g,d,v,y,h,Fe.instance,m,E),d=(l.add(g),new wI(t.sessionTimeoutMillis,II.postfix(o,"_".concat(e.slice(8))))),v=(g.addListener(d),new QT(i,"".concat(et,"_").concat(e),We)),E=new sN(CI.clientDispatch(t.eventUrl),a),l=E,s=(s&&(l=new sN(CI.beaconDispatch(t.eventUrl,r.key),u)),new uN(v,E)),r=new iN(E,l,s),u=new oS([new cS(UO.dedupIntervalMillis(t)),new fS(UO.dedupIntervalMillis(t))]),v=new dN(r,We,new jO("setTimeout"),$e),E=new V0(v,u,d,g),w=new JN,l=new f_(new OI(o,"".concat(st,"_").concat(e.slice(0,8)))),r=new f_(new OI(o,"".concat(at,"_").concat(e.slice(0,8)))),u=new xI(II.prefix(i,"".concat(ut,"_").concat(e.slice(0,8),"_"))),i=new MA(II.prefix(i,"".concat(ct,"_").concat(e.slice(0,8),"_"))),_=zT.create(f,E,[l,r],u),e=new pO(new hO(II.postfix(o,"_".concat(e.slice(0,8)))),y,_,g),b=new L0(g,_),b=(d.addListener(e),d.addListener(b),new ZI(_)),u=new UI([new DI,new FI(new QA),new jI(new QA),new HI(u,Fe.instance),new GI(new tO),new JI(new tO),new WI(new nO),new $I(new nO)]),u=new PA([new kA(i),new VA(u),new LA]),b=new BA(Fe.instance,b,u),u=new KA([new YA,new qA(b),new XA(b)]),T=new gA(CI.inAppMessageRenderer(t.cdnUrl,t.IAM_RENDERER_VERSION_HEADER)),T=new eA(vA.create(T),b,u),b=new zA(new EA(MT.get("targetMatcher")),new TA(i)),u=new oA(f,b,_),i=(new rA(v,u,T),new MO(f)),b=(new RO(v,i),new IS(g,h,dt)),u=(h.addListener(b),new OS(_)),v=(b.addListener(u),new ES(_,g)),i=(t.automaticPageTracking&&h.addListener(v),new DN(MT.get("targetMatcher"))),u=new GN(o,lt,{days:pt}),o=new UN(f,i,u,_),f=new jN(new HN(y),new oO,u,w),i=new MN(o,f,g,_),y=(h.addListener(i),new SI(_,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:y}:void 0,l=new Di(CI.monitoring(t.monitoringUrl),a,c,new jO("setTimeout"),qe),I=(_i.addRegistry(l),new XN),r=(I.addListener(h),I.addListener(b),I.addListener(d),I.addListener(n),I.addListener(s),I.addListener(E),I.addListener(l),p.start(),QN.create(ht,1)),A=new Uo(_,p,d,g,r,v,T,i),u=(RS=A,(new YT).install(_,g),g.resolve().hackleProperties.browserName);return I.install("string"==typeof u?u:null),o=Date.now(),f=g.currentUser,y=d.currentSessionId,(tI(m,f)?d.startNewSessionIfNeeded(f,o):d.startNewSession(m,f,o))===y&&e.startNewCampaignIfNeeded(f,o),A.onReady(function(){t.autoOpenDevTool&&(t.devTool?A.showUserExplorer():SS.error("DevTool is not provided")),I.initialize(),w.dispatchDoneEventIfNeeded()}),A}var xS=function(e,t){return(xS=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 PS=function(){return(PS=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 US(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}kS.prototype.on=function(e,t){this.listeners[e]=(this.listeners[e]||[]).concat(t)},kS.prototype.off=function(e,t){this.listeners[e]=(this.listeners[e]||[]).filter(function(e){return e!==t})},kS.prototype.emit=function(e,t){(this.listeners[e]||[]).forEach(function(e){e(t)})};Oa=kS;function kS(){this.listeners={}}LS.arePropertiesEqual=function(e,t){var r=LS.coerceUnknownToProperties(e),n=LS.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]})},LS.coerceUnknownToProperties=function(e){return"object"==typeof e&&null!==e?e:{}};var DS=LS;function LS(){}VS.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)&&DS.arePropertiesEqual(null==e?void 0:e.properties,null==t?void 0:t.properties)&&DS.arePropertiesEqual(null==e?void 0:e.identifiers,null==t?void 0:t.identifiers)};var FS=VS;function VS(){}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=CS(e,PS(PS({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"11.39.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 xS(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(PS(PS({},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){FS.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}(Oa);var k={exports:{}},w={},BS=Object.getOwnPropertySymbols,HS=Object.prototype.hasOwnProperty,zS=Object.prototype.propertyIsEnumerable;var Ia=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]))HS.call(r,o)&&(n[o]=r[o]);if(BS)for(var s=BS(r),a=0;a<s.length;a++)zS.call(r,s[a])&&(n[s[a]]=r[s[a]])}return n},GS=Ia,I="function"==typeof Symbol&&Symbol.for,KS=I?Symbol.for("react.element"):60103,JS=I?Symbol.for("react.portal"):60106,Q=I?Symbol.for("react.fragment"):60107,Ap=I?Symbol.for("react.strict_mode"):60108,g=I?Symbol.for("react.profiler"):60114,YS=I?Symbol.for("react.provider"):60109,WS=I?Symbol.for("react.context"):60110,qS=I?Symbol.for("react.forward_ref"):60112,M=I?Symbol.for("react.suspense"):60113,$S=I?Symbol.for("react.memo"):60115,XS=I?Symbol.for("react.lazy"):60116,ZS="function"==typeof Symbol&&Symbol.iterator;function QS(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 eR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tR={};function rR(e,t,r){this.props=e,this.context=t,this.refs=tR,this.updater=r||eR}function nR(){}function iR(e,t,r){this.props=e,this.context=t,this.refs=tR,this.updater=r||eR}rR.prototype.isReactComponent={},rR.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(QS(85));this.updater.enqueueSetState(this,e,t,"setState")},rR.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},nR.prototype=rR.prototype;var da=iR.prototype=new nR,oR=(da.constructor=iR,GS(da,rR.prototype),da.isPureReactComponent=!0,{current:null}),sR=Object.prototype.hasOwnProperty,aR={key:!0,ref:!0,__self:!0,__source:!0};function uR(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)sR.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:KS,type:e,key:o,ref:s,props:i,_owner:oR.current}}function cR(e){return"object"==typeof e&&null!==e&&e.$$typeof===KS}var lR=/\/+/g,pR=[];function fR(e,t,r,n){var i;return pR.length?((i=pR.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 hR(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,pR.length<10&&pR.push(e)}function dR(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 KS:case JS:o=!0}}if(o)return n(i,t,""===r?"."+vR(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+vR(a=t[s],s);o+=e(a,u,n,i)}else if("function"==typeof(u=null!==t&&"object"==typeof t&&"function"==typeof(u=ZS&&t[ZS]||t["@@iterator"])?u:null))for(t=u.call(t),s=0;!(a=t.next()).done;)o+=e(a=a.value,u=r+vR(a,s++),n,i);else if("object"===a)throw n=""+t,Error(QS(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return o}(e,"",t,r)}function vR(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 yR(e,t){e.func.call(e.context,t,e.count++)}function gR(e,t,r){var n=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?mR(e,n,r,function(e){return e}):null!=e&&(cR(e)&&(t=i+(!(i=e).key||t&&t.key===e.key?"":(""+e.key).replace(lR,"$&/")+"/")+r,e={$$typeof:KS,type:i.type,key:t,ref:i.ref,props:i.props,_owner:i._owner}),n.push(e))}function mR(e,t,r,n,i){var o="";dR(e,gR,t=fR(t,o=null!=r?(""+r).replace(lR,"$&/")+"/":o,n,i)),hR(t)}var ER={current:null};function wR(){var e=ER.current;if(null===e)throw Error(QS(321));return e}var _R,bR,TR,i={ReactCurrentDispatcher:ER,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:oR,IsSomeRendererActing:{current:!1},assign:GS},A=(w.Children={map:function(e,t,r){if(null==e)return e;var n=[];return mR(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;dR(e,yR,t=fR(null,null,t,r)),hR(t)},count:function(e){return dR(e,function(){return null},null)},toArray:function(e){var t=[];return mR(e,t,null,function(e){return e}),t},only:function(e){if(cR(e))return e;throw Error(QS(143))}},w.Component=rR,w.Fragment=Q,w.Profiler=g,w.PureComponent=iR,w.StrictMode=Ap,w.Suspense=M,w.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i,w.cloneElement=function(e,t,r){if(null==e)throw Error(QS(267,e));var n=GS({},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=oR.current),void 0!==t.key&&(i=""+t.key),e.type&&e.type.defaultProps&&(u=e.type.defaultProps),t)sR.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:KS,type:e.type,key:i,ref:o,props:n,_owner:s}},w.createContext=function(e,t){return(e={$$typeof:WS,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:YS,_context:e},e.Consumer=e},w.createElement=uR,w.createFactory=function(e){var t=uR.bind(null,e);return t.type=e,t},w.createRef=function(){return{current:null}},w.forwardRef=function(e){return{$$typeof:qS,render:e}},w.isValidElement=cR,w.lazy=function(e){return{$$typeof:XS,_ctor:e,_status:-1,_result:null}},w.memo=function(e,t){return{$$typeof:$S,type:e,compare:void 0===t?null:t}},w.useCallback=function(e,t){return wR().useCallback(e,t)},w.useContext=function(e,t){return wR().useContext(e,t)},w.useDebugValue=function(){},w.useEffect=function(e,t){return wR().useEffect(e,t)},w.useImperativeHandle=function(e,t,r){return wR().useImperativeHandle(e,t,r)},w.useLayoutEffect=function(e,t){return wR().useLayoutEffect(e,t)},w.useMemo=function(e,t){return wR().useMemo(e,t)},w.useReducer=function(e,t,r){return wR().useReducer(e,t,r)},w.useRef=function(e){return wR().useRef(e)},w.useState=function(e){return wR().useState(e)},w.version="16.14.0",{}),Lc=Function.call.bind(Object.prototype.hasOwnProperty),IR=function(){};function AR(e,t,r,n,i){if("production"!==production)for(var o in e)if(TR(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,_R)}catch(e){s=e}!s||s instanceof Error||IR((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 bR)&&(bR[s.message]=!0,o=i?i():"",IR("Failed "+r+" type: "+s.message+(null!=o?o:"")))}}if("production"!==production&&(_R="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",bR={},TR=Lc,IR=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),AR.resetWarningCache=function(){"production"!==production&&(bR={})},"production"!==production){var OR=Ia,NR=AR,T="function"==typeof Symbol&&Symbol.for,SR=T?Symbol.for("react.element"):60103,RR=T?Symbol.for("react.portal"):60106,CR=T?Symbol.for("react.fragment"):60107,MR=T?Symbol.for("react.strict_mode"):60108,xR=T?Symbol.for("react.profiler"):60114,PR=T?Symbol.for("react.provider"):60109,UR=T?Symbol.for("react.context"):60110,kR=T?Symbol.for("react.concurrent_mode"):60111,DR=T?Symbol.for("react.forward_ref"):60112,LR=T?Symbol.for("react.suspense"):60113,FR=T?Symbol.for("react.suspense_list"):60120,VR=T?Symbol.for("react.memo"):60115,jR=T?Symbol.for("react.lazy"):60116,BR=T?Symbol.for("react.block"):60121,HR=T?Symbol.for("react.fundamental"):60117,zR=T?Symbol.for("react.responder"):60118,GR=T?Symbol.for("react.scope"):60119,KR="function"==typeof Symbol&&Symbol.iterator,JR="@@iterator";function YR(e){if(null===e||"object"!=typeof e)return null;e=KR&&e[KR]||e[JR];return"function"==typeof e?e:null}var WR={current:null},qR={current:null},$R=/^(.*)[\\\/]/,XR=1;function ZR(e){if(null==e)return null;if("number"==typeof e.tag&&iC("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 CR:return"Fragment";case RR:return"Portal";case xR:return"Profiler";case MR:return"StrictMode";case LR:return"Suspense";case FR:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case UR:return"Context.Consumer";case PR:return"Context.Provider";case DR:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case VR:return ZR(e.type);case BR:return ZR(e.render);case jR:r=(t=e)._status===XR?t._result:null;if(r)return ZR(r)}var t,r;return null}var QR={},eC=null;function tC(e){eC=e}QR.getCurrentStack=null,QR.getStackAddendum=function(){var e,t,r,n,i,o="",s=(eC&&(e=ZR(eC.type),r=eC._owner,o+=(e=e,t=eC._source,r=r&&ZR(r.type),i="",t?(n=(s=t.fileName).replace($R,""),i=" (at "+(n=/^index\./.test(n)&&(s=s.match($R))&&(s=s[1])?s.replace($R,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(i=" (created by "+r+")"),"\n in "+(e||"Unknown")+i)),QR.getCurrentStack);return s&&(o+=s()||""),o};var rC={ReactCurrentDispatcher:WR,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:qR,IsSomeRendererActing:{current:!1},assign:OR};function nC(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];oC("warn",e,r)}function iC(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];oC("error",e,r)}function oC(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=rC.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){}}OR(rC,{ReactDebugCurrentFrame:QR,ReactComponentTreeHook:{}});var sC={};function aC(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;sC[r]||(iC("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),sC[r]=!0)}var uC={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){aC(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){aC(e,"replaceState")},enqueueSetState:function(e,t,r,n){aC(e,"setState")}},cC={};function lC(e,t,r){this.props=e,this.context=t,this.refs=cC,this.updater=r||uC}Object.freeze(cC),lC.prototype.isReactComponent={},lC.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")},lC.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var pC,fC={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(pC in fC)fC.hasOwnProperty(pC)&&!function(e,t){Object.defineProperty(lC.prototype,e,{get:function(){nC("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(pC,fC[pC]);function hC(){}function dC(e,t,r){this.props=e,this.context=t,this.refs=cC,this.updater=r||uC}hC.prototype=lC.prototype,(T=dC.prototype=new hC).constructor=dC,OR(T,lC.prototype),T.isPureReactComponent=!0;var vC,yC,gC=Object.prototype.hasOwnProperty,mC={key:!0,ref:!0,__self:!0,__source:!0};function EC(e){if(gC.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function wC(e){if(gC.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var _C={},bC=function(e,t,r,n,i,o,s){e={$$typeof:SR,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 TC(e,t,r){var n,i={},o=null,s=null,a=null,u=null;if(null!=t)for(n in EC(t)&&(s=t.ref,"string"==typeof(c=t).ref&&qR.current&&c.__self&&qR.current.stateNode!==c.__self&&(p=ZR(qR.current.type),_C[p]||(iC('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',ZR(qR.current.type),c.ref),_C[p]=!0))),wC(t)&&(o=""+t.key),a=void 0===t.__self?null:t.__self,u=void 0===t.__source?null:t.__source,t)gC.call(t,n)&&!mC.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(){yC||(yC=!0,iC("%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(){vC||(vC=!0,iC("%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}))),bC(e,o,s,a,u,qR.current,i)}function IC(e){return"object"==typeof e&&null!==e&&e.$$typeof===SR}var AC=".",OC=":",NC=!1,SC=/\/+/g;function RC(e){return(""+e).replace(SC,"$&/")}var CC=10,MC=[];function xC(e,t,r,n){var i;return MC.length?((i=MC.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 PC(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,MC.length<CC&&MC.push(e)}function UC(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 SR:case RR:a=!0}}if(a)return n(i,t,""===r?AC+kC(t,0):r),1;var u=0,c=""===r?AC:r+OC;if(Array.isArray(t))for(var l=0;l<t.length;l++)u+=e(o=t[l],c+kC(o,l),n,i);else if("function"==typeof(r=YR(t))){r===t.entries&&(NC||nC("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."),NC=!0);for(var p,f=r.call(t),h=0;!(p=f.next()).done;)u+=e(o=p.value,c+kC(o,h++),n,i)}else if("object"==s)throw r="",r=" If you meant to render a collection of children, use an array instead."+QR.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 kC(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 DC(e,t,r){var n=e.func,i=e.context;n.call(i,t,e.count++)}function LC(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)?FC(o,n,r,function(e){return e}):null!=o&&(IC(o)&&(e=i+(!(s=o).key||t&&t.key===o.key?"":RC(o.key)+"/")+r,o=bC(s.type,e,s.ref,s._self,s._source,s._owner,s.props)),n.push(o))}function FC(e,t,r,n,i){var o="",t=xC(t,o=null!=r?RC(r)+"/":o,n,i);UC(e,LC,t),PC(t)}function VC(e){return"string"==typeof e||"function"==typeof e||e===CR||e===kR||e===xR||e===MR||e===LR||e===FR||"object"==typeof e&&null!==e&&(e.$$typeof===jR||e.$$typeof===VR||e.$$typeof===PR||e.$$typeof===UR||e.$$typeof===DR||e.$$typeof===HR||e.$$typeof===zR||e.$$typeof===GR||e.$$typeof===BR)}function jC(){var e=WR.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 BC(){if(qR.current){var e=ZR(qR.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var HC=!1,zC={};function GC(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=BC())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),zC[t=r]||(zC[t]=!0,r="",e&&e._owner&&e._owner!==qR.current&&(r=" It was passed a child from "+ZR(e._owner.type)+"."),tC(e),iC('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),tC(null)))}function KC(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];IC(n)&&GC(n,t)}else if(IC(e))e._store&&(e._store.validated=!0);else if(e){var i=YR(e);if("function"==typeof i&&i!==e.entries)for(var o,s=i.call(e);!(o=s.next()).done;)IC(o.value)&&GC(o.value,t)}}function JC(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=ZR(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==DR&&t.$$typeof!==VR)return;r=t.propTypes}r?(tC(e),NR(r,e.props,"prop",n,QR.getStackAddendum),tC(null)):void 0===t.PropTypes||HC||(HC=!0,iC("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||iC("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function YC(e,t,r){var n,i=VC(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+".":"")||BC(),null===e?s="null":Array.isArray(e)?s="array":void 0!==e&&e.$$typeof===SR?(s="<"+(ZR(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,iC("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)),TC.apply(this,arguments));if(null==t)return t;if(i)for(var o=2;o<arguments.length;o++)KC(arguments[o],e);if(e===CR){var s=t;tC(s);for(var a=Object.keys(s.props),u=0;u<a.length;u++){var c=a[u];if("children"!==c&&"key"!==c){iC("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==s.ref&&iC("Invalid attribute `ref` supplied to `React.Fragment`."),tC(null)}else JC(t);return t}var WC=!1;try{var qC=Object.freeze({}),$C=new Map([[qC,null]]),XC=new Set([qC]);$C.set(0,0),XC.add(0)}catch(e){}function ZC(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=OR({},e.props),s=e.key,a=e.ref,u=e._self,c=e._source,l=e._owner;if(null!=t)for(n in EC(t)&&(a=t.ref,l=qR.current),wC(t)&&(s=""+t.key),e.type&&e.type.defaultProps&&(i=e.type.defaultProps),t)gC.call(t,n)&&!mC.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 bC(e.type,s,a,u,c,l,o)}.apply(this,arguments),i=2;i<arguments.length;i++)KC(arguments[i],n.type);return JC(n),n}function QC(e){var t=YC.bind(null,e);return t.type=e,WC||(WC=!0,nC("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 nC("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}T=YC,A.Children={map:function(e,t,r){if(null==e)return e;var n=[];return FC(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=xC(null,null,t,r),UC(e,DC,t),PC(t)},count:function(e){return UC(e,function(){return null},null)},toArray:function(e){var t=[];return FC(e,t,null,function(e){return e}),t},only:function(e){if(IC(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},A.Component=lC,A.Fragment=CR,A.Profiler=xR,A.PureComponent=dC,A.StrictMode=MR,A.Suspense=LR,A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rC,A.cloneElement=ZC,A.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&iC("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:UR,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:PR,_context:r}),i=!1,t={$$typeof:UR,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return i||(i=!0,iC("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,iC("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},A.createElement=T,A.createFactory=QC,A.createRef=function(){var e={current:null};return Object.seal(e),e},A.forwardRef=function(e){return null!=e&&e.$$typeof===VR?iC("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?iC("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&iC("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||iC("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:DR,render:e}},A.isValidElement=IC,A.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){iC("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){iC("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},A.memo=function(e,t){return VC(e)||iC("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:VR,type:e,compare:void 0===t?null:t}},A.useCallback=function(e,t){return jC().useCallback(e,t)},A.useContext=function(e,t){var r,n=jC();return void 0!==t&&iC("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?iC("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&&iC("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},A.useDebugValue=function(e,t){return jC().useDebugValue(e,t)},A.useEffect=function(e,t){return jC().useEffect(e,t)},A.useImperativeHandle=function(e,t,r){return jC().useImperativeHandle(e,t,r)},A.useLayoutEffect=function(e,t){return jC().useLayoutEffect(e,t)},A.useMemo=function(e,t){return jC().useMemo(e,t)},A.useReducer=function(e,t,r){return jC().useReducer(e,t,r)},A.useRef=function(e){return jC().useRef(e)},A.useState=function(e){return jC().useState(e)},A.version="16.14.0"}"production"===production?k.exports=w:k.exports=A;var eM=k.exports,tM=k.exports.createContext({hackle:void 0,userVersion:0,initialized:!1}),du=tM.Consumer,rM=tM.Provider;var nM=s.log;function iM(e,t){e=oM(e,t=void 0===t?"A":t);return{isLoading:e.isLoading,variation:e.decision.variation}}function oM(e,t){void 0===t&&(t="A");var r=k.exports.useContext(tM),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,f.EXCEPTION):bt.of(t,f.SDK_NOT_READY)},[t,e,n,o]),r=US(k.exports.useState(function(){return n?s():(nM.error("HackleClient is not existed"),bt.of(t,f.EXCEPTION))}),2),a=r[0],r=r[1],i={key:e,userVersion:i,initialized:o},u=US(k.exports.useState(i),2),c=u[0],u=u[1];return uM(c,i)||(u(i),r(s())),{isLoading:!o,decision:a}}function sM(e){e=aM(e);return{isLoading:e.isLoading,isOn:e.decision.isOn}}function aM(e){var t=k.exports.useContext(tM),r=t.hackle,n=t.userVersion,i=t.initialized,o=k.exports.useCallback(function(){return i?(null==r?void 0:r.featureFlagDetail(e))||It.off(f.EXCEPTION):It.off(f.SDK_NOT_READY)},[e,r,i]),t=US(k.exports.useState(function(){return r?o():(nM.error("HackleClient is not existed"),It.off(f.EXCEPTION))}),2),s=t[0],t=t[1],n={key:e,userVersion:n,initialized:i},a=US(k.exports.useState(n),2),u=a[0],a=a[1];return uM(u,n)||(a(n),t(o())),{isLoading:!i,decision:s}}function uM(e,t){return e.initialized===t.initialized&&e.key===t.key&&e.userVersion===t.userVersion}function cM(e){var t,r=e.experimentKey,e=e.children,n=(r=iM(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 lM(e){return e.variation,e=e.children,k.exports.createElement(k.exports.Fragment,null,e)}function pM(e){var t=(r=sM(e.featureKey)).isLoading,r=r.isOn;return t?null:eM.createElement(eM.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=f,n.EXPERIMENT_IMPLEMENTATION_TYPE=Ct,n.EmptyHackleRemoteConfig=Ot,n.EmptyParameterConfig=je,n.EventType=Ft,n.Experiment=Mt,n.FeatureFlagDecision=It,n.HackleContext=tM,n.HackleContextConsumer=du,n.HackleContextProvider=rM,n.HackleExperiment=cM,n.HackleFeature=pM,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=US(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 PS(PS({},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 PS(PS({},e),{initialized:!0})})},function(){a(function(e){return PS(PS({},e),{initialized:!0})})}).catch(function(){a(function(e){return PS(PS({},e),{initialized:!0})})})},[t]),i||s.initialized?eM.createElement(rM,{value:s},e):null},n.HackleVariation=lM,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=Mr,n.IAM_STATUS=Cr,n.IAM_TIMEUNIT=xr,n.IAM_VERTICAL_ALIGNMENT=Fr,n.IdentifierType=jt,n.IdentifiersBuilder=zt,n.InAppMessage=jr,n.InAppMessageAction=Cn,n.InAppMessageAlignment=hn,n.InAppMessageBackground=Rn,n.InAppMessageButton=In,n.InAppMessageButtonStyle=Sn,n.InAppMessageContext=sn,n.InAppMessageContextLayout=pn,n.InAppMessageContextMessage=cn,n.InAppMessageDecision=wt,n.InAppMessageDurationCap=Qr,n.InAppMessageEventFrequencyCap=qr,n.InAppMessageEventTrigger=Jr,n.InAppMessageEventTriggerRule=Yr,n.InAppMessageExperimentContext=un,n.InAppMessageIdentifierCap=Xr,n.InAppMessageImage=vn,n.InAppMessageImageAutoScroll=gn,n.InAppMessagePeriodAlways=Hr,n.InAppMessagePeriodCustom=Gr,n.InAppMessagePositionalButton=On,n.InAppMessageTargetContext=tn,n.InAppMessageText=En,n.InAppMessageTextAttribute=_n,n.InAppMessageTextStyle=Tn,n.InAppMessageUserOverride=nn,n.Logger=s,n.MATCH_OPERATORS=Ir,n.MATCH_TYPES=br,n.MATCH_VALUE_TYPES=Tr,n.MetaVersion=wr,n.ParameterConfiguration=St,n.PropertyOperations=No,n.PropertyOperationsBuilder=Ao,n.RemoteConfigDecision=mt,n.RemoteConfigParameter=lr,n.RemoteConfigParameterValue=dr,n.RemoteConfigTargetRule=fr,n.SEGMENT_TYPES=Nr,n.Segment=ir,n.Slot=Dt,n.SplitUrlConfig=kn,n.SplitUrlTargets=Ln,n.TARGET_ACTION_TYPES=Ar,n.TARGET_KEY_TYPES=Or,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=Pt,n.Version=yr,n.createInstance=function(e,t){return new jS(e,t)},n.getUserId=Ko,n.removeUserId=Jo,n.resolveIdentifiers=Ht,n.sanitizeUser=Kt,n.setUserId=function(e){Bo.getInstance().setItem(Qe,e)},n.useFeature=function(e){var t=(n=k.exports.useContext(tM)).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=US(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&nM.error("HackleClient is not existed"),!1)}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=US(k.exports.useState(r),2))[0],n=n[1];return uM(a,r)||(n(r),s(i())),o},n.useFeatureFlagDetail=function(e){var t=(n=k.exports.useContext(tM)).hackle,r=n.userVersion,n=n.initialized,i=k.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e))||It.off(f.EXCEPTION)},[e,t,n]),o=(s=US(k.exports.useState(function(){return t?i():("undefined"!=typeof window&&nM.error("HackleClient is not existed"),It.off(f.EXCEPTION))}),2))[0],s=s[1],r={key:e,userVersion:r,initialized:n},a=(n=US(k.exports.useState(r),2))[0],n=n[1];return uM(a,r)||(n(r),s(i())),o},n.useLoadableFeature=sM,n.useLoadableFeatureDetail=aM,n.useLoadableRemoteConfig=function(){var e=(o=k.exports.useContext(tM)).hackle,t=o.userVersion,r=o.initialized,n=k.exports.useCallback(function(){return r&&(null==e?void 0:e.remoteConfig())||new Ot},[e,r]),i=(o=US(k.exports.useState(function(){return e||nM.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(a=US(k.exports.useState(t),2))[0],a=a[1];return uM(s,t)||(a(t),o(n())),{isLoading:!r,remoteConfig:i}},n.useLoadableVariation=iM,n.useLoadableVariationDetail=oM,n.useRemoteConfig=function(){var e=(r=k.exports.useContext(tM)).hackle,t=r.userVersion,r=r.initialized,n=k.exports.useCallback(function(){return(null==e?void 0:e.remoteConfig())||new Ot},[e,r]),i=(o=US(k.exports.useState(function(){return e||nM.error("HackleClient is not existed"),n()}),2))[0],o=o[1],t={userVersion:t,initialized:r},s=(r=US(k.exports.useState(t),2))[0],r=r[1];return uM(s,t)||(r(t),o(n())),i},n.useTrack=function(){var t=k.exports.useContext(tM).hackle;return t?function(e){return null==t?void 0:t.track(e)}:(nM.error("HackleClient is not existed"),function(){})},n.useVariation=function(e,t){void 0===t&&(t="A");var r=(a=k.exports.useContext(tM)).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=US(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&nM.error("HackleClient is not existed"),t)}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(c=US(k.exports.useState(n),2))[0],c=c[1];return uM(u,n)||(c(n),a(o())),s},n.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(i=k.exports.useContext(tM)).hackle,n=i.userVersion,i=i.initialized,o=k.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e))||bt.of(t,f.EXCEPTION)},[t,e,r,i]),s=(a=US(k.exports.useState(function(){return r?o():("undefined"!=typeof window&&nM.error("HackleClient is not existed"),bt.of(t,f.EXCEPTION))}),2))[0],a=a[1],n={key:e,userVersion:n,initialized:i},u=(i=US(k.exports.useState(n),2))[0],i=i[1];return uM(u,n)||(i(n),a(o())),s},Object.defineProperty(n,"__esModule",{value:!0})});
|