UNPKG

followanalytics-alpha

Version:

FollowAnalytics Web SDK - NPM package for the FollowAnalytics Web SDK.

1 lines 101 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 o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.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=21)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SDK_VERSION="2.0.0-alpha",e.SDK_PLATFORM="Web",e.ENV=Object({SDK_CHANNEL:"alpha",SDK_VERSION:"2.0.0",ENV_SUFFIX:void 0,ENV_PROTOCOL:void 0,SDK_ENVIRONMENT:void 0,API_ROUTE:void 0}).ENV||"",e.ENV_DOMAIN=Object({SDK_CHANNEL:"alpha",SDK_VERSION:"2.0.0",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.SESSION_TO_SEND_STORAGE_NAME="faSessionToSend",e.LOCATION_STORAGE_NAME="faLocation",e.OPENED_BY_CAMPAIGN_STORAGE_NAME="faCampaigns",e.FAILED_REQUESTS_TO_REDEPLOY=3,e.SESSION_AUTO_UPDATE_DELAY=1e3,e.SESSION_TIMEOUT=120,e.SESSION_LOGGER_UPLOAD_DELAY=8e3,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 o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),i=n(14),a=n(33),s=n(34),u=n(8),c=n(15),l=n(16);n(39),n(40);var f=n(0),d=n(9),p=n(41),h=n(7),g=n(3),y=n(19),_=n(46),m=n(47),S=n(49),v=n(50),b=n(20),A=n(51),E=n(11),O=n(13),I=n(54),T=n(56),N=function(){function t(){this.bundleVersion="1.0",this.sessionTimeout=null,this.geolocationEnabled=!1,this.geolocationService=null,this.currentRetryCount=1,this.initialRetryDelay=1e4,this.isVerbose=!1,this.isReady=!1,this.sdkBaseUrl=null,this.deviceIdCharsCount=0,this.isDataWalletEnabled=!1,this.optInAnalyticsDefault=!0}return t.prototype.initialize=function(t){var e=this;void 0===t&&(t={}),this.setupFaDeviceConfig(t),this.windowStateHandler=new _.default,this.SOR_identifier="SOR-SDK_"+s.default.hex_md5("web"+this.bundleId),this.Gender={MALE:1,FEMALE:2,OTHER:3},this.UserAttributes=new I.default,this.optInAnalyticsDefault=!1!==t.optInAnalyticsDefault,this.onDataWalletPolicyChange=t.onDataWalletPolicyChange||function(){};var n=o.get(f.OPT_IN_ANALYTICS_NAME_KEY),r=[!0,!1].indexOf(n)>-1?n:this.optInAnalyticsDefault;this.setOptInAnalytics(r),this.isDataWalletEnabled=!0===t.isDataWalletEnabled,this.analyticsScope=t.analyticsScope||E.default.FULL,this.session=new p.default,this.registerSession(),this.sdkBaseUrl=t.sdkBaseUrl||null,this.env=t.env||f.ENV,this.envDomain=t.envDomain||f.ENV_DOMAIN,this.envProtocol=t.envProtocol||f.ENV_PROTOCOL,this.defaultIcon=t.defaultIcon||null;var i=new m.default;this.userInfo=i.getUserInfo(),this.webPushService=new A.default,this.geolocationService=new S.default(this.geolocationEnabled),this.clearFAHistoryLogQueue(),this.registerServices([i,this.geolocationService,this.windowStateHandler,new v.default,new b.default,this.webPushService]),this.listenInputChain(),this.deploy().then(function(){e.webPushService.checkOpenedByCampaign(),e.webPushService.evaluateServiceWorkerValidity(),!0===e.isDataWalletEnabled&&e.initDataWalletPolicy()})},t.prototype.setupFaDeviceConfig=function(t){void 0===t&&(t={}),u.default(this.getConfigStorage())&&(t.deviceId=T(),o.set(f.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=e.userId||t.userId,this.deviceId=e.deviceId||t.deviceId,this.env=t.env||f.ENV,this.envDomain=t.envDomain||f.ENV,this.envProtocol=t.envProtocol||f.ENV_PROTOCOL,this.bundleVersion=e.bundleVersion||t.bundleVersion,this.isVerbose=t.isVerbose||!1,this.sessionTimeout=t.sessionTimeout||f.SESSION_TIMEOUT,this.geolocationEnabled=t.geolocationEnabled||!1},t.prototype.registerServices=function(t){for(var e=y.default.initialize(),n=0;n<t.length;n+=1)e.register(t[n])},t.prototype.registerSession=function(){y.default.initialize().register(this.session)},t.prototype.listenInputChain=function(){var t=this;i.add(document,"keypress",function(e){var n=f.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=o.get(f.CONFIG_STORAGE_NAME)||{};return t?e[t]:e},t.prototype.getSession=function(){return this.session},t.prototype.getSessionLogs=function(){return o.get(f.SESSION_TO_SEND_STORAGE_NAME)||[]},t.prototype.checkUserLocation=function(){this.geolocationEnabled&&this.geolocationService.getUserLocation()},t.prototype.deploy=function(){var t={FAID:this.FAID,sdkPlatform:f.SDK_PLATFORM,sdkVersion:f.SDK_VERSION};return this.getDeployPromise(t)},t.prototype.retryDeploymentEndpoint=function(){var t=this;setTimeout(function(){t.deploy().then(function(t){return!0}).catch(function(t){return new Error("could not find correct domain")})},this.currentRetryCount*this.initialRetryDelay+1)},t.prototype.clearFAHistoryLogQueue=function(){o.remove("faLogs")},t.prototype.getDeployPromise=function(t){var e=this;return new c.Promise(function(n,r){d.default.deploy(t,function(t){e.isReady||e.session.initSession(),e.isReady=!0,y.default.initialize().notifyEveryone(new h.default(g.default.SDK_DEPLOYED,null)),t.success?(e.sdkBaseUrl=t.result.service_domain,n()):(e.sdkBaseUrl=null,e.retryDeploymentEndpoint(),e.currentRetryCount+=1,r())})})},t.prototype.registerForPushNotification=function(){var t=this;if(navigator.serviceWorker&&window.PushManager&&void 0!==this.webPushService)return this.webPushService.register().then(function(){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!0})}).catch(function(e){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!1})})},t.prototype.unregisterFromPushNotification=function(){var t=this;return this.webPushService.unsubscribe().then(function(e){t.updateStoreWithProperty("faDeviceProperties",{isRegisteredForPush:!1})})},t.prototype.isRegisteredForPushNotifications=function(){return u.default(this.getConfigStorage())?c.Promise.reject(new Error("FollowAnalytics sdk is not initialized")):(this.checkNotificationPermissionChanges(),this.hasNotificationPermission()&&!!o.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=o.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=o.get(t);o.set(t,r({},n,e))},t.prototype.setUserId=function(t){if(t!==this.userId)return null===this.userId&&null!==t?(this.userId=t,void this.updateCurrentStoreUser(t)):void this.initSession(t)},t.prototype.initSession=function(t){var e=y.default.initialize();e.notifyEveryone(new h.default(g.default.INIT_SESSION_STOP,{autoStart:!1})),this.userId=t,this.updateCurrentStoreUser(t),e.notifyEveryone(new h.default(g.default.INIT_SESSION_START,null))},t.prototype.updateCurrentStoreUser=function(t){var e=this.getConfigStorage();e&&(e.userId=t,o.set(f.CONFIG_STORAGE_NAME,e))},t.prototype.getFAID=function(){return this.FAID},t.prototype.getSdkBaseUrl=function(){return this.sdkBaseUrl},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 f.SDK_VERSION},t.prototype.getOptInAnalytics=function(){return this.optInAnalytics},t.prototype.setOptInAnalytics=function(t){t!==this.optInAnalytics&&(o.set(f.OPT_IN_ANALYTICS_NAME_KEY,t),this.optInAnalytics=t,!1===t&&this.session&&(this.session.addEvent({logName:l.default.FALogNameUserOptedOut,logDetails:null}),this.session.endSession()),!0===t&&(this.session=new p.default,this.session.initSession(),this.session.addEvent({logName:l.default.FALogNameUserOptedIn,logDetails:null})))},t.prototype.initDataWalletPolicy=function(){this.isDataWalletEnabled&&(this.lastPolicyFetchTimestamp=o.get(f.POLICY_FETCH_TIMESTAMP_KEY),this.getDataWalletPolicy())},t.prototype.getDataWalletPolicy=function(){var t=this;if(!this.isDataWalletEnabled)return console.warn("Have you forgotten to enable the Data Wallet feature?"),{version:"0.0"};var e=o.get(f.CURRENT_LOCAL_POLICY_KEY);return setTimeout(function(){if(t.policyFetchTimeHasExpired()){var n=e?e.version:"0.0",r=d.default.getApiUrl("data_wallet/policy/?bundleId="+t.bundleId+"&FAID="+t.FAID+"&if_modified_since_version="+n);d.default.getDataFrom(r,function(n){var r;try{r=JSON.parse(n)}catch(t){console.log("Unable to fetch Privacy Policy at the moment.")}if(!r)return{version:"0.0"};o.set(f.CURRENT_LOCAL_POLICY_KEY,r.result),r.result.version.endsWith(".0")&&(e?e.version:"")!==r.result.version&&(o.set(f.POLICY_IS_READ_KEY,!1),t.onDataWalletPolicyChange())})}},500),e||{version:"0.0"}},t.prototype.getDataWalletIsRead=function(){return this.isDataWalletEnabled||console.warn("Have you forgotten to enable the Data Wallet feature?"),"0.0"===(o.get(f.CURRENT_LOCAL_POLICY_KEY)||{version:"0.0"}).version||o.get(f.POLICY_IS_READ_KEY)||!1},t.prototype.setDataWalletIsRead=function(t){this.isDataWalletEnabled?this.markPolicyAsRead():console.warn("Have you forgotten to enable the Data Wallet feature?")},t.prototype.policyFetchTimeHasExpired=function(){var t=Math.round((new Date).getTime()/1e3);return this.lastPolicyFetchTimestamp?!(t-this.lastPolicyFetchTimestamp<3600||(this.setPolicyFetchTimestamp(t),0)):(this.setPolicyFetchTimestamp(t),!0)},t.prototype.setPolicyFetchTimestamp=function(t){o.set(f.POLICY_FETCH_TIMESTAMP_KEY,t),this.lastPolicyFetchTimestamp=t},t.prototype.markPolicyAsRead=function(){o.set(f.POLICY_IS_READ_KEY,!0)},t.prototype.gdprRequestToken=function(){var t=this.deviceId+":"+(this.userId||"")+":"+O.default(new Date);return a.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:O.default(new Date),packageName:this.bundleId}},t.prototype.dispatchGDPRRequest=function(t){var e=this.generateGDPRPayload();return new c.Promise(function(n,r){d.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.getStoredUserAtrributes=function(){return this.UserAttributes.getAttributesStore()},t.prototype.updateStoredUserAtrributesRemovingSent=function(t){return this.UserAttributes.updateStoredUserAtrributesRemovingSent(t)},t}();e.default=new N},function(t,e,n){var r=n(23),o=n(24),i=[n(31)];t.exports=r.createStore(o,i)},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!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.SDK_DEPLOYED=10]="SDK_DEPLOYED",t[t.APP_OPENED_FROM_PUSH=11]="APP_OPENED_FROM_PUSH"}(r||(r={})),e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19),o=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=o},function(t,e,n){(function(e){function n(t,e){return Array.prototype.slice.call(t,e||0)}function r(t,e){o(t,function(t,n){return e(t,n),!1})}function o(t,e){if(i(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 i(t){return null!=t&&"function"!=typeof t&&"number"==typeof t.length}var a=Object.assign?Object.assign:function(t,e,n,o){for(var i=1;i<arguments.length;i++)r(Object(arguments[i]),function(e,n){t[n]=e});return t},s=function(){function t(){}return Object.create?function(t,e,r,o){var i=n(arguments,1);return a.apply(this,[Object.create(t)].concat(i))}:function(e,r,o,i){var s=n(arguments,1);return t.prototype=e,a.apply(this,[new t].concat(s))}}(),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:a,create:s,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=i(t)?[]:{};return o(t,function(t,r){return n[r]=e(t,r),!1}),n},pluck:o,isList:i,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(6))},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";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){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";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(10),i=n(1),a=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,i.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 i;window.XDomainRequest?((i=new window.XDomainRequest).timeout=3e3,i.onload=function(){n&&n(JSON.parse(i.responseText)),o.default("_req :: ",i.responseText)},i.onprogress=function(){},i.ontimeout=i.onerror=function(){n&&n({error:i.responseText,success:!1})},i.open("POST",this.getApiUrl(t),!0)):((i=new XMLHttpRequest).open("POST",this.getApiUrl(t),!0),i.setRequestHeader("Content-Type","application/json; charset=utf-8")),i.onreadystatechange=function(){if(4===i.readyState)if(200===i.status)n&&n(JSON.parse(i.response)),o.default("_req :: ",i);else{var t="Bad HTTP status: "+i.status+" "+i.statusText;n&&n({error:t,success:!1})}},i.send(r)}catch(t){console.error(t)}},t.prototype.getApiUrl=function(t){var e=""+r.API_ROUTE,n="deployment"===t?"auth":this.loggerDomain,o=""===i.default.getEnv()?".":i.default.getEnv()+".",a=i.default.getEnvDomain();return i.default.getEnvProtocol()+"://"+n+o+a+"/"+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 a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!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";var r;Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.FULL="full",t.PUSH="push"}(r||(r={})),e.default=r},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!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,n){"use strict";function r(t){return("0"+t).slice(-2)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=Date.parse(t),n=new Date(e),o=n.getFullYear()+"-"+r(n.getMonth()+1)+"-"+r(n.getDate());return o=(o+="T")+r(n.getHours())+":"+r(n.getMinutes())+":"+r(n.getSeconds()),o+=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){var r,o;!function(i,a){void 0===(o="function"==typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=o)}(0,function(){function t(t,e){return function(n,r,o,i){n[t]?n[t](r,o,i):n[e]&&n[e]("on"+r,o)}}return{add:t("addEventListener","attachEvent"),remove:t("removeEventListener","detachEvent")}})},function(t,e,n){e.Promise=n(35)},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!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";Object.defineProperty(e,"__esModule",{value:!0});var r=n(42);e.default=function(t,e){for(var n=Object.keys(e),o=0;o<n.length;o+=1){var i=n[o];r(t[i])?t[i]=new Date(e[i]):t[i]=e[i]}}},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";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),o=n(3),i=n(10),a=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=o.default[t.getType()];-1===r.DEBUG_EXCLUDED_EVENTS.indexOf(e)&&i.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=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)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),a=n(0),s=n(4),u=n(3),c=n(1),l=n(9),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.handleNotification=function(t){switch(t.getType()){case u.default.ACTION_LOGGED:this.saveLog(t);break;case u.default.SESSION_UPDATED:this.saveSessionData(t);break;case u.default.SESSION_ENDED:this.markSessionAsEnded(t),this.clearSessionData()}},e.prototype.markSessionAsEnded=function(t){var e=i.get(a.SESSION_TO_SEND_STORAGE_NAME);if(e&&0!==e.length){var n=t.getPayload().id,r=e[n];r&&(r.ended=!0,e[n]=r),i.set(a.SESSION_TO_SEND_STORAGE_NAME,e)}},e.prototype.saveLog=function(t){var e=t.getPayload().sessionId,n=i.get(a.SESSION_TO_SEND_STORAGE_NAME);n||(n={}),n[e]=n[e]||{logs:[],internal_id:e,id:null,fetching:!1,ended:!1},n[e].logs.push(t.getPayload()),i.set(a.SESSION_TO_SEND_STORAGE_NAME,n),this.updateStoredSessionsMissingSessionId()},e.prototype.saveSessionData=function(t){i.set(a.SESSION_STORAGE_NAME,t.getPayload())},e.prototype.clearSessionData=function(){i.remove(a.SESSION_STORAGE_NAME)},e.prototype.updateStoredSessionsMissingSessionId=function(){for(var t=this.sessionsWithoutSessionIdNotFetching(),e=0;e<t.length;e++){var n=t[e],r=i.get(a.SESSION_TO_SEND_STORAGE_NAME);if(!r||0===r.length)return;var o=r[n];o.fetching=!0,r[n]=o,i.set(a.SESSION_TO_SEND_STORAGE_NAME,r),this.fetchAndAttributeSessionId(n)}},e.prototype.sessionsWithoutSessionIdNotFetching=function(){for(var t=i.get(a.SESSION_TO_SEND_STORAGE_NAME),e=Object.keys(t),n=[],r=0;r<e.length;r++){var o=e[r];null===t[o].id&&!1===t[o].fetching&&n.push(e[r])}return n},e.prototype.fetchAndAttributeSessionId=function(t){var e=this;if(null!==c.default.getSdkBaseUrl()&&null!==t){var n={FAID:c.default.getFAID(),sessionData:o({bundleId:c.default.getBundleId(),bundleVersion:c.default.getBundleVersion(),sessionTimeout:c.default.getSessionTimeout(),deviceId:c.default.getDeviceId(),sdkPlatform:a.SDK_PLATFORM,sdkVersion:a.SDK_VERSION,countryCode:c.default.getCountryCode()},c.default.getUserInfo())};l.default.dispatchPostRequest("sessionId",n,function(n){n&&n.result?e.updateStoredSession(t,n.result,!1):e.updateStoredSession(t,null,!1)})}},e.prototype.updateStoredSession=function(t,e,n){void 0===n&&(n=!1);var r=i.get(a.SESSION_TO_SEND_STORAGE_NAME);if(r&&0!==r.length){var o=r[t];o&&(null===e?o.fetching=!1:(o.fetching=!0,o.id=e.sessionId),r[t]=o,i.set(a.SESSION_TO_SEND_STORAGE_NAME,r))}},e}(s.default);e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),o=n(22);!window||window.hasOwnProperty("FollowAnalytics")&&!r.default(window.FollowAnalytics)||(window.FollowAnalytics=o.default)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(11),i=function(){function t(){this.DataWallet={getPolicy:function(){return r.default.getDataWalletPolicy()},isRead:function(){return r.default.getDataWalletIsRead()},setIsRead:function(t){return r.default.setDataWalletIsRead(t)}},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=o.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(){if(r.default.isReady)return r.default.getSession().getSessionData()},t.prototype.getSessionLogs=function(){if(r.default.isReady)return r.default.getSessionLogs()},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){void 0===e&&(e={});var n={logName:t,logDetails:e};r.default.getSession().addEvent(n)},t.prototype.logError=function(t,e){void 0===e&&(e={});var n={logName:t,logDetails:e};r.default.getSession().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}();e.default=new i},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+"_":"",o=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 h=c({_namespacePrefix:r,_namespaceRegexp:o,_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=i(arguments,0),r=this,o=[function(){if(n)return s(arguments,function(t,n){e[n]=t}),n.apply(r,e)}].concat(e);return t.apply(r,o)}},_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))s(t,function(t){e._addPlugin(t)});else if(!a(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");s(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)}},p,{plugins:[]});return h.raw={},s(h,function(t,e){f(t)&&(h.raw[e]=u(h,t))}),s(t,function(t){h._addStorage(t)}),s(e,function(t){h._addPlugin(t)}),h}var o=n(5),i=o.slice,a=o.pluck,s=o.each,u=o.bind,c=o.create,l=o.isList,f=o.isFunction,d=o.isObject;t.exports={createStore:r};var p={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(25),n(26),n(27),n(28),n(29),n(30)]},function(t,e,n){function r(){return i.localStorage}function o(t){return r().getItem(t)}var i=n(5).Global;t.exports={name:"localStorage",read:o,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(o(n),n)}},remove:function(t){return r().removeItem(t)},clearAll:function(){return r().clear()}}},function(t,e,n){function r(t){for(var e=i.length-1;e>=0;e--){var n=i.key(e);t(i[n],n)}}var o=n(5).Global;t.exports={name:"oldFF-globalStorage",read:function(t){return i[t]},write:function(t,e){i[t]=e},each:r,remove:function(t){return i.removeItem(t)},clearAll:function(){r(function(t,e){delete i[t]})}};var i=o.globalStorage},function(t,e,n){function r(t){return t.replace(/^\d/,"___$&").replace(c,"___")}var o=n(5).Global;t.exports={name:"oldIE-userDataStorage",write:function(t,e){if(!u){var n=r(t);s(function(t){t.setAttribute(n,e),t.save(i)})}},read:function(t){if(!u){var e=r(t),n=null;return s(function(t){n=t.getAttribute(e)}),n}},each:function(t){s(function(e){for(var n=e.XMLDocument.documentElement.attributes,r=n.length-1;r>=0;r--){var o=n[r];t(e.getAttribute(o.name),o.name)}})},remove:function(t){var e=r(t);s(function(t){t.removeAttribute(e),t.save(i)})},clearAll:function(){s(function(t){var e=t.XMLDocument.documentElement.attributes;t.load(i);for(var n=e.length-1;n>=0;n--)t.removeAttribute(e[n].name);t.save(i)})}};var i="storejs",a=o.document,s=function(){if(!a||!a.documentElement||!a.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=a.createElement("div"),t=a.body}return function(e){var r=[].slice.call(arguments,0);r.unshift(n),t.appendChild(n),n.addBehavior("#default#userData"),n.load(i),e.apply(this,r),t.removeChild(n)}}(),u=(o.navigator?o.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("="),o=unescape(r[0]);t(unescape(r[1]),o)}}function o(t){t&&i(t)&&(c.cookie=escape(t)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function i(t){return new RegExp("(?:^|;\\s*)"+escape(t).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(c.cookie)}var a=n(5),s=a.Global,u=a.trim;t.exports={name:"cookieStorage",read:function(t){if(!t||!i(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:o,clearAll:function(){r(function(t,e){o(e)})}};var c=s.document},function(t,e,n){function r(){return i.sessionStorage}function o(t){return r().getItem(t)}var i=n(5).Global;t.exports={name:"sessionStorage",read:o,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(o(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(32),{}}},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,o,i,a,s=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,a=[],"[object Array]"===Object.prototype.toString.apply(u)){for(i=u.length,n=0;n<i;n+=1)a[n]=str(n,u)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;n<i;n+=1)"string"==typeof rep[n]&&(o=str(r=rep[n],u))&&a.push(quote(r)+(gap?": ":":")+o);else for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(o=str(r,u))&&a.push(quote(r)+(gap?": ":":")+o);return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}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,o=t[e];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(void 0!==(r=walk(o,n))?o[n]=r:delete o[n]);return reviver.call(t,e,o)}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";Object.defineProperty(e,"__esModule",{value:!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),o=Array(16),i=0;i<16;i++)r[i]=909522486^n[i],o[i]=1549556828^n[i];var a=this.binb_sha256(r.concat(this.rstr2binb(e)),512+8*e.length);return this.binb2rstr(this.binb_sha256(o.concat(a),768))},t.prototype.rstr2hex=function(t){try{this.hexcase}catch(t){this.hexcase=0}for(var e,n=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",r="",o=0;o<t.length;o++)e=t.charCodeAt(o),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 o=t.charCodeAt(r)<<16|(r+1<n?t.charCodeAt(r+1)<<8:0)|(r+2<n?t.charCodeAt(r+2):0),i=0;i<4;i++)8*r+6*i>8*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63);return e},t.prototype.rstr2any=function(t,e){var n,r,o,i,a=e.length,s=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(i=Array(),o=0,n=0;n<u.length;n++)o=(o<<16)+u[n],o-=(r=Math.floor(o/a))*a,(i.length>0||r>0)&&(i[i.length]=r);s[s.length]=o,u=i}var c="";for(n=s.length-1;n>=0;n--)c+=e.charAt(s[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="",o=-1;++o<t.length;)e=t.charCodeAt(o),n=o+1<t.length?t.charCodeAt(o+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),o++),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,o,i,a,s,u,c,l,f,d,p,h=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=h[0],r=h[1],o=h[2],i=h[3],a=h[4],s=h[5],u=h[6],c=h[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(a)),this.sha256_Ch(a,s,u)),this.sha256_K[f]),g[f]),p=this.safe_add(this.sha256_Sigma0256(n),this.sha256_Maj(n,r,o)),c=u,u=s,s=a,a=this.safe_add(i,d),i=o,o=r,r=n,n=this.safe_add(d,p);h[0]=this.safe_add(n,h[0]),h[1]=this.safe_add(r,h[1]),h[2]=this.safe_add(o,h[2]),h[3]=this.safe_add(i,h[3]),h[4]=this.safe_add(a,h[4]),h[5]=this.safe_add(s,h[5]),h[6]=this.safe_add(u,h[6]),h[7]=this.safe_add(c,h[7])}return h},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";Object.defineProperty(e,"__esModule",{value:!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),o=Array(16),i=0;i<16;i++)r[i]=909522486^n[i],o[i]=1549556828^n[i];var a=this.binl_md5(r.concat(this.rstr2binl(e)),512+8*e.length);return this.binl2rstr(this.binl_md5(o.concat(a),640))},t.prototype.rstr2hex=function(t){try{this.hexcase}catch(t){this.hexcase=0}for(var e,n=this.hexcase?"0123456789ABCDEF":"0123456789abcdef",r="",o=0;o<t.length;o++)e=t.charCodeAt(o),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 o=t.charCodeAt(r)<<16|(r+1<n?t.charCodeAt(r+1)<<8:0)|(r+2<n?t.charCodeAt(r+2):0),i=0;i<4;i++)8*r+6*i>8*t.length?e+=this.b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(o>>>6*(3-i)&63);return e},t.prototype.rstr2any=function(t,e){var n,r,o,i,a,s=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(a=Array(),i=0,n=0;n<u.length;n++)i=(i<<16)+u[n],i-=(o=Math.floor(i/s))*s,(a.length>0||o>0)&&(a[a.length]=o);l[r]=i,u=a}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="",o=-1;++o<t.length;)e=t.charCodeAt(o),n=o+1<t.length?t.charCodeAt(o+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),o++),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.rstr2binl=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))<<n%32;return e},t.prototype.binl2rstr=function(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>n%32&255);return e},t.prototype.binl_md5=function(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,a=0;a<t.length;a+=16){var s=n,u=r,c=o,l=i;n=this.md5_ff(n,r,o,i,t[a+0],7,-680876936),i=this.md5_ff(i,n,r,o,t[a+1],12,-389564586),o=this.md5_ff(o,i,n,r,t[a+2],17,606105819),r=this.md5_ff(r,o,i,n,t[a+3],22,-1044525330),n=this.md5_ff(n,r,o,i,t[a+4],7,-176418897),i=this.md5_ff(i,n,r,o,t[a+5],12,1200080426),o=this.md5_ff(o,i,n,r,t[a+6],17,-1473231341),r=this.md5_ff(r,o,i,n,t[a+7],22,-45705983),n=this.md5_ff(n,r,o,i,t[a+8],7,1770035416),i=this.md5_ff(i,n,r,o,t[a+9],12,-1958414417),o=this.md5_ff(o,i,n,r,t[a+10],17,-42063),r=this.md5_ff(r,o,i,n,t[a+11],22,-1990404162),n=this.md5_ff(n,r,o,i,t[a+12],7,1804603682),i=this.md5_ff(i,n,r,o,t[a+13],12,-40341101),o=this.md5_ff(o,i,n,r,t[a+14],17,-1502002290),r=this.md5_ff(r,o,i,n,t[a+15],22,1236535329),n=this.md5_gg(n,r,o,i,t[a+1],5,-165796510),i=this.md5_gg(i,n,r,o,t[a+6],9,-1069501632),o=this.md5_gg(o,i,n,r,t[a+11],14,643717713),r=this.md5_gg(r,o,i,n,t[a+0],20,-373897302),n=this.md5_gg(n,r,o,i,t[a+5],5,-701558691),i=this.md5_gg(i,n,r,o,t[a+10],9,38016083),o=this.md5_gg(o,i,n,r,t[a+15],14,-660478335),r=this.md5_gg(r,o,i,n,t[a+4],20,-405537848),n=this.md5_gg(n,r,o,i,t[a+9],5,568446438),i=this.md5_gg(i,n,r,o,t[a+14],9,-1019803690),o=this.md5_gg(o,i,n,r,t[a+3],14,-187363961),r=this.md5_gg(r,o,i,n,t[a+8],20,1163531501),n=this.md5_gg(n,r,o,i,t[a+13],5,-1444681467),i=this.md5_gg(i,n,r,o,t[a+2],9,-51403784),o=this.md5_gg(o,i,n,r,t[a+7],14,1735328473),r=this.md5_gg(r,o,i,n,t[a+12],20,-1926607734),n=this.md5_hh(n,r,o,i,t[a+5],4,-378558),i=this.md5_hh(i,n,r,o,t[a+8],11,-2022574463),o=this.md5_hh(o,i,n,r,t[a+11],16,1839030562),r=this.md5_hh(r,o,i,n,t[a+14],23,-35309556),n=this.md5_hh(n,r,o,i,t[a+1],4,-1530992060),i=this.md5_hh(i,n,r,o,t[a+4],11,1272893353),o=this.md5_hh(o,i,n,r,t[a+7],16,-155497632),r=this.md5_hh(r,o,i,n,t[a+10],23,-1094730640),n=this.md5_hh(n,r,o,i,t[a+13],4,681279174),i=this.md5_hh(i,n,r,o,t[a+0],11,-358537222),o=this.md5_hh(o,i,n,r,t[a+3],16,-722521979),r=this.md5_hh(r,o,i,n,t[a+6],23,76029189),n=this.md5_hh(n,r,o,i,t[a+9],4,-640364487),i=this.md5_hh(i,n,r,o,t[a+12],11,-421815835),o=this.md5_hh(o,i,n,r,t[a+15],16,530742520),r=this.md5_hh(r,o,i,n,t[a+2],23,-995338651),n=this.md5_ii(n,r,o,i,t[a+0],6,-198630844),i=this.md5_ii(i,n,r,o,t[a+7],10,1126891415),o=this.md5_ii