UNPKG

followanalytics

Version:
1 lines 114 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("fa-sdk-web",[],e):"object"==typeof exports?exports["fa-sdk-web"]=e():t["fa-sdk-web"]=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=23)}([function(t,e,n){"use strict";e.__esModule=!0,e.SDK_VERSION="2.1.10-snapshot",e.SDK_PLATFORM="Web",e.ENV=Object({SDK_CHANNEL:"snapshot",SDK_VERSION:"2.1.10",ENV_SUFFIX:void 0,ENV_PROTOCOL:void 0,SDK_ENVIRONMENT:void 0,API_ROUTE:void 0}).ENV||"",e.ENV_DOMAIN=Object({SDK_CHANNEL:"snapshot",SDK_VERSION:"2.1.10",ENV_SUFFIX:void 0,ENV_PROTOCOL:void 0,SDK_ENVIRONMENT:void 0,API_ROUTE:void 0}).ENV_DOMAIN||"follow-apps.com",e.ENV_PROTOCOL="https",e.API_ROUTE="api/",e.CONFIG_STORAGE_NAME="faDeviceProperties",e.SESSION_STORAGE_NAME="faSession",e.LOCATION_STORAGE_NAME="faLocation",e.OPENED_BY_CAMPAIGN_STORAGE_NAME="faCampaigns",e.AUTH_TTL=108e5,e.DEPLOY_RETRY_DELAY=2e3,e.FAILED_REQUESTS_TO_REDEPLOY=3,e.SESSION_AUTO_UPDATE_DELAY=1e3,e.SESSION_TIMEOUT=120,e.API_SYNC_DELAY=8e3,e.SESSIONS_LOCAL_STORAGE_QUEUE="faSessionsQueue",e.SESSIONS_WITH_ID_LOCAL_STORAGE_QUEUE="faSessionsWithIdQueue",e.LOGS_LOCAL_STORAGE_QUEUE="faLogsQueue",e.GEO_LOCATION_UPDATE_DELAY=3e4,e.GEO_LOCATION_MAXIMUM_AGE=33e3,e.PUSH_NOTOFICATION_RENEWAL_INTERVAL=36e5,e.DEBUG_EXCLUDED_EVENTS=["SESSION_UPDATED"],e.INPUT_CHAIN_KEY="==follow==",e.CAMPAIGN_LOG_REGISTERATION_TIMEOUT=6048e5,e.OPT_IN_ANALYTICS_NAME_KEY="FollowAnalyticsTrackingState",e.CURRENT_LOCAL_POLICY_KEY="FollowAnalyticsDataWalletPolicy",e.POLICY_FETCH_TIMESTAMP_KEY="FollowAnalyticsDataWalletPolicyFetchTimestamp",e.POLICY_IS_READ_KEY="FollowAnalyticsDataWalletPolicyIsRead",e.FA_USER_ATTRIBUTE_STORAGE_KEY="FollowAnalyticsUserAttributesStorage",e.FAUserAttribute={FirstName:{target:"first_name",type:"string"},LastName:{target:"last_name",type:"string"},Email:{target:"email",type:"string"},DateOfBirth:{target:"date_of_birth",type:"date"},Gender:{target:"gender",type:"integer"},Country:{target:"country",type:"string"},City:{target:"city",type:"string"},Region:{target:"region",type:"string"},ProfilePictureUrl:{target:"profile_picture_url",type:"string"},Number:{target:"number",type:"number"},Boolean:{target:"boolean",type:"boolean"},String:{target:"string",type:"string"},Date:{target:"date",type:"date"},DateTime:{target:"datetime",type:"datetime"},Custom:{target:"custom",type:"any"},clear:{target:"clear",type:"any"},clearSet:{target:"clearSet",type:"any"},addToSet:{target:"addToSet",type:"any"},removeFromSet:{target:"removeFromSet",type:"any"}},e.FAUserActionType={Add:"ADD",Remove:"REMOVE",Delete:"DEL"}},function(t,e,n){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};e.__esModule=!0;var i=n(2),o=n(18),s=n(35),a=n(36),u=n(7),c=n(37),l=n(3),f=n(14);n(42),n(43);var d=n(0),h=n(9),p=n(19),g=n(44),_=n(45),y=n(47),m=n(48),v=n(57),S=n(17),b=n(16),A=n(59),E=n(61),I=n(12),O=n(13),T=n(67),w=function(){function t(){this.bundleVersion=null,this.sessionTimeout=null,this.userId=null,this.geolocationEnabled=!1,this.geolocationService=null,this.apiSyncService=null,this.isVerbose=!1,this.deviceIdCharsCount=0,this.optInAnalyticsDefault=!0,this.initServiceWorker=!0}return t.prototype.initialize=function(t){void 0===t&&(t={}),this.setupFaDeviceConfig(t),this.windowStateHandler=new g.default,this.SOR_identifier="SOR-SDK_"+a.default.hex_md5("web"+this.bundleId),this.Gender={MALE:1,FEMALE:2,OTHER:3},this.UserAttributes=new A.default,this.optInAnalyticsDefault=!1!==t.optInAnalyticsDefault;var e=i.get(d.OPT_IN_ANALYTICS_NAME_KEY),n=[!0,!1].indexOf(e)>-1?e:this.optInAnalyticsDefault;this.initOptInAnalytics(n),this.initServiceWorker=!1!==t.initServiceWorker,this.analyticsScope=t.analyticsScope||S.default.FULL,this.env=t.env||d.ENV,this.envDomain=t.envDomain||d.ENV_DOMAIN,this.envProtocol=t.envProtocol||d.ENV_PROTOCOL,this.defaultIcon=t.defaultIcon||null;var r=new _.default;this.userInfo=r.getUserInfo(),this.webPushService=new v.default(t.serviceWorkerPath),this.geolocationService=new y.default(this.geolocationEnabled),this.session=new O.default(this),this.logManager=new E.default(this),this.apiSyncService=new m.default,this.clearFAHistoryLogQueue(),this.registerServices([r,this.geolocationService,this.windowStateHandler,this.webPushService,this.logManager]),this.listenInputChain(),this.webPushService.checkOpenedByCampaign(),this.initServiceWorker&&this.webPushService.evaluateServiceWorkerValidity(),!0===this.getOptInAnalytics()&&this.session.resolveSession(),this.windowStateHandler.checkWindowState(),this.checkForNullEndingUrl()},t.prototype.setupFaDeviceConfig=function(t){void 0===t&&(t={}),u.default(this.getConfigStorage())&&(t.deviceId=T(),i.set(d.CONFIG_STORAGE_NAME,Object.assign({},t,this.userInfo)));var e=this.getConfigStorage();this.FAID=t.FAID||e.FAID,this.bundleId=t.bundleId||e.bundleId,this.userId=c.default(e.userId)||c.default(t.userId)||null,this.deviceId=e.deviceId||t.deviceId,this.env=t.env||d.ENV,this.envDomain=t.envDomain||d.ENV,this.envProtocol=t.envProtocol||d.ENV_PROTOCOL,this.bundleVersion=e.bundleVersion||t.bundleVersion||"1.0",this.isVerbose=t.isVerbose||!1,this.sessionTimeout=t.sessionTimeout||d.SESSION_TIMEOUT,this.geolocationEnabled=t.geolocationEnabled||!1},t.prototype.registerServices=function(t){for(var e=p.default.initialize(),n=0;n<t.length;n+=1)e.register(t[n])},t.prototype.listenInputChain=function(){var t=this;o.add(document,"keypress",function(e){var n=d.INPUT_CHAIN_KEY.split(""),r=e.key;n[t.deviceIdCharsCount]===r?t.deviceIdCharsCount++:t.deviceIdCharsCount=0,t.deviceIdCharsCount===n.length&&(t.deviceIdCharsCount=0,prompt("Copy to clipboard: Ctrl+C, Enter",t.getDeviceId()))})},t.prototype.getConfigStorage=function(t){void 0===t&&(t=null);var e=i.get(d.CONFIG_STORAGE_NAME)||{};return t?e[t]:e},t.prototype.getLogManager=function(){return this.logManager},t.prototype.getSession=function(){return this.session},t.prototype.getSessionData=function(){return this.session.getSessionData()},t.prototype.getApiSyncService=function(){return this.apiSyncService},t.prototype.checkUserLocation=function(){this.geolocationEnabled&&this.geolocationService.getUserLocation()},t.prototype.clearFAHistoryLogQueue=function(){i.remove("faLogs")},t.prototype.registerForPushNotification=function(){var t=this;return new l.Promise(function(e,n){navigator.serviceWorker&&window.PushManager||n(new Error("Error: Push Notifications not supported")),void 0===t.webPushService&&n(new Error("There was a problem registering. Please try again later.")),t.webPushService.register().then(function(n){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!0}),e()}).catch(function(e){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!1}),n(e)})})},t.prototype.unregisterFromPushNotification=function(){var t=this;return new l.Promise(function(e,n){t.webPushService.unsubscribe().then(function(n){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!1}),e()}).catch(function(t){n(t)})})},t.prototype.isRegisteredForPushNotifications=function(){return u.default(this.getConfigStorage())?(console.log(new Error("FollowAnalytics sdk is not initialized")),!1):(this.checkNotificationPermissionChanges(),this.hasNotificationPermission()&&!!i.get("faDeviceProperties").isRegisteredForPush)},t.prototype.hasNotificationPermission=function(){if(window.Notification){var t=Notification.permission;if(["default","denied"].indexOf(t)>=0)return!1;if("granted"===t)return!0}return!1},t.prototype.checkNotificationPermissionChanges=function(){if(window.Notification){var t=i.get("faDeviceProperties").isRegisteredForPush,e=Notification.permission,n=!(["default","denied"].indexOf(e)>=0);n!==t&&(!1===n?(navigator.serviceWorker.controller.postMessage("unregisterFromPushNotification"),this.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!1})):!0===n&&this.registerForPushNotification())}},t.prototype.updateStoreWithProperty=function(t,e){var n=i.get(t);i.set(t,r({},n,e))},t.prototype.setUserId=function(t){var e=c.default(t)||null;if(e!==this.userId)return null===this.userId&&null!==e?(this.userId=e,void this.updateCurrentStoreUser(e)):void this.initSession(e)},t.prototype.initSession=function(t){var e=this,n=this.getSession();return I.default.withLockOn(d.SESSION_STORAGE_NAME).do(function(){n.stopSession(!1),e.userId=t,e.updateCurrentStoreUser(t),n.startSession()})},t.prototype.updateCurrentStoreUser=function(t){var e=this.getConfigStorage();e&&(e.userId=t,i.set(d.CONFIG_STORAGE_NAME,e))},t.prototype.getFAID=function(){return this.FAID},t.prototype.getBundleId=function(){return this.bundleId},t.prototype.getBundleVersion=function(){return this.bundleVersion},t.prototype.getSessionTimeout=function(){return this.sessionTimeout},t.prototype.getUserId=function(){return this.userId},t.prototype.getDeviceId=function(){return this.deviceId},t.prototype.getUserInfo=function(){return this.userInfo},t.prototype.getCountryCode=function(){return this.countryCode},t.prototype.getDefaultIcon=function(){return this.defaultIcon},t.prototype.getEnvProtocol=function(){return this.envProtocol},t.prototype.getEnv=function(){return this.formatEnv()},t.prototype.getEnvDomain=function(){return this.envDomain},t.prototype.getEnvironment=function(){return this.env},t.prototype.formatEnv=function(){var t=this.env;return this.env&&0!==this.env.trim().length?this.stringStarstWithChar(this.env,"-")?this.env:"-"+t:""},t.prototype.isForeground=function(){return this.windowStateHandler.isForeground()},t.prototype.stringStarstWithChar=function(t,e){return t.length>0&&t.substring(0,e.length)===e},t.prototype.getVersion=function(){return d.SDK_VERSION},t.prototype.getOptInAnalytics=function(){return this.optInAnalytics},t.prototype.setOptInAnalytics=function(t){if(t!==this.optInAnalytics){var e=this.getSession();!1===t?(this.logManager.addEvent({logName:f.default[f.default.FALogNameUserOptedOut],logDetails:null}),e.stopSession(!1),i.set(d.OPT_IN_ANALYTICS_NAME_KEY,t),this.optInAnalytics=t):!0===t&&(i.set(d.OPT_IN_ANALYTICS_NAME_KEY,t),this.optInAnalytics=t,e.startSession(),this.logManager.addEvent({logName:f.default[f.default.FALogNameUserOptedIn],logDetails:null}))}},t.prototype.initOptInAnalytics=function(t){i.set(d.OPT_IN_ANALYTICS_NAME_KEY,t),this.optInAnalytics=t},t.prototype.gdprRequestToken=function(){var t=this.deviceId+":"+(this.userId||"")+":"+b.default(new Date);return s.default.hex_sha256(t).toUpperCase()},t.prototype.generateGDPRPayload=function(){return{FAID:this.FAID,deviceId:this.deviceId,sdkPlatform:"Web",userId:this.userId,sdkVersion:this.getVersion(),requestDate:b.default(new Date),packageName:this.bundleId}},t.prototype.dispatchGDPRRequest=function(t){var e=this.generateGDPRPayload();return new l.Promise(function(n,r){h.default.dispatchPostRequest(t,e,function(t){t.success?n(t):r(t)})})},t.prototype.requestToAccessMyData=function(){var t=this.gdprRequestToken();return this.dispatchGDPRRequest("/gdpr/collect?token="+t)},t.prototype.requestToDeleteMyData=function(){var t=this.gdprRequestToken();return this.dispatchGDPRRequest("/gdpr/erasure?token="+t)},t.prototype.getStoredUserAttributes=function(){return this.UserAttributes.getAttributesStore()},t.prototype.updateStoredUserAttributesRemovingSent=function(t){return this.UserAttributes.updateStoredUserAttributesRemovingSent(t)},t.prototype.serviceWorkerParams=function(){return"?FAID="+encodeURIComponent(this.getFAID())+"&deviceId="+encodeURIComponent(this.getDeviceId())+"&bundleId="+encodeURIComponent(this.getBundleId())+"&envProtocol="+encodeURIComponent(this.getEnvProtocol())+"&env="+encodeURIComponent(this.getEnv())+"&envDomain="+encodeURIComponent(this.getEnvDomain())+"&defaultIcon="+encodeURIComponent(this.getDefaultIcon())},t.prototype.checkForNullEndingUrl=function(){var t=window.location.pathname.split("/");"null"==t[t.length-1]&&this.logManager.addError({logName:"NullStringURL"})},t}();e.SDK=w,e.default=new w},function(t,e,n){var r=n(25),i=n(26),o=[n(33)];t.exports=r.createStore(i,o)},function(t,e,n){e.Promise=n(38)},function(t,e,n){(function(e){function n(t,e){return Array.prototype.slice.call(t,e||0)}function r(t,e){i(t,function(t,n){return e(t,n),!1})}function i(t,e){if(o(t)){for(var n=0;n<t.length;n++)if(e(t[n],n))return t[n]}else for(var r in t)if(t.hasOwnProperty(r)&&e(t[r],r))return t[r]}function o(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}var s=Object.assign?Object.assign:function(t,e,n,i){for(var o=1;o<arguments.length;o++)r(Object(arguments[o]),function(e,n){t[n]=e});return t},a=function(){function t(){}return Object.create?function(t,e,r,i){var o=n(arguments,1);return s.apply(this,[Object.create(t)].concat(o))}:function(e,r,i,o){var a=n(arguments,1);return t.prototype=e,s.apply(this,[new t].concat(a))}}(),u=String.prototype.trim?function(t){return String.prototype.trim.call(t)}:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},c="undefined"!=typeof window?window:e;t.exports={assign:s,create:a,trim:u,bind:function(t,e){return function(){return e.apply(t,Array.prototype.slice.call(arguments,0))}},slice:n,each:r,map:function(t,e){var n=o(t)?[]:{};return i(t,function(t,r){return n[r]=e(t,r),!1}),n},pluck:i,isList:o,isFunction:function(t){return t&&"[object Function]"==={}.toString.call(t)},isObject:function(t){return t&&"[object Object]"==={}.toString.call(t)},Global:c}}).call(e,n(8))},function(t,e,n){"use strict";var r;e.__esModule=!0,function(t){t[t.TEST_EVENT=0]="TEST_EVENT",t[t.WINDOW_STATE_CHANGED=1]="WINDOW_STATE_CHANGED",t[t.GET_USER_INFO=2]="GET_USER_INFO",t[t.ACTION_LOGGED=3]="ACTION_LOGGED",t[t.SESSION_ID_RECEIVED=4]="SESSION_ID_RECEIVED",t[t.SESSION_UPDATED=5]="SESSION_UPDATED",t[t.SESSION_ENDED=6]="SESSION_ENDED",t[t.INIT_SESSION_START=7]="INIT_SESSION_START",t[t.INIT_SESSION_STOP=8]="INIT_SESSION_STOP",t[t.SET_USER_LOCATION=9]="SET_USER_LOCATION",t[t.APP_OPENED_FROM_PUSH=10]="APP_OPENED_FROM_PUSH",t[t.SESSION_STARTED=11]="SESSION_STARTED",t[t.SDK_LOGGER_READY=12]="SDK_LOGGER_READY"}(r||(r={})),e.default=r},function(t,e,n){"use strict";e.__esModule=!0;var r=n(19),i=function(){function t(){}return t.prototype.handleNotification=function(t){},t.prototype.notifyEveryone=function(e){t.observersBroker.notifyEveryone(e)},t.observersBroker=r.default.initialize(),t}();e.default=i},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";e.__esModule=!0;var r=n(0),i=n(15),o=n(1),s=function(){function t(){this.loggerDomain=""}return t.prototype.deploy=function(t,e){var n=this;this.dispatchPostRequest("deployment",t,function(t){t&&t.success&&(n.loggerDomain=t.result.service_domain,o.default.countryCode=t.result.countryCode),e(t)})},t.prototype.dispatchPostRequest=function(t,e,n){void 0===n&&(n=null);var r=JSON.stringify(e);try{var o;window.XDomainRequest?((o=new window.XDomainRequest).timeout=3e3,o.onload=function(){n&&n(JSON.parse(o.responseText)),i.default("_req :: ",o.responseText)},o.onprogress=function(){},o.ontimeout=o.onerror=function(){n&&n({error:o.responseText,success:!1})},o.open("POST",this.getApiUrl(t),!0)):((o=new XMLHttpRequest).open("POST",this.getApiUrl(t),!0),o.setRequestHeader("Content-Type","application/json; charset=utf-8")),o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)n&&n(JSON.parse(o.response)),i.default("_req :: ",o);else{var t="Bad HTTP status: "+o.status+" "+o.statusText;n&&n({error:t,success:!1})}},o.send(r)}catch(t){console.error(t)}},t.prototype.getApiUrl=function(t){var e=""+r.API_ROUTE,n="deployment"===t?"auth":this.loggerDomain,i=""===o.default.getEnv()?".":o.default.getEnv()+".",s=o.default.getEnvDomain();return o.default.getEnvProtocol()+"://"+n+i+s+"/"+e+t},t.prototype.getDataFrom=function(t,e){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&200===n.status&&e(n.responseText)},n.open("GET",t,!0),n.send(null)},t}();e.default=new s},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(t,e){void 0===e&&(e=null),this.type=t,this.payload=e}return t.prototype.getType=function(){return this.type},t.prototype.getPayload=function(){return this.payload},t}();e.default=r},function(t,e,n){"use strict";e.__esModule=!0;var r=n(2),i=n(12),o=n(3),s=function(){function t(t){this.key=t}return t.prototype.getSize=function(){var t=this.key+"_head",e=this.key+"_next",n=parseInt(r.get(t),10)||0;return(parseInt(r.get(e),10)||0)-n},t.prototype.enqueue=function(t){var e=this;return new o.Promise(function(n,o){var s=e.key+"_next";return i.default.withLockOn(s).do(function(){var n=parseInt(r.get(s),10)||0,i=e.key+"_"+n;r.set(i,t),r.set(s,n+1)}).then(n,o)})},t.prototype.enqueueMany=function(t){var e=this;return new o.Promise(function(n,o){var s=e.key+"_next";return i.default.withLockOn(s).do(function(){for(var n=0;n<t.length;n++){var i=parseInt(r.get(s),10)||0,o=e.key+"_"+i;r.set(o,t[n]),r.set(s,i+1)}}).then(n).catch(o)})},t.prototype.peek=function(t){var e=this;return void 0===t&&(t=0),new o.Promise(function(n,o){var s=e.key+"_head",a=e.key+"_next",u={object:null},c=function(){u.object?n(u.object):o()};i.default.withLockOn(s).do(function(){var n=t+(parseInt(r.get(s),10)||0);if(n<(parseInt(r.get(a),10)||0)){var i=e.key+"_"+n;u.object=r.get(i)}}).then(c).catch(c)})},t.prototype.dequeue=function(){var t=this;return new o.Promise(function(e,n){var o=t.key+"_head",s=t.key+"_next",a={object:null},u=function(){a.object?e(a.object):n()};i.default.withLockOn(o).do(function(){var e=parseInt(r.get(o),10)||0;if(e<(parseInt(r.get(s),10)||0)){var n=t.key+"_"+e;a.object=r.get(n),r.set(o,e+1),r.remove(n)}}).then(u).catch(u)})},t.prototype.dequeueMany=function(t){return this.dequeueWhile(function(e,n,r){return e<n+t&&e<r})},t.prototype.dequeueAll=function(){return this.dequeueWhile(function(t,e,n){return t<n})},t.prototype.dequeueWhile=function(t){var e=this;return new o.Promise(function(n,o){var s=e.key+"_head",a=e.key+"_next",u={array:null},c=function(){u.array?n(u.array):o()};i.default.withLockOn(s).do(function(){var n=parseInt(r.get(s),10)||0,i=parseInt(r.get(a),10)||0;u.array=[];for(var o=n;t(o,n,i);o++){var c=e.key+"_"+o;u.array.push(r.get(c)),r.set(s,o+1),r.remove(c)}}).then(c,c)})},t.prototype.getAll=function(){for(var t=this.key+"_head",e=parseInt(r.get(t),10)||0,n=this.key+"_next",i=parseInt(r.get(n),10)||0,o=[],s=e;s<i;s++)o.push(r.get(this.key+"_"+s));return o},t.prototype.transfer=function(t,e){var n=this;return new o.Promise(function(r,i){n.peek().then(function(o){var s=e(o);t.enqueue(s).then(function(){n.dequeue().then(function(){return r(s)}).catch(i)}).catch(i)}).catch(i)})},t}();e.LocalStorageQueue=s},function(t,e,n){"use strict";e.__esModule=!0;var r=n(2),i=n(3),o=n(50),s=function(){function t(t){this.what=t}return t.prototype.do=function(t){return this.what(t)},t}(),a=function(){function t(){this.myId=t.now()+":"+t.someNumber()}return t.now=function(){return(new Date).getTime()},t.someNumber=function(){return 1e9*Math.random()|0},t.prototype.getter=function(e){return function(){var n=r.get(e);if(!n)return null;var i=n.split(/\|/);return parseInt(i[1],10)<t.now()?null:i[0]}},t.prototype.retry=function(t,e,n,r){var i=this;void 0===n&&(n=function(){}),void 0===r&&(r=5e3),setTimeout(function(){i.runInLock(t,e,n,r)},0)},t.prototype.runInLock=function(e,n,i,o){var s=this;void 0===i&&(i=function(){}),void 0===o&&(o=5e3);var a=e+"__MUTEX_x",u=e+"__MUTEX_y",c=this.getter(u);if(r.set(a,this.myId),c())return this.retry(e,n,i),!1;var l=this.myId+"|"+(t.now()+o);return r.set(u,l),r.get(a)!==this.myId?(setTimeout(function(){c()!==s.myId?s.retry(e,n,i):s.execute(u,l,n,i)},50+Math.round(50*Math.random())),!1):(this.execute(u,l,n,i),!0)},t.prototype.execute=function(t,e,n,i){void 0===i&&(i=function(){});try{n()}finally{if(r.get(t)!==e)throw t+" was changed by a different process while I held the lock";r.remove(t),i()}},t.prototype.unlessLocked=function(t,e){var n=this;return void 0===e&&(e=5e3),new s(function(r){return n.runInLock(t,r,function(){},e)?o.SynchronousPromise.resolve():o.SynchronousPromise.reject("Did not acquire lock")})},t.prototype.withLockOn=function(t,e){var n=this;return void 0===e&&(e=1e4),new s(function(r){return new i.Promise(function(i,o){var s={performed:!1};n.runInLock(t,function(){r(),s.performed=!0},function(){s.performed?i():o()},e)})})},t}();e.default=new a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t};e.__esModule=!0;var o=n(2),s=n(7),a=n(0),u=n(1),c=n(6),l=n(10),f=n(5),d=n(12),h=n(11),p=function(t){function e(n){var r=t.call(this)||this;return r.id=null,r.sessionAutoUpdateHandler=null,r.isSessionPaused=!0,r.onSessionAutoUpdate=function(){d.default.withLockOn(a.SESSION_STORAGE_NAME).do(function(){r.endTime=new Date;var t=e.getCurrentSessionData();t&&(r.startTime=new Date(t.startTime),r.id=t.id),o.set(a.SESSION_STORAGE_NAME,i({},t,r.getSessionData()))})},r.sdk=n,r.sessionsQueue=new h.LocalStorageQueue(a.SESSIONS_LOCAL_STORAGE_QUEUE),r.sessionsWithIdQueue=new h.LocalStorageQueue(a.SESSIONS_WITH_ID_LOCAL_STORAGE_QUEUE),r.loadDataFromStore(),r}return r(e,t),e.getCurrentSessionData=function(){return o.get(a.SESSION_STORAGE_NAME)},e.generateSessionId=function(){return"INTERNAL_"+(new Date).getTime().toString()},e.prototype.startSession=function(){this.startTime=new Date,this.endTime=new Date,this.id=e.generateSessionId(),this.notifyEveryone(new l.default(f.default.SESSION_STARTED)),u.default.checkUserLocation(),o.set(a.SESSION_STORAGE_NAME,this.getSessionData()),this.startSessionAutoUpdate()},e.prototype.stopSession=function(t){void 0===t&&(t=!0),!0===u.default.getOptInAnalytics()&&(this.storeSession(),this.notifyEveryone(new l.default(f.default.SESSION_ENDED,{id:this.id}))),this.stopSessionAutoUpdate(),this.id=null,this.startTime=null,this.endTime=null,o.remove(a.SESSION_STORAGE_NAME),t&&this.startSession()},e.prototype.storeSession=function(){var t=e.getCurrentSessionData();return t&&t.sessionId?this.sessionsWithIdQueue.enqueue(t):this.sessionsQueue.enqueue(t)},e.prototype.isStopped=function(){return null===this.id},e.prototype.resumeSession=function(){this.loadDataFromStore(),this.isSessionPaused&&this.startSessionAutoUpdate()},e.prototype.pauseSession=function(){this.isSessionPaused||this.stopSessionAutoUpdate()},e.prototype.isPaused=function(){return this.isSessionPaused},e.prototype.resolveSession=function(){var t=this;return d.default.withLockOn(a.SESSION_STORAGE_NAME).do(function(){var n=e.getCurrentSessionData();s.default(n)?t.startSession():t.isExpired()?t.stopSession():t.resumeSession()})},e.prototype.getSessionData=function(){return{duration:this.getDuration(),id:this.id,startTime:this.startTime?this.startTime.getTime():null,endTime:this.endTime?this.endTime.getTime():null}},e.prototype.isExpired=function(){var t=e.getCurrentSessionData(),n=t&&t.endTime||this.endTime.getTime();return(new Date).getTime()-n>=1e3*this.sdk.getSessionTimeout()},e.prototype.getDuration=function(){return this.endTime&&this.startTime?(this.endTime.getTime()-this.startTime.getTime())/1e3:0},e.prototype.startSessionAutoUpdate=function(){null===this.sessionAutoUpdateHandler&&(this.sessionAutoUpdateHandler=setInterval(this.onSessionAutoUpdate,a.SESSION_AUTO_UPDATE_DELAY)),this.isSessionPaused=!1},e.prototype.stopSessionAutoUpdate=function(){clearInterval(this.sessionAutoUpdateHandler),this.sessionAutoUpdateHandler=null,this.isSessionPaused=!0},e.prototype.loadDataFromStore=function(){var t=e.getCurrentSessionData();s.default(t)||(this.startTime=new Date(t.startTime),this.endTime=new Date(t.endTime),this.id=t.id)},e}(c.default);e.default=p},function(t,e,n){"use strict";var r;e.__esModule=!0,function(t){t[t.FALogNameStartSession=0]="FALogNameStartSession",t[t.FALogNameEnterForeground=1]="FALogNameEnterForeground",t[t.FALogNameEnterBackground=2]="FALogNameEnterBackground",t[t.FALogNameLocation=3]="FALogNameLocation",t[t.FALogNamePing=4]="FALogNamePing",t[t.FALogNameEndSession=5]="FALogNameEndSession",t[t.FALogNameCustomEvent=6]="FALogNameCustomEvent",t[t.FALogNameCustomError=7]="FALogNameCustomError",t[t.FALogNameDidReceiveTheCampaign=8]="FALogNameDidReceiveTheCampaign",t[t.FALogNameApplicationOpenedFromPushMessage=9]="FALogNameApplicationOpenedFromPushMessage",t[t.FALogNameUserOptedIn=10]="FALogNameUserOptedIn",t[t.FALogNameUserOptedOut=11]="FALogNameUserOptedOut"}(r||(r={})),e.default=r},function(t,e,n){"use strict";e.__esModule=!0;var r=n(1);e.default=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];r.default.isVerbose&&console.log.apply(console,t)}},function(t,e,n){"use strict";function r(t){return("0"+t).slice(-2)}e.__esModule=!0,e.default=function(t){var e=Date.parse(t),n=new Date(e),i=n.getFullYear()+"-"+r(n.getMonth()+1)+"-"+r(n.getDate());return i=(i+="T")+r(n.getHours())+":"+r(n.getMinutes())+":"+r(n.getSeconds()),i+=function(t){var e=t.getTimezoneOffset()>0?"-":"+",n=Math.abs(t.getTimezoneOffset());return e+r(Math.floor(n/60))+":"+r(n%60)}(n)}},function(t,e,n){"use strict";var r;e.__esModule=!0,function(t){t.FULL="full",t.PUSH="push"}(r||(r={})),e.default=r},function(t,e,n){var r,i;!function(o,s){void 0===(i="function"==typeof(r=s)?r.call(e,n,e,t):r)||(t.exports=i)}(0,function(){function t(t,e){return function(n,r,i,o){n[t]?n[t](r,i,o):n[e]&&n[e]("on"+r,i)}}return{add:t("addEventListener","attachEvent"),remove:t("removeEventListener","detachEvent")}})},function(t,e,n){"use strict";e.__esModule=!0;var r=n(0),i=n(5),o=n(15),s=function(){function t(){this.observers=[]}return t.initialize=function(){return null===t.instance&&(t.instance=new t),t.instance},t.prototype.register=function(t){this.observers.push(t)},t.prototype.notifyEveryone=function(t){var e=i.default[t.getType()];-1===r.DEBUG_EXCLUDED_EVENTS.indexOf(e)&&o.default("InnerSDKEvent:: ",e,"::",t.getPayload());for(var n=0;n<this.observers.length;n+=1)this.observers[n].handleNotification(t)},t.instance=null,t}();e.default=s},function(t,e,n){"use strict";var r;e.__esModule=!0,function(t){t[t.FOREGROUND=0]="FOREGROUND",t[t.BACKGROUND=1]="BACKGROUND",t[t.CLOSED=2]="CLOSED"}(r||(r={})),e.default=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){return t.reduce(function(t,n){var r=n[e];return null!==r&&void 0!==r&&(t[""+r]=n),t},{})}},function(t,e,n){"use strict";e.__esModule=!0;var r=n(7),i=n(24);!window||window.hasOwnProperty("FollowAnalytics")&&!r.default(window.FollowAnalytics)||(window.FollowAnalytics=i.default)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(1),i=n(17),o=function(){function t(){this.DataWallet={getPolicy:function(){return!1},isRead:function(){return!1},setIsRead:function(t){return!1}},this.GDPR={requestToAccessMyData:function(){return r.default.requestToAccessMyData()},requestToDeleteMyData:function(){return r.default.requestToDeleteMyData()}},this.UserAttributes={setFirstName:function(t){return r.default.UserAttributes.setFirstName(t)},setLastName:function(t){return r.default.UserAttributes.setLastName(t)},setDateOfBirth:function(t){return r.default.UserAttributes.setDateOfBirth(t)},setGender:function(t){return r.default.UserAttributes.setGender(t)},setCountry:function(t){return r.default.UserAttributes.setCountry(t)},setRegion:function(t){return r.default.UserAttributes.setRegion(t)},setCity:function(t){return r.default.UserAttributes.setCity(t)},setProfilePictureUrl:function(t){return r.default.UserAttributes.setProfilePictureUrl(t)},setEmail:function(t){return r.default.UserAttributes.setEmail(t)},setNumber:function(t,e){return r.default.UserAttributes.setNumber(t,e)},setBoolean:function(t,e){return r.default.UserAttributes.setBoolean(t,e)},setString:function(t,e){return r.default.UserAttributes.setString(t,e)},setDate:function(t,e){return r.default.UserAttributes.setDate(t,e)},setDateTime:function(t,e){return r.default.UserAttributes.setDateTime(t,e)},clearSet:function(t){return r.default.UserAttributes.clearSet(t)},addToSet:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return r.default.UserAttributes.addToSet(t,e)},removeFromSet:function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return r.default.UserAttributes.removeFromSet(t,e)}},this.Gender={MALE:1,FEMALE:2,OTHER:3},this.AnalyticsScope=i.default}return t.prototype.initialize=function(t){void 0===t&&(t={}),r.default.initialize(t)},t.prototype.getVersion=function(){return r.default.getVersion()},t.prototype.getSessionInfo=function(){return r.default.getSessionData()},t.prototype.getUserId=function(){return r.default.getUserId()},t.prototype.getDeviceId=function(){return r.default.getDeviceId()},t.prototype.setUserId=function(t){r.default.setUserId(t)},t.prototype.logEvent=function(t,e){if(void 0===e&&(e={}),!this.isInitialized())return!1;var n={logName:t,logDetails:e};return r.default.getLogManager().addEvent(n)},t.prototype.logError=function(t,e){if(void 0===e&&(e={}),!this.isInitialized())return!1;var n={logName:t,logDetails:e};return r.default.getLogManager().addError(n)},t.prototype.registerForPushNotifications=function(){return r.default.registerForPushNotification()},t.prototype.unregisterFromPushNotifications=function(){return r.default.unregisterFromPushNotification()},t.prototype.isRegisteredForPushNotifications=function(){return r.default.isRegisteredForPushNotifications()},t.prototype.getEnvironment=function(){return r.default.getEnvironment()},t.prototype.getOptInAnalytics=function(){return r.default.getOptInAnalytics()},t.prototype.setOptInAnalytics=function(t){r.default.setOptInAnalytics(t)},t.prototype.getAnalyticsScope=function(){return r.default.analyticsScope},t.prototype.getServiceWorkerParams=function(){return r.default.serviceWorkerParams()},t.prototype.isInitialized=function(){return!(!r.default&&!r.default.getLogManager()&&(!window.console||"function"!=typeof console.warn||(console.warn("FollowAnalytics Web SDK not initialized. Please do so before logging."),1)))},t}();e.default=new o},function(t,e,n){function r(t,e,n){n||(n=""),t&&!l(t)&&(t=[t]),e&&!l(e)&&(e=[e]);var r=n?"__storejs_"+n+"_":"",i=n?new RegExp("^"+r):null;if(!/^[a-zA-Z0-9_\-]*$/.test(n))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var p=c({_namespacePrefix:r,_namespaceRegexp:i,_testStorage:function(t){try{var e="__storejs__test__";t.write(e,e);var n=t.read(e)===e;return t.remove(e),n}catch(t){return!1}},_assignPluginFnProp:function(t,e){var n=this[e];this[e]=function(){var e=o(arguments,0),r=this,i=[function(){if(n)return a(arguments,function(t,n){e[n]=t}),n.apply(r,e)}].concat(e);return t.apply(r,i)}},_serialize:function(t){return JSON.stringify(t)},_deserialize:function(t,e){if(!t)return e;var n="";try{n=JSON.parse(t)}catch(e){n=t}return void 0!==n?n:e},_addStorage:function(t){this.enabled||this._testStorage(t)&&(this.storage=t,this.enabled=!0)},_addPlugin:function(t){var e=this;if(l(t))a(t,function(t){e._addPlugin(t)});else if(!s(this.plugins,function(e){return t===e})){if(this.plugins.push(t),!f(t))throw new Error("Plugins must be function values that return objects");var n=t.call(this);if(!d(n))throw new Error("Plugins must return an object of function properties");a(n,function(n,r){if(!f(n))throw new Error("Bad plugin property: "+r+" from plugin "+t.name+". Plugins should only return functions.");e._assignPluginFnProp(n,r)})}},addStorage:function(t){!function(){var t="undefined"==typeof console?null:console;t&&(t.warn?t.warn:t.log).apply(t,arguments)}("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(t)}},h,{plugins:[]});return p.raw={},a(p,function(t,e){f(t)&&(p.raw[e]=u(p,t))}),a(t,function(t){p._addStorage(t)}),a(e,function(t){p._addPlugin(t)}),p}var i=n(4),o=i.slice,s=i.pluck,a=i.each,u=i.bind,c=i.create,l=i.isList,f=i.isFunction,d=i.isObject;t.exports={createStore:r};var h={version:"2.0.12",enabled:!1,get:function(t,e){var n=this.storage.read(this._namespacePrefix+t);return this._deserialize(n,e)},set:function(t,e){return void 0===e?this.remove(t):(this.storage.write(this._namespacePrefix+t,this._serialize(e)),e)},remove:function(t){this.storage.remove(this._namespacePrefix+t)},each:function(t){var e=this;this.storage.each(function(n,r){t.call(e,e._deserialize(n),(r||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(t){return this._namespacePrefix=="__storejs_"+t+"_"},createStore:function(){return r.apply(this,arguments)},addPlugin:function(t){this._addPlugin(t)},namespace:function(t){return r(this.storage,this.plugins,t)}}},function(t,e,n){t.exports=[n(27),n(28),n(29),n(30),n(31),n(32)]},function(t,e,n){function r(){return o.localStorage}function i(t){return r().getItem(t)}var o=n(4).Global;t.exports={name:"localStorage",read:i,write:function(t,e){return r().setItem(t,e)},each:function(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(i(n),n)}},remove:function(t){return r().removeItem(t)},clearAll:function(){return r().clear()}}},function(t,e,n){function r(t){for(var e=o.length-1;e>=0;e--){var n=o.key(e);t(o[n],n)}}var i=n(4).Global;t.exports={name:"oldFF-globalStorage",read:function(t){return o[t]},write:function(t,e){o[t]=e},each:r,remove:function(t){return o.removeItem(t)},clearAll:function(){r(function(t,e){delete o[t]})}};var o=i.globalStorage},function(t,e,n){function r(t){return t.replace(/^\d/,"___$&").replace(c,"___")}var i=n(4).Global;t.exports={name:"oldIE-userDataStorage",write:function(t,e){if(!u){var n=r(t);a(function(t){t.setAttribute(n,e),t.save(o)})}},read:function(t){if(!u){var e=r(t),n=null;return a(function(t){n=t.getAttribute(e)}),n}},each:function(t){a(function(e){for(var n=e.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var i=n[r];t(e.getAttribute(i.name),i.name)}})},remove:function(t){var e=r(t);a(function(t){t.removeAttribute(e),t.save(o)})},clearAll:function(){a(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(o);for(var n=e.length-1;n>=0;n--)t.removeAttribute(e[n].name);t.save(o)})}};var o="storejs",s=i.document,a=function(){if(!s||!s.documentElement||!s.documentElement.addBehavior)return null;var t,e,n;try{(e=new ActiveXObject("htmlfile")).open(),e.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),e.close(),t=e.w.frames[0].document,n=t.createElement("div")}catch(e){n=s.createElement("div"),t=s.body}return function(e){var r=[].slice.call(arguments,0);r.unshift(n),t.appendChild(n),n.addBehavior("#default#userData"),n.load(o),e.apply(this,r),t.removeChild(n)}}(),u=(i.navigator?i.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./),c=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g")},function(t,e,n){function r(t){for(var e=c.cookie.split(/; ?/g),n=e.length-1;n>=0;n--)if(u(e[n])){var r=e[n].split("="),i=unescape(r[0]);t(unescape(r[1]),i)}}function i(t){t&&o(t)&&(c.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function o(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(c.cookie)}var s=n(4),a=s.Global,u=s.trim;t.exports={name:"cookieStorage",read:function(t){if(!t||!o(t))return null;var e="(?:^|.*;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(c.cookie.replace(new RegExp(e),"$1"))},write:function(t,e){t&&(c.cookie=escape(t)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")},each:r,remove:i,clearAll:function(){r(function(t,e){i(e)})}};var c=a.document},function(t,e,n){function r(){return o.sessionStorage}function i(t){return r().getItem(t)}var o=n(4).Global;t.exports={name:"sessionStorage",read:i,write:function(t,e){return r().setItem(t,e)},each:function(t){for(var e=r().length-1;e>=0;e--){var n=r().key(e);t(i(n),n)}},remove:function(t){return r().removeItem(t)},clearAll:function(){return r().clear()}}},function(t,e){t.exports={name:"memoryStorage",read:function(t){return n[t]},write:function(t,e){n[t]=e},each:function(t){for(var e in n)n.hasOwnProperty(e)&&t(n[e],e)},remove:function(t){delete n[t]},clearAll:function(t){n={}}};var n={}},function(t,e,n){t.exports=function(){return n(34),{}}},function(module,exports){"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,r,i,o,s,a=gap,u=e[t];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(t)),"function"==typeof rep&&(u=rep.call(e,t,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,s=[],"[object Array]"===Object.prototype.toString.apply(u)){for(o=u.length,n=0;n<o;n+=1)s[n]=str(n,u)||"null";return i=0===s.length?"[]":gap?"[\n"+gap+s.join(",\n"+gap)+"\n"+a+"]":"["+s.join(",")+"]",gap=a,i}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;n<o;n+=1)"string"==typeof rep[n]&&(i=str(r=rep[n],u))&&s.push(quote(r)+(gap?": ":":")+i);else for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(i=str(r,u))&&s.push(quote(r)+(gap?": ":":")+i);return i=0===s.length?"{}":gap?"{\n"+gap+s.join(",\n"+gap)+"\n"+a+"}":"{"+s.join(",")+"}",gap=a,i}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,r,i=t[e];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(void 0!==(r=walk(i,n))?i[n]=r:delete i[n]);return reviver.call(t,e,i)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(){this.hexcase=0,this.b64pad="",this.sha256_K=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998)}return t.prototype.initialize=function(t){},t.prototype.hex_sha256=function(t){return this.rstr2hex(this.rstr_sha256(this.str2rstr_utf8(t)))},t.prototype.b64_sha256=function(t){return this.rstr2b64(this.rstr_sha256(this.str2rstr_utf8(t)))},t.prototype.any_sha256=function(t,e){return this.rstr2any(this.rstr_sha256(this.str2rstr_utf8(t)),e)},t.prototype.hex_hmac_sha256=function(t,e){return this.rstr2hex(this.rstr_hmac_sha256(this.str2rstr_utf8(t),this.str2rstr_utf8(e)))},t.prototype.b64_hmac_sha256=function(t,e){return this.rstr2b64(this.rstr_hmac_sha256(this.str2rstr_utf8(t),this.str2rstr_utf8(e)))},t.prototype.any_hmac_sha256=function(t,e,n){return this.rstr2any(this.rstr_hmac_sha256(this.str2rstr_utf8(t),this.str2rstr_utf8(e)),n)},t.prototype.sha256_vm_test=function(){return"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"==this.hex_sha256("abc").toLowerCase()},t.prototype.rstr_sha256=function(t){return this.binb2rstr(this.binb_sha256(this.rstr2binb(t),8*t.length))},t.prototype.rstr_hmac_sha256=function(t,e){var n=this.rstr2binb(t);n.length>16&&(n=this.binb_sha256(n,8*t.length));for(var r=Array(16),i=Array(16),o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var s=this.binb_sha256(r.concat(this.rstr2binb(e)),512+8*e.length);return this.binb2rstr(this.binb_sha256(i.concat(s),768))},t.prototype.rstr2hex=function(t){try{this.hexcase}catch(t){this.hexcase=0}for(var e,n=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",r="",i=0;i<t.length;i++)e=t.charCodeAt(i),r+=n.charAt(e>>>4&15)+n.charAt(15&e);return r},t.prototype.rstr2b64=function(t){try{this.b64pad}catch(t){this.b64pad=""}for(var e="",n=t.length,r=0;r<n;r+=3)for(var i=t.charCodeAt(r)<<16|(r+1<n?t.charCodeAt(r+1)<<8:0)|(r+2<n?t.charCodeAt(r+2):0),o=0;o<4;o++)8*r+6*o>8*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63);return e},t.prototype.rstr2any=function(t,e){var n,r,i,o,s=e.length,a=Array(),u=Array(Math.ceil(t.length/2));for(n=0;n<u.length;n++)u[n]=t.charCodeAt(2*n)<<8|t.charCodeAt(2*n+1);for(;u.length>0;){for(o=Array(),i=0,n=0;n<u.length;n++)i=(i<<16)+u[n],i-=(r=Math.floor(i/s))*s,(o.length>0||r>0)&&(o[o.length]=r);a[a.length]=i,u=o}var c="";for(n=a.length-1;n>=0;n--)c+=e.charAt(a[n]);var l=Math.ceil(8*t.length/(Math.log(e.length)/Math.log(2)));for(n=c.length;n<l;n++)c=e[0]+c;return c},t.prototype.str2rstr_utf8=function(t){for(var e,n,r="",i=-1;++i<t.length;)e=t.charCodeAt(i),n=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),i++),e<=127?r+=String.fromCharCode(e):e<=2047?r+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?r+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(r+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return r},t.prototype.str2rstr_utf16le=function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(255&t.charCodeAt(n),t.charCodeAt(n)>>>8&255);return e},t.prototype.str2rstr_utf16be=function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t.charCodeAt(n)>>>8&255,255&t.charCodeAt(n));return e},t.prototype.rstr2binb=function(t){for(var e=Array(t.length>>2),n=0;n<e.length;n++)e[n]=0;for(n=0;n<8*t.length;n+=8)e[n>>5]|=(255&t.charCodeAt(n/8))<<24-n%32;return e},t.prototype.binb2rstr=function(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>24-n%32&255);return e},t.prototype.sha256_S=function(t,e){return t>>>e|t<<32-e},t.prototype.sha256_R=function(t,e){return t>>>e},t.prototype.sha256_Ch=function(t,e,n){return t&e^~t&n},t.prototype.sha256_Maj=function(t,e,n){return t&e^t&n^e&n},t.prototype.sha256_Sigma0256=function(t){return this.sha256_S(t,2)^this.sha256_S(t,13)^this.sha256_S(t,22)},t.prototype.sha256_Sigma1256=function(t){return this.sha256_S(t,6)^this.sha256_S(t,11)^this.sha256_S(t,25)},t.prototype.sha256_Gamma0256=function(t){return this.sha256_S(t,7)^this.sha256_S(t,18)^this.sha256_R(t,3)},t.prototype.sha256_Gamma1256=function(t){return this.sha256_S(t,17)^this.sha256_S(t,19)^this.sha256_R(t,10)},t.prototype.sha256_Sigma0512=function(t){return this.sha256_S(t,28)^this.sha256_S(t,34)^this.sha256_S(t,39)},t.prototype.sha256_Sigma1512=function(t){return this.sha256_S(t,14)^this.sha256_S(t,18)^this.sha256_S(t,41)},t.prototype.sha256_Gamma0512=function(t){return this.sha256_S(t,1)^this.sha256_S(t,8)^this.sha256_R(t,7)},t.prototype.sha256_Gamma1512=function(t){return this.sha256_S(t,19)^this.sha256_S(t,61)^this.sha256_R(t,6)},t.prototype.binb_sha256=function(t,e){var n,r,i,o,s,a,u,c,l,f,d,h,p=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(t[e>>5]|=128<<24-e%32,t[15+(e+64>>9<<4)]=e,l=0;l<t.length;l+=16){for(n=p[0],r=p[1],i=p[2],o=p[3],s=p[4],a=p[5],u=p[6],c=p[7],f=0;f<64;f++)g[f]=f<16?t[f+l]:this.safe_add(this.safe_add(this.safe_add(this.sha256_Gamma1256(g[f-2]),g[f-7]),this.sha256_Gamma0256(g[f-15])),g[f-16]),d=this.safe_add(this.safe_add(this.safe_add(this.safe_add(c,this.sha256_Sigma1256(s)),this.sha256_Ch(s,a,u)),this.sha256_K[f]),g[f]),h=this.safe_add(this.sha256_Sigma0256(n),this.sha256_Maj(n,r,i)),c=u,u=a,a=s,s=this.safe_add(o,d),o=i,i=r,r=n,n=this.safe_add(d,h);p[0]=this.safe_add(n,p[0]),p[1]=this.safe_add(r,p[1]),p[2]=this.safe_add(i,p[2]),p[3]=this.safe_add(o,p[3]),p[4]=this.safe_add(s,p[4]),p[5]=this.safe_add(a,p[5]),p[6]=this.safe_add(u,p[6]),p[7]=this.safe_add(c,p[7])}return p},t.prototype.safe_add=function(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n},t}();e.default=new r},function(t,e,n){"use strict";e.__esModule=!0;var r=function(){function t(){this.hexcase=0,this.b64pad=""}return t.prototype.hex_md5=function(t){return this.rstr2hex(this.rstr_md5(this.str2rstr_utf8(t)))},t.prototype.b64_md5=function(t){return this.rstr2b64(this.rstr_md5(this.str2rstr_utf8(t)))},t.prototype.any_md5=function(t,e){return this.rstr2any(this.rstr_md5(this.str2rstr_utf8(t)),e)},t.prototype.hex_hmac_md5=function(t,e){return this.rstr2hex(this.rstr_hmac_md5(this.str2rstr_utf8(t),this.str2rstr_utf8(e)))},t.prototype.b64_hmac_md5=function(t,e){return this.rstr2b64(this.rstr_hmac_md5(this.str2rstr_utf8(t),this.str2rstr_utf8(e)))},t.prototype.any_hmac_md5=function(t,e,n){return this.rstr2any(this.rstr_hmac_md5(this.str2rstr_utf8(t),this.str2rstr_utf8(e)),n)},t.prototype.md5_vm_test=function(){return"900150983cd24fb0d6963f7d28e17f72"==this.hex_md5("abc").toLowerCase()},t.prototype.rstr_md5=function(t){return this.binl2rstr(this.binl_md5(this.rstr2binl(t),8*t.length))},t.prototype.rstr_hmac_md5=function(t,e){var n=this.rstr2binl(t);n.length>16&&(n=this.binl_md5(n,8*t.length));for(var r=Array(16),i=Array(16),o=0;o<16;o++)r[o]=909522486^n[o],i[o]=1549556828^n[o];var s=this.binl_md5(r.concat(this.rstr2binl(e)),512+8*e.length);return this.binl2rstr(this.binl_md5(i.concat(s),640))},t.prototype.rstr2hex=function(t){try{this.hexcase}catch(t){this.hexcase=0}for(var e,n=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",r="",i=0;i<t.length;i++)e=t.charCodeAt(i),r+=n.charAt(e>>>4&15)+n.charAt(15&e);return r},t.prototype.rstr2b64=function(t){try{this.b64pad}catch(t){this.b64pad=""}for(var e="",n=t.length,r=0;r<n;r+=3)for(var i=t.charCodeAt(r)<<16|(r+1<n?t.charCodeAt(r+1)<<8:0)|(r+2<n?t.charCodeAt(r+2):0),o=0;o<4;o++)8*r+6*o>8*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63);return e},t.prototype.rstr2any=function(t,e){var n,r,i,o,s,a=e.length,u=Array(Math.ceil(t.length/2));for(n=0;n<u.length;n++)u[n]=t.charCodeAt(2*n)<<8|t.charCodeAt(2*n+1);var c=Math.ceil(8*t.length/(Math.log(e.length)/Math.log(2))),l=Array(c);for(r=0;r<c;r++){for(s=Array(),o=0,n=0;n<u.length;n++)o=(o<<16)+u[n],o-=(i=Math.floor(o/a))*a,(s.length>0||i>0)&&(s[s.length]=i);l[r]=o,u=s}var f="";for(n=l.length-1;n>=0;n--)f+=e.charAt(l[n]);return f},t.prototype.str2rstr_utf8=function(t){for(var e,n,r="",i=-1;++i<t.length;)e=t.charCodeAt(i),n=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),i++),e<=127?r+=String.fromCharCode(e):e<=2047?r+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?r+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(r+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,