UNPKG

@flagship.io/js-sdk

Version:
1 lines 173 kB
!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{var e=i();for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(self,(()=>(()=>{"use strict";var t,i,e={5:(t,i,e)=>{var s;e.d(i,{FSFetchReasons:()=>s}),function(t){t.UPDATE_CONTEXT="UPDATE_CONTEXT",t.AUTHENTICATE="AUTHENTICATE",t.UNAUTHENTICATE="UNAUTHENTICATE",t.FLAGS_FETCHING_ERROR="FLAGS_FETCHING_ERROR",t.FLAGS_FETCHED_FROM_CACHE="FLAGS_FETCHED_FROM_CACHE",t.FLAGS_NEVER_FETCHED="FLAGS_NEVER_FETCHED",t.NONE="NONE"}(s||(s={}))},7:t=>{var i,e="object"==typeof Reflect?Reflect:null,s=e&&"function"==typeof e.apply?e.apply:function(t,i,e){return Function.prototype.apply.call(t,i,e)};i=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function n(){n.init.call(this)}t.exports=n,t.exports.once=function(t,i){return new Promise((function(e,s){function o(e){t.removeListener(i,n),s(e)}function n(){"function"==typeof t.removeListener&&t.removeListener("error",o),e([].slice.call(arguments))}I(t,i,n,{once:!0}),"error"!==i&&function(t,i){"function"==typeof t.on&&I(t,"error",i,{once:!0})}(t,o)}))},n.EventEmitter=n,n.prototype._events=void 0,n.prototype._eventsCount=0,n.prototype._maxListeners=void 0;var a=10;function r(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?n.defaultMaxListeners:t._maxListeners}function c(t,i,e,s){var o,n,a,c;if(r(e),void 0===(n=t._events)?(n=t._events=Object.create(null),t._eventsCount=0):(void 0!==n.newListener&&(t.emit("newListener",i,e.listener?e.listener:e),n=t._events),a=n[i]),void 0===a)a=n[i]=e,++t._eventsCount;else if("function"==typeof a?a=n[i]=s?[e,a]:[a,e]:s?a.unshift(e):a.push(e),(o=h(t))>0&&a.length>o&&!a.warned){a.warned=!0;var g=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(i)+" listeners added. Use emitter.setMaxListeners() to increase limit");g.name="MaxListenersExceededWarning",g.emitter=t,g.type=i,g.count=a.length,c=g,console&&console.warn&&console.warn(c)}return t}function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,i,e){var s={fired:!1,wrapFn:void 0,target:t,type:i,listener:e},o=g.bind(s);return o.listener=e,s.wrapFn=o,o}function l(t,i,e){var s=t._events;if(void 0===s)return[];var o=s[i];return void 0===o?[]:"function"==typeof o?e?[o.listener||o]:[o]:e?function(t){for(var i=new Array(t.length),e=0;e<i.length;++e)i[e]=t[e].listener||t[e];return i}(o):u(o,o.length)}function _(t){var i=this._events;if(void 0!==i){var e=i[t];if("function"==typeof e)return 1;if(void 0!==e)return e.length}return 0}function u(t,i){for(var e=new Array(i),s=0;s<i;++s)e[s]=t[s];return e}function I(t,i,e,s){if("function"==typeof t.on)s.once?t.once(i,e):t.on(i,e);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(i,(function o(n){s.once&&t.removeEventListener(i,o),e(n)}))}}Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),n.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},n.prototype.getMaxListeners=function(){return h(this)},n.prototype.emit=function(t){for(var i=[],e=1;e<arguments.length;e++)i.push(arguments[e]);var o="error"===t,n=this._events;if(void 0!==n)o=o&&void 0===n.error;else if(!o)return!1;if(o){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var r=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw r.context=a,r}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)s(h,this,i);else{var c=h.length,g=u(h,c);for(e=0;e<c;++e)s(g[e],this,i)}return!0},n.prototype.addListener=function(t,i){return c(this,t,i,!1)},n.prototype.on=n.prototype.addListener,n.prototype.prependListener=function(t,i){return c(this,t,i,!0)},n.prototype.once=function(t,i){return r(i),this.on(t,d(this,t,i)),this},n.prototype.prependOnceListener=function(t,i){return r(i),this.prependListener(t,d(this,t,i)),this},n.prototype.removeListener=function(t,i){var e,s,o,n,a;if(r(i),void 0===(s=this._events))return this;if(void 0===(e=s[t]))return this;if(e===i||e.listener===i)0==--this._eventsCount?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,e.listener||i));else if("function"!=typeof e){for(o=-1,n=e.length-1;n>=0;n--)if(e[n]===i||e[n].listener===i){a=e[n].listener,o=n;break}if(o<0)return this;0===o?e.shift():function(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}(e,o),1===e.length&&(s[t]=e[0]),void 0!==s.removeListener&&this.emit("removeListener",t,a||i)}return this},n.prototype.off=n.prototype.removeListener,n.prototype.removeAllListeners=function(t){var i,e,s;if(void 0===(e=this._events))return this;if(void 0===e.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==e[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete e[t]),this;if(0===arguments.length){var o,n=Object.keys(e);for(s=0;s<n.length;++s)"removeListener"!==(o=n[s])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(i=e[t]))this.removeListener(t,i);else if(void 0!==i)for(s=i.length-1;s>=0;s--)this.removeListener(t,i[s]);return this},n.prototype.listeners=function(t){return l(this,t,!0)},n.prototype.rawListeners=function(t){return l(this,t,!1)},n.listenerCount=function(t,i){return"function"==typeof t.listenerCount?t.listenerCount(i):_.call(t,i)},n.prototype.listenerCount=_,n.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},87:(t,i,e)=>{e.d(i,{ACTION_TRACKING:()=>We,ACTION_TRACKING_DISPATCHED:()=>Je,ACTION_TRACKING_HIT_RECEIVED:()=>Xe,ACTION_TRACKING_INVALID_HIT:()=>ze,ACTION_TRACKING_INVALID_NONCE:()=>je,ACTIVATE_ADDED_IN_QUEUE:()=>pt,ACTIVATE_HIT:()=>Ke,ADD_ACTIVATE:()=>St,ADD_TROUBLESHOOTING_HIT:()=>Ct,ADD_USAGE_HIT:()=>vt,ALLOCATION:()=>me,ALL_HITS_FLUSHED:()=>Ve,ANALYTICS_HIT_ADDED_IN_QUEUE:()=>Tt,ANALYTICS_HIT_SENT_SUCCESS:()=>Rt,ANALYTIC_HIT_ALLOCATION:()=>_,ANONYMOUS_ID:()=>Kt,AUTHENTICATE:()=>fe,BASE_API_URL:()=>C,BATCH:()=>Ut,BATCH_HIT:()=>Qe,BATCH_LOOP_STARTED:()=>we,BATCH_LOOP_STOPPED:()=>Ge,BATCH_MAX_SIZE:()=>l,BUCKETING_API_URL:()=>R,BUCKETING_NEW_ALLOCATION:()=>Ne,BUCKETING_POOLING_STARTED:()=>Di,BUCKETING_POOLING_STOPPED:()=>Li,BUCKETING_VARIATION_CACHE:()=>Re,CDN_ACCOUNT_SETTINGS_URL:()=>$,CLEAR_CONTEXT:()=>Yi,CLICK_PATH_DELAY_MS:()=>p,CLIENT_CACHE_KEY:()=>it,CONSENT_CHANGED:()=>Xi,CONSENT_NOT_SPECIFY_WARNING:()=>Ye,CONTEXT_KEY_ERROR:()=>Ki,CONTEXT_KEY_VALUE_UPDATE:()=>$i,CONTEXT_NULL_ERROR:()=>dt,CONTEXT_VALUE_ERROR:()=>Qi,CUSTOMER_ENV_ID_API_ACTIVATE:()=>xt,CUSTOMER_ENV_ID_API_ITEM:()=>Gt,CUSTOMER_UID:()=>Bt,DEFAULT_BROWSER_POOL_MAX_SIZE:()=>d,DEFAULT_BROWSER_TIME_INTERVAL:()=>g,DEFAULT_DEDUPLICATION_TIME:()=>a,DEFAULT_HIT_CACHE_TIME_MS:()=>ot,DEFAULT_POLLING_INTERVAL:()=>r,DEFAULT_SERVER_POOL_MAX_SIZE:()=>c,DEFAULT_SERVER_TIME_INTERVAL:()=>h,DIRECT_HIT:()=>qe,DL_API_ITEM:()=>jt,DS_API_ITEM:()=>Yt,EAI_SCORE_CONTEXT_KEY:()=>tt,EMIT_READY:()=>ht,EMOTION_AI_EVENT_URL:()=>Y,EMOTION_AI_UC_URL:()=>q,EVENT_ACTION_API_ITEM:()=>Ei,EVENT_CATEGORY_API_ITEM:()=>Ii,EVENT_LABEL_API_ITEM:()=>fi,EVENT_VALUE_API_ITEM:()=>Ti,EXPOSE_ALL_KEYS:()=>G,FETCH_CAMPAIGNS_FROM_CACHE:()=>Ji,FETCH_CAMPAIGNS_SUCCESS:()=>ji,FETCH_EAI_SCORE:()=>j,FETCH_EAI_SCORE_ERROR:()=>J,FETCH_EAI_SCORE_SUCCESS:()=>Z,FETCH_FLAGS_BUFFERING_MESSAGE:()=>Dt,FETCH_FLAGS_FROM_CAMPAIGNS:()=>Zi,FETCH_FLAGS_PANIC_MODE:()=>ie,FETCH_FLAGS_STARTED:()=>te,FETCH_FLAG_BUFFERING_DEFAULT_TIME:()=>n,FLAGSHIP_SDK:()=>rt,FLAGSHIP_VISITOR_NOT_AUTHENTICATE:()=>Se,FLAG_METADATA:()=>_e,FLAG_VALUE:()=>ne,FLAG_VISITOR_EXPOSED:()=>de,FS_CONSENT:()=>x,FS_FORCED_VARIATIONS:()=>K,FS_IS_QA_MODE_ENABLED:()=>B,FS_QA_ASSISTANT:()=>k,FS_QA_ASSISTANT_LOCAL:()=>b,FS_QA_ASSISTANT_SCRIPT_TAG_ID:()=>Q,FS_QA_ASSISTANT_STAGING:()=>M,FS_QA_URL:()=>U,GET_FLAG:()=>ae,GET_FLAG_CAST_ERROR:()=>re,GET_FLAG_MISSING_ERROR:()=>se,GET_FLAG_NOT_FOUND:()=>oe,GET_FLAG_VALUE:()=>he,GET_THIRD_PARTY_SEGMENT:()=>$e,HEADER_APPLICATION_JSON:()=>Oi,HEADER_CONTENT_TYPE:()=>mi,HEADER_X_API_KEY:()=>Si,HEADER_X_SDK_CLIENT:()=>Ri,HEADER_X_SDK_VERSION:()=>Ni,HIT_ADDED_IN_QUEUE:()=>At,HIT_CACHE_ERROR:()=>Le,HIT_CACHE_LOADED:()=>be,HIT_CACHE_SAVED:()=>Pe,HIT_CACHE_VERSION:()=>st,HIT_DATA_FLUSHED:()=>Fe,HIT_EVENT_URL:()=>v,HIT_SENT_SUCCESS:()=>Be,ICN_API_ITEM:()=>oi,IC_API_ITEM:()=>gi,INITIALIZATION_PARAM_ERROR:()=>gt,INITIALIZATION_STARTING:()=>yi,IN_API_ITEM:()=>ci,IP_API_ITEM:()=>di,IQ_API_ITEM:()=>li,IV_API_ITEM:()=>_i,LOOKUP_VISITOR_JSON_OBJECT_ERROR:()=>Oe,MAX_ACTIVATE_HIT_PER_BATCH:()=>nt,MAX_CLICK_PATH_LENGTH:()=>E,MAX_COLLECTING_TIME_MS:()=>u,MAX_LAST_COLLECTING_TIME_MS:()=>I,MAX_SCORING_POLLING_TIME:()=>f,METADATA_PANIC_MODE:()=>Ee,METADATA_SDK_NOT_READY:()=>Ie,METHOD_DEACTIVATED_CONSENT_ERROR:()=>It,METHOD_DEACTIVATED_ERROR:()=>Et,NEW_VISITOR_NOT_READY:()=>Ht,NO_FLAG_METADATA:()=>ue,PM_API_ITEM:()=>ai,POLLING_EVENT_200:()=>ki,POLLING_EVENT_300:()=>Mi,POLLING_EVENT_FAILED:()=>bi,PREDEFINED_CONTEXT_LOADED:()=>Bi,PREDEFINED_CONTEXT_TYPE_ERROR:()=>qi,PROCESS_BUCKETING:()=>Hi,PROCESS_CACHE:()=>ye,PROCESS_CACHE_HIT:()=>Ft,PROCESS_CLEAR_CONTEXT:()=>Wi,PROCESS_FETCHING_FLAGS:()=>ee,PROCESS_FLUSH_HIT:()=>Vt,PROCESS_INITIALIZATION:()=>kt,PROCESS_LOOKUP_HIT:()=>wt,PROCESS_NEW_VISITOR:()=>bt,PROCESS_SDK_STATUS:()=>Pi,PROCESS_SEND_HIT:()=>Pt,PROCESS_SET_CONSENT:()=>zi,PROCESS_UPDATE_CONTEXT:()=>Mt,QA_ASSISTANT_LOCAL_URL:()=>H,QA_ASSISTANT_PROD_URL:()=>D,QA_ASSISTANT_STAGING_URL:()=>L,QA_MODE_API_ITEM:()=>zt,QT_API_ITEM:()=>Xt,REQUEST_TIME_OUT:()=>o,SAVE_VISITOR_INSTANCE:()=>Vi,SCORING_INTERVAL:()=>A,SCREEN_RESOLUTION_API_ITEM:()=>Ai,SCROLL_END_DELAY_MS:()=>T,SDK_APP:()=>Jt,SDK_INFO:()=>s,SDK_STARTED_INFO:()=>at,SDK_STATUS_CHANGED:()=>Fi,SEND_BATCH:()=>Nt,SEND_EAI_EVENT:()=>W,SEND_EAI_EVENT_ERROR:()=>X,SEND_EAI_EVENT_SUCCESS:()=>z,SEND_TROUBLESHOOTING:()=>Ot,SEND_USAGE_HIT:()=>yt,SESSION_NUMBER:()=>vi,SM_API_ITEM:()=>ni,S_API_ITEM:()=>ui,TAG_QA_ASSISTANT:()=>P,TAG_QA_ASSISTANT_LOCAL:()=>V,TAG_QA_ASSISTANT_STAGING:()=>F,TAG_QA_URL:()=>w,TA_API_ITEM:()=>ti,TCC_API_ITEM:()=>si,TC_API_ITEM:()=>ei,THIRD_PARTY_SEGMENT_URL:()=>N,TID_API_ITEM:()=>Zt,TRACKER_MANAGER_MISSING_ERROR:()=>lt,TRACKING_MANAGER:()=>Ue,TRACKING_MANAGER_ERROR:()=>xe,TROUBLESHOOTING_HIT_ADDED_IN_QUEUE:()=>ft,TROUBLESHOOTING_HIT_URL:()=>S,TROUBLESHOOTING_SENT_SUCCESS:()=>mt,TRUSTED_QA_ORIGINS:()=>Ze,TR_API_ITEM:()=>ri,TS_API_ITEM:()=>hi,TT_API_ITEM:()=>ii,TYPE_ERROR:()=>_t,T_API_ITEM:()=>Wt,UNAUTHENTICATE:()=>ve,URL_ACTIVATE_MODIFICATION:()=>y,URL_CAMPAIGNS:()=>O,USAGE_HIT_URL:()=>m,USER_EXPOSED_CAST_ERROR:()=>le,USER_EXPOSED_FLAG_ERROR:()=>ce,USER_IP_API_ITEM:()=>pi,USER_LANGUAGE:()=>Ci,VARIATION_GROUP_ID_API_ITEM_ACTIVATE:()=>qt,VARIATION_ID_API_ITEM:()=>$t,VISITOR_ALREADY_AUTHENTICATE:()=>pe,VISITOR_AUTHENTICATE:()=>Te,VISITOR_AUTHENTICATE_VISITOR_ID_ERROR:()=>Ae,VISITOR_CACHE_ERROR:()=>De,VISITOR_CACHE_FLUSHED:()=>Me,VISITOR_CACHE_LOADED:()=>He,VISITOR_CACHE_SAVED:()=>ke,VISITOR_CACHE_VERSION:()=>et,VISITOR_CREATED:()=>wi,VISITOR_EXPOSED_VALUE_NOT_CALLED:()=>ge,VISITOR_ID_API_ITEM:()=>Qt,VISITOR_ID_ERROR:()=>ut,VISITOR_ID_FROM_AB_TASTY_TAG:()=>Gi,VISITOR_ID_GENERATED:()=>xi,VISITOR_PROFILE_LOADED:()=>Ui,VISITOR_SYNC_FLAGS_MESSAGE:()=>Lt,VISITOR_UNAUTHENTICATE:()=>Ce});const s={name:"TypeScript",version:e(789).version},o=2,n=2,a=2.5,r=5,h=10,c=100,g=5,d=10,l=25e5,_=1,u=3e4,I=12e4,E=1900,f=12e4,T=200,p=500,A=5e3,C="https://decision.flagship.io/v2/",v="https://events.flagship.io",S="https://events.flagship.io/troubleshooting",m="https://events.flagship.io/analytics",R="https://cdn.flagship.io/{0}/bucketing.json",N="https://api-data-connector.flagship.io/accounts/{0}/segments/{1}",O="/campaigns",y="activate",D="https://qa-assistant.flagship.io/bundle.js",L="https://staging-qa-assistant.flagship.io/bundle.js",H="https://local-qa-assistant.flagship.io:5000/bundle.js",k="fs_qa_assistant",M="fs_qa_assistant_staging",b="fs_qa_assistant_local",P="abtasty_qa_assistant",F="abtasty_qa_assistant_staging",V="abtasty_qa_assistant_local",w="qa-assistant.abtasty.com",U="qa-assistant.flagship.io",G="exposeAllKeys",x="fs_consent",B="FS_IS_QA_MODE_ENABLED",K="FS_FORCED_VARIATIONS",Q="FS_QA_ASSISTANT_SCRIPT_TAG_ID",q="https://uc-info.flagship.io/v1/segments/clients/{0}/visitors/{1}",$="https://cdn.flagship.io/{0}/accountSettings.json",Y="https://events.flagship.io/emotionsai",W="sendEAIEvent",X="Failed to send Emotion AI event: {0}",z="Emotion AI event sent: {0}",j="fetchEAIScore",J="visitor {0}, Failed to fetch EAIScore: {1}",Z="visitor {0}, EAIScore fetched: {1}",tt="eai::eas",it="FS_CLIENT_VISITOR",et=1,st=1,ot=144e5,nt=100,at="Flagship SDK (version: {0}) {1} in **{2}** mode",rt="Flagship SDK",ht="ready",ct="https://docs.developers.flagship.io/docs/js-v3",gt=`Params 'envId' and 'apiKey' must not be null or empty.\n Learn more: ${ct}#initialization`,dt="Context must not to be null",lt="trackerManager must not be null.",_t="{0} must be a {1}",ut="visitorId must not be null or empty",It="Method {0} is deactivated for visitor {1} : visitor did not consent.",Et="Visitor {0}, method {1} is deactivated while SDK status is: {2}.",ft="The TROUBLESHOOTING HIT has been added to the pool queue : {0}",Tt="The USAGE HIT has been added to the pool queue : {0}",pt="The ACTIVATE has been added to the pool queue : {0}",At="The HIT has been added into the pool queue : {0}",Ct="ADD TROUBLESHOOTING HIT",vt="ADD USAGE HIT",St="ADD ACTIVATE",mt="Troubleshooting hit has been sent : {0}",Rt="Usage hit has been sent : {0}",Nt="SEND BATCH",Ot="SEND TROUBLESHOOTING",yt="SEND USAGE HIT",Dt="Visitor {0}, fetchFlags has been ignored and will continue to be ignored for the next {1}ms, this delay can be changed with `fetchFlagsBufferingTime` option in the SDK config",Lt="without calling `fetchFlags` method afterwards. So, the value of the flag `{1}` might be outdated",Ht=`You can't create a new visitor without first calling the "Flagship.start" method.\nLearn more: ${ct}#initialization\n`,kt="INITIALIZATION",Mt="UPDATE CONTEXT",bt="NEW VISITOR",Pt="ADD HIT",Ft="CACHE HIT",Vt="FLUSH HIT",wt="LOOKUP HIT",Ut="batch",Gt="cid",xt="cid",Bt="cuid",Kt="aid",Qt="vid",qt="caid",$t="vaid",Yt="ds",Wt="t",Xt="qt",zt="qa",jt="dl",Jt="APP",Zt="tid",ti="ta",ii="tt",ei="tc",si="tcc",oi="icn",ni="sm",ai="pm",ri="tr",hi="ts",ci="in",gi="ic",di="ip",li="iq",_i="iv",ui="s",Ii="ec",Ei="ea",fi="el",Ti="ev",pi="uip",Ai="sr",Ci="ul",vi="sn",Si="x-api-key",mi="Content-Type",Ri="x-sdk-client",Ni="x-sdk-version",Oi="application/json",yi="Flagship SDK version {0} is starting in {1} mode with config {2}",Di="Bucketing polling process has been started",Li="Bucketing polling process has been stopped",Hi="BUCKETING",ki="Polling event with code status 200 : {0}",Mi="Polling event with code status 304",bi="Polling event failed with error",Pi="SDK STATUS",Fi="SDK status has changed: {0}",Vi="Visitor {0} has been saved in SDK instance",wi="Visitor {0} has been created with context {1}, isAuthenticated:{2} and hasConsented {3}",Ui="Visitor profile has been loaded {0}",Gi="The visitor ID '{0}' has been retrieved from ABTasty tag",xi="Visitor identifier is empty. A UUID {0} has been generated.",Bi="Predefined Context have been loaded {0}",Ki=`Visitor {0}, the key '{1}' must be a non null String.\nLearn more: ${ct}#updating-the-visitor-context`,Qi=`Visitor {0}, 'value' for key '{1}[], must be one of the following types : String, Number, Boolean\nLearn more: ${ct}#updating-the-visitor-context`,qi=`visitor {0}, Predefined Context {0} must be of type {1}\nLearn more: ${ct}#predefined-user-context-keys-`,$i="visitor `{0}`, context have been updated: key {1}, value {2}, Context {3}",Yi="visitor `{0}`, context has been cleared cleared `{1}`",Wi="CLEAR_CONTEXT",Xi="Visitor `{0}` consent has been changed : {1}",zi="SET_CONSENT",ji="Visitor {0}, anonymousId {1} with context {2} has just fetched campaigns {3} in {4} ms",Ji="Visitor {0}, anonymousId {1} with context {2} has just fetched campaigns from cache {3} in {4} ms",Zi="Visitor {0}, anonymousId {1} with context {2} has just fetched flags {3} from Campaigns",te="visitor `{0}` fetchFlags process is started",ie="Panic mode is enabled : all feature are disabled except fetchFlags.",ee="FETCH_FLAGS",se='For the visitor "{0}", no flags were found with the key "{1}". Therefore, the default value "{2}" has been returned.',oe='For the visitor "{0}", no flags were found with the key "{1}". Therefore, an empty flag has been returned.',ne="FLAG_VALUE",ae="GET_FLAG",re='For the visitor "{0}", the flag with key "{1}" has a different type compared to the default value. Therefore, the default value "{2}" has been returned.',he="Visitor {0}, Flag for key {1} returns value {2}",ce='For the visitor "{0}", no flags were found with the key "{1}". As a result, user exposure will not be sent.',ge="For the visitor `{0}`,assuming the getValue() method has not previously been invoked for the flag `{0}`. Therefore, the exposure is canceled",de="FLAG_VISITOR_EXPOSED",le="For the visitor `{0}, the flag with the key `{0}` has a different type compared to the default value. Therefore, the exposure is interrupted",_e="FLAG_METADATA",ue="Visitor {0}, No Flags found for key {1}: Empty metadata object is returned",Ie=`Visitor {0}, Flag for key {1} Method Flag.metadata is deactivated while SDK status is NOT_READY: Empty metadata object is returned {2}\nLearn more: ${ct}#getting-flags-campaigns-metadata`,Ee="Visitor {0}, Flag for key {1} Method Flag.metadata is deactivated while SDK status is PANIC: Empty metadata object is returned {2}\nLearn more: https://docs.developers.flagship.io/docs/glossary#panic-mode",fe="AUTHENTICATE",Te="The visitor is authenticated with new visitor ID {0} anonymous ID {1}",pe="The visitor is already authenticated with visitor ID {0}",Ae=`Visitor {0}, visitorId must not be null or empty\nLearn more: ${ct}#authenticate`,Ce="The visitor is unauthenticated with visitor ID {0}",ve="UNAUTHENTICATE",Se="Visitor {0} is not authenticated yet",me="ALLOCATION",Re="Visitor {0}, Variation {1} selected from cache.",Ne="Visitor {0}, Variation {1} selected with allocation {2}.",Oe=`lookupVisitor method has loaded a bad format version ({0}) for visitor {1}.\nLearn more: ${ct}#managing-visitor-cache`,ye="CACHE",De="visitor {0}. {1} threw an exception {2}",Le="{0} threw an exception {1}",He="Visitor {0}, visitor cache has been loaded from database: {1}",ke="Visitor {0}, visitor cache has been saved into database : {0}",Me="Visitor {0}, visitor cache has been flushed from database.",be="Hits cache has been loaded from database: {0}",Pe="Hit cache has been saved into database : {0}",Fe="The following hit keys have been flushed from database : {0}",Ve="All hits cache has been flushed from database",we="The Batch Loop has been started with a time interval of {0} ms",Ue="TRACKING_MANAGER",Ge="The Batch Loop has been stopped",xe="{0} Unexpected Error occurred {1}",Be="{0} has been sent : {1}",Ke="ACTIVATE HIT",Qe="BATCH HIT",qe="HIT",$e="GET_THIRD_PARTY_SEGMENT",Ye="Consent has not been specified. By default, consent is set to false, which may result in some features being deactivated.",We="Action Tracking",Xe="Hit received: {0}",ze="Invalid hit data: {0}",je="Invalid nonce: {0}",Je="action tracking hits have been dispatched {0}",Ze=["https://local-qa-assistant.abtasty.com:5000","https://staging-qa-assistant.abtasty.com","https://qa-assistant.abtasty.com","https://qa-assistant.flagship.io","https://local-qa-assistant.flagship.io:5000","https://staging-qa-assistant.flagship.io"]},121:(t,i,e)=>{e.r(i),e.d(i,{VisitorEvent:()=>s});class s{_customerAccountId;_visitorId;_currentUrl;_clickPath;_clickPosition;_screenSize;_scrollPosition;get customerAccountId(){return this._customerAccountId}get visitorId(){return this._visitorId}get currentUrl(){return this._currentUrl}get clickPath(){return this._clickPath}get clickPosition(){return this._clickPosition}get screenSize(){return this._screenSize}get scrollPosition(){return this._scrollPosition}constructor({customerAccountId:t,visitorId:i,currentUrl:e,clickPath:s,clickPosition:o,screenSize:n,scrollPosition:a}){this._customerAccountId=t,this._visitorId=i,this._currentUrl=e,this._clickPath=s,this._clickPosition=o,this._screenSize=n,this._scrollPosition=a}toApiKeys(){const t={cid:this._customerAccountId,vid:this._visitorId,dl:this._currentUrl,sr:this._screenSize,t:"VISITOREVENT"};return this._clickPath&&(t.cp=this._clickPath),this._clickPosition&&(t.cpo=this._clickPosition),this._scrollPosition&&(t.sp=this._scrollPosition),t}}},221:(t,i,e)=>{e.r(i),e.d(i,{PageView:()=>s});class s{_customerAccountId;_visitorId;_hasAdBlocker;_screenDepth;_screenSize;_doNotTrack;_fonts;_hasFakeBrowserInfos;_hasFakeLanguageInfos;_hasFakeOsInfos;_hasFakeResolutionInfos;_userLanguage;_deviceCategory;_pixelRatio;_plugins;_documentReferer;_viewportSize;_touchSupport;_currentUrl;_userAgent;_customerUserId;_timezoneOffset;_eventCategory;get customerAccountId(){return this._customerAccountId}get visitorId(){return this._visitorId}get hasAdBlocker(){return this._hasAdBlocker}get screenDepth(){return this._screenDepth}get screenSize(){return this._screenSize}get doNotTrack(){return this._doNotTrack}get fonts(){return this._fonts}get hasFakeBrowserInfos(){return this._hasFakeBrowserInfos}get hasFakeLanguageInfos(){return this._hasFakeLanguageInfos}get hasFakeOsInfos(){return this._hasFakeOsInfos}get hasFakeResolutionInfos(){return this._hasFakeResolutionInfos}get userLanguage(){return this._userLanguage}get deviceCategory(){return this._deviceCategory}get pixelRatio(){return this._pixelRatio}get plugins(){return this._plugins}get documentReferer(){return this._documentReferer}get viewportSize(){return this._viewportSize}get touchSupport(){return this._touchSupport}get currentUrl(){return this._currentUrl}get userAgent(){return this._userAgent}get customerUserId(){return this._customerUserId}get timezoneOffset(){return this._timezoneOffset}get eventCategory(){return this._eventCategory}constructor({customerAccountId:t,visitorId:i,hasAdBlocker:e,screenDepth:s,screenSize:o,doNotTrack:n,fonts:a,hasFakeBrowserInfos:r,hasFakeLanguageInfos:h,hasFakeOsInfos:c,hasFakeResolutionInfos:g,userLanguage:d,deviceCategory:l,pixelRatio:_,plugins:u,documentReferer:I,viewportSize:E,touchSupport:f,currentUrl:T,userAgent:p,customerUserId:A,timezoneOffset:C,eventCategory:v}){this._customerAccountId=t,this._visitorId=i,this._hasAdBlocker=e,this._screenDepth=s,this._screenSize=o,this._doNotTrack=n,this._fonts=a,this._hasFakeBrowserInfos=r,this._hasFakeLanguageInfos=h,this._hasFakeOsInfos=c,this._hasFakeResolutionInfos=g,this._userLanguage=d,this._deviceCategory=l,this._pixelRatio=_,this._plugins=u,this._documentReferer=I,this._viewportSize=E,this._touchSupport=f,this._currentUrl=T,this._userAgent=p,this._customerUserId=A,this._timezoneOffset=C,this._eventCategory=v}toApiKeys(){const t={cid:this._customerAccountId,vid:this._visitorId,adb:this._hasAdBlocker,sd:this._screenDepth,sr:this._screenSize,dnt:this._doNotTrack,fnt:this._fonts,hlb:this._hasFakeBrowserInfos,hll:this._hasFakeLanguageInfos,hlo:this._hasFakeOsInfos,hlr:this._hasFakeResolutionInfos,ul:this._userLanguage,dc:this._deviceCategory,pxr:this._pixelRatio,dr:this._documentReferer,vp:this._viewportSize,tof:this._timezoneOffset,tsp:this._touchSupport,dl:this._currentUrl,ua:this._userAgent,ec:this._eventCategory,t:"PAGEVIEW"};return this._plugins&&(t.plu=this._plugins),this._customerUserId&&(t.cuid=this._customerUserId),t}}},495:(t,i,e)=>{var s;e.d(i,{LogLevel:()=>s}),function(t){t[t.NONE=0]="NONE",t[t.EMERGENCY=1]="EMERGENCY",t[t.ALERT=2]="ALERT",t[t.CRITICAL=3]="CRITICAL",t[t.ERROR=4]="ERROR",t[t.WARNING=5]="WARNING",t[t.NOTICE=6]="NOTICE",t[t.INFO=7]="INFO",t[t.DEBUG=8]="DEBUG",t[t.ALL=9]="ALL"}(s||(s={}))},686:(t,i,e)=>{e.d(i,{deepEqual:()=>v,errorFormat:()=>T,formatLogOutput:()=>m,hasSameType:()=>E,hexToValue:()=>C,isBrowser:()=>I,logDebug:()=>u,logDebugSprintf:()=>_,logError:()=>h,logErrorSprintf:()=>r,logInfo:()=>l,logInfoSprintf:()=>d,logWarning:()=>g,logWarningSprintf:()=>c,onDomReady:()=>S,sprintf:()=>a,uuidV4:()=>f,valueToHex:()=>A,visitorFlagSyncStatusMessage:()=>p});var s=e(5),o=e(495),n=e(87);function a(t,...i){let e=t;for(let t=0;t<i.length;t++){const s=i[t],o="string"==typeof s?s:JSON.stringify(s instanceof Map?Array.from(s.values()):s);e=e.replace(new RegExp(`\\{${t}\\}`,"g"),o)}return e}function r(t,i,e,...s){!t||!t.logLevel||t.logLevel<o.LogLevel.ERROR||h(t,a(e,...s),i)}function h(t,i,e){!t||!t.logLevel||t.logLevel<o.LogLevel.ERROR||("function"==typeof t.onLog&&t.onLog(o.LogLevel.ERROR,e,i),t.logManager&&"function"==typeof t.logManager.error&&t.logManager.error(i,e))}function c(t,i,e,...s){!t||!t.logLevel||t.logLevel<o.LogLevel.WARNING||g(t,a(e,...s),i)}function g(t,i,e){!t||!t.logLevel||t.logLevel<o.LogLevel.WARNING||("function"==typeof t.onLog&&t.onLog(o.LogLevel.WARNING,e,i),t.logManager&&"function"==typeof t.logManager.warning&&t.logManager.warning(i,e))}function d(t,i,e,...s){!t||!t.logLevel||t.logLevel<o.LogLevel.INFO||l(t,a(e,...s),i)}function l(t,i,e){!t||!t.logLevel||t.logLevel<o.LogLevel.INFO||("function"==typeof t.onLog&&t.onLog(o.LogLevel.INFO,e,i),t.logManager&&"function"==typeof t.logManager.info&&t.logManager.info(i,e))}function _(t,i,e,...s){!t||!t.logLevel||t.logLevel<o.LogLevel.DEBUG||u(t,a(e,...s),i)}function u(t,i,e){!t||!t.logLevel||t.logLevel<o.LogLevel.DEBUG||("function"==typeof t.onLog&&t.onLog(o.LogLevel.DEBUG,e,i),t.logManager&&"function"==typeof t.logManager.debug&&t.logManager.debug(i,e))}function I(){return"undefined"!=typeof window&&void 0!==window.document}function E(t,i){return typeof t==typeof i&&("object"!=typeof t||"object"!=typeof i||Array.isArray(t)===Array.isArray(i))}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const i=16*Math.random()|0;return("x"===t?i:3&i|8).toString(16)}))}function T(t,i){return JSON.stringify({message:t,data:i})}function p(t){let i="";switch(t){case s.FSFetchReasons.FLAGS_NEVER_FETCHED:i=`Visitor \`{0}\` has been created ${n.VISITOR_SYNC_FLAGS_MESSAGE}`;break;case s.FSFetchReasons.UPDATE_CONTEXT:i=`Visitor context for visitor \`{0}\` has been updated ${n.VISITOR_SYNC_FLAGS_MESSAGE}`;break;case s.FSFetchReasons.AUTHENTICATE:i=`Visitor \`{0}\` has been authenticated ${n.VISITOR_SYNC_FLAGS_MESSAGE}`;break;case s.FSFetchReasons.UNAUTHENTICATE:i=`Visitor \`{0}\` has been unauthenticated ${n.VISITOR_SYNC_FLAGS_MESSAGE}`;break;case s.FSFetchReasons.FLAGS_FETCHING_ERROR:i='There was an error while fetching flags for visitor `{0}`. So the value of the flag `{1}` may be outdated"';break;case s.FSFetchReasons.FLAGS_FETCHED_FROM_CACHE:i="Flags for visitor `{0}` have been fetched from cache"}return i}function A(t){const i=JSON.stringify(t);return Array.from(i,(t=>t.charCodeAt(0).toString(16))).join("")}function C(t,i){if("string"!=typeof t)return r(i,"hexToValue","Invalid hex string: {0}",t),null;let e="";for(let s=0;s<t.length;s+=2){const o=t.slice(s,s+2),n=parseInt(o,16);if(isNaN(n))return r(i,"hexToValue","Invalid hex character: {0}",o),null;e+=String.fromCharCode(n)}try{return JSON.parse(e)}catch(t){return r(i,"hexToValue","Error while parsing JSON: {0}",t),null}}function v(t,i){if(t===i)return!0;if("object"!=typeof t||"object"!=typeof i||null==t||null==i)return!1;const e=Object.keys(t),s=Object.keys(i);if(e.length!==s.length)return!1;for(const o of e)if(!s.includes(o)||!v(t[o],i[o]))return!1;return!0}function S(t){{if(!I())return!1;const i="interactive"===document.readyState||"complete"===document.readyState;if("function"!=typeof t)return i;if(i)t();else{const i=()=>{document.removeEventListener("DOMContentLoaded",i),t()};document.addEventListener("DOMContentLoaded",i)}return i}}function m(t,i,e){const s=new Date,a=t=>t.toString().padStart(2,"0"),r={[o.LogLevel.EMERGENCY]:"",[o.LogLevel.ALERT]:"",[o.LogLevel.CRITICAL]:"",[o.LogLevel.ERROR]:"",[o.LogLevel.WARNING]:"",[o.LogLevel.NOTICE]:"",[o.LogLevel.INFO]:"",[o.LogLevel.DEBUG]:"",[o.LogLevel.NONE]:"",[o.LogLevel.ALL]:""}[t]||"",h=`${s.getFullYear()}-${a(s.getMonth()+1)}-${a(s.getDate())} ${a(s.getHours())}:${a(s.getMinutes())}:${a(s.getSeconds())}.${s.getMilliseconds().toString().padStart(3,"0")}`,c=o.LogLevel[t].padEnd(2);return`${r}[${h}] [${n.FLAGSHIP_SDK}] [${c}] [${e}] ${i}`}},789:(t,i,e)=>{e.d(i,{version:()=>s});const s="5.1.2"}},s={};function o(t){var i=s[t];if(void 0!==i)return i.exports;var n=s[t]={exports:{}};return e[t](n,n.exports,o),n.exports}o.m=e,o.d=(t,i)=>{for(var e in i)o.o(i,e)&&!o.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((i,e)=>(o.f[e](t,i),i)),[])),o.u=t=>"chunks/browser/lite/"+t+"."+{49:"99408e6da456208c991a",587:"47ee61cea7984eb06da2"}[t]+".js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),t={},i="@flagship.io/js-sdk:",o.l=(e,s,n,a)=>{if(t[e])t[e].push(s);else{var r,h;if(void 0!==n)for(var c=document.getElementsByTagName("script"),g=0;g<c.length;g++){var d=c[g];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==i+n){r=d;break}}r||(h=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",i+n),r.src=e),t[e]=[s];var l=(i,s)=>{r.onerror=r.onload=null,clearTimeout(_);var o=t[e];if(delete t[e],r.parentNode&&r.parentNode.removeChild(r),o&&o.forEach((t=>t(s))),i)return i(s)},_=setTimeout(l.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=l.bind(null,r.onerror),r.onload=l.bind(null,r.onload),h&&document.head.appendChild(r)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var i=o.g.document;if(!t&&i&&(i.currentScript&&"SCRIPT"===i.currentScript.tagName.toUpperCase()&&(t=i.currentScript.src),!t)){var e=i.getElementsByTagName("script");if(e.length)for(var s=e.length-1;s>-1&&(!t||!/^http(s?):/.test(t));)t=e[s--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{var t={792:0};o.f.j=(i,e)=>{var s=o.o(t,i)?t[i]:void 0;if(0!==s)if(s)e.push(s[2]);else{var n=new Promise(((e,o)=>s=t[i]=[e,o]));e.push(s[2]=n);var a=o.p+o.u(i),r=new Error;o.l(a,(e=>{if(o.o(t,i)&&(0!==(s=t[i])&&(t[i]=void 0),s)){var n=e&&("load"===e.type?"missing":e.type),a=e&&e.target&&e.target.src;r.message="Loading chunk "+i+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,s[1](r)}}),"chunk-"+i,i)}};var i=(i,e)=>{var s,n,[a,r,h]=e,c=0;if(a.some((i=>0!==t[i]))){for(s in r)o.o(r,s)&&(o.m[s]=r[s]);h&&h(o)}for(i&&i(e);c<a.length;c++)n=a[c],o.o(t,n)&&t[n]&&t[n][0](),t[n]=0},e=self.webpackChunk_flagship_io_js_sdk=self.webpackChunk_flagship_io_js_sdk||[];e.forEach(i.bind(null,0)),e.push=i.bind(null,e.push.bind(e))})();var n={};o.r(n),o.d(n,{ABTastyWebSDKPostMessageType:()=>f,APP_VERSION_CODE:()=>It,APP_VERSION_NAME:()=>ut,CARRIER_NAME:()=>lt,CacheStrategy:()=>d,DEVICE_LOCALE:()=>tt,DEVICE_MODEL:()=>et,DEVICE_TYPE:()=>it,DecisionApiConfig:()=>m,DecisionMode:()=>r,EventCategory:()=>A,FLAGSHIP_CLIENT:()=>ft,FLAGSHIP_CONTEXT:()=>At,FLAGSHIP_VERSION:()=>Tt,FLAGSHIP_VISITOR:()=>pt,FSFetchReasons:()=>mt.FSFetchReasons,FSFetchStatus:()=>vt,FSFlag:()=>kt,FSFlagCollection:()=>Mt,FSFlagMetadata:()=>Ct,FSFlagStatus:()=>St,FSSdkStatus:()=>a,Flagship:()=>ti,HitType:()=>p,INTERFACE_NAME:()=>Et,INTERNET_CONNECTION:()=>_t,IP:()=>ht,LOCATION_CITY:()=>st,LOCATION_COUNTRY:()=>nt,LOCATION_LAT:()=>at,LOCATION_LONG:()=>rt,LOCATION_REGION:()=>ot,LogLevel:()=>l.LogLevel,OS_NAME:()=>ct,OS_VERSION_CODE:()=>dt,OS_VERSION_NAME:()=>gt,TroubleshootingLabel:()=>I,Visitor:()=>g,VisitorCacheStatus:()=>E,default:()=>ii});var a,r,h=o(7),c=o(87);class g extends h.EventEmitter{visitorDelegate;_onReady;constructor(t){super(),this.visitorDelegate=t,this._onReady=t=>{this.emit(c.EMIT_READY,t)},this.visitorDelegate.on(c.EMIT_READY,this._onReady);const i=this;i.sendEaiVisitorEvent=t=>{this.visitorDelegate.sendEaiVisitorEvent(t)},i.sendEaiPageView=t=>{this.visitorDelegate.sendEaiPageView(t)},i.onEAICollectStatusChange=t=>{this.visitorDelegate.onEAICollectStatusChange(t)}}get visitorId(){return this.visitorDelegate.visitorId}set visitorId(t){this.visitorDelegate.visitorId=t}get anonymousId(){return this.visitorDelegate.anonymousId}get config(){return this.visitorDelegate.config}get context(){return this.visitorDelegate.context}get flagsStatus(){return this.visitorDelegate.flagsStatus}get hasConsented(){return this.visitorDelegate.hasConsented}setConsent(t){this.visitorDelegate.setConsent(t)}updateContext(t,i){this.visitorDelegate.updateContext(t,i)}clearContext(){this.visitorDelegate.clearContext()}getFlag(t){return this.visitorDelegate.getFlag(t)}getFlags(){return this.visitorDelegate.getFlags()}fetchFlags(){return this.visitorDelegate.fetchFlags()}sendHit(t){return this.visitorDelegate.sendHit(t)}sendHits(t){return this.visitorDelegate.sendHits(t)}authenticate(t){this.visitorDelegate.authenticate(t)}unauthenticate(){this.visitorDelegate.unauthenticate()}collectEAIEventsAsync(...t){let i;return t.length>0&&(i=t[0]),this.visitorDelegate.collectEAIEventsAsync(i)}cleanup(){this.visitorDelegate.cleanup(),this.visitorDelegate.off(c.EMIT_READY,this._onReady)}}!function(t){t[t.SDK_NOT_INITIALIZED=0]="SDK_NOT_INITIALIZED",t[t.SDK_INITIALIZING=1]="SDK_INITIALIZING",t[t.SDK_PANIC=2]="SDK_PANIC",t[t.SDK_INITIALIZED=3]="SDK_INITIALIZED"}(a||(a={})),function(t){t.DECISION_API="DECISION-API",t.BUCKETING="BUCKETING",t.BUCKETING_EDGE="BUCKETING_EDGE"}(r||(r={}));var d,l=o(495),_=o(686);!function(t){t[t.CONTINUOUS_CACHING=0]="CONTINUOUS_CACHING",t[t.PERIODIC_CACHING=1]="PERIODIC_CACHING"}(d||(d={}));class u{_batchIntervals;_poolMaxSize;_batchStrategy;constructor(t){this.batchIntervals=t?.batchIntervals,this.poolMaxSize=t?.poolMaxSize,this._batchStrategy=this.getCacheStrategy(t?.cacheStrategy)}getCacheStrategy(t){return"number"==typeof t?t:(0,_.isBrowser)()?d.CONTINUOUS_CACHING:d.PERIODIC_CACHING}get batchIntervals(){return this._batchIntervals}set batchIntervals(t){("number"!=typeof t||t<1||t>10800)&&(t=(0,_.isBrowser)()?c.DEFAULT_BROWSER_TIME_INTERVAL:c.DEFAULT_SERVER_TIME_INTERVAL),this._batchIntervals=t}get poolMaxSize(){return this._poolMaxSize}set poolMaxSize(t){("number"!=typeof t||t<5)&&(t=(0,_.isBrowser)()?c.DEFAULT_BROWSER_POOL_MAX_SIZE:c.DEFAULT_SERVER_POOL_MAX_SIZE),this._poolMaxSize=t}get cacheStrategy(){return this._batchStrategy}}var I,E,f,T,p,A,C=o(789);class v{_envId;_apiKey;_decisionMode;_timeout;_logLevel;_onSdkStatusChanged;_logManager;_fetchNow;_pollingInterval;_onBucketingUpdated;_reuseVisitorIds;_initialBucketing;_decisionApiUrl;_hitDeduplicationTime;_visitorCacheImplementation;_hitCacheImplementation;_disableCache;_trackingManagerConfig;_onVisitorExposed;_fetchThirdPartyData;_nextFetchConfig;_fetchFlagsBufferingTime;_disableDeveloperUsageTracking;_onLog;_isQAModeEnabled;get isQAModeEnabled(){return this._isQAModeEnabled}set isQAModeEnabled(t){this._isQAModeEnabled=t}_enableAnalytics;get disableDeveloperUsageTracking(){return this._disableDeveloperUsageTracking}set disableDeveloperUsageTracking(t){this._disableDeveloperUsageTracking=t}get fetchFlagsBufferingTime(){return this._fetchFlagsBufferingTime}set fetchFlagsBufferingTime(t){this._fetchFlagsBufferingTime=t}get nextFetchConfig(){return this._nextFetchConfig}set nextFetchConfig(t){this._nextFetchConfig=t}get fetchThirdPartyData(){return this._fetchThirdPartyData}set fetchThirdPartyData(t){this._fetchThirdPartyData=t}get trackingManagerConfig(){return this._trackingManagerConfig}get onLog(){return this._onLog}set onLog(t){this._onLog=t}get onVisitorExposed(){return this._onVisitorExposed}constructor(t){const{envId:i,apiKey:e,timeout:s,logLevel:o,logManager:n,onSdkStatusChanged:a,fetchNow:h,decisionMode:g,reuseVisitorIds:d,initialBucketing:_,decisionApiUrl:I,hitDeduplicationTime:E,visitorCacheImplementation:f,hitCacheImplementation:T,disableCache:p,language:A,sdkVersion:C,trackingManagerConfig:v,onLog:S,onVisitorExposed:m,nextFetchConfig:R,fetchFlagsBufferingTime:N,disableDeveloperUsageTracking:O}=t;this.initQaMode(),this.initSDKInfo(A,C),n&&(this.logManager=n),this.fetchFlagsBufferingTime=N??c.FETCH_FLAG_BUFFERING_DEFAULT_TIME,this.nextFetchConfig=R||{revalidate:20},this._trackingManagerConfig=new u(v||{}),this.onLog=S,this.decisionApiUrl=I||c.BASE_API_URL,this._envId=i,this._apiKey=e,this.logLevel=o??l.LogLevel.INFO,this.timeout=s||c.REQUEST_TIME_OUT,this.fetchNow=void 0===h||h,this.reuseVisitorIds=void 0===d||d,this._decisionMode=g||r.DECISION_API,this._initialBucketing=_,this.hitDeduplicationTime=E??c.DEFAULT_DEDUPLICATION_TIME,this.disableCache=!!p,this.disableDeveloperUsageTracking=O||!1,f&&(this.visitorCacheImplementation=f),T&&(this.hitCacheImplementation=T),this.onSdkStatusChanged=a,this._onVisitorExposed=m}initQaMode(){if((0,_.isBrowser)())try{const t=sessionStorage.getItem(c.FS_IS_QA_MODE_ENABLED);this.isQAModeEnabled=t?JSON.parse(t):void 0}catch(t){(0,_.logError)(this,(0,_.errorFormat)(t.message||t),"initQaMode"),this.isQAModeEnabled=!1}}initSDKInfo(t,i){switch(t){case 1:c.SDK_INFO.name="ReactJS",c.SDK_INFO.version=i??C.version;break;case 2:c.SDK_INFO.name="React-Native",c.SDK_INFO.version=i??C.version;break;default:c.SDK_INFO.name="undefined"!=typeof window&&"Deno"in window?"Deno":"TypeScript",c.SDK_INFO.version=C.version}}get initialBucketing(){return this._initialBucketing}set initialBucketing(t){this._initialBucketing=t}get reuseVisitorIds(){return this._reuseVisitorIds}set reuseVisitorIds(t){this._reuseVisitorIds=t}get onBucketingUpdated(){return this._onBucketingUpdated}set onBucketingUpdated(t){this._onBucketingUpdated=t}set envId(t){this._envId=t}get envId(){return this._envId}set apiKey(t){this._apiKey=t}get apiKey(){return this._apiKey}get decisionMode(){return this._decisionMode}get timeout(){return this._timeout}set timeout(t){this._timeout=t}get logLevel(){return this._logLevel}set logLevel(t){this._logLevel=t}get fetchNow(){return this._fetchNow}set fetchNow(t){this._fetchNow=t}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){this._pollingInterval=t}get hitDeduplicationTime(){return this._hitDeduplicationTime}set hitDeduplicationTime(t){"number"==typeof t?this._hitDeduplicationTime=t:(0,_.logError)(this,(0,_.sprintf)(c.TYPE_ERROR,"hitDeduplicationTime","number"),"hitDeduplicationTime")}get visitorCacheImplementation(){return this._visitorCacheImplementation}set visitorCacheImplementation(t){this._visitorCacheImplementation=t}get hitCacheImplementation(){return this._hitCacheImplementation}set hitCacheImplementation(t){this._hitCacheImplementation=t}get disableCache(){return this._disableCache}set disableCache(t){this._disableCache=t}get onSdkStatusChanged(){return this._onSdkStatusChanged}set onSdkStatusChanged(t){t&&"function"!=typeof t?(0,_.logError)(this,"statusChangedCallback must be a function","onSdkStatusChanged"):this._onSdkStatusChanged=t}get logManager(){return this._logManager}set logManager(t){this._logManager=t}get decisionApiUrl(){return this._decisionApiUrl}set decisionApiUrl(t){"string"==typeof t?this._decisionApiUrl=t:(0,_.logError)(this,(0,_.sprintf)(c.TYPE_ERROR,"decisionApiUrl","string"),"decisionApiUrl")}}class S extends v{constructor(t){super({...t,decisionMode:r.BUCKETING}),this.pollingInterval=t?.pollingInterval??c.DEFAULT_POLLING_INTERVAL,this.onBucketingUpdated=t?.onBucketingUpdated,this.fetchThirdPartyData=t?.fetchThirdPartyData}}class m extends v{constructor(t){super({...t,decisionMode:r.DECISION_API})}}class R{_config;_decisionManager;_trackingManager;_sharedActionTracking;constructor(t,i,e,s){this._config=t,this._decisionManager=i,this._trackingManager=e,this._sharedActionTracking=s}get config(){return this._config}set config(t){this._config=t}get decisionManager(){return this._decisionManager}set decisionManager(t){this._decisionManager=t}get trackingManager(){return this._trackingManager}set trackingManager(t){this._trackingManager=t}get sharedActionTracking(){return this._sharedActionTracking}}!function(t){t.VISITOR_SEND_HIT="VISITOR_SEND_HIT",t.VISITOR_FETCH_CAMPAIGNS_ERROR="VISITOR_FETCH_CAMPAIGNS_ERROR",t.VISITOR_FETCH_CAMPAIGNS="VISITOR_FETCH_CAMPAIGNS",t.VISITOR_AUTHENTICATE="VISITOR_AUTHENTICATE",t.VISITOR_UNAUTHENTICATE="VISITOR_UNAUTHENTICATE",t.VISITOR_EXPOSED_FLAG_NOT_FOUND="VISITOR_EXPOSED_FLAG_NOT_FOUND",t.FLAG_VALUE_NOT_CALLED="FLAG_VALUE_NOT_CALLED",t.GET_FLAG_VALUE_FLAG_NOT_FOUND="GET_FLAG_VALUE_FLAG_NOT_FOUND",t.GET_FLAG_METADATA_TYPE_WARNING="GET_FLAG_METADATA_TYPE_WARNING",t.GET_FLAG_VALUE_TYPE_WARNING="GET_FLAG_VALUE_TYPE_WARNING",t.VISITOR_EXPOSED_TYPE_WARNING="VISITOR_EXPOSED_TYPE_WARNING",t.VISITOR_SEND_ACTIVATE="VISITOR_SEND_ACTIVATE",t.GET_CAMPAIGNS_ROUTE_RESPONSE_ERROR="GET_CAMPAIGNS_ROUTE_RESPONSE_ERROR",t.GET_CAMPAIGNS_ROUTE_RESPONSE="GET_CAMPAIGNS_ROUTE_RESPONSE",t.SDK_BUCKETING_FILE="SDK_BUCKETING_FILE",t.SEND_ACTIVATE_HIT_ROUTE_ERROR="SEND_ACTIVATE_HIT_ROUTE_ERROR",t.SEND_BATCH_HIT_ROUTE_RESPONSE_ERROR="SEND_BATCH_HIT_ROUTE_RESPONSE_ERROR",t.SEND_HIT_ROUTE_ERROR="SEND_HIT_ROUTE_ERROR",t.SDK_BUCKETING_FILE_ERROR="SDK_BUCKETING_FILE_ERROR",t.SDK_CONFIG="SDK_CONFIG",t.ACCOUNT_SETTINGS="ACCOUNT_SETTINGS",t.ACCOUNT_SETTINGS_ERROR="ACCOUNT_SETTINGS_ERROR",t.EMOTION_AI_SCORE="EMOTION_EAI_SCORE",t.EMOTION_AI_SCORE_FROM_LOCAL_CACHE="EMOTION_AI_SCORE_FROM_LOCAL_CACHE",t.EMOTION_AI_SCORE_ERROR="EMOTION_EAI_SCORE_ERROR",t.EMOTION_AI_VISITOR_EVENT="EMOTION_AI_VISITOR_EVENT",t.EMOTION_AI_VISITOR_EVENT_ERROR="EMOTION_AI_VISITOR_EVENT_ERROR",t.EMOTION_AI_PAGE_VIEW="EMOTION_AI_PAGE_VIEW",t.EMOTION_AI_PAGE_VIEW_ERROR="EMOTION_AI_PAGE_VIEW_ERROR",t.EMOTION_AI_START_COLLECTING="EMOTION_AI_START_COLLECTING",t.EMOTION_AI_STOP_COLLECTING="EMOTION_AI_STOP_COLLECTING",t.EMOTION_AI_START_SCORING="EMOTION_AI_START_SCORING",t.EMOTION_AI_SCORING_FAILED="EMOTION_AI_SCORING_FAILED",t.EMOTION_AI_SCORING_SUCCESS="EMOTION_AI_SCORING_SUCCESS"}(I||(I={})),function(t){t.NONE="NONE",t.ANONYMOUS_ID_CACHE="ANONYMOUS_ID_CACHE",t.VISITOR_ID_CACHE="VISITOR_ID_CACHE",t.VISITOR_ID_CACHE_WITH_ANONYMOUS_ID_CACHE="VISITOR_ID_CACHE_WITH_ANONYMOUS_ID_CACHE"}(E||(E={})),function(t){t.AB_TASTY_WEB_SDK_INITIALIZED="AB_TASTY_WEB_SDK_INITIALIZED"}(f||(f={}));class N{_visitorId;_config;_type;_ds;_anonymousId;_userIp;_screenResolution;_locale;_sessionNumber;_key;_createdAt;_qaMode;_isActionTrackingHit;get isActionTrackingHit(){return this._isActionTrackingHit}set isActionTrackingHit(t){this._isActionTrackingHit=t}get key(){return this._key}set key(t){this._key=t}get sessionNumber(){return this._sessionNumber}set sessionNumber(t){this._sessionNumber=t}get locale(){return this._locale}set locale(t){this._locale=t}get screenResolution(){return this._screenResolution}set screenResolution(t){this._screenResolution=t}get userIp(){return this._userIp}set userIp(t){this._userIp=t}get anonymousId(){return this._anonymousId}set anonymousId(t){this._anonymousId=t}get visitorId(){return this._visitorId}set visitorId(t){this._visitorId=t}get ds(){return this._ds}set ds(t){this._ds=t}get type(){return this._type}get config(){return this._config}set config(t){this._config=t}get createdAt(){return this._createdAt}set createdAt(t){this._createdAt=t}get qaMode(){return this._qaMode}set qaMode(t){this._qaMode=t}constructor(t){const{type:i,userIp:e,screenResolution:s,locale:o,sessionNumber:n,visitorId:a,anonymousId:r,ds:h,qaMode:g,isActionTrackingHit:d}=t;this._type=i,e&&(this.userIp=e),s&&(this.screenResolution=s),o&&(this.locale=o),n&&(this.sessionNumber=n),this.visitorId=a,this._anonymousId=r||null,this.createdAt=Date.now(),this.ds=h||c.SDK_APP,this.qaMode=g,this.isActionTrackingHit=d}isNotEmptyString(t,i){return!(!t||"string"!=typeof t)||((0,_.logError)(this.config,(0,_.sprintf)(c.TYPE_ERROR,i,"string"),i),!1)}isNumeric(t,i){return!(!t||"number"!=typeof t)||((0,_.logError)(this.config,(0,_.sprintf)(c.TYPE_ERROR,i,"number"),i),!1)}isInteger(t,i){return!!Number.isInteger(t)||((0,_.logError)(this.config,(0,_.sprintf)(c.TYPE_ERROR,i,"integer"),i),!1)}toApiKeys(){const t={[c.VISITOR_ID_API_ITEM]:this.visitorId,[c.DS_API_ITEM]:this.ds,[c.CUSTOMER_ENV_ID_API_ITEM]:`${this.config?.envId}`,[c.T_API_ITEM]:this.type,[c.CUSTOMER_UID]:null,[c.QT_API_ITEM]:Date.now()-this._createdAt};return this.qaMode&&(t[c.QA_MODE_API_ITEM]=!0),this.userIp&&(t[c.USER_IP_API_ITEM]=this.userIp),this.screenResolution&&(t[c.SCREEN_RESOLUTION_API_ITEM]=this.screenResolution),this.locale&&(t[c.USER_LANGUAGE]=this.locale),this.sessionNumber&&(t[c.SESSION_NUMBER]=this.sessionNumber),this.visitorId&&this.anonymousId&&(t[c.VISITOR_ID_API_ITEM]=this.anonymousId,t[c.CUSTOMER_UID]=this.visitorId),t}toObject(){return{key:this.key,visitorId:this.visitorId,ds:this.ds,type:this.type,userIp:this.userIp,screenResolution:this.screenResolution,locale:this.locale,sessionNumber:this.sessionNumber,anonymousId:this.anonymousId,createdAt:this.createdAt,qaMode:this.qaMode}}isReady(t=!0){return!!(this.visitorId&&this.ds&&this.config&&this.config.envId&&this.type)}}!function(t){t[t.Timer=0]="Timer",t[t.BatchLength=1]="BatchLength",t[t.Flush=2]="Flush",t[t.ActivateLength=3]="ActivateLength",t[t.DirectHit=4]="DirectHit",t[t.DirectActivate=5]="DirectActivate"}(T||(T={}));class O extends N{data;_traffic;get traffic(){return this._traffic}set traffic(t){this._traffic=t}constructor(t){super({type:t.type,userIp:t.userIp,screenResolution:t.screenResolution,locale:t.locale,sessionNumber:t.sessionNumber,visitorId:t.visitorId,anonymousId:t.anonymousId}),this.data={...t,version:t.version||"1",stackType:t.stackType||"SDK",stackName:t.stackName||c.SDK_INFO.name,stackVersion:t.stackVersion||c.SDK_INFO.version,label:t.label,logLevel:t.logLevel,timestamp:t.timestamp||new Date(Date.now()).toISOString(),timeZone:this.getTimezone(),ds:c.SDK_APP,envId:t.envId||t.config.envId},this._traffic=t.traffic,this.config=t.config}getTimezone(){return("object"==typeof Intl?Intl.DateTimeFormat()?.resolvedOptions()?.timeZone:void 0)||""+(new Date).getTimezoneOffset()/60}toApiKeys(){const t={[c.VISITOR_ID_API_ITEM]:this.visitorId,[c.DS_API_ITEM]:this.data.ds,[c.CUSTOMER_ENV_ID_API_ITEM]:`${this.data.config?.envId}`,[c.T_API_ITEM]:this.type,cv:{}},i={version:`${this.data.version}`,logLevel:`${l.LogLevel[this.data.logLevel]}`,timestamp:`${this.data.timestamp}`,timeZone:`${this.data.timeZone}`,label:`${this.data.label}`,"stack.type":`${this.data.stackType}`,"stack.name":`${this.data.stackName}`,"stack.version":`${this.data.stackVersion}`};if(void 0!==this.data.lastBucketingTimestamp&&(i.lastBucketingTimestamp=`${this.data.lastBucketingTimestamp}`),void 0!==this.data.lastInitializationTimestamp&&(i.lastInitializationTimestamp=`${this.data.lastInitializationTimestamp}`),void 0!==this.data.flagshipInstanceId&&(i.flagshipInstanceId=`${this.data.flagshipInstanceId}`),this.data.accountId&&(i.accountId=`${this.data.accountId}`),this.data.envId&&(i.envId=`${this.data.envId}`),void 0!==this.data.sdkBucketingFile&&(i.sdkBucketingFile=JSON.stringify(this.data.sdkBucketingFile)),void 0!==this.data.stackOriginName&&(i["stack.origin.name"]=`${this.data.stackOriginName}`),void 0!==this.data.stackOriginVersion&&(i["stack.origin.version"]=`${this.data.stackOriginVersion}`),void 0!==this.data.sdkStatus&&(i["sdk.status"]=`${a[this.data.sdkStatus]}`),void 0!==this.data.sdkConfigLogLevel&&(i["sdk.config.logLevel"]=`${l.LogLevel[this.data.sdkConfigLogLevel]}`),void 0!==this.data.sdkConfigMode&&(i["sdk.config.mode"]=`${this.data.sdkConfigMode}`),void 0!==this.data.sdkConfigCustomLogManager&&(i["sdk.config.customLogManager"]=`${this.data.sdkConfigCustomLogManager}`),void 0!==this.data.sdkConfigCustomCacheManager&&(i["sdk.config.customCacheManager"]=`${this.data.sdkConfigCustomCacheManager}`),void 0!==this.data.sdkConfigStatusListener&&(i["sdk.config.custom.StatusListener"]=`${this.data.sdkConfigStatusListener}`),void 0!==this.data.sdkConfigTimeout&&(i["sdk.config.timeout"]=""+1e3*this.data.sdkConfigTimeout),void 0!==this.data.sdkConfigPollingInterval&&(i["sdk.config.pollingTime"]=""+1e3*this.data.sdkConfigPollingInterval),void 0!==this.data.sdkConfigTrackingManagerStrategy&&(i["sdk.config.trackingManager.strategy"]=`${d[this.data.sdkConfigTrackingManagerStrategy]}`),void 0!==this.data.sdkConfigTrackingManagerBatchIntervals&&(i["sdk.config.trackingManager.batchIntervals"]=""+1e3*this.data.sdkConfigTrackingManagerBatchIntervals),void 0!==this.data.sdkConfigTrackingManagerPoolMaxSize&&(i["sdk.config.trackingManager.poolMaxSize"]=`${this.data.sdkConfigTrack