web-push-notifications 3.24.0 → 3.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -1,10 +1,10 @@
1
- !function(root,factory){if("object"==typeof exports&&"object"==typeof module)module.exports=factory();else if("function"==typeof define&&define.amd)define([],factory);else{var a=factory();for(var i in a)("object"==typeof exports?exports:root)[i]=a[i]}}(this,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=78)}([function(module,exports,__webpack_require__){"use strict";var support=__webpack_require__(7),base64=__webpack_require__(59),nodejsUtils=__webpack_require__(31),setImmediate=__webpack_require__(100),external=__webpack_require__(26);function identity(input){return input}function stringToArrayLike(str,array){for(var i=0;i<str.length;++i)array[i]=255&str.charCodeAt(i);return array}exports.newBlob=function(part,type){exports.checkSupport("blob");try{return new Blob([part],{type:type})}catch(e){try{var builder=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return builder.append(part),builder.getBlob(type)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var arrayToStringHelper={stringifyByChunk:function(array,type,chunk){var result=[],k=0,len=array.length;if(len<=chunk)return String.fromCharCode.apply(null,array);for(;k<len;)"array"===type||"nodebuffer"===type?result.push(String.fromCharCode.apply(null,array.slice(k,Math.min(k+chunk,len)))):result.push(String.fromCharCode.apply(null,array.subarray(k,Math.min(k+chunk,len)))),k+=chunk;return result.join("")},stringifyByChar:function(array){for(var resultStr="",i=0;i<array.length;i++)resultStr+=String.fromCharCode(array[i]);return resultStr},applyCanBeUsed:{uint8array:function(){try{return support.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return support.nodebuffer&&1===String.fromCharCode.apply(null,nodejsUtils.allocBuffer(1)).length}catch(e){return!1}}()}};function arrayLikeToString(array){var chunk=65536,type=exports.getTypeOf(array),canUseApply=!0;if("uint8array"===type?canUseApply=arrayToStringHelper.applyCanBeUsed.uint8array:"nodebuffer"===type&&(canUseApply=arrayToStringHelper.applyCanBeUsed.nodebuffer),canUseApply)for(;chunk>1;)try{return arrayToStringHelper.stringifyByChunk(array,type,chunk)}catch(e){chunk=Math.floor(chunk/2)}return arrayToStringHelper.stringifyByChar(array)}function arrayLikeToArrayLike(arrayFrom,arrayTo){for(var i=0;i<arrayFrom.length;i++)arrayTo[i]=arrayFrom[i];return arrayTo}exports.applyFromCharCode=arrayLikeToString;var transform={};transform.string={string:identity,array:function(input){return stringToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return transform.string.uint8array(input).buffer},uint8array:function(input){return stringToArrayLike(input,new Uint8Array(input.length))},nodebuffer:function(input){return stringToArrayLike(input,nodejsUtils.allocBuffer(input.length))}},transform.array={string:arrayLikeToString,array:identity,arraybuffer:function(input){return new Uint8Array(input).buffer},uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.arraybuffer={string:function(input){return arrayLikeToString(new Uint8Array(input))},array:function(input){return arrayLikeToArrayLike(new Uint8Array(input),new Array(input.byteLength))},arraybuffer:identity,uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(new Uint8Array(input))}},transform.uint8array={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return input.buffer},uint8array:identity,nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.nodebuffer={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return transform.nodebuffer.uint8array(input).buffer},uint8array:function(input){return arrayLikeToArrayLike(input,new Uint8Array(input.length))},nodebuffer:identity},exports.transformTo=function(outputType,input){if(input||(input=""),!outputType)return input;exports.checkSupport(outputType);var inputType=exports.getTypeOf(input);return transform[inputType][outputType](input)},exports.getTypeOf=function(input){return"string"==typeof input?"string":"[object Array]"===Object.prototype.toString.call(input)?"array":support.nodebuffer&&nodejsUtils.isBuffer(input)?"nodebuffer":support.uint8array&&input instanceof Uint8Array?"uint8array":support.arraybuffer&&input instanceof ArrayBuffer?"arraybuffer":void 0},exports.checkSupport=function(type){if(!support[type.toLowerCase()])throw new Error(type+" is not supported by this platform")},exports.MAX_VALUE_16BITS=65535,exports.MAX_VALUE_32BITS=-1,exports.pretty=function(str){var code,i,res="";for(i=0;i<(str||"").length;i++)res+="\\x"+((code=str.charCodeAt(i))<16?"0":"")+code.toString(16).toUpperCase();return res},exports.delay=function(callback,args,self){setImmediate(function(){callback.apply(self||null,args||[])})},exports.inherits=function(ctor,superCtor){var Obj=function(){};Obj.prototype=superCtor.prototype,ctor.prototype=new Obj},exports.extend=function(){var i,attr,result={};for(i=0;i<arguments.length;i++)for(attr in arguments[i])arguments[i].hasOwnProperty(attr)&&void 0===result[attr]&&(result[attr]=arguments[i][attr]);return result},exports.prepareContent=function(name,inputData,isBinary,isOptimizedBinaryString,isBase64){return external.Promise.resolve(inputData).then(function(data){return support.blob&&(data instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(data)))&&"undefined"!=typeof FileReader?new external.Promise(function(resolve,reject){var reader=new FileReader;reader.onload=function(e){resolve(e.target.result)},reader.onerror=function(e){reject(e.target.error)},reader.readAsArrayBuffer(data)}):data}).then(function(data){var dataType=exports.getTypeOf(data);return dataType?("arraybuffer"===dataType?data=exports.transformTo("uint8array",data):"string"===dataType&&(isBase64?data=base64.decode(data):isBinary&&!0!==isOptimizedBinaryString&&(data=function(str){return stringToArrayLike(str,support.uint8array?new Uint8Array(str.length):new Array(str.length))}(data))),data):external.Promise.reject(new Error("Can't read the data of '"+name+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_SERVICE_WORKER_URL="/pushwoosh-service-worker.js",exports.DEFAULT_API_URL="https://cp.pushwoosh.com/json/1.3/",exports.FACEBOOK_APP_ID="436711767081797",exports.FACEBOOK_HWID_KEY="FACEBOOK_HWID_KEY",exports.PERIOD_SEND_APP_OPEN=36e5,exports.PERIOD_GOAL_EVENT=864e5,exports.DEFAULT_NOTIFICATION_DURATION=10,exports.MIN_NOTIFICATION_DURATION=10,exports.MAX_NOTIFICATION_DURATION=55,exports.WAKE_UP_SERVICE_WORKER_INTERVAL=20,exports.DEFAULT_NOTIFICATION_TITLE="Pushwoosh notification",exports.DEFAULT_NOTIFICATION_IMAGE="https://cp.pushwoosh.com/img/logo-medium.png",exports.DEFAULT_NOTIFICATION_URL="/",exports.KEY_API_PARAMS="API_PARAMS",exports.KEY_INIT_PARAMS="INIT_PARAMS",exports.KEY_SDK_VERSION="SDK_VERSION",exports.KEY_WORKER_VERSION="WORKER_VERSION",exports.KEY_LAST_SENT_APP_OPEN="LAST_SENT_APP_OPEN",exports.KEY_LAST_OPEN_MESSAGE="LAST_OPEN_MESSAGE",exports.KEY_API_BASE_URL="API_BASE_URL",exports.KEY_SHOW_SUBSCRIBE_WIDGET="WIDGET_SHOWED",exports.KEY_CLICK_SUBSCRIBE_WIDGET="WIDGET_CLICKED",exports.KEY_DELAYED_EVENT="DELAYED_EVENT",exports.KEY_COMMUNICATION_ENABLED="COMMUNICATION_ENABLED",exports.KEY_DEVICE_DATA_REMOVED="DEVICE_DATA_REMOVED",exports.KEY_INTERNAL_EVENTS="INTERNAL_EVENTS",exports.KEY_UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS="UNSUBSCRIBED_DUE_TO_UNDEFINED_KEYS",exports.KEY_FAKE_PUSH_TOKEN="fakePushToken",exports.KEY_DEVICE_REGISTRATION_STATUS="deviceRegistrationStatus",exports.KEY_SAFARI_PREVIOUS_PERMISSION="safariPreviousPermission",exports.MANUAL_SET_LOGGER_LEVEL="PW_SET_LOGGER_LEVEL",exports.DEVICE_REGISTRATION_STATUS_REGISTERED="registered",exports.DEVICE_REGISTRATION_STATUS_UNREGISTERED="unregistered",exports.KEY_SENDER_ID="GCM_SENDER_ID",exports.KEY_FCM_SUBSCRIPTION="FCM_SUBSCRIPTION",exports.PERMISSION_DENIED="denied",exports.PERMISSION_GRANTED="granted",exports.PERMISSION_PROMPT="default",exports.EVENT_ON_LOAD="onLoad",exports.EVENT_ON_READY="onReady",exports.EVENT_ON_SUBSCRIBE="onSubscribe",exports.EVENT_ON_UNSUBSCRIBE="onUnsubscribe",exports.EVENT_ON_REGISTER="onRegister",exports.EVENT_ON_PERMISSION_PROMPT="onPermissionPrompt",exports.EVENT_ON_PERMISSION_DENIED="onPermissionDenied",exports.EVENT_ON_PERMISSION_GRANTED="onPermissionGranted",exports.EVENT_ON_SW_INIT_ERROR="onSWInitError",exports.EVENT_ON_PUSH_DELIVERY="onPushDelivery",exports.EVENT_ON_NOTIFICATION_CLICK="onNotificationClick",exports.EVENT_ON_NOTIFICATION_CLOSE="onNotificationClose",exports.EVENT_ON_CHANGE_COMMUNICATION_ENABLED="onChangeCommunicationEnabled",exports.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE="onPutNewMessageToInboxStore",exports.EVENT_ON_UPDATE_INBOX_MESSAGES="onUpdateInboxMessages",exports.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG="onShowNotificationPermissionDialog",exports.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG="onHideNotificationPermissionDialog",exports.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET="onShowSubscriptionWidget",exports.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET="onHideSubscriptionWidget",exports.EVENT_SHOW_SUBSCRIBE_BUTTON="showSubscribeButton",exports.EVENT_CLICK_SUBSCRIBE_BUTTON="clickSubscribeButton",exports.EVENT_GDPR_CONSENT="GDPRConsent",exports.EVENT_GDPR_DELETE="GDPRDelete",exports.EVENT_PW_SITE_OPENED="PW_SiteOpened",exports.MANUAL_UNSUBSCRIBE="MANUAL_UNSUBSCRIBE",exports.PAGE_VISITED_URL="PAGE_VISITED_URL",exports.CHANNELS="CHANNELS",exports.SUBSCRIPTION_SEGMENT_EVENT="Subscription Segments",exports.SUBSCRIPTION_WIDGET_USE_CASE_NOT_SET="not-set",exports.SUBSCRIPTION_WIDGET_USE_CASE_NOT_USED="not-used",exports.SUBSCRIPTION_WIDGET_USE_CASE_DEFAULT="default",exports.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED="topic-based",exports.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG={headerText:"Subscribe to our news",headerTextColor:"#000000",subheaderText:"Don't miss out on the latest news and updates!",subheaderTextColor:"#000000",buttonAcceptText:"Agree",buttonAcceptTextColor:"#1A72E8",buttonAcceptRound:"4px",buttonAcceptBackgroundColor:"#FFFFFF",buttonAcceptBorderColor:"#E3E4E8",buttonCancelText:"Deny",buttonCancelTextColor:"#1A72E8",buttonCancelRound:"4px",buttonCancelBackgroundColor:"#FFFFFF",buttonCancelBorderColor:"#E3E4E8",cappingCount:3,cappingDelay:144e5,backgroundColor:"#FFFFFF"}},function(module,exports,__webpack_require__){"use strict";function GenericWorker(name){this.name=name||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}GenericWorker.prototype={push:function(chunk){this.emit("data",chunk)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(name,listener){return this._listeners[name].push(listener),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(name,arg){if(this._listeners[name])for(var i=0;i<this._listeners[name].length;i++)this._listeners[name][i].call(this,arg)},pipe:function(next){return next.registerPrevious(this)},registerPrevious:function(previous){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=previous.streamInfo,this.mergeStreamInfo(),this.previous=previous;var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.end()}),previous.on("error",function(e){self.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var withError=!1;return this.generatedError&&(this.error(this.generatedError),withError=!0),this.previous&&this.previous.resume(),!withError},flush:function(){},processChunk:function(chunk){this.push(chunk)},withStreamInfo:function(key,value){return this.extraStreamInfo[key]=value,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var key in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(key)&&(this.streamInfo[key]=this.extraStreamInfo[key])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var me="Worker "+this.name;return this.previous?this.previous+" -> "+me:me}},module.exports=GenericWorker},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},__rest=this&&this.__rest||function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t};Object.defineProperty(exports,"__esModule",{value:!0});var databasePromise,version_1=__webpack_require__(18),MigrationExecutor_1=__webpack_require__(19),constants_1=__webpack_require__(9);function onversionchange(database,event){console.info("onversionchange",event),database.close()}function getInstance(){return databasePromise||(databasePromise=new Promise(function(resolve,reject){var request=indexedDB.open("PUSHWOOSH_SDK_STORE",version_1.default);request.onsuccess=function(event){var database=event.target.result;database.onversionchange=onversionchange.bind(null,database,reject),resolve(database)},request.onerror=function(){return reject(request.error)},request.onupgradeneeded=function(event){var database=event.target.result;database.onversionchange=onversionchange.bind(null,database,reject),new MigrationExecutor_1.default(database).applyMigrations()}})),databasePromise}function getInstanceWithPromise(executor){return getInstance().then(function(database){return new Promise(function(resolve,reject){return executor(database,resolve,reject)})})}exports.getInstance=getInstance;var LogBase=function(){function LogBase(){}return LogBase.prototype._add=function(obj){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var request=database.transaction([_this.name],"readwrite").objectStore(_this.name).add(obj);request.onsuccess=function(){resolve(obj)},request.onerror=function(){reject(request.error)}}).then(function(obj){return _this.getAll().then(function(items){if(Array.isArray(items)){var ids=items.map(function(i){return i.id}).sort(function(a,b){return a==b?0:a<b?1:-1});if(ids.length>_this.maxItems)return Promise.all(ids.slice(_this.maxItems).map(function(id){return _this.delete(id)})).then(function(){return obj})}return obj})})},LogBase.prototype.delete=function(key){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var request=database.transaction([_this.name],"readwrite").objectStore(_this.name).delete(key);request.onsuccess=function(){resolve(request.result)},request.onerror=function(){reject(request.error)}})},LogBase.prototype.getAll=function(){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var result=[],cursor=database.transaction(_this.name).objectStore(_this.name).openCursor();cursor.onsuccess=function(ev){var cursorResult=ev.target.result;cursorResult?(cursorResult.value&&result.push(cursorResult.value),cursorResult.continue()):resolve(result)},cursor.onerror=function(){reject(cursor.error)}})},LogBase}();exports.LogBase=LogBase;var LogLog=function(_super){function LogLog(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.name=constants_1.STORE_NAME_MAIN_LOG,_this.maxItems=100,_this.environment="undefined"!=typeof self&&self.registration?"worker":"browser",_this}return __extends(LogLog,_super),LogLog.prototype.add=function(type,message,additional){var obj={type:type,environment:this.environment,message:""+message,date:new Date};return message instanceof Error&&(obj.stack=message.stack),additional&&(obj.additional=additional),this._add(obj)},LogLog}(LogBase);exports.LogLog=LogLog;var LogMessage=function(_super){function LogMessage(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.name=constants_1.STORE_NAME_MESSAGE_LOG,_this.maxItems=25,_this}return __extends(LogMessage,_super),LogMessage.prototype.add=function(log){return this._add(__assign(__assign({},log),{date:new Date}))},LogMessage}(LogBase);exports.LogMessage=LogMessage,exports.keyValue=function(name){return{get:function(key,defaultValue){return getInstanceWithPromise(function(database,resolve,reject){var timeout,request=database.transaction(name).objectStore(name).get(key),isComplete=!1,isError=!1,check=function(){if(clearTimeout(timeout),isComplete){var result=request.result;resolve(result&&result.value||defaultValue)}else isError?reject(request.error):timeout=setTimeout(check,0)};request.onsuccess=function(){return isComplete=!0},request.onerror=function(){return isError=!0},check()})},getAll:function(){return getInstanceWithPromise(function(database,resolve,reject){var timeout,result={},cursor=database.transaction(name).objectStore(name).openCursor(),isComplete=!1,isError=!1,check=function(){clearTimeout(timeout),isComplete?resolve(result):isError?reject(cursor.error):timeout=setTimeout(check,0)};cursor.onsuccess=function(event){var cursorResult=event.target.result;cursorResult?(result[cursorResult.key]=cursorResult.value.value,cursorResult.continue()):isComplete=!0},cursor.onerror=function(){return isError=!0},check()})},extend:function(key,value){return __awaiter(this,void 0,void 0,function(){var oldValues,newValues;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.get(key)];case 1:return oldValues=_a.sent(),newValues=__rest(value,[]),[4,this.set(key,__assign(__assign({},oldValues),newValues))];case 2:return _a.sent(),[2]}})})},set:function(key,value){return getInstanceWithPromise(function(database,resolve,reject){var timeout,request=database.transaction([name],"readwrite").objectStore(name).put({key:key,value:value}),isComplete=!1,isError=!1,check=function(){clearTimeout(timeout),isComplete?resolve(key):isError?reject(request.error):timeout=setTimeout(check,0)};request.onsuccess=function(){return isComplete=!0},request.onerror=function(){return isError=!0},check()})}}}(constants_1.STORE_NAME_KEY_VALUE),exports.log=new LogLog,exports.message=new LogMessage},function(module,exports,__webpack_require__){"use strict";var __spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0});var storage_1=__webpack_require__(3),levels={error:1,info:2,debug:3},limitLevel=3;__webpack_require__(10).patchConsole();var Logger={setLevel:function(level){levels[level]||(level="error"),limitLevel=levels[level]},write:function(type,message,additional){return"error"===type?this.error(message):this.info(message),storage_1.log.add(type,message,additional)}};exports.Logger=Logger,Object.keys(levels).forEach(function(levelName){var levelNumber=levels[levelName];Logger[levelName]=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];levelNumber<=limitLevel&&(console.groupCollapsed(levelName),console.info.apply(console,__spreadArrays([""],args)),console.trace("trace"),console.groupEnd())}}),exports.logAndThrowError=function(error){var logText=new Error(error);throw Logger.write("error",logText,"logAndThrowError"),logText},exports.logAndRejectError=function(error,reject){var logText=new Error(error);Logger.write("error",logText,"logAndRejectError"),reject(logText)}},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var storage_1=__webpack_require__(3),CONSTANTS=__webpack_require__(1),Data=function(){function Data(store){void 0===store&&(store=storage_1.keyValue),this.store=store}return Data.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationCode",void 0)];case 1:return _a.sent(),[4,this.store.set("params.hwid",void 0)];case 2:return _a.sent(),[4,this.store.set("params.deviceType",void 0)];case 3:return _a.sent(),[4,this.store.set("params.deviceModel",void 0)];case 4:return _a.sent(),[4,this.store.set("params.language",void 0)];case 5:return _a.sent(),[4,this.store.set("params.apiEntrypoint",void 0)];case 6:return _a.sent(),[4,this.store.set("params.tokens",void 0)];case 7:return _a.sent(),[4,this.store.set("params.applicationServerKey",void 0)];case 8:return _a.sent(),[4,this.store.set("params.senderId",void 0)];case 9:return _a.sent(),[4,this.store.set("params.webSitePushId",void 0)];case 10:return _a.sent(),[4,this.store.set("params.defaultNotificationImage",void 0)];case 11:return _a.sent(),[4,this.store.set("params.defaultNotificationTitle",void 0)];case 12:return _a.sent(),[4,this.store.set("params.userId",void 0)];case 13:return _a.sent(),[4,this.store.set("params.userIdWasChanged",void 0)];case 14:return _a.sent(),[4,this.store.set("params.isLastPermissionStatus",void 0)];case 15:return _a.sent(),[4,this.store.set("params.isManualUnsubscribed",void 0)];case 16:return _a.sent(),[4,this.store.set("params.isCommunicationDisabled",void 0)];case 17:return _a.sent(),[4,this.store.set("params.isDropAllData",void 0)];case 18:return _a.sent(),[4,this.store.set("params.sdkVersion",void 0)];case 19:return _a.sent(),[4,this.store.set("params.serviceWorkerVersion",void 0)];case 20:return _a.sent(),[4,this.store.set("params.serviceWorkerUrl",void 0)];case 21:return _a.sent(),[4,this.store.set("params.serviceWorkerScope",void 0)];case 22:return _a.sent(),[4,this.store.set("params.lastOpenMessage",void 0)];case 23:return _a.sent(),[4,this.store.set("params.lastOpenApplicationTime",void 0)];case 24:return _a.sent(),[4,this.store.set("params.features",void 0)];case 25:return _a.sent(),[4,this.store.set("params.init",void 0)];case 26:return _a.sent(),[4,this.store.set("API_PARAMS",void 0)];case 27:return _a.sent(),[4,this.store.set("SENDER_ID",void 0)];case 28:return _a.sent(),[4,this.store.set("COMMUNICATION_ENABLED",void 0)];case 29:return _a.sent(),[4,this.store.set("DEVICE_DATA_REMOVED",void 0)];case 30:return _a.sent(),[4,this.store.set("LAST_OPEN_MESSAGE",void 0)];case 31:return _a.sent(),[4,this.store.set("DELAYED_EVENT",void 0)];case 32:return _a.sent(),[2]}})})},Data.prototype.setApplicationCode=function(application){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationCode",application)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApplicationCode=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.applicationCode")];case 1:return[2,_a.sent()]}})})},Data.prototype.setHwid=function(hwid){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.hwid",hwid)];case 1:return _a.sent(),[2]}})})},Data.prototype.getHwid=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.hwid")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDeviceType=function(type){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.deviceType",type)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDeviceType=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.deviceType")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDeviceModel=function(model){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.deviceModel",model)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDeviceModel=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.deviceModel")];case 1:return[2,_a.sent()]}})})},Data.prototype.setLanguage=function(language){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.language",language)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLanguage=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.language","en")];case 1:return[2,_a.sent()]}})})},Data.prototype.setApiEntrypoint=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.apiEntrypoint",url)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApiEntrypoint=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.apiEntrypoint",CONSTANTS.DEFAULT_API_URL)];case 1:return[2,_a.sent()]}})})},Data.prototype.setTokens=function(tokens){return __awaiter(this,void 0,void 0,function(){var hwid;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getHwid()];case 1:return hwid=_a.sent(),[4,this.store.set("API_PARAMS",__assign({hwid:hwid},tokens))];case 2:return _a.sent(),[4,this.store.set("params.tokens",tokens)];case 3:return _a.sent(),[2]}})})},Data.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("API_PARAMS")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.tokens")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setApplicationServerKey=function(key){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationServerKey",key)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApplicationServerKey=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.applicationServerKey")];case 1:return[2,_a.sent()]}})})},Data.prototype.setSenderId=function(senderId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("GCM_SENDER_ID",senderId)];case 1:return _a.sent(),[4,this.store.set("params.senderId",senderId)];case 2:return _a.sent(),[2]}})})},Data.prototype.getSenderId=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("GCM_SENDER_ID")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.senderId")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setWebSitePushId=function(senderId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.webSitePushId",senderId)];case 1:return _a.sent(),[2]}})})},Data.prototype.getWebSitePushId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.webSitePushId")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDefaultNotificationImage=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.defaultNotificationImage",url)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDefaultNotificationImage=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.defaultNotificationImage",CONSTANTS.DEFAULT_NOTIFICATION_IMAGE)];case 1:return[2,_a.sent()]}})})},Data.prototype.setDefaultNotificationTitle=function(text){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.defaultNotificationTitle",text)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDefaultNotificationTitle=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.defaultNotificationTitle",CONSTANTS.DEFAULT_NOTIFICATION_TITLE)];case 1:return[2,_a.sent()]}})})},Data.prototype.setUserId=function(userId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return userId?[3,2]:[4,this.store.set("params.userId",void 0)];case 1:return _a.sent(),[2];case 2:return[4,this.store.set("params.userId",userId.toString())];case 3:return _a.sent(),[2]}})})},Data.prototype.getUserId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.userId")];case 1:return[2,_a.sent()]}})})},Data.prototype.setStatusUserIdWasChanged=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.userIdWasChanged",status)];case 1:return _a.sent(),[2]}})})},Data.prototype.getStatusUserIdWasChanged=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.userIdWasChanged",!1)];case 1:return[2,_a.sent()]}})})},Data.prototype.setLastPermissionStatus=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.isLastPermissionStatus",status)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLastPermissionStatus=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.isLastPermissionStatus")];case 1:return[2,_a.sent()]}})})},Data.prototype.setStatusManualUnsubscribed=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("MANUAL_UNSUBSCRIBE",status)];case 1:return _a.sent(),[4,this.store.set("params.isManualUnsubscribed",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("MANUAL_UNSUBSCRIBE",!1)];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isManualUnsubscribed",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setStatusCommunicationDisabled=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("COMMUNICATION_ENABLED",status?0:1)];case 1:return _a.sent(),[4,this.store.set("params.isCommunicationDisabled",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusCommunicationDisabled=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("COMMUNICATION_ENABLED")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isCommunicationDisabled",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:0==oldValue]}})})},Data.prototype.setStatusDropAllData=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("DEVICE_DATA_REMOVED",status)];case 1:return _a.sent(),[4,this.store.set("params.isDropAllData",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusDropAllData=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("DEVICE_DATA_REMOVED",!1)];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isDropAllData",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setSdkVersion=function(version){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.sdkVersion",version)];case 1:return _a.sent(),[2]}})})},Data.prototype.getSdkVersion=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.sdkVersion")];case 1:return[2,_a.sent()]}})})},Data.prototype.setServiceWorkerVersion=function(version){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("WORKER_VERSION",version)];case 1:return _a.sent(),[4,this.store.set("params.serviceWorkerVersion",version)];case 2:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerVersion=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("WORKER_VERSION")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.serviceWorkerVersion")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setServiceWorkerUrl=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return url?[4,this.store.set("params.serviceWorkerUrl",url)]:[2];case 1:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerUrl=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.serviceWorkerUrl",CONSTANTS.DEFAULT_SERVICE_WORKER_URL)];case 1:return[2,_a.sent()]}})})},Data.prototype.setServiceWorkerScope=function(scope){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return scope?[4,this.store.set("params.serviceWorkerScope",scope)]:[2];case 1:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerScope=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.serviceWorkerScope")];case 1:return[2,_a.sent()]}})})},Data.prototype.setLastOpenMessage=function(message){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("LAST_OPEN_MESSAGE",message)];case 1:return _a.sent(),[4,this.store.set("params.lastOpenMessage",message)];case 2:return _a.sent(),[2]}})})},Data.prototype.getLastOpenMessage=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("LAST_OPEN_MESSAGE")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.lastOpenMessage")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setLastOpenApplicationTime=function(time){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.lastOpenApplicationTime",time)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLastOpenApplicationTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.lastOpenApplicationTime")];case 1:return[2,_a.sent()]}})})},Data.prototype.setFeatures=function(features){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.features",features)];case 1:return _a.sent(),[2]}})})},Data.prototype.getFeatures=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.features")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInitParams=function(params){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.init",params)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInitParams=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.init")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInboxLastRequestCode=function(lastCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.lastRequestCode",lastCode)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxLastRequestCode=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.inbox.lastRequestCode","")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInboxLastRequestTime=function(lastRequestTime){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.lastRequestTime",lastRequestTime)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxLastRequestTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inbox.lastRequestTime",0)]})})},Data.prototype.setInboxNewMessagesCount=function(count){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.newMessagesCount",count)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxNewMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inbox.newMessagesCount",0)]})})},Data.prototype.setDelayedEvent=function(event){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("DELAYED_EVENT",event)];case 1:return _a.sent(),[4,this.store.set("params.delayedEvent",event)];case 2:return _a.sent(),[2]}})})},Data.prototype.getDelayedEvent=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("DELAYED_EVENT")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.delayedEvent")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setInApps=function(inApps){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inApps",inApps)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInApps=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inApps")]})})},Data.prototype.setPromptDisplayCount=function(count){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.promptDisplayCount",count)];case 1:return _a.sent(),[2]}})})},Data.prototype.getPromptDisplayCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.promptDisplayCount",0)]})})},Data.prototype.setPromptLastSeenTime=function(time){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.promptLastSeenTime",time)];case 1:return _a.sent(),[2]}})})},Data.prototype.getPromptLastSeenTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.promptLastSeenTime",0)]})})},Data}();exports.Data=Data},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var DateModule=function(){function DateModule(date){void 0===date&&(date=new Date),this._date=date}return Object.defineProperty(DateModule.prototype,"date",{get:function(){return this._date},set:function(date){this._date=date},enumerable:!0,configurable:!0}),DateModule.prototype.getUtcTimestamp=function(){return Math.floor((this.date.getTime()+60*this.date.getTimezoneOffset()*1e3)/1e3)},DateModule.prototype.getTimestamp=function(){return Math.round(this.date.getTime()/1e3)},DateModule.prototype.setLocal=function(){var newDateTimestamp=this._date.getTime()-60*this.date.getTimezoneOffset()*1e3;this._date=new Date(newDateTimestamp)},DateModule.prototype.addDays=function(days){var newDateTimestamp=this._date.getTime()+24*days*60*60*1e3;this._date=new Date(newDateTimestamp)},DateModule.prototype.getInboxFakeOrder=function(){return(100*this._date.getTime()+9e9).toString()},DateModule}();exports.default=DateModule},function(module,exports,__webpack_require__){"use strict";(function(Buffer){if(exports.base64=!0,exports.array=!0,exports.string=!0,exports.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,exports.nodebuffer=void 0!==Buffer,exports.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)exports.blob=!1;else{var buffer=new ArrayBuffer(0);try{exports.blob=0===new Blob([buffer],{type:"application/zip"}).size}catch(e){try{var builder=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);builder.append(buffer),exports.blob=0===builder.getBlob("application/zip").size}catch(e){exports.blob=!1}}}try{exports.nodestream=!!__webpack_require__(52).Readable}catch(e){exports.nodestream=!1}}).call(this,__webpack_require__(23).Buffer)},function(module,exports,__webpack_require__){"use strict";var TYPED_OK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function _has(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)}exports.assign=function(obj){for(var sources=Array.prototype.slice.call(arguments,1);sources.length;){var source=sources.shift();if(source){if("object"!=typeof source)throw new TypeError(source+"must be non-object");for(var p in source)_has(source,p)&&(obj[p]=source[p])}}return obj},exports.shrinkBuf=function(buf,size){return buf.length===size?buf:buf.subarray?buf.subarray(0,size):(buf.length=size,buf)};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray)dest.set(src.subarray(src_offs,src_offs+len),dest_offs);else for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){var i,l,len,pos,chunk,result;for(len=0,i=0,l=chunks.length;i<l;i++)len+=chunks[i].length;for(result=new Uint8Array(len),pos=0,i=0,l=chunks.length;i<l;i++)chunk=chunks[i],result.set(chunk,pos),pos+=chunk.length;return result}},fnUntyped={arraySet:function(dest,src,src_offs,len,dest_offs){for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){return[].concat.apply([],chunks)}};exports.setTyped=function(on){on?(exports.Buf8=Uint8Array,exports.Buf16=Uint16Array,exports.Buf32=Int32Array,exports.assign(exports,fnTyped)):(exports.Buf8=Array,exports.Buf16=Array,exports.Buf32=Array,exports.assign(exports,fnUntyped))},exports.setTyped(TYPED_OK)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.STORE_NAME_KEY_VALUE="keyValue",exports.STORE_NAME_MESSAGE_LOG="messages",exports.STORE_NAME_MAIN_LOG="log",exports.STORE_NAME_INBOX_MESSAGES="inboxMessages",exports.KEY_PATH_BASE_INCREMENT="id"},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t};Object.defineProperty(exports,"__esModule",{value:!0});var storage_1=__webpack_require__(3),constants_1=__webpack_require__(1),PlatformChecker_1=__webpack_require__(21);function getGlobal(){return Function("return this")()}function createUUID(pushToken){for(var s="",i=0;i<32;i++){var l=pushToken.length-i-1,charCode=0;l>=0&&(charCode=pushToken.charCodeAt(l)),s+="0123456789abcdef".substr(charCode%"0123456789abcdef".length,1)}return s}function getFakePushToken(){return localStorage.getItem(constants_1.KEY_FAKE_PUSH_TOKEN)}function generateFakePushToken(){var token=function(len){len=len||32;for(var text="",possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=0;i<len;i++)text+=possible.charAt(Math.floor(Math.random()*possible.length));return text}();return localStorage.setItem(constants_1.KEY_FAKE_PUSH_TOKEN,token),token}function getSubsKey(pushSubscription,key){var rawKey=pushSubscription&&pushSubscription.getKey&&pushSubscription.getKey(key);return rawKey?btoa(String.fromCharCode.apply(String,new Uint8Array(rawKey))):""}exports.getGlobal=getGlobal,exports.getVersion=function(){return"3.24.0"},exports.parseSerializedNotificationParams=function(param,defaultValue){if("string"==typeof param)try{return JSON.parse(param)}catch(e){console.log(e)}return void 0===param&&void 0!==defaultValue?defaultValue:param},exports.urlB64ToUint8Array=function(base64String){for(var base64=(base64String+"=".repeat((4-base64String.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),rawData=window.atob(base64),outputArray=new Uint8Array(rawData.length),i=0;i<rawData.length;++i)outputArray[i]=rawData.charCodeAt(i);return outputArray},exports.createUUID=createUUID,exports.generateHwid=function(applicationCode,pushToken){return applicationCode+"_"+createUUID(pushToken=getFakePushToken()||pushToken||generateFakePushToken())},exports.getFakePushToken=getFakePushToken,exports.generateFakePushToken=generateFakePushToken,exports.getPushToken=function(pushSubscription){return pushSubscription?pushSubscription.subscriptionId?pushSubscription.subscriptionId:12===PlatformChecker_1.default.platform?pushSubscription.endpoint:pushSubscription.endpoint.split("/").pop()||"":""},exports.getFcmKey=function(pushSubscription,key){return pushSubscription?new Promise(function(resolve){storage_1.keyValue.get(constants_1.KEY_FCM_SUBSCRIPTION).then(function(fcmSubscription){resolve(fcmSubscription&&fcmSubscription[key]||"")}).catch(function(){resolve("")})}):Promise.resolve("")},exports.getAuthToken=function(pushSubscription){return getSubsKey(pushSubscription,"auth")},exports.getPublicKey=function(pushSubscription){return getSubsKey(pushSubscription,"p256dh")},exports.getPushwooshUrl=function(applicationCode){var url=applicationCode&&!~applicationCode.indexOf(".")?"https://"+applicationCode+".api.pushwoosh.com/json/1.3/":"https://cp.pushwoosh.com/json/1.3/";return storage_1.keyValue.get(constants_1.KEY_API_BASE_URL).then(function(base_url){return void 0===base_url&&(base_url=null),base_url||url}).catch(function(){return url})},exports.patchConsole=function(){for(var method,noop=function(){},methods=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],len=methods.length,global=getGlobal(),console=global.console=global.console||{};len--;)console[method=methods[len]]||(console[method]=noop)},exports.clearLocationHash=function(){"history"in getGlobal()&&history.pushState?history.pushState(null,"","#"):location.hash="#"},exports.validateParams=function(params){var result=__rest(params,[]);return result.userId&&"user_id"===result.userId&&delete result.userId,result},exports.sendInternalPostEvent=function(params){storage_1.keyValue.get(constants_1.KEY_INTERNAL_EVENTS).then(function(events){var _a;void 0===events&&(events={}),0===Object.keys(events).length&&storage_1.keyValue.set(constants_1.KEY_INTERNAL_EVENTS,{});var currentDate=(new Date).setHours(0,0,0,0),dateFromStore=events[params.event];if(!dateFromStore||currentDate>dateFromStore){storage_1.keyValue.extend(constants_1.KEY_INTERNAL_EVENTS,((_a={})[params.event]=currentDate,_a));var xhr=new XMLHttpRequest,request=__assign({application:"DD275-06947"},params);xhr.open("POST","https://cp.pushwoosh.com/json/1.3/postEvent",!0),xhr.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),xhr.send(JSON.stringify({request:request}))}})},exports.generateUUID=function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})}},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(29),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=Object.create(__webpack_require__(25));util.inherits=__webpack_require__(15);var Readable=__webpack_require__(53),Writable=__webpack_require__(43);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&!1===options.readable&&(this.readable=!1),options&&!1===options.writable&&(this.writable=!1),this.allowHalfOpen=!0,options&&!1===options.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self){self.end()}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(value){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=value,this._writableState.destroyed=value)}}),Duplex.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}},function(module,exports,__webpack_require__){var v1=__webpack_require__(32),v4=__webpack_require__(33),uuid=v4;uuid.v1=v1,uuid.v4=v4,module.exports=uuid},function(module,exports,__webpack_require__){"use strict";for(var utils=__webpack_require__(0),support=__webpack_require__(7),nodejsUtils=__webpack_require__(31),GenericWorker=__webpack_require__(2),_utf8len=new Array(256),i=0;i<256;i++)_utf8len[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;function Utf8DecodeWorker(){GenericWorker.call(this,"utf-8 decode"),this.leftOver=null}function Utf8EncodeWorker(){GenericWorker.call(this,"utf-8 encode")}exports.utf8encode=function(str){return support.nodebuffer?nodejsUtils.newBufferFrom(str,"utf-8"):function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos<str_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),buf_len+=c<128?1:c<2048?2:c<65536?3:4;for(buf=support.uint8array?new Uint8Array(buf_len):new Array(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),c<128?buf[i++]=c:c<2048?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):c<65536?(buf[i++]=224|c>>>12,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|c>>>12&63,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c);return buf}(str)},exports.utf8decode=function(buf){return support.nodebuffer?utils.transformTo("nodebuffer",buf).toString("utf-8"):function(buf){var i,out,c,c_len,len=buf.length,utf16buf=new Array(2*len);for(out=0,i=0;i<len;)if((c=buf[i++])<128)utf16buf[out++]=c;else if((c_len=_utf8len[c])>4)utf16buf[out++]=65533,i+=c_len-1;else{for(c&=2===c_len?31:3===c_len?15:7;c_len>1&&i<len;)c=c<<6|63&buf[i++],c_len--;c_len>1?utf16buf[out++]=65533:c<65536?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|c>>10&1023,utf16buf[out++]=56320|1023&c)}return utf16buf.length!==out&&(utf16buf.subarray?utf16buf=utf16buf.subarray(0,out):utf16buf.length=out),utils.applyFromCharCode(utf16buf)}(buf=utils.transformTo(support.uint8array?"uint8array":"array",buf))},utils.inherits(Utf8DecodeWorker,GenericWorker),Utf8DecodeWorker.prototype.processChunk=function(chunk){var data=utils.transformTo(support.uint8array?"uint8array":"array",chunk.data);if(this.leftOver&&this.leftOver.length){if(support.uint8array){var previousData=data;(data=new Uint8Array(previousData.length+this.leftOver.length)).set(this.leftOver,0),data.set(previousData,this.leftOver.length)}else data=this.leftOver.concat(data);this.leftOver=null}var nextBoundary=function(buf,max){var pos;for((max=max||buf.length)>buf.length&&(max=buf.length),pos=max-1;pos>=0&&128==(192&buf[pos]);)pos--;return pos<0?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max}(data),usableData=data;nextBoundary!==data.length&&(support.uint8array?(usableData=data.subarray(0,nextBoundary),this.leftOver=data.subarray(nextBoundary,data.length)):(usableData=data.slice(0,nextBoundary),this.leftOver=data.slice(nextBoundary,data.length))),this.push({data:exports.utf8decode(usableData),meta:chunk.meta})},Utf8DecodeWorker.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:exports.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},exports.Utf8DecodeWorker=Utf8DecodeWorker,utils.inherits(Utf8EncodeWorker,GenericWorker),Utf8EncodeWorker.prototype.processChunk=function(chunk){this.push({data:exports.utf8encode(chunk.data),meta:chunk.meta})},exports.Utf8EncodeWorker=Utf8EncodeWorker},function(module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}},function(module,exports){var getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);module.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);module.exports=function(){for(var r,i=0;i<16;i++)0==(3&i)&&(r=4294967296*Math.random()),rnds[i]=r>>>((3&i)<<3)&255;return rnds}}},function(module,exports){for(var byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);module.exports=function(buf,offset){var i=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=7},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Migrations_1=__webpack_require__(37),MigrationExecutor=function(){function MigrationExecutor(db,migrationsBuilder){void 0===migrationsBuilder&&(migrationsBuilder=new Migrations_1.default),this.db=db,this.migrationsBuilder=migrationsBuilder}return MigrationExecutor.prototype.applyMigrations=function(){var _this=this;this.applyMigrationsPack(this.migrationsBuilder.initial),this.migrationsBuilder.dateSorted.forEach(function(migrationsPack){_this.applyMigrationsPack(migrationsPack)})},MigrationExecutor.prototype.applyMigrationsPack=function(migrationsPack){var _this=this;migrationsPack.forEach(function(migration){migration(_this.db)})},MigrationExecutor}();exports.default=MigrationExecutor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.storeCreatorDecorator=function(name,storeCreator){return function(database){database.objectStoreNames.contains(name)||storeCreator(database)}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PlatformChecker_1=__webpack_require__(22),PlatformChecker_2=__webpack_require__(22);exports.PlatformChecker=PlatformChecker_2.PlatformChecker,exports.default=PlatformChecker_1.platformChecker},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PlatformChecker=function(){function PlatformChecker(global){void 0===global&&(global=window),this.global=global,this._isSafari=this.isSafariBrowser(),this._isOpera=this.isOperaBrowser(),this._isEdge=this.isEdgeBrowser(),this._isFirefox=this.isFirefoxBrowser(),this._isChrome=this.isChromeBrowser(),this._isMacOS=this.isMacOS(),this._isAvailablePromise=this.canUsePromise(),this._isAvailableServiceWorker=this.canUseServiceWorkers(),this._isAvailableNotifications=this.canReceiveNotifications(),this._platform=this.getPlatformType(),this._browserVersion=this.getBrowserVersion()}return Object.defineProperty(PlatformChecker.prototype,"isEdge",{get:function(){return this._isEdge},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isSafari",{get:function(){return this._isSafari},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isOpera",{get:function(){return this._isOpera},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailablePromise",{get:function(){return this._isAvailablePromise},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailableServiceWorker",{get:function(){return this._isAvailableServiceWorker},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailableNotifications",{get:function(){return this._isAvailableNotifications},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"platform",{get:function(){return this._platform},enumerable:!0,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"browserVersion",{get:function(){return this._browserVersion},enumerable:!0,configurable:!0}),PlatformChecker.prototype.isSafariBrowser=function(){return"safari"in this.global&&navigator.userAgent.indexOf("Safari")>-1},PlatformChecker.prototype.isOperaBrowser=function(){return-1!==navigator.userAgent.indexOf("Opera")||-1!==navigator.userAgent.indexOf("OPR")},PlatformChecker.prototype.isEdgeBrowser=function(){return navigator.userAgent.indexOf("Edge")>-1},PlatformChecker.prototype.isFirefoxBrowser=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("firefox")},PlatformChecker.prototype.isChromeBrowser=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)&&!this._isOpera&&!this._isEdge},PlatformChecker.prototype.isMacOS=function(){return"platform"in navigator&&-1!==navigator.platform.toLowerCase().indexOf("mac")},PlatformChecker.prototype.canUseServiceWorkers=function(){return!!navigator.serviceWorker&&"PushManager"in this.global&&"Notification"in this.global},PlatformChecker.prototype.canUsePromise=function(){return"Promise"in this.global},PlatformChecker.prototype.canReceiveNotifications=function(){return this._isSafari&&this._isMacOS||this._isAvailableServiceWorker&&!this._isEdge},PlatformChecker.prototype.getPlatformType=function(){var platform=11;switch(!0){case this._isSafari:platform=10;break;case this._isOpera||this._isChrome:platform=11;break;case this._isFirefox:platform=12;break;case this._isEdge:platform=150}return platform},PlatformChecker.prototype.getBrowserVersion=function(){var userAgent=navigator.userAgent,matchOperaVersion=userAgent.match(/\bOPR\/(\d+)/);if(null!==matchOperaVersion)return"Opera "+matchOperaVersion[1];var matchEdgeVersion=userAgent.match(/\bEdge\/(\d+)/);if(null!==matchEdgeVersion)return"Edge "+matchEdgeVersion[1];var matchEdgVersion=userAgent.match(/\bEdg\/(\d+)/);if(null!==matchEdgVersion)return"Edge "+matchEdgVersion[1];var match=userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],_a=(match[0],match[1]),browser=void 0===_a?"":_a;if(/trident/i.test(userAgent)){var matchIeVersion=/trident\/([.\d]+)/gi.exec(userAgent)||[];return"IE "+(("7.0"===matchIeVersion[1]?"11":matchIeVersion[1])||"")}match=match[2]?[browser,match[2]]:[navigator.appName,navigator.appVersion,"-?"];var version=userAgent.match(/version\/([.\d]+)/i);return null!==version&&match.splice(1,1,version[1]),match.join(" ")},PlatformChecker}();exports.PlatformChecker=PlatformChecker,exports.platformChecker=new PlatformChecker(Function("return this")())},function(module,exports,__webpack_require__){"use strict";(function(global){
1
+ !function(root,factory){if("object"==typeof exports&&"object"==typeof module)module.exports=factory();else if("function"==typeof define&&define.amd)define([],factory);else{var a=factory();for(var i in a)("object"==typeof exports?exports:root)[i]=a[i]}}(this,function(){return function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=78)}([function(module,exports,__webpack_require__){"use strict";var support=__webpack_require__(7),base64=__webpack_require__(57),nodejsUtils=__webpack_require__(29),setImmediate=__webpack_require__(100),external=__webpack_require__(24);function identity(input){return input}function stringToArrayLike(str,array){for(var i=0;i<str.length;++i)array[i]=255&str.charCodeAt(i);return array}exports.newBlob=function(part,type){exports.checkSupport("blob");try{return new Blob([part],{type:type})}catch(e){try{var builder=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return builder.append(part),builder.getBlob(type)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var arrayToStringHelper={stringifyByChunk:function(array,type,chunk){var result=[],k=0,len=array.length;if(len<=chunk)return String.fromCharCode.apply(null,array);for(;k<len;)"array"===type||"nodebuffer"===type?result.push(String.fromCharCode.apply(null,array.slice(k,Math.min(k+chunk,len)))):result.push(String.fromCharCode.apply(null,array.subarray(k,Math.min(k+chunk,len)))),k+=chunk;return result.join("")},stringifyByChar:function(array){for(var resultStr="",i=0;i<array.length;i++)resultStr+=String.fromCharCode(array[i]);return resultStr},applyCanBeUsed:{uint8array:function(){try{return support.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return support.nodebuffer&&1===String.fromCharCode.apply(null,nodejsUtils.allocBuffer(1)).length}catch(e){return!1}}()}};function arrayLikeToString(array){var chunk=65536,type=exports.getTypeOf(array),canUseApply=!0;if("uint8array"===type?canUseApply=arrayToStringHelper.applyCanBeUsed.uint8array:"nodebuffer"===type&&(canUseApply=arrayToStringHelper.applyCanBeUsed.nodebuffer),canUseApply)for(;chunk>1;)try{return arrayToStringHelper.stringifyByChunk(array,type,chunk)}catch(e){chunk=Math.floor(chunk/2)}return arrayToStringHelper.stringifyByChar(array)}function arrayLikeToArrayLike(arrayFrom,arrayTo){for(var i=0;i<arrayFrom.length;i++)arrayTo[i]=arrayFrom[i];return arrayTo}exports.applyFromCharCode=arrayLikeToString;var transform={};transform.string={string:identity,array:function(input){return stringToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return transform.string.uint8array(input).buffer},uint8array:function(input){return stringToArrayLike(input,new Uint8Array(input.length))},nodebuffer:function(input){return stringToArrayLike(input,nodejsUtils.allocBuffer(input.length))}},transform.array={string:arrayLikeToString,array:identity,arraybuffer:function(input){return new Uint8Array(input).buffer},uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.arraybuffer={string:function(input){return arrayLikeToString(new Uint8Array(input))},array:function(input){return arrayLikeToArrayLike(new Uint8Array(input),new Array(input.byteLength))},arraybuffer:identity,uint8array:function(input){return new Uint8Array(input)},nodebuffer:function(input){return nodejsUtils.newBufferFrom(new Uint8Array(input))}},transform.uint8array={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return input.buffer},uint8array:identity,nodebuffer:function(input){return nodejsUtils.newBufferFrom(input)}},transform.nodebuffer={string:arrayLikeToString,array:function(input){return arrayLikeToArrayLike(input,new Array(input.length))},arraybuffer:function(input){return transform.nodebuffer.uint8array(input).buffer},uint8array:function(input){return arrayLikeToArrayLike(input,new Uint8Array(input.length))},nodebuffer:identity},exports.transformTo=function(outputType,input){if(input||(input=""),!outputType)return input;exports.checkSupport(outputType);var inputType=exports.getTypeOf(input);return transform[inputType][outputType](input)},exports.getTypeOf=function(input){return"string"==typeof input?"string":"[object Array]"===Object.prototype.toString.call(input)?"array":support.nodebuffer&&nodejsUtils.isBuffer(input)?"nodebuffer":support.uint8array&&input instanceof Uint8Array?"uint8array":support.arraybuffer&&input instanceof ArrayBuffer?"arraybuffer":void 0},exports.checkSupport=function(type){if(!support[type.toLowerCase()])throw new Error(type+" is not supported by this platform")},exports.MAX_VALUE_16BITS=65535,exports.MAX_VALUE_32BITS=-1,exports.pretty=function(str){var code,i,res="";for(i=0;i<(str||"").length;i++)res+="\\x"+((code=str.charCodeAt(i))<16?"0":"")+code.toString(16).toUpperCase();return res},exports.delay=function(callback,args,self){setImmediate(function(){callback.apply(self||null,args||[])})},exports.inherits=function(ctor,superCtor){var Obj=function(){};Obj.prototype=superCtor.prototype,ctor.prototype=new Obj},exports.extend=function(){var i,attr,result={};for(i=0;i<arguments.length;i++)for(attr in arguments[i])arguments[i].hasOwnProperty(attr)&&void 0===result[attr]&&(result[attr]=arguments[i][attr]);return result},exports.prepareContent=function(name,inputData,isBinary,isOptimizedBinaryString,isBase64){return external.Promise.resolve(inputData).then(function(data){return support.blob&&(data instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(data)))&&"undefined"!=typeof FileReader?new external.Promise(function(resolve,reject){var reader=new FileReader;reader.onload=function(e){resolve(e.target.result)},reader.onerror=function(e){reject(e.target.error)},reader.readAsArrayBuffer(data)}):data}).then(function(data){var dataType=exports.getTypeOf(data);return dataType?("arraybuffer"===dataType?data=exports.transformTo("uint8array",data):"string"===dataType&&(isBase64?data=base64.decode(data):isBinary&&!0!==isOptimizedBinaryString&&(data=function(str){return stringToArrayLike(str,support.uint8array?new Uint8Array(str.length):new Array(str.length))}(data))),data):external.Promise.reject(new Error("Can't read the data of '"+name+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG=exports.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED=exports.SUBSCRIPTION_WIDGET_USE_CASE_DEFAULT=exports.SUBSCRIPTION_WIDGET_USE_CASE_NOT_SET=exports.SUBSCRIPTION_SEGMENT_EVENT=exports.PAGE_VISITED_URL=exports.MANUAL_UNSUBSCRIBE=exports.EVENT_PW_SITE_OPENED=exports.EVENT_GDPR_DELETE=exports.EVENT_GDPR_CONSENT=exports.EVENT_CLICK_SUBSCRIBE_BUTTON=exports.EVENT_SHOW_SUBSCRIBE_BUTTON=exports.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET=exports.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET=exports.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG=exports.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG=exports.EVENT_ON_UPDATE_INBOX_MESSAGES=exports.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE=exports.EVENT_ON_CHANGE_COMMUNICATION_ENABLED=exports.EVENT_ON_NOTIFICATION_CLOSE=exports.EVENT_ON_NOTIFICATION_CLICK=exports.EVENT_ON_PUSH_DELIVERY=exports.EVENT_ON_SW_INIT_ERROR=exports.EVENT_ON_PERMISSION_GRANTED=exports.EVENT_ON_PERMISSION_DENIED=exports.EVENT_ON_PERMISSION_PROMPT=exports.EVENT_ON_REGISTER=exports.EVENT_ON_UNSUBSCRIBE=exports.EVENT_ON_SUBSCRIBE=exports.EVENT_ON_READY=exports.EVENT_ON_LOAD=exports.PERMISSION_PROMPT=exports.PERMISSION_GRANTED=exports.PERMISSION_DENIED=exports.DEVICE_REGISTRATION_STATUS_UNREGISTERED=exports.DEVICE_REGISTRATION_STATUS_REGISTERED=exports.MANUAL_SET_LOGGER_LEVEL=exports.KEY_SAFARI_PREVIOUS_PERMISSION=exports.KEY_DEVICE_REGISTRATION_STATUS=exports.KEY_CLICK_SUBSCRIBE_WIDGET=exports.KEY_SHOW_SUBSCRIBE_WIDGET=exports.DEFAULT_NOTIFICATION_IMAGE=exports.DEFAULT_NOTIFICATION_TITLE=exports.WAKE_UP_SERVICE_WORKER_INTERVAL=exports.MAX_NOTIFICATION_DURATION=exports.MIN_NOTIFICATION_DURATION=exports.DEFAULT_NOTIFICATION_DURATION=exports.PERIOD_GOAL_EVENT=exports.PERIOD_SEND_APP_OPEN=exports.FACEBOOK_HWID_KEY=exports.FACEBOOK_APP_ID=exports.DEFAULT_API_URL=exports.DEFAULT_SERVICE_WORKER_URL=void 0,exports.DEFAULT_SERVICE_WORKER_URL="/pushwoosh-service-worker.js",exports.DEFAULT_API_URL="https://cp.pushwoosh.com/json/1.3/",exports.FACEBOOK_APP_ID="436711767081797",exports.FACEBOOK_HWID_KEY="FACEBOOK_HWID_KEY",exports.PERIOD_SEND_APP_OPEN=36e5,exports.PERIOD_GOAL_EVENT=864e5,exports.DEFAULT_NOTIFICATION_DURATION=10,exports.MIN_NOTIFICATION_DURATION=10,exports.MAX_NOTIFICATION_DURATION=55,exports.WAKE_UP_SERVICE_WORKER_INTERVAL=20,exports.DEFAULT_NOTIFICATION_TITLE="Pushwoosh notification",exports.DEFAULT_NOTIFICATION_IMAGE="https://cp.pushwoosh.com/img/logo-medium.png",exports.KEY_SHOW_SUBSCRIBE_WIDGET="WIDGET_SHOWED",exports.KEY_CLICK_SUBSCRIBE_WIDGET="WIDGET_CLICKED",exports.KEY_DEVICE_REGISTRATION_STATUS="deviceRegistrationStatus",exports.KEY_SAFARI_PREVIOUS_PERMISSION="safariPreviousPermission",exports.MANUAL_SET_LOGGER_LEVEL="PW_SET_LOGGER_LEVEL",exports.DEVICE_REGISTRATION_STATUS_REGISTERED="registered",exports.DEVICE_REGISTRATION_STATUS_UNREGISTERED="unregistered",exports.PERMISSION_DENIED="denied",exports.PERMISSION_GRANTED="granted",exports.PERMISSION_PROMPT="default",exports.EVENT_ON_LOAD="onLoad",exports.EVENT_ON_READY="onReady",exports.EVENT_ON_SUBSCRIBE="onSubscribe",exports.EVENT_ON_UNSUBSCRIBE="onUnsubscribe",exports.EVENT_ON_REGISTER="onRegister",exports.EVENT_ON_PERMISSION_PROMPT="onPermissionPrompt",exports.EVENT_ON_PERMISSION_DENIED="onPermissionDenied",exports.EVENT_ON_PERMISSION_GRANTED="onPermissionGranted",exports.EVENT_ON_SW_INIT_ERROR="onSWInitError",exports.EVENT_ON_PUSH_DELIVERY="onPushDelivery",exports.EVENT_ON_NOTIFICATION_CLICK="onNotificationClick",exports.EVENT_ON_NOTIFICATION_CLOSE="onNotificationClose",exports.EVENT_ON_CHANGE_COMMUNICATION_ENABLED="onChangeCommunicationEnabled",exports.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE="onPutNewMessageToInboxStore",exports.EVENT_ON_UPDATE_INBOX_MESSAGES="onUpdateInboxMessages",exports.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG="onShowNotificationPermissionDialog",exports.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG="onHideNotificationPermissionDialog",exports.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET="onShowSubscriptionWidget",exports.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET="onHideSubscriptionWidget",exports.EVENT_SHOW_SUBSCRIBE_BUTTON="showSubscribeButton",exports.EVENT_CLICK_SUBSCRIBE_BUTTON="clickSubscribeButton",exports.EVENT_GDPR_CONSENT="GDPRConsent",exports.EVENT_GDPR_DELETE="GDPRDelete",exports.EVENT_PW_SITE_OPENED="PW_SiteOpened",exports.MANUAL_UNSUBSCRIBE="MANUAL_UNSUBSCRIBE",exports.PAGE_VISITED_URL="PAGE_VISITED_URL",exports.SUBSCRIPTION_SEGMENT_EVENT="Subscription Segments",exports.SUBSCRIPTION_WIDGET_USE_CASE_NOT_SET="not-set",exports.SUBSCRIPTION_WIDGET_USE_CASE_DEFAULT="default",exports.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED="topic-based",exports.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG={headerText:"Subscribe to our news",headerTextColor:"#000000",subheaderText:"Don't miss out on the latest news and updates!",subheaderTextColor:"#000000",buttonAcceptText:"Agree",buttonAcceptTextColor:"#1A72E8",buttonAcceptRound:"4px",buttonAcceptBackgroundColor:"#FFFFFF",buttonAcceptBorderColor:"#E3E4E8",buttonCancelText:"Deny",buttonCancelTextColor:"#1A72E8",buttonCancelRound:"4px",buttonCancelBackgroundColor:"#FFFFFF",buttonCancelBorderColor:"#E3E4E8",cappingCount:3,cappingDelay:144e5,backgroundColor:"#FFFFFF"}},function(module,exports,__webpack_require__){"use strict";function GenericWorker(name){this.name=name||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}GenericWorker.prototype={push:function(chunk){this.emit("data",chunk)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(name,listener){return this._listeners[name].push(listener),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(name,arg){if(this._listeners[name])for(var i=0;i<this._listeners[name].length;i++)this._listeners[name][i].call(this,arg)},pipe:function(next){return next.registerPrevious(this)},registerPrevious:function(previous){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=previous.streamInfo,this.mergeStreamInfo(),this.previous=previous;var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.end()}),previous.on("error",function(e){self.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var withError=!1;return this.generatedError&&(this.error(this.generatedError),withError=!0),this.previous&&this.previous.resume(),!withError},flush:function(){},processChunk:function(chunk){this.push(chunk)},withStreamInfo:function(key,value){return this.extraStreamInfo[key]=value,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var key in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(key)&&(this.streamInfo[key]=this.extraStreamInfo[key])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var me="Worker "+this.name;return this.previous?this.previous+" -> "+me:me}},module.exports=GenericWorker},function(module,exports,__webpack_require__){"use strict";var __spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Logger=exports.logAndRejectError=exports.logAndThrowError=void 0;var storage_1=__webpack_require__(5),levels={error:1,info:2,debug:3},limitLevel=3;__webpack_require__(10).patchConsole();var Logger={setLevel:function(level){levels[level]||(level="error"),limitLevel=levels[level]},write:function(type,message,additional){return"error"===type?this.error(message):this.info(message),storage_1.log.add(type,message,additional)}};exports.Logger=Logger,Object.keys(levels).forEach(function(levelName){var levelNumber=levels[levelName];Logger[levelName]=function(){for(var args=[],_i=0;_i<arguments.length;_i++)args[_i]=arguments[_i];levelNumber<=limitLevel&&(console.groupCollapsed(levelName),console.info.apply(console,__spreadArrays([""],args)),console.trace("trace"),console.groupEnd())}}),exports.logAndThrowError=function(error){var logText=new Error(error);throw Logger.write("error",logText,"logAndThrowError"),logText},exports.logAndRejectError=function(error,reject){var logText=new Error(error);Logger.write("error",logText,"logAndRejectError"),reject(logText)}},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Data=void 0;var storage_1=__webpack_require__(5),CONSTANTS=__webpack_require__(1),Data=function(){function Data(store){void 0===store&&(store=storage_1.keyValue),this.store=store}return Data.prototype.clearAll=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationCode",void 0)];case 1:return _a.sent(),[4,this.store.set("params.hwid",void 0)];case 2:return _a.sent(),[4,this.store.set("params.deviceType",void 0)];case 3:return _a.sent(),[4,this.store.set("params.deviceModel",void 0)];case 4:return _a.sent(),[4,this.store.set("params.language",void 0)];case 5:return _a.sent(),[4,this.store.set("params.apiEntrypoint",void 0)];case 6:return _a.sent(),[4,this.store.set("params.tokens",void 0)];case 7:return _a.sent(),[4,this.store.set("params.applicationServerKey",void 0)];case 8:return _a.sent(),[4,this.store.set("params.senderId",void 0)];case 9:return _a.sent(),[4,this.store.set("params.webSitePushId",void 0)];case 10:return _a.sent(),[4,this.store.set("params.defaultNotificationImage",void 0)];case 11:return _a.sent(),[4,this.store.set("params.defaultNotificationTitle",void 0)];case 12:return _a.sent(),[4,this.store.set("params.userId",void 0)];case 13:return _a.sent(),[4,this.store.set("params.userIdWasChanged",void 0)];case 14:return _a.sent(),[4,this.store.set("params.isLastPermissionStatus",void 0)];case 15:return _a.sent(),[4,this.store.set("params.isManualUnsubscribed",void 0)];case 16:return _a.sent(),[4,this.store.set("params.isCommunicationDisabled",void 0)];case 17:return _a.sent(),[4,this.store.set("params.isDropAllData",void 0)];case 18:return _a.sent(),[4,this.store.set("params.sdkVersion",void 0)];case 19:return _a.sent(),[4,this.store.set("params.serviceWorkerVersion",void 0)];case 20:return _a.sent(),[4,this.store.set("params.serviceWorkerUrl",void 0)];case 21:return _a.sent(),[4,this.store.set("params.serviceWorkerScope",void 0)];case 22:return _a.sent(),[4,this.store.set("params.lastOpenMessage",void 0)];case 23:return _a.sent(),[4,this.store.set("params.lastOpenApplicationTime",void 0)];case 24:return _a.sent(),[4,this.store.set("params.features",void 0)];case 25:return _a.sent(),[4,this.store.set("params.init",void 0)];case 26:return _a.sent(),[4,this.store.set("API_PARAMS",void 0)];case 27:return _a.sent(),[4,this.store.set("SENDER_ID",void 0)];case 28:return _a.sent(),[4,this.store.set("COMMUNICATION_ENABLED",void 0)];case 29:return _a.sent(),[4,this.store.set("DEVICE_DATA_REMOVED",void 0)];case 30:return _a.sent(),[4,this.store.set("LAST_OPEN_MESSAGE",void 0)];case 31:return _a.sent(),[4,this.store.set("DELAYED_EVENT",void 0)];case 32:return _a.sent(),[2]}})})},Data.prototype.setApplicationCode=function(application){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationCode",application)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApplicationCode=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.applicationCode")];case 1:return[2,_a.sent()]}})})},Data.prototype.setHwid=function(hwid){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.hwid",hwid)];case 1:return _a.sent(),[2]}})})},Data.prototype.getHwid=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.hwid")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDeviceType=function(type){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.deviceType",type)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDeviceType=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.deviceType")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDeviceModel=function(model){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.deviceModel",model)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDeviceModel=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.deviceModel")];case 1:return[2,_a.sent()]}})})},Data.prototype.setLanguage=function(language){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.language",language)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLanguage=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.language","en")];case 1:return[2,_a.sent()]}})})},Data.prototype.setApiEntrypoint=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.apiEntrypoint",url)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApiEntrypoint=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.apiEntrypoint",CONSTANTS.DEFAULT_API_URL)];case 1:return[2,_a.sent()]}})})},Data.prototype.setTokens=function(tokens){return __awaiter(this,void 0,void 0,function(){var hwid;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getHwid()];case 1:return hwid=_a.sent(),[4,this.store.set("API_PARAMS",__assign({hwid:hwid},tokens))];case 2:return _a.sent(),[4,this.store.set("params.tokens",tokens)];case 3:return _a.sent(),[2]}})})},Data.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("API_PARAMS")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.tokens")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setApplicationServerKey=function(key){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.applicationServerKey",key)];case 1:return _a.sent(),[2]}})})},Data.prototype.getApplicationServerKey=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.applicationServerKey")];case 1:return[2,_a.sent()]}})})},Data.prototype.setSenderId=function(senderId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("GCM_SENDER_ID",senderId)];case 1:return _a.sent(),[4,this.store.set("params.senderId",senderId)];case 2:return _a.sent(),[2]}})})},Data.prototype.getSenderId=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("GCM_SENDER_ID")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.senderId")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setWebSitePushId=function(senderId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.webSitePushId",senderId)];case 1:return _a.sent(),[2]}})})},Data.prototype.getWebSitePushId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.webSitePushId")];case 1:return[2,_a.sent()]}})})},Data.prototype.setDefaultNotificationImage=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.defaultNotificationImage",url)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDefaultNotificationImage=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.defaultNotificationImage",CONSTANTS.DEFAULT_NOTIFICATION_IMAGE)];case 1:return[2,_a.sent()]}})})},Data.prototype.setDefaultNotificationTitle=function(text){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.defaultNotificationTitle",text)];case 1:return _a.sent(),[2]}})})},Data.prototype.getDefaultNotificationTitle=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.defaultNotificationTitle",CONSTANTS.DEFAULT_NOTIFICATION_TITLE)];case 1:return[2,_a.sent()]}})})},Data.prototype.setUserId=function(userId){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return userId?[3,2]:[4,this.store.set("params.userId",void 0)];case 1:return _a.sent(),[2];case 2:return[4,this.store.set("params.userId",userId.toString())];case 3:return _a.sent(),[2]}})})},Data.prototype.getUserId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.userId")];case 1:return[2,_a.sent()]}})})},Data.prototype.setStatusUserIdWasChanged=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.userIdWasChanged",status)];case 1:return _a.sent(),[2]}})})},Data.prototype.getStatusUserIdWasChanged=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.userIdWasChanged",!1)];case 1:return[2,_a.sent()]}})})},Data.prototype.setLastPermissionStatus=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.isLastPermissionStatus",status)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLastPermissionStatus=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.isLastPermissionStatus")];case 1:return[2,_a.sent()]}})})},Data.prototype.setStatusManualUnsubscribed=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("MANUAL_UNSUBSCRIBE",status)];case 1:return _a.sent(),[4,this.store.set("params.isManualUnsubscribed",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("MANUAL_UNSUBSCRIBE",!1)];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isManualUnsubscribed",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setStatusCommunicationDisabled=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("COMMUNICATION_ENABLED",status?0:1)];case 1:return _a.sent(),[4,this.store.set("params.isCommunicationDisabled",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusCommunicationDisabled=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("COMMUNICATION_ENABLED")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isCommunicationDisabled",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:0==oldValue]}})})},Data.prototype.setStatusDropAllData=function(status){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("DEVICE_DATA_REMOVED",status)];case 1:return _a.sent(),[4,this.store.set("params.isDropAllData",status)];case 2:return _a.sent(),[2]}})})},Data.prototype.getStatusDropAllData=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("DEVICE_DATA_REMOVED",!1)];case 1:return oldValue=_a.sent(),[4,this.store.get("params.isDropAllData",!1)];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setSdkVersion=function(version){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.sdkVersion",version)];case 1:return _a.sent(),[2]}})})},Data.prototype.getSdkVersion=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.sdkVersion")];case 1:return[2,_a.sent()]}})})},Data.prototype.setServiceWorkerVersion=function(version){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("WORKER_VERSION",version)];case 1:return _a.sent(),[4,this.store.set("params.serviceWorkerVersion",version)];case 2:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerVersion=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("WORKER_VERSION")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.serviceWorkerVersion")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setServiceWorkerUrl=function(url){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return url?[4,this.store.set("params.serviceWorkerUrl",url)]:[2];case 1:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerUrl=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.serviceWorkerUrl",CONSTANTS.DEFAULT_SERVICE_WORKER_URL)];case 1:return[2,_a.sent()]}})})},Data.prototype.setServiceWorkerScope=function(scope){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return scope?[4,this.store.set("params.serviceWorkerScope",scope)]:[2];case 1:return _a.sent(),[2]}})})},Data.prototype.getServiceWorkerScope=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.serviceWorkerScope")];case 1:return[2,_a.sent()]}})})},Data.prototype.setLastOpenMessage=function(message){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("LAST_OPEN_MESSAGE",message)];case 1:return _a.sent(),[4,this.store.set("params.lastOpenMessage",message)];case 2:return _a.sent(),[2]}})})},Data.prototype.getLastOpenMessage=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("LAST_OPEN_MESSAGE")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.lastOpenMessage")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setLastOpenApplicationTime=function(time){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.lastOpenApplicationTime",time)];case 1:return _a.sent(),[2]}})})},Data.prototype.getLastOpenApplicationTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.lastOpenApplicationTime")];case 1:return[2,_a.sent()]}})})},Data.prototype.setFeatures=function(features){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.features",features)];case 1:return _a.sent(),[2]}})})},Data.prototype.getFeatures=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.features")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInitParams=function(params){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.init",params)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInitParams=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.init")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInboxLastRequestCode=function(lastCode){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.lastRequestCode",lastCode)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxLastRequestCode=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("params.inbox.lastRequestCode","")];case 1:return[2,_a.sent()]}})})},Data.prototype.setInboxLastRequestTime=function(lastRequestTime){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.lastRequestTime",lastRequestTime)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxLastRequestTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inbox.lastRequestTime",0)]})})},Data.prototype.setInboxNewMessagesCount=function(count){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inbox.newMessagesCount",count)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInboxNewMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inbox.newMessagesCount",0)]})})},Data.prototype.setDelayedEvent=function(event){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("DELAYED_EVENT",event)];case 1:return _a.sent(),[4,this.store.set("params.delayedEvent",event)];case 2:return _a.sent(),[2]}})})},Data.prototype.getDelayedEvent=function(){return __awaiter(this,void 0,void 0,function(){var oldValue,newValue;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.get("DELAYED_EVENT")];case 1:return oldValue=_a.sent(),[4,this.store.get("params.delayedEvent")];case 2:return[2,void 0!==(newValue=_a.sent())?newValue:oldValue]}})})},Data.prototype.setInApps=function(inApps){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.inApps",inApps)];case 1:return _a.sent(),[2]}})})},Data.prototype.getInApps=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.inApps")]})})},Data.prototype.setPromptDisplayCount=function(count){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.promptDisplayCount",count)];case 1:return _a.sent(),[2]}})})},Data.prototype.getPromptDisplayCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.promptDisplayCount",0)]})})},Data.prototype.setPromptLastSeenTime=function(time){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.store.set("params.promptLastSeenTime",time)];case 1:return _a.sent(),[2]}})})},Data.prototype.getPromptLastSeenTime=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.store.get("params.promptLastSeenTime",0)]})})},Data}();exports.Data=Data},function(module,exports,__webpack_require__){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])})(d,b)};return function(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},__rest=this&&this.__rest||function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]])}return t};Object.defineProperty(exports,"__esModule",{value:!0}),exports.message=exports.log=exports.keyValue=exports.LogMessage=exports.LogLog=exports.LogBase=exports.getInstance=void 0;var databasePromise,version_1=__webpack_require__(18),MigrationExecutor_1=__webpack_require__(19),constants_1=__webpack_require__(9);function onversionchange(database,event){console.info("onversionchange",event),database.close()}function getInstance(){return databasePromise||(databasePromise=new Promise(function(resolve,reject){var request=indexedDB.open("PUSHWOOSH_SDK_STORE",version_1.default);request.onsuccess=function(event){var database=event.target.result;database.onversionchange=onversionchange.bind(null,database,reject),resolve(database)},request.onerror=function(){return reject(request.error)},request.onupgradeneeded=function(event){var database=event.target.result;database.onversionchange=onversionchange.bind(null,database,reject),new MigrationExecutor_1.default(database).applyMigrations()}})),databasePromise}function getInstanceWithPromise(executor){return getInstance().then(function(database){return new Promise(function(resolve,reject){return executor(database,resolve,reject)})})}exports.getInstance=getInstance;var LogBase=function(){function LogBase(){}return LogBase.prototype._add=function(obj){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var request=database.transaction([_this.name],"readwrite").objectStore(_this.name).add(obj);request.onsuccess=function(){resolve(obj)},request.onerror=function(){reject(request.error)}}).then(function(obj){return _this.getAll().then(function(items){if(Array.isArray(items)){var ids=items.map(function(i){return i.id}).sort(function(a,b){return a==b?0:a<b?1:-1});if(ids.length>_this.maxItems)return Promise.all(ids.slice(_this.maxItems).map(function(id){return _this.delete(id)})).then(function(){return obj})}return obj})})},LogBase.prototype.delete=function(key){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var request=database.transaction([_this.name],"readwrite").objectStore(_this.name).delete(key);request.onsuccess=function(){resolve(request.result)},request.onerror=function(){reject(request.error)}})},LogBase.prototype.getAll=function(){var _this=this;return getInstanceWithPromise(function(database,resolve,reject){var result=[],cursor=database.transaction(_this.name).objectStore(_this.name).openCursor();cursor.onsuccess=function(ev){var cursorResult=ev.target.result;cursorResult?(cursorResult.value&&result.push(cursorResult.value),cursorResult.continue()):resolve(result)},cursor.onerror=function(){reject(cursor.error)}})},LogBase}();exports.LogBase=LogBase;var LogLog=function(_super){function LogLog(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.name=constants_1.STORE_NAME_MAIN_LOG,_this.maxItems=100,_this.environment="undefined"!=typeof self&&self.registration?"worker":"browser",_this}return __extends(LogLog,_super),LogLog.prototype.add=function(type,message,additional){var obj={type:type,environment:this.environment,message:""+message,date:new Date};return message instanceof Error&&(obj.stack=message.stack),additional&&(obj.additional=additional),this._add(obj)},LogLog}(LogBase);exports.LogLog=LogLog;var LogMessage=function(_super){function LogMessage(){var _this=null!==_super&&_super.apply(this,arguments)||this;return _this.name=constants_1.STORE_NAME_MESSAGE_LOG,_this.maxItems=25,_this}return __extends(LogMessage,_super),LogMessage.prototype.add=function(log){return this._add(__assign(__assign({},log),{date:new Date}))},LogMessage}(LogBase);exports.LogMessage=LogMessage,exports.keyValue=function(name){return{get:function(key,defaultValue){return getInstanceWithPromise(function(database,resolve,reject){var timeout,request=database.transaction(name).objectStore(name).get(key),isComplete=!1,isError=!1,check=function(){if(clearTimeout(timeout),isComplete){var result=request.result;resolve(result&&result.value||defaultValue)}else isError?reject(request.error):timeout=setTimeout(check,0)};request.onsuccess=function(){return isComplete=!0},request.onerror=function(){return isError=!0},check()})},getAll:function(){return getInstanceWithPromise(function(database,resolve,reject){var timeout,result={},cursor=database.transaction(name).objectStore(name).openCursor(),isComplete=!1,isError=!1,check=function(){clearTimeout(timeout),isComplete?resolve(result):isError?reject(cursor.error):timeout=setTimeout(check,0)};cursor.onsuccess=function(event){var cursorResult=event.target.result;cursorResult?(result[cursorResult.key]=cursorResult.value.value,cursorResult.continue()):isComplete=!0},cursor.onerror=function(){return isError=!0},check()})},extend:function(key,value){return __awaiter(this,void 0,void 0,function(){var oldValues,newValues;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.get(key)];case 1:return oldValues=_a.sent(),newValues=__rest(value,[]),[4,this.set(key,__assign(__assign({},oldValues),newValues))];case 2:return _a.sent(),[2]}})})},set:function(key,value){return getInstanceWithPromise(function(database,resolve,reject){var timeout,request=database.transaction([name],"readwrite").objectStore(name).put({key:key,value:value}),isComplete=!1,isError=!1,check=function(){clearTimeout(timeout),isComplete?resolve(key):isError?reject(request.error):timeout=setTimeout(check,0)};request.onsuccess=function(){return isComplete=!0},request.onerror=function(){return isError=!0},check()})}}}(constants_1.STORE_NAME_KEY_VALUE),exports.log=new LogLog,exports.message=new LogMessage},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var DateModule=function(){function DateModule(date){void 0===date&&(date=new Date),this._date=date}return Object.defineProperty(DateModule.prototype,"date",{get:function(){return this._date},set:function(date){this._date=date},enumerable:!1,configurable:!0}),DateModule.prototype.getUtcTimestamp=function(){return Math.floor((this.date.getTime()+60*this.date.getTimezoneOffset()*1e3)/1e3)},DateModule.prototype.getTimestamp=function(){return Math.round(this.date.getTime()/1e3)},DateModule.prototype.setLocal=function(){var newDateTimestamp=this._date.getTime()-60*this.date.getTimezoneOffset()*1e3;this._date=new Date(newDateTimestamp)},DateModule.prototype.addDays=function(days){var newDateTimestamp=this._date.getTime()+24*days*60*60*1e3;this._date=new Date(newDateTimestamp)},DateModule.prototype.getInboxFakeOrder=function(){return(100*this._date.getTime()+9e9).toString()},DateModule}();exports.default=DateModule},function(module,exports,__webpack_require__){"use strict";(function(Buffer){if(exports.base64=!0,exports.array=!0,exports.string=!0,exports.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,exports.nodebuffer=void 0!==Buffer,exports.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)exports.blob=!1;else{var buffer=new ArrayBuffer(0);try{exports.blob=0===new Blob([buffer],{type:"application/zip"}).size}catch(e){try{var builder=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);builder.append(buffer),exports.blob=0===builder.getBlob("application/zip").size}catch(e){exports.blob=!1}}}try{exports.nodestream=!!__webpack_require__(50).Readable}catch(e){exports.nodestream=!1}}).call(this,__webpack_require__(21).Buffer)},function(module,exports,__webpack_require__){"use strict";var TYPED_OK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function _has(obj,key){return Object.prototype.hasOwnProperty.call(obj,key)}exports.assign=function(obj){for(var sources=Array.prototype.slice.call(arguments,1);sources.length;){var source=sources.shift();if(source){if("object"!=typeof source)throw new TypeError(source+"must be non-object");for(var p in source)_has(source,p)&&(obj[p]=source[p])}}return obj},exports.shrinkBuf=function(buf,size){return buf.length===size?buf:buf.subarray?buf.subarray(0,size):(buf.length=size,buf)};var fnTyped={arraySet:function(dest,src,src_offs,len,dest_offs){if(src.subarray&&dest.subarray)dest.set(src.subarray(src_offs,src_offs+len),dest_offs);else for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){var i,l,len,pos,chunk,result;for(len=0,i=0,l=chunks.length;i<l;i++)len+=chunks[i].length;for(result=new Uint8Array(len),pos=0,i=0,l=chunks.length;i<l;i++)chunk=chunks[i],result.set(chunk,pos),pos+=chunk.length;return result}},fnUntyped={arraySet:function(dest,src,src_offs,len,dest_offs){for(var i=0;i<len;i++)dest[dest_offs+i]=src[src_offs+i]},flattenChunks:function(chunks){return[].concat.apply([],chunks)}};exports.setTyped=function(on){on?(exports.Buf8=Uint8Array,exports.Buf16=Uint16Array,exports.Buf32=Int32Array,exports.assign(exports,fnTyped)):(exports.Buf8=Array,exports.Buf16=Array,exports.Buf32=Array,exports.assign(exports,fnUntyped))},exports.setTyped(TYPED_OK)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.KEY_PATH_BASE_INCREMENT=exports.STORE_NAME_INBOX_MESSAGES=exports.STORE_NAME_MAIN_LOG=exports.STORE_NAME_MESSAGE_LOG=exports.STORE_NAME_KEY_VALUE=void 0,exports.STORE_NAME_KEY_VALUE="keyValue",exports.STORE_NAME_MESSAGE_LOG="messages",exports.STORE_NAME_MAIN_LOG="log",exports.STORE_NAME_INBOX_MESSAGES="inboxMessages",exports.KEY_PATH_BASE_INCREMENT="id"},function(module,exports,__webpack_require__){"use strict";function getGlobal(){return"undefined"!=typeof globalThis?globalThis:Function("return this")()}Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateUUID=exports.clearLocationHash=exports.patchConsole=exports.parseSerializedNotificationParams=exports.getVersion=exports.getGlobal=void 0,exports.getGlobal=getGlobal,exports.getVersion=function(){return"3.28.0"},exports.parseSerializedNotificationParams=function(param,defaultValue){if("string"==typeof param)try{return JSON.parse(param)}catch(e){console.log(e)}return void 0===param&&void 0!==defaultValue?defaultValue:param},exports.patchConsole=function(){for(var method,noop=function(){},methods=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],len=methods.length,global=getGlobal(),console=global.console=global.console||{};len--;)console[method=methods[len]]||(console[method]=noop)},exports.clearLocationHash=function(){"history"in getGlobal()&&history.pushState?history.pushState(null,"","#"):location.hash="#"},exports.generateUUID=function(){var d=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(d+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=(d+16*Math.random())%16|0;return d=Math.floor(d/16),("x"===c?r:3&r|8).toString(16)})}},function(module,exports){var g;g=function(){return this}();try{g=g||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(g=window)}module.exports=g},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(27),objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};module.exports=Duplex;var util=Object.create(__webpack_require__(23));util.inherits=__webpack_require__(15);var Readable=__webpack_require__(51),Writable=__webpack_require__(41);util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options),Writable.call(this,options),options&&!1===options.readable&&(this.readable=!1),options&&!1===options.writable&&(this.writable=!1),this.allowHalfOpen=!0,options&&!1===options.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(self){self.end()}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(value){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=value,this._writableState.destroyed=value)}}),Duplex.prototype._destroy=function(err,cb){this.push(null),this.end(),pna.nextTick(cb,err)}},function(module,exports,__webpack_require__){var v1=__webpack_require__(30),v4=__webpack_require__(31),uuid=v4;uuid.v1=v1,uuid.v4=v4,module.exports=uuid},function(module,exports,__webpack_require__){"use strict";for(var utils=__webpack_require__(0),support=__webpack_require__(7),nodejsUtils=__webpack_require__(29),GenericWorker=__webpack_require__(2),_utf8len=new Array(256),i=0;i<256;i++)_utf8len[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;_utf8len[254]=_utf8len[254]=1;function Utf8DecodeWorker(){GenericWorker.call(this,"utf-8 decode"),this.leftOver=null}function Utf8EncodeWorker(){GenericWorker.call(this,"utf-8 encode")}exports.utf8encode=function(str){return support.nodebuffer?nodejsUtils.newBufferFrom(str,"utf-8"):function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos<str_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),buf_len+=c<128?1:c<2048?2:c<65536?3:4;for(buf=support.uint8array?new Uint8Array(buf_len):new Array(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),c<128?buf[i++]=c:c<2048?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):c<65536?(buf[i++]=224|c>>>12,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|c>>>12&63,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c);return buf}(str)},exports.utf8decode=function(buf){return support.nodebuffer?utils.transformTo("nodebuffer",buf).toString("utf-8"):function(buf){var i,out,c,c_len,len=buf.length,utf16buf=new Array(2*len);for(out=0,i=0;i<len;)if((c=buf[i++])<128)utf16buf[out++]=c;else if((c_len=_utf8len[c])>4)utf16buf[out++]=65533,i+=c_len-1;else{for(c&=2===c_len?31:3===c_len?15:7;c_len>1&&i<len;)c=c<<6|63&buf[i++],c_len--;c_len>1?utf16buf[out++]=65533:c<65536?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|c>>10&1023,utf16buf[out++]=56320|1023&c)}return utf16buf.length!==out&&(utf16buf.subarray?utf16buf=utf16buf.subarray(0,out):utf16buf.length=out),utils.applyFromCharCode(utf16buf)}(buf=utils.transformTo(support.uint8array?"uint8array":"array",buf))},utils.inherits(Utf8DecodeWorker,GenericWorker),Utf8DecodeWorker.prototype.processChunk=function(chunk){var data=utils.transformTo(support.uint8array?"uint8array":"array",chunk.data);if(this.leftOver&&this.leftOver.length){if(support.uint8array){var previousData=data;(data=new Uint8Array(previousData.length+this.leftOver.length)).set(this.leftOver,0),data.set(previousData,this.leftOver.length)}else data=this.leftOver.concat(data);this.leftOver=null}var nextBoundary=function(buf,max){var pos;for((max=max||buf.length)>buf.length&&(max=buf.length),pos=max-1;pos>=0&&128==(192&buf[pos]);)pos--;return pos<0?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max}(data),usableData=data;nextBoundary!==data.length&&(support.uint8array?(usableData=data.subarray(0,nextBoundary),this.leftOver=data.subarray(nextBoundary,data.length)):(usableData=data.slice(0,nextBoundary),this.leftOver=data.slice(nextBoundary,data.length))),this.push({data:exports.utf8decode(usableData),meta:chunk.meta})},Utf8DecodeWorker.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:exports.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},exports.Utf8DecodeWorker=Utf8DecodeWorker,utils.inherits(Utf8EncodeWorker,GenericWorker),Utf8EncodeWorker.prototype.processChunk=function(chunk){this.push({data:exports.utf8encode(chunk.data),meta:chunk.meta})},exports.Utf8EncodeWorker=Utf8EncodeWorker},function(module,exports){"function"==typeof Object.create?module.exports=function(ctor,superCtor){superCtor&&(ctor.super_=superCtor,ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function(ctor,superCtor){if(superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype,ctor.prototype=new TempCtor,ctor.prototype.constructor=ctor}}},function(module,exports){var getRandomValues="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(getRandomValues){var rnds8=new Uint8Array(16);module.exports=function(){return getRandomValues(rnds8),rnds8}}else{var rnds=new Array(16);module.exports=function(){for(var r,i=0;i<16;i++)0==(3&i)&&(r=4294967296*Math.random()),rnds[i]=r>>>((3&i)<<3)&255;return rnds}}},function(module,exports){for(var byteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);module.exports=function(buf,offset){var i=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=7},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Migrations_1=__webpack_require__(35),MigrationExecutor=function(){function MigrationExecutor(db,migrationsBuilder){void 0===migrationsBuilder&&(migrationsBuilder=new Migrations_1.default),this.db=db,this.migrationsBuilder=migrationsBuilder}return MigrationExecutor.prototype.applyMigrations=function(){var _this=this;this.applyMigrationsPack(this.migrationsBuilder.initial),this.migrationsBuilder.dateSorted.forEach(function(migrationsPack){_this.applyMigrationsPack(migrationsPack)})},MigrationExecutor.prototype.applyMigrationsPack=function(migrationsPack){var _this=this;migrationsPack.forEach(function(migration){migration(_this.db)})},MigrationExecutor}();exports.default=MigrationExecutor},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.storeCreatorDecorator=void 0,exports.storeCreatorDecorator=function(name,storeCreator){return function(database){database.objectStoreNames.contains(name)||storeCreator(database)}}},function(module,exports,__webpack_require__){"use strict";(function(global){
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
5
5
  * @author Feross Aboukhadijeh <http://feross.org>
6
6
  * @license MIT
7
7
  */
8
- var base64=__webpack_require__(87),ieee754=__webpack_require__(88),isArray=__webpack_require__(51);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(that=new Uint8Array(length)).__proto__=Buffer.prototype:(null===that&&(that=new Buffer(length)),that.length=length),that}function Buffer(arg,encodingOrOffset,length){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(arg,encodingOrOffset,length);if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}function from(that,value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer?function(that,array,byteOffset,length){if(array.byteLength,byteOffset<0||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");array=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length);Buffer.TYPED_ARRAY_SUPPORT?(that=array).__proto__=Buffer.prototype:that=fromArrayLike(that,array);return that}(that,value,encodingOrOffset,length):"string"==typeof value?function(that,string,encoding){"string"==typeof encoding&&""!==encoding||(encoding="utf8");if(!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');var length=0|byteLength(string,encoding),actual=(that=createBuffer(that,length)).write(string,encoding);actual!==length&&(that=that.slice(0,actual));return that}(that,value,encodingOrOffset):function(that,obj){if(Buffer.isBuffer(obj)){var len=0|checked(obj.length);return 0===(that=createBuffer(that,len)).length?that:(obj.copy(that,0,0,len),that)}if(obj){if("undefined"!=typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return"number"!=typeof obj.length||function(val){return val!=val}(obj.length)?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(that,value)}function assertSize(size){if("number"!=typeof size)throw new TypeError('"size" argument must be a number');if(size<0)throw new RangeError('"size" argument must not be negative')}function allocUnsafe(that,size){if(assertSize(size),that=createBuffer(that,size<0?0:0|checked(size)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<size;++i)that[i]=0;return that}function fromArrayLike(that,array){var length=array.length<0?0:0|checked(array.length);that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=255&array[i];return that}function checked(length){if(length>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)===read(val,-1===foundIndex?0:i-foundIndex)){if(-1===foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else-1!==foundIndex&&(i-=i-foundIndex),foundIndex=-1}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length))>remaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i<length;++i){var parsed=parseInt(string.substr(2*i,2),16);if(isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(function(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(function(str,units){for(var c,hi,lo,byteArray=[],i=0;i<str.length&&!((units-=2)<0);++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i<end;){var secondByte,thirdByte,fourthByte,tempCodePoint,firstByte=buf[i],codePoint=null,bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end)switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:128==(192&(secondByte=buf[i+1]))&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;i<len;)res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}(res)}exports.Buffer=Buffer,exports.SlowBuffer=function(length){+length!=length&&(length=0);return Buffer.alloc(+length)},exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return function(that,size,fill,encoding){return assertSize(size),size<=0?createBuffer(that,size):void 0!==fill?"string"==typeof encoding?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill):createBuffer(that,size)}(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(list,length){if(!isArray(list))throw new TypeError('"list" argument must be an Array of Buffers');if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var len=this.length;if(len%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function(){var len=this.length;if(len%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function(){var len=this.length;if(len%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function(){var length=0|this.length;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):function(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0},Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)},Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else{if(!isFinite(offset))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0)}var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||start<0)&&(start=0),(!end||end<0||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=String.fromCharCode(bytes[i]+256*bytes[i+1]);return res}function checkOffset(offset,ext,length){if(offset%1!=0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i)buf[offset+i]=value>>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function(start,end){var newBuf,len=this.length;if(start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end<start&&(end=start),Buffer.TYPED_ARRAY_SUPPORT)(newBuf=this.subarray(start,end)).__proto__=Buffer.prototype;else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,void 0);for(var i=0;i<sliceLen;++i)newBuf[i]=this[i+start]}return newBuf},Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;byteLength>0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val>=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return val>=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){(value=+value,offset|=0,byteLength|=0,noAssert)||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){(value=+value,offset|=0,byteLength|=0,noAssert)||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);var i=byteLength-1,mul=1;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(targetStart<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var i,len=end-start;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;i>=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);code<256&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(start<0||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;var i;if(start>>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString()),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){var codePoint;units=units||1/0;for(var length=string.length,leadSurrogate=null,bytes=[],i=0;i<length;++i){if((codePoint=string.charCodeAt(i))>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function(str){if((str=function(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(11))},function(module,exports){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,function(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},function(module,exports,__webpack_require__){function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=function(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)},exports.isBoolean=function(arg){return"boolean"==typeof arg},exports.isNull=function(arg){return null===arg},exports.isNullOrUndefined=function(arg){return null==arg},exports.isNumber=function(arg){return"number"==typeof arg},exports.isString=function(arg){return"string"==typeof arg},exports.isSymbol=function(arg){return"symbol"==typeof arg},exports.isUndefined=function(arg){return void 0===arg},exports.isRegExp=function(re){return"[object RegExp]"===objectToString(re)},exports.isObject=function(arg){return"object"==typeof arg&&null!==arg},exports.isDate=function(d){return"[object Date]"===objectToString(d)},exports.isError=function(e){return"[object Error]"===objectToString(e)||e instanceof Error},exports.isFunction=function(arg){return"function"==typeof arg},exports.isPrimitive=function(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg},exports.isBuffer=__webpack_require__(23).Buffer.isBuffer},function(module,exports,__webpack_require__){"use strict";var ES6Promise=null;ES6Promise="undefined"!=typeof Promise?Promise:__webpack_require__(101),module.exports={Promise:ES6Promise}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},__spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0});var DateModule_1=__webpack_require__(6),InboxMessages=function(){function InboxMessages(data,api,inboxModel,dateModule){void 0===dateModule&&(dateModule=new DateModule_1.default),this.data=data,this.api=api,this.inboxModel=inboxModel,this.dateModule=dateModule,this.publicMessageBuilder=this.publicMessageBuilder.bind(this)}return InboxMessages.prototype.messageTypeFactory=function(actionParams){var messageType=0;return"h"in actionParams||"rm"in actionParams||"r"in actionParams?messageType=1:"l"in actionParams&&null!=actionParams.l&&(messageType=actionParams.l.startsWith("http")?2:3),messageType},InboxMessages.prototype.updateMessagesStatusWithCodes=function(codes,messages,status){return __awaiter(this,void 0,void 0,function(){var updatedMessages,inboxStatusQueries,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return updatedMessages=[],inboxStatusQueries=[],messages.forEach(function(msg){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){return-1===codes.indexOf(msg.inbox_id)?[2]:(msg.status=status,updatedMessages.push(msg),inboxStatusQueries.push(this.api.inboxStatus(msg.order,msg.status)),[2])})})}),[4,this.inboxModel.putBulkMessages(updatedMessages)];case 1:return _a.sent(),[4,Promise.all(inboxStatusQueries)];case 2:return _a.sent(),[2]}})})},InboxMessages.prototype.publicMessageBuilder=function(message){return __awaiter(this,void 0,void 0,function(){var imageUrl,_a,title,_b;return __generator(this,function(_c){switch(_c.label){case 0:return(_a=message.image)?[3,2]:[4,this.data.getDefaultNotificationImage()];case 1:_a=_c.sent(),_c.label=2;case 2:return imageUrl=_a,(_b=message.title)?[3,4]:[4,this.data.getDefaultNotificationTitle()];case 3:_b=_c.sent(),_c.label=4;case 4:return title=_b,this.dateModule.date=new Date(1e3*parseInt(message.send_date)),this.dateModule.setLocal(),[2,{title:title,imageUrl:imageUrl,code:message.inbox_id,message:message.text,sendDate:this.dateModule.date.toISOString(),type:this.messageTypeFactory(JSON.parse(message.action_params)),isRead:2===message.status||3===message.status,isActionPerformed:3===message.status}]}})})},InboxMessages.prototype.messagesWithNoActionPerformedCount=function(){return this.inboxModel.getDeliveredReadMessagesCount()},InboxMessages.prototype.unreadMessagesCount=function(){return this.inboxModel.getDeliveredMessagesCount()},InboxMessages.prototype.messagesCount=function(){return this.inboxModel.messagesCount()},InboxMessages.prototype.loadMessages=function(){return __awaiter(this,void 0,void 0,function(){var readMessages,unreadMessages,buildMessagePromises;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return readMessages=_a.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return unreadMessages=_a.sent(),buildMessagePromises=__spreadArrays(readMessages,unreadMessages).sort(function(msgA,msgB){return parseInt(msgB.send_date,10)-parseInt(msgA.send_date,10)}).sort(function(msgA,msgB){return parseInt(msgB.order||"0",10)-parseInt(msgA.order||"0",10)}).map(this.publicMessageBuilder),[2,Promise.all(buildMessagePromises)]}})})},InboxMessages.prototype.readMessagesWithCodes=function(codes){return __awaiter(this,void 0,void 0,function(){var unreadMessages,statusRead;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getDeliveredMessages()];case 1:return unreadMessages=_a.sent(),statusRead=2,[4,this.updateMessagesStatusWithCodes(codes,unreadMessages,statusRead)];case 2:return _a.sent(),[2]}})})},InboxMessages.prototype.performActionForMessageWithCode=function(code){return __awaiter(this,void 0,void 0,function(){var message,actionParams,messageType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getMessage(code)];case 1:return message=_a.sent(),actionParams=JSON.parse(message.action_params),2===(messageType=this.messageTypeFactory(actionParams))&&null!=actionParams.l?document.location.href=actionParams.l:3===messageType&&null!=actionParams.l&&window.history.go(actionParams.l),message.status=3,[4,this.inboxModel.putMessage(message)];case 2:return _a.sent(),[4,this.api.inboxStatus(message.order,message.status)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.deleteMessagesWithCodes=function(codes){return __awaiter(this,void 0,void 0,function(){var readMessages,unreadMessages,statusDeleted;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return readMessages=_a.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return unreadMessages=_a.sent(),statusDeleted=4,[4,this.updateMessagesStatusWithCodes(codes,__spreadArrays(readMessages,unreadMessages),statusDeleted)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.syncMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.updateMessages()];case 1:return _a.sent(),[2]}})})},InboxMessages}();exports.default=InboxMessages},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Data_1=__webpack_require__(5),logger_1=__webpack_require__(4),ApiClient=function(){function ApiClient(data,logger){void 0===data&&(data=new Data_1.Data),void 0===logger&&(logger=logger_1.Logger),this.data=data,this.logger=logger}return ApiClient.prototype.checkDevice=function(options){return this.createRequest("checkDevice",options)},ApiClient.prototype.getConfig=function(options){return this.createRequest("getConfig",options)},ApiClient.prototype.applicationOpen=function(options){return this.createRequest("applicationOpen",options)},ApiClient.prototype.registerDevice=function(options){return this.createRequest("registerDevice",options)},ApiClient.prototype.unregisterDevice=function(options){return this.createRequest("unregisterDevice",options)},ApiClient.prototype.deleteDevice=function(options){return this.createRequest("deleteDevice",options)},ApiClient.prototype.messageDeliveryEvent=function(options){return this.createRequest("messageDeliveryEvent",options)},ApiClient.prototype.pushStat=function(options){return this.createRequest("pushStat",options)},ApiClient.prototype.setTags=function(options){return this.createRequest("setTags",options)},ApiClient.prototype.getTags=function(options){return this.createRequest("getTags",options)},ApiClient.prototype.registerUser=function(options){return this.createRequest("registerUser",options)},ApiClient.prototype.postEvent=function(options){return this.createRequest("postEvent",options)},ApiClient.prototype.getInboxMessages=function(options){return this.createRequest("getInboxMessages",options)},ApiClient.prototype.inboxStatus=function(options){return this.createRequest("inboxStatus",options)},ApiClient.prototype.pageVisit=function(options,url){return this.createRequest("pageVisit",options,url)},ApiClient.prototype.getInApps=function(options){return this.createRequest("getInApps",options)},ApiClient.prototype.setPurchase=function(options){return this.createRequest("setPurchase",options)},ApiClient.prototype.createRequest=function(methodName,request,customUrl){return __awaiter(this,void 0,void 0,function(){var entrypoint,response,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApiEntrypoint()];case 1:return entrypoint=_a.sent(),[4,fetch(customUrl||entrypoint+methodName,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify({request:request})})];case 2:return response=_a.sent(),[4,this.checkResponse(response)];case 3:return(result=_a.sent()).base_url?[4,this.data.setApiEntrypoint(result.base_url)]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[4,this.logger.write("apirequest",methodName+" call with arguments: "+JSON.stringify(request)+" to Pushwoosh has been successful. Result: "+JSON.stringify(result.response))];case 6:return _a.sent(),[2,result.response]}})})},ApiClient.prototype.checkResponse=function(response){return __awaiter(this,void 0,void 0,function(){var data;return __generator(this,function(_a){switch(_a.label){case 0:if(200!==response.status)throw new Error("Error code: "+response.status+". Error text: "+response.statusText);return[4,response.json()];case 1:if(200!==(data=_a.sent()).status_code)throw new Error("Error code: "+data.status_code+". Error text: "+data.status_message);return[2,data]}})})},ApiClient}();exports.ApiClient=ApiClient},function(module,exports,__webpack_require__){"use strict";(function(process){void 0===process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?module.exports={nextTick:function(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i<args.length;)args[i++]=arguments[i];return process.nextTick(function(){fn.apply(null,args)})}}}:module.exports=process}).call(this,__webpack_require__(24))},function(module,exports,__webpack_require__){var buffer=__webpack_require__(23),Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports={isNode:void 0!==Buffer,newBufferFrom:function(data,encoding){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(data,encoding);if("number"==typeof data)throw new Error('The "data" argument must not be a number');return new Buffer(data,encoding)},allocBuffer:function(size){if(Buffer.alloc)return Buffer.alloc(size);var buf=new Buffer(size);return buf.fill(0),buf},isBuffer:function(b){return Buffer.isBuffer(b)},isStream:function(obj){return obj&&"function"==typeof obj.on&&"function"==typeof obj.pause&&"function"==typeof obj.resume}}}).call(this,__webpack_require__(23).Buffer)},function(module,exports,__webpack_require__){var _nodeId,_clockseq,rng=__webpack_require__(16),bytesToUuid=__webpack_require__(17),_lastMSecs=0,_lastNSecs=0;module.exports=function(options,buf,offset){var i=buf&&offset||0,b=buf||[],node=(options=options||{}).node||_nodeId,clockseq=void 0!==options.clockseq?options.clockseq:_clockseq;if(null==node||null==clockseq){var seedBytes=rng();null==node&&(node=_nodeId=[1|seedBytes[0],seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]),null==clockseq&&(clockseq=_clockseq=16383&(seedBytes[6]<<8|seedBytes[7]))}var msecs=void 0!==options.msecs?options.msecs:(new Date).getTime(),nsecs=void 0!==options.nsecs?options.nsecs:_lastNSecs+1,dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&void 0===options.clockseq&&(clockseq=clockseq+1&16383),(dt<0||msecs>_lastMSecs)&&void 0===options.nsecs&&(nsecs=0),nsecs>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=msecs,_lastNSecs=nsecs,_clockseq=clockseq;var tl=(1e4*(268435455&(msecs+=122192928e5))+nsecs)%4294967296;b[i++]=tl>>>24&255,b[i++]=tl>>>16&255,b[i++]=tl>>>8&255,b[i++]=255&tl;var tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255,b[i++]=255&tmh,b[i++]=tmh>>>24&15|16,b[i++]=tmh>>>16&255,b[i++]=clockseq>>>8|128,b[i++]=255&clockseq;for(var n=0;n<6;++n)b[i+n]=node[n];return buf||bytesToUuid(b)}},function(module,exports,__webpack_require__){var rng=__webpack_require__(16),bytesToUuid=__webpack_require__(17);module.exports=function(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"===options?new Array(16):null,options=null);var rnds=(options=options||{}).random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid(rnds)}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var EventBus_1=__webpack_require__(35);exports.EventBus=EventBus_1.EventBus},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var uuid_1=__webpack_require__(13),EventBus=function(){return function(){var _this=this;this.addEventHandler=function(name,handler){var savedEventHandlers=_this.savedEventHandlersMap[name];savedEventHandlers||(savedEventHandlers=[]),savedEventHandlers.push(handler),_this.savedEventHandlersMap[name]=savedEventHandlers},this.removeEventHandler=function(name,handler){var savedEventHandlers=_this.savedEventHandlersMap[name];savedEventHandlers&&(_this.savedEventHandlersMap[name]=savedEventHandlers.filter(function(savedEventHandler){return savedEventHandler!==handler}))},this.dispatchEvent=function(name,payload){var eventId=payload.eventId||uuid_1.v4(),savedEventHandlers=_this.savedEventHandlersMap[name];return savedEventHandlers?(savedEventHandlers.forEach(function(element){"function"==typeof element&&setTimeout(function(){element(__assign(__assign({},payload),{eventId:eventId}))},0)}),eventId):eventId},this.savedEventHandlersMap={}}}();exports.EventBus=EventBus},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Data_1=__webpack_require__(5),ApiClient_1=__webpack_require__(28),CONSTANTS=__webpack_require__(1),Api=function(){function Api(eventBus,data,apiClient){void 0===data&&(data=new Data_1.Data),void 0===apiClient&&(apiClient=new ApiClient_1.ApiClient),this.eventBus=eventBus,this.data=data,this.apiClient=apiClient}return Api.prototype.checkDevice=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.checkDevice(params)];case 2:return[2,_a.sent()]}})})},Api.prototype.checkDeviceSubscribeForPushNotifications=function(useCache){return void 0===useCache&&(useCache=!0),__awaiter(this,void 0,void 0,function(){var status,_a,exist,push_token_exist;return __generator(this,function(_b){switch(_b.label){case 0:return void 0!==(status=localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS))&&useCache?[3,2]:[4,this.checkDevice()];case 1:_a=_b.sent(),exist=_a.exist,push_token_exist=_a.push_token_exist,localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,exist&&push_token_exist?CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED:CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),status=localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS),_b.label=2;case 2:return[2,status===CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED]}})})},Api.prototype.getConfig=function(features){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getConfig(__assign(__assign({},params),{features:features}))]}})})},Api.prototype.applicationOpen=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.setLastOpenApplicationTime(Date.now())];case 2:return _a.sent(),[2,this.apiClient.applicationOpen(params)]}})})},Api.prototype.registerDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,tokens,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusCommunicationDisabled()];case 1:if(_a.sent())throw new Error("Can't register device: Communication is disabled!");return[4,this.getRequestParams()];case 2:return params=_a.sent(),[4,this.data.getTokens()];case 3:if(!(tokens=_a.sent()).pushToken)throw new Error("Can't register device: pushToken is not exist!");return[4,this.apiClient.registerDevice(__assign(__assign({},params),{push_token:tokens.pushToken,auth_token:tokens.authToken,public_key:tokens.publicKey,fcm_push_set:tokens.fcmPushSet,fcm_token:tokens.fcmToken}))];case 4:return response=_a.sent(),[4,this.data.setStatusManualUnsubscribed(!1)];case 5:return _a.sent(),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED),this.eventBus.dispatchEvent("register",{}),[2,response]}})})},Api.prototype.unregisterDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),response=this.apiClient.unregisterDevice(params),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),this.eventBus.dispatchEvent("unsubscribe",{}),[2,response]}})})},Api.prototype.deleteDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),response=this.apiClient.deleteDevice(params),[4,this.data.setStatusManualUnsubscribed(!0)];case 2:return _a.sent(),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),this.eventBus.dispatchEvent("unsubscribe",{}),[2,response]}})})},Api.prototype.messageDeliveryEvent=function(hash,isTrackingLogOnFailure,metaData){return void 0===metaData&&(metaData={}),__awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return Math.round(+new Date),[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.messageDeliveryEvent(__assign(__assign({},params),{hash:hash,metaData:metaData}))];case 2:return[2,_a.sent()]}})})},Api.prototype.pushStat=function(hash,isTrackingLogOnFailure,metaData){return void 0===metaData&&(metaData={}),__awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return Math.round(+new Date),[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.pushStat(__assign(__assign({},params),{hash:hash,metaData:metaData}))];case 2:return[2,_a.sent()]}})})},Api.prototype.setTags=function(tags){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.setTags(__assign(__assign({},params),{tags:tags}))]}})})},Api.prototype.getTags=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getTags(params)]}})})},Api.prototype.registerUser=function(userId){return __awaiter(this,void 0,void 0,function(){var params,deviceType,id,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getDeviceType()];case 2:return deviceType=_a.sent(),id=""+userId,[4,this.apiClient.registerUser(__assign(__assign({},params),{userId:id,ts_offset:60*-(new Date).getTimezoneOffset(),device_type:deviceType}))];case 3:return response=_a.sent(),[4,this.data.setUserId(""+userId)];case 4:return _a.sent(),[4,this.data.setStatusUserIdWasChanged(!0)];case 5:return _a.sent(),[2,response]}})})},Api.prototype.postEvent=function(event,attributes){return __awaiter(this,void 0,void 0,function(){var params,date,time,timestampUTC,timestampCurrent,lastOpenMessage,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),date=new Date,time=date.getTime(),timestampUTC=Math.floor(time/1e3),timestampCurrent=timestampUTC-date.getTimezoneOffset()/60*3600,[4,this.data.getLastOpenMessage()];case 2:if((lastOpenMessage=_a.sent())&&lastOpenMessage.expiry>Date.now()){if(attributes.msgHash)return[2,Promise.reject("attribute msgHash already defined")];attributes=__assign(__assign({},attributes),{msgHash:lastOpenMessage.messageHash})}return[4,this.data.setLastOpenMessage(void 0)];case 3:return _a.sent(),[4,this.apiClient.postEvent(__assign(__assign({},params),{event:event,timestampUTC:timestampUTC,timestampCurrent:timestampCurrent,attributes:attributes}))];case 4:return(response=_a.sent())&&response.code&&this.eventBus.dispatchEvent("receive-in-app-code",{code:response.code}),[2,response]}})})},Api.prototype.getInboxMessages=function(count){return void 0===count&&(count=0),__awaiter(this,void 0,void 0,function(){var params,lastCode,lastRequestTime;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getInboxLastRequestCode()];case 2:return lastCode=_a.sent(),[4,this.data.getInboxLastRequestTime()];case 3:return lastRequestTime=_a.sent(),[2,this.apiClient.getInboxMessages(__assign(__assign({},params),{count:count,last_code:lastCode,last_request_time:lastRequestTime}))]}})})},Api.prototype.inboxStatus=function(order,status){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.inboxStatus(__assign(__assign({},params),{inbox_code:order,status:status,time:(new Date).getTime()}))]}})})},Api.prototype.triggerEvent=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){throw new Error("Method has been deprecated, because we don't aggregate this statistics.")})})},Api.prototype.pageVisit=function(config){return __awaiter(this,void 0,void 0,function(){var params,features,url;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getFeatures()];case 2:return features=_a.sent(),(url=features&&features.page_visit&&features.page_visit.entrypoint)?[2,this.apiClient.pageVisit(__assign(__assign({},params),config),url)]:[2]}})})},Api.prototype.getInApps=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getInApps(params)]}})})},Api.prototype.setPurchase=function(attributes){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.setPurchase(__assign(__assign({},params),attributes))]}})})},Api.prototype.getParams=function(){return __awaiter(this,void 0,void 0,function(){var applicationCode,hwid,apiParams,initParams;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return applicationCode=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getTokens()];case 3:return apiParams=_a.sent(),[4,this.data.getInitParams()];case 4:return initParams=_a.sent(),[2,__assign(__assign({applicationCode:applicationCode,hwid:hwid},apiParams),initParams)]}})})},Object.defineProperty(Api.prototype,"params",{get:function(){throw new Error('Property "Pushwoosh.api.params" have been deprecated. Use the async method "Pushwoosh.api.getParams()"')},enumerable:!0,configurable:!0}),Api.prototype.getRequestParams=function(){return __awaiter(this,void 0,void 0,function(){var applicationCode,hwid,userId,deviceType,deviceModel,language,version,timezone;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return applicationCode=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getUserId()];case 3:return userId=_a.sent(),[4,this.data.getDeviceType()];case 4:return deviceType=_a.sent(),[4,this.data.getDeviceModel()];case 5:return deviceModel=_a.sent(),[4,this.data.getLanguage()];case 6:return language=_a.sent(),[4,this.data.getSdkVersion()];case 7:return version=_a.sent(),timezone=60*-(new Date).getTimezoneOffset(),[2,{application:applicationCode,hwid:hwid,userId:userId||hwid,device_type:deviceType,device_model:deviceModel,timezone:timezone,language:language,v:version}]}})})},Api}();exports.Api=Api},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var initial_1=__webpack_require__(38),_26_11_2018_1=__webpack_require__(39),DateModule_1=__webpack_require__(6),Migrations=function(){function Migrations(dateModule){void 0===dateModule&&(dateModule=new DateModule_1.default),this.migrations={initial:initial_1.default,"2018/11/26":_26_11_2018_1.default},this.dateModule=dateModule}return Object.defineProperty(Migrations.prototype,"initial",{get:function(){return this.migrations.initial},enumerable:!0,configurable:!0}),Object.defineProperty(Migrations.prototype,"dateSorted",{get:function(){var _this=this;return Object.keys(this.migrations).filter(function(key){return"initial"!==key}).sort(function(a,b){var dateA=new DateModule_1.default(new Date(a)),dateB=new DateModule_1.default(new Date(b));return dateA.getTimestamp()-dateB.getTimestamp()}).map(function(key){return _this.migrations[key]})},enumerable:!0,configurable:!0}),Migrations}();exports.default=Migrations},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(20),constants_1=__webpack_require__(9);exports.default=[helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_KEY_VALUE,function(database){database.createObjectStore(constants_1.STORE_NAME_KEY_VALUE,{keyPath:"key"})}),helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_MAIN_LOG,function(database){var logStore=database.createObjectStore(constants_1.STORE_NAME_MAIN_LOG,{keyPath:constants_1.KEY_PATH_BASE_INCREMENT,autoIncrement:!0});logStore.createIndex("environment","environment",{unique:!1}),logStore.createIndex("date","date",{unique:!1}),logStore.createIndex("type","type",{unique:!1})}),helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_MESSAGE_LOG,function(database){database.createObjectStore(constants_1.STORE_NAME_MESSAGE_LOG,{keyPath:constants_1.KEY_PATH_BASE_INCREMENT,autoIncrement:!0}).createIndex("date","date",{unique:!1})})]},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(20),constants_1=__webpack_require__(9);exports.default=[helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_INBOX_MESSAGES,function(database){var store=database.createObjectStore(constants_1.STORE_NAME_INBOX_MESSAGES,{keyPath:"inbox_id",autoIncrement:!1});store.createIndex("status","status",{unique:!1,multiEntry:!0}),store.createIndex("rt","rt",{unique:!1,multiEntry:!0})})]},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var uuid_1=__webpack_require__(13),logger_1=__webpack_require__(4),CONSTANTS=__webpack_require__(1),PushServiceDefault=function(){function PushServiceDefault(api,data,config){this.api=api,this.data=data,this.config=config}return PushServiceDefault.prototype.getPermission=function(){return Notification.permission},PushServiceDefault.prototype.checkIsPermissionGranted=function(){return this.getPermission()===CONSTANTS.PERMISSION_GRANTED},PushServiceDefault.prototype.checkIsPermissionDefault=function(){return this.getPermission()===CONSTANTS.PERMISSION_PROMPT},PushServiceDefault.prototype.checkIsManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getStatusManualUnsubscribed()]})})},PushServiceDefault.prototype.askPermission=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,Notification.requestPermission()];case 1:return _a.sent(),[2]}})})},PushServiceDefault.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getTokens()]})})},PushServiceDefault.prototype.subscribe=function(subscription){return __awaiter(this,void 0,void 0,function(){var currentSubscription,senderId_1,applicationServerKey,senderId,pushToken,_p256dn,_auth,p256dh,auth,_a,token,pushSet;return __generator(this,function(_b){switch(_b.label){case 0:return currentSubscription=subscription,this.checkIsPermissionGranted()?currentSubscription?[3,6]:[4,this.trySubscribe()]:(logger_1.Logger.error("You must have permission granted before subscribe!"),[2]);case 1:return currentSubscription=_b.sent(),[4,this.getSenderIdFromManifest()];case 2:return senderId_1=_b.sent(),[4,this.checkIsChangeSenderId(senderId_1)];case 3:return _b.sent()?[4,this.unsubscribe()]:[3,6];case 4:return _b.sent(),[4,this.data.setSenderId(senderId_1)];case 5:_b.sent(),_b.label=6;case 6:return[4,this.getApplicationServerKey()];case 7:return applicationServerKey=_b.sent(),[4,this.data.getSenderId()];case 8:return senderId=_b.sent(),[4,this.getPushToken(currentSubscription)];case 9:if(pushToken=_b.sent(),_p256dn=currentSubscription.getKey("p256dh"),_auth=currentSubscription.getKey("auth"),!_p256dn||!_auth)throw new Error("Can't get subscription keys!");return p256dh=btoa(String.fromCharCode.apply(String,new Uint8Array(_p256dn))),auth=btoa(String.fromCharCode.apply(String,new Uint8Array(_auth))),[4,this.getFcmKeys({endpoint:currentSubscription.endpoint,application_pub_key:applicationServerKey,encryption_key:p256dh,encryption_auth:auth,authorized_entity:senderId})];case 10:return _a=_b.sent(),token=_a.token,pushSet=_a.pushSet,[4,this.data.setTokens({publicKey:p256dh,pushToken:pushToken,authToken:auth,fcmPushSet:pushSet,fcmToken:token,endpoint:currentSubscription.endpoint})];case 11:return _b.sent(),[4,this.api.registerDevice()];case 12:return _b.sent(),[2]}})})},PushServiceDefault.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){var subscription;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return[4,_a.sent().pushManager.getSubscription()];case 2:return subscription=_a.sent(),[4,this.data.setTokens({})];case 3:return _a.sent(),[4,this.data.setStatusManualUnsubscribed(!0)];case 4:return _a.sent(),[4,this.api.unregisterDevice()];case 5:return _a.sent(),subscription?[4,subscription.unsubscribe()]:[2];case 6:return _a.sent(),[2]}})})},PushServiceDefault.prototype.checkIsRegister=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},PushServiceDefault.prototype.checkIsNeedResubscribe=function(){return __awaiter(this,void 0,void 0,function(){var savedSenderId,isExistSavedSenderId,manifestSenderId,isChangeSenderID,lastPermission,permission,credentials,pushTokenFromSubscription,pushTokenFromStore,isEqualPushTokens;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getSenderId()];case 1:return savedSenderId=_a.sent(),isExistSavedSenderId=void 0!==savedSenderId,[4,this.getSenderIdFromManifest()];case 2:return manifestSenderId=_a.sent(),isChangeSenderID=isExistSavedSenderId&&manifestSenderId!==savedSenderId,[4,this.data.setSenderId(manifestSenderId)];case 3:return _a.sent(),[4,this.data.getLastPermissionStatus()];case 4:return lastPermission=_a.sent(),permission=this.getPermission(),isExistSavedSenderId&&lastPermission!==permission?[4,this.data.setLastPermissionStatus(permission)]:[3,6];case 5:return _a.sent(),[2,!0];case 6:return[4,this.getCredentials()];case 7:return credentials=_a.sent(),[4,this.getPushToken(credentials)];case 8:return pushTokenFromSubscription=_a.sent(),[4,this.data.getTokens()];case 9:return pushTokenFromStore=_a.sent(),isEqualPushTokens=pushTokenFromSubscription===(pushTokenFromStore&&pushTokenFromStore.pushToken),[2,isChangeSenderID||!isEqualPushTokens]}})})},PushServiceDefault.prototype.getServiceWorkerRegistration=function(){return __awaiter(this,void 0,void 0,function(){var url,_a;return __generator(this,function(_b){switch(_b.label){case 0:return this.registration?[3,5]:[4,this.registerServiceWorker()];case 1:return _b.sent(),[4,this.data.getServiceWorkerUrl()];case 2:return url=_b.sent(),_a=this,[4,navigator.serviceWorker.getRegistration(url)];case 3:return _a.registration=_b.sent(),[4,this.registration.update()];case 4:_b.sent(),_b.label=5;case 5:if(!this.registration)throw new Error("Internal Error: Can't register service worker!");return[2,this.registration]}})})},PushServiceDefault.prototype.registerServiceWorker=function(){return __awaiter(this,void 0,void 0,function(){var url,scope,sdkVersion,serviceWorkerVersion,cleanCache;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getServiceWorkerUrl()];case 1:return url=_a.sent(),[4,this.data.getServiceWorkerScope()];case 2:return scope=_a.sent(),[4,this.data.getSdkVersion()];case 3:return sdkVersion=_a.sent(),[4,this.data.getServiceWorkerVersion()];case 4:return serviceWorkerVersion=_a.sent(),cleanCache="",sdkVersion!==serviceWorkerVersion&&(cleanCache="?cache_clean="+uuid_1.v4()),[4,navigator.serviceWorker.register(""+url+cleanCache,{scope:scope})];case 5:return _a.sent(),[2]}})})},PushServiceDefault.prototype.trySubscribe=function(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,4]),[4,this.subscribePushManager()];case 1:return[2,_a.sent()];case 2:return error_1=_a.sent(),console.error(error_1),[4,this.unsubscribe()];case 3:return _a.sent(),[2,this.subscribePushManager()];case 4:return[2]}})})},PushServiceDefault.prototype.subscribePushManager=function(){return __awaiter(this,void 0,void 0,function(){var registration,applicationServerKey;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return registration=_a.sent(),[4,this.getApplicationServerKey()];case 2:return applicationServerKey=_a.sent(),[2,registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:applicationServerKey?this.urlBase64ToUint8Array(applicationServerKey):null})]}})})},PushServiceDefault.prototype.getCredentials=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return[4,_a.sent().pushManager.getSubscription()];case 2:return[2,_a.sent()]}})})},PushServiceDefault.prototype.getFcmKeys=function(config){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,fetch(this.config.entrypoint||"https://fcm.googleapis.com/fcm/connect/subscribe",{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify(config)})];case 1:return 200!==(response=_a.sent()).status?[3,3]:[4,response.json()];case 2:return[2,_a.sent()];case 3:throw new Error("Internal error: Can't register device in fcm. Status: "+response.status+". Message: "+response.statusText)}})})},PushServiceDefault.prototype.getPushToken=function(subscription){return __awaiter(this,void 0,void 0,function(){var deviceType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),subscription?12===deviceType?[2,subscription.endpoint]:[2,subscription.endpoint.split("/").pop()||""]:[2,""]}})})},PushServiceDefault.prototype.getApplicationServerKey=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return 11!==_a.sent()?[2]:[4,this.data.getApplicationServerKey()];case 2:return[2,_a.sent()]}})})},PushServiceDefault.prototype.getSenderIdFromManifest=function(){return __awaiter(this,void 0,void 0,function(){var manifest,url,response,data,match;return __generator(this,function(_a){switch(_a.label){case 0:if(!(manifest=document.querySelector('link[rel="manifest"]')))throw new Error("Error: manifest.json not found!");if(!(url=manifest.getAttribute("href")))throw new Error("Error: manifest.json url not found!");return[4,fetch(url,{method:"GET",headers:{"Content-Type":"application/json;charset=UTF-8"}})];case 1:if(200!==(response=_a.sent()).status)throw new Error("Error: Can't load manifest.json! "+response.statusText);return[4,response.text()];case 2:if(data=_a.sent(),!(match=data.match(/("|')?gcm_sender_id("|')?:\s*("|')?(\d+)("|')?/))||"string"!=typeof match[4])throw new Error("Error: Can't find gcm_sender_id in manifest.json!");return[2,match[4]]}})})},PushServiceDefault.prototype.checkIsChangeSenderId=function(currentSenderId){return __awaiter(this,void 0,void 0,function(){var senderIdFromIndexedDB;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getSenderId()];case 1:return senderIdFromIndexedDB=_a.sent(),[2,currentSenderId!==senderIdFromIndexedDB]}})})},PushServiceDefault.prototype.urlBase64ToUint8Array=function(base64String){for(var base64=(base64String+"=".repeat((4-base64String.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),rawData=window.atob(base64),outputArray=new Uint8Array(rawData.length),i=0;i<rawData.length;++i)outputArray[i]=rawData.charCodeAt(i);return outputArray},PushServiceDefault}();exports.PushServiceDefault=PushServiceDefault},function(module,exports,__webpack_require__){"use strict";var ReflectOwnKeys,R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function(target,receiver,args){return Function.prototype.apply.call(target,receiver,args)};ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))}:function(target){return Object.getOwnPropertyNames(target)};var NumberIsNaN=Number.isNaN||function(value){return value!=value};function EventEmitter(){EventEmitter.init.call(this)}module.exports=EventEmitter,module.exports.once=function(emitter,name){return new Promise(function(resolve,reject){function errorListener(err){emitter.removeListener(name,resolver),reject(err)}function resolver(){"function"==typeof emitter.removeListener&&emitter.removeListener("error",errorListener),resolve([].slice.call(arguments))}eventTargetAgnosticAddListener(emitter,name,resolver,{once:!0}),"error"!==name&&function(emitter,handler,flags){"function"==typeof emitter.on&&eventTargetAgnosticAddListener(emitter,"error",handler,flags)}(emitter,errorListener,{once:!0})})},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(listener){if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener)}function _getMaxListeners(that){return void 0===that._maxListeners?EventEmitter.defaultMaxListeners:that._maxListeners}function _addListener(target,type,listener,prepend){var m,events,existing;if(checkListener(listener),void 0===(events=target._events)?(events=target._events=Object.create(null),target._eventsCount=0):(void 0!==events.newListener&&(target.emit("newListener",type,listener.listener?listener.listener:listener),events=target._events),existing=events[type]),void 0===existing)existing=events[type]=listener,++target._eventsCount;else if("function"==typeof existing?existing=events[type]=prepend?[listener,existing]:[existing,listener]:prepend?existing.unshift(listener):existing.push(listener),(m=_getMaxListeners(target))>0&&existing.length>m&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(state);return wrapped.listener=listener,state.wrapFn=wrapped,wrapped}function _listeners(target,type,unwrap){var events=target._events;if(void 0===events)return[];var evlistener=events[type];return void 0===evlistener?[]:"function"==typeof evlistener?unwrap?[evlistener.listener||evlistener]:[evlistener]:unwrap?function(arr){for(var ret=new Array(arr.length),i=0;i<ret.length;++i)ret[i]=arr[i].listener||arr[i];return ret}(evlistener):arrayClone(evlistener,evlistener.length)}function listenerCount(type){var events=this._events;if(void 0!==events){var evlistener=events[type];if("function"==typeof evlistener)return 1;if(void 0!==evlistener)return evlistener.length}return 0}function arrayClone(arr,n){for(var copy=new Array(n),i=0;i<n;++i)copy[i]=arr[i];return copy}function eventTargetAgnosticAddListener(emitter,name,listener,flags){if("function"==typeof emitter.on)flags.once?emitter.once(name,listener):emitter.on(name,listener);else{if("function"!=typeof emitter.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof emitter);emitter.addEventListener(name,function wrapListener(arg){flags.once&&emitter.removeEventListener(name,wrapListener),listener(arg)})}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(arg){if("number"!=typeof arg||arg<0||NumberIsNaN(arg))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+".");defaultMaxListeners=arg}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(n){if("number"!=typeof n||n<0||NumberIsNaN(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this},EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function(type){for(var args=[],i=1;i<arguments.length;i++)args.push(arguments[i]);var doError="error"===type,events=this._events;if(void 0!==events)doError=doError&&void 0===events.error;else if(!doError)return!1;if(doError){var er;if(args.length>0&&(er=args[0]),er instanceof Error)throw er;var err=new Error("Unhandled error."+(er?" ("+er.message+")":""));throw err.context=er,err}var handler=events[type];if(void 0===handler)return!1;if("function"==typeof handler)ReflectApply(handler,this,args);else{var len=handler.length,listeners=arrayClone(handler,len);for(i=0;i<len;++i)ReflectApply(listeners[i],this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){return _addListener(this,type,listener,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(type,listener){return _addListener(this,type,listener,!0)},EventEmitter.prototype.once=function(type,listener){return checkListener(listener),this.on(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.prependOnceListener=function(type,listener){return checkListener(listener),this.prependListener(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.removeListener=function(type,listener){var list,events,position,i,originalListener;if(checkListener(listener),void 0===(events=this._events))return this;if(void 0===(list=events[type]))return this;if(list===listener||list.listener===listener)0==--this._eventsCount?this._events=Object.create(null):(delete events[type],events.removeListener&&this.emit("removeListener",type,list.listener||listener));else if("function"!=typeof list){for(position=-1,i=list.length-1;i>=0;i--)if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener,position=i;break}if(position<0)return this;0===position?list.shift():function(list,index){for(;index+1<list.length;index++)list[index]=list[index+1];list.pop()}(list,position),1===list.length&&(events[type]=list[0]),void 0!==events.removeListener&&this.emit("removeListener",type,originalListener||listener)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(type){var listeners,events,i;if(void 0===(events=this._events))return this;if(void 0===events.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==events[type]&&(0==--this._eventsCount?this._events=Object.create(null):delete events[type]),this;if(0===arguments.length){var key,keys=Object.keys(events);for(i=0;i<keys.length;++i)"removeListener"!==(key=keys[i])&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(listeners=events[type]))this.removeListener(type,listeners);else if(void 0!==listeners)for(i=listeners.length-1;i>=0;i--)this.removeListener(type,listeners[i]);return this},EventEmitter.prototype.listeners=function(type){return _listeners(this,type,!0)},EventEmitter.prototype.rawListeners=function(type){return _listeners(this,type,!1)},EventEmitter.listenerCount=function(emitter,type){return"function"==typeof emitter.listenerCount?emitter.listenerCount(type):listenerCount.call(emitter,type)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]}},function(module,exports,__webpack_require__){(exports=module.exports=__webpack_require__(53)).Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(43),exports.Duplex=__webpack_require__(12),exports.Transform=__webpack_require__(58),exports.PassThrough=__webpack_require__(95)},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate,global){var pna=__webpack_require__(29);function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){!function(corkReq,state,err){var entry=corkReq.entry;corkReq.entry=null;for(;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree?state.corkedRequestsFree.next=corkReq:state.corkedRequestsFree=corkReq}(_this,state)}}module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(__webpack_require__(25));util.inherits=__webpack_require__(15);var internalUtil={deprecate:__webpack_require__(94)},Stream=__webpack_require__(54),Buffer=__webpack_require__(30).Buffer,OurUint8Array=global.Uint8Array||function(){};var realHasInstance,destroyImpl=__webpack_require__(55);function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(12),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(writableHwm||0===writableHwm)?writableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=!1===options.decodeStrings;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){!function(stream,er){var state=stream._writableState,sync=state.sync,cb=state.writecb;if(function(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}(state),er)!function(stream,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream,state),stream._writableState.errorEmitted=!0,stream.emit("error",er)):(cb(er),stream._writableState.errorEmitted=!0,stream.emit("error",er),finishMaybe(stream,state))}(stream,state,sync,er,cb);else{var finished=needFinish(state);finished||state.corked||state.bufferProcessing||!state.bufferedRequest||clearBuffer(stream,state),sync?asyncWrite(afterWrite,stream,state,finished,cb):afterWrite(stream,state,finished,cb)}}(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(12),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream._writev(chunk,state.onwrite):stream._write(chunk,encoding,state.onwrite),state.sync=!1}function afterWrite(stream,state,finished,cb){finished||function(stream,state){0===state.length&&state.needDrain&&(state.needDrain=!1,stream.emit("drain"))}(stream,state),state.pendingcb--,cb(),finishMaybe(stream,state)}function clearBuffer(stream,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback;if(doWrite(stream,state,!1,state.objectMode?1:chunk.length,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}null===entry&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}function needFinish(state){return state.ending&&0===state.length&&null===state.bufferedRequest&&!state.finished&&!state.writing}function callFinal(stream,state){stream._final(function(err){state.pendingcb--,err&&stream.emit("error",err),state.prefinished=!0,stream.emit("prefinish"),finishMaybe(stream,state)})}function finishMaybe(stream,state){var need=needFinish(state);return need&&(!function(stream,state){state.prefinished||state.finalCalled||("function"==typeof stream._final?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream,state)):(state.prefinished=!0,stream.emit("prefinish")))}(stream,state),0===state.pendingcb&&(state.finished=!0,stream.emit("finish"))),need}util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||this===Writable&&(object&&object._writableState instanceof WritableState)}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&function(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}(chunk);return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=function(chunk){return Buffer.from(chunk)}(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?function(stream,cb){var er=new Error("write after end");stream.emit("error",er),pna.nextTick(cb,er)}(this,cb):(isBuf||function(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}(this,state,chunk,cb))&&(state.pendingcb++,ret=function(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=function(state,chunk,encoding){state.objectMode||!1===state.decodeStrings||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding));return chunk}(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;ret||(state.needDrain=!0);if(state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk:chunk,encoding:encoding,isBuf:isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream,state,!1,len,chunk,encoding,cb);return ret}(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||function(stream,state,cb){state.ending=!0,finishMaybe(stream,state),cb&&(state.finished?pna.nextTick(cb):stream.once("finish",cb));state.ended=!0,stream.writable=!1}(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(this,__webpack_require__(24),__webpack_require__(56).setImmediate,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var external=__webpack_require__(26),DataWorker=__webpack_require__(62),DataLengthProbe=__webpack_require__(63),Crc32Probe=__webpack_require__(64);DataLengthProbe=__webpack_require__(63);function CompressedObject(compressedSize,uncompressedSize,crc32,compression,data){this.compressedSize=compressedSize,this.uncompressedSize=uncompressedSize,this.crc32=crc32,this.compression=compression,this.compressedContent=data}CompressedObject.prototype={getContentWorker:function(){var worker=new DataWorker(external.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new DataLengthProbe("data_length")),that=this;return worker.on("end",function(){if(this.streamInfo.data_length!==that.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),worker},getCompressedWorker:function(){return new DataWorker(external.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},CompressedObject.createWorkerFrom=function(uncompressedWorker,compression,compressionOptions){return uncompressedWorker.pipe(new Crc32Probe).pipe(new DataLengthProbe("uncompressedSize")).pipe(compression.compressWorker(compressionOptions)).pipe(new DataLengthProbe("compressedSize")).withStreamInfo("compression",compression)},module.exports=CompressedObject},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0);var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(input,crc){return void 0!==input&&input.length?"string"!==utils.getTypeOf(input)?function(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^buf[i])];return-1^crc}(0|crc,input,input.length,0):function(crc,str,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^str.charCodeAt(i))];return-1^crc}(0|crc,input,input.length,0):0}},function(module,exports,__webpack_require__){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Storage_1=__webpack_require__(48),DateModule_1=__webpack_require__(6),InboxMessagesPublic_1=__webpack_require__(27),InboxMessages=function(){function InboxMessages(eventBus,data,api,storage,dateModule){void 0===storage&&(storage=new Storage_1.default),void 0===dateModule&&(dateModule=new DateModule_1.default),this.eventBus=eventBus,this.data=data,this.api=api,this.storage=storage,this.storeName="inboxMessages",this.dateModule=dateModule}return InboxMessages.prototype.getInboxMessages=function(){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.api.getInboxMessages()];case 1:return response=_a.sent(),[4,this.storeGetInboxMessagesRequestParams(response.next,response.new_inbox)];case 2:return _a.sent(),[2,response]}})})},InboxMessages.prototype.storeGetInboxMessagesRequestParams=function(next,newMessagesCount){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return this.dateModule.date=new Date,[4,this.data.setInboxLastRequestTime(this.dateModule.getUtcTimestamp())];case 1:return _a.sent(),[4,this.data.setInboxLastRequestCode(next)];case 2:return _a.sent(),[4,this.data.setInboxNewMessagesCount(newMessagesCount)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.putServerMessages=function(messages){return __awaiter(this,void 0,void 0,function(){var putTransactions,_this=this;return __generator(this,function(_a){return putTransactions=messages.map(function(message){return __awaiter(_this,void 0,void 0,function(){var localMessage;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.get(this.storeName,message.inbox_id,{})];case 1:return"status"in(localMessage=_a.sent())&&(message.status=localMessage.status),[2,this.putMessage(message)]}})})}),[2,Promise.all(putTransactions)]})})},InboxMessages.prototype.putMessage=function(message){return this.storage.put(this.storeName,message)},InboxMessages.prototype.putBulkMessages=function(messages){var _this=this,putTransactions=messages.map(function(message){return _this.putMessage(message)});return Promise.all(putTransactions)},InboxMessages.prototype.deleteMessages=function(codes){var _this=this,deleteTransactions=codes.map(function(code){return _this.storage.delete(_this.storeName,code)});return Promise.all(deleteTransactions)},InboxMessages.prototype.deleteExpiredMessages=function(){return __awaiter(this,void 0,void 0,function(){var upperBound,allMessages,codesToDelete;return __generator(this,function(_a){switch(_a.label){case 0:return this.dateModule.date=new Date,upperBound=this.dateModule.getTimestamp().toString(),[4,this.storage.getAll(this.storeName)];case 1:return allMessages=_a.sent(),codesToDelete=allMessages.filter(function(msg){return msg.rt>upperBound}).map(function(msg){return msg.inbox_id}),[2,this.deleteMessages(codesToDelete)]}})})},InboxMessages.prototype.getMessage=function(code){return this.storage.get(this.storeName,code)},InboxMessages.prototype.getReadOpenMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,_a.sent().filter(function(msg){return 2===msg.status||3===msg.status})]}})})},InboxMessages.prototype.getDeliveredMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,_a.sent().filter(function(msg){return 1===msg.status})]}})})},InboxMessages.prototype.messagesCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.storage.count(this.storeName)]})})},InboxMessages.prototype.getDeliveredMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var deliveredStatus,statusIndexName;return __generator(this,function(_a){return deliveredStatus=1,statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,deliveredStatus)]})})},InboxMessages.prototype.getReadMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var readStatus,statusIndexName;return __generator(this,function(_a){return readStatus=2,statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,readStatus)]})})},InboxMessages.prototype.getDeliveredReadMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var _a,readStatus,openStatus,keyRange,statusIndexName;return __generator(this,function(_b){return readStatus=(_a=[2,3])[0],openStatus=_a[1],keyRange=IDBKeyRange.bound(readStatus,openStatus),statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,keyRange)]})})},InboxMessages.prototype.updateMessages=function(){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getInboxMessages()];case 1:return response=_a.sent(),[4,this.deleteExpiredMessages()];case 2:return _a.sent(),[4,this.deleteMessages(response.deleted)];case 3:return _a.sent(),[4,this.putServerMessages(response.messages)];case 4:return _a.sent(),this.eventBus.dispatchEvent("update-inbox-messages",{messages:new InboxMessagesPublic_1.default(this.data,this.api,this)}),[2]}})})},InboxMessages}();exports.default=InboxMessages},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var version_1=__webpack_require__(18),MigrationExecutor_1=__webpack_require__(19),Store_1=__webpack_require__(49),Storage=function(){function Storage(){}return Storage.prototype.dbVersionChangeHandler=function(db,event){console.info("onversionchange",event),db.close()},Storage.prototype.dbRequestSuccessHandler=function(resolve,event){var _this=this,database=event.target.result;database.onversionchange=function(event){_this.dbVersionChangeHandler(database,event)},resolve(database)},Storage.prototype.dbRequestUpgradeNeededHandler=function(event){var _this=this,database=event.target.result;database.onversionchange=function(event){_this.dbVersionChangeHandler(database,event)},new MigrationExecutor_1.default(database).applyMigrations()},Storage.prototype.getDB=function(){var _this=this;return new Promise(function(resolve,reject){var request=indexedDB.open("PUSHWOOSH_SDK_STORE",version_1.default);request.onsuccess=function(event){_this.dbRequestSuccessHandler(resolve,event)},request.onupgradeneeded=function(event){_this.dbRequestUpgradeNeededHandler(event)},request.onerror=function(){return reject(request.error)}})},Storage.prototype.put=function(storeName,data,key){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).put(data,key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.delete=function(storeName,key){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).delete(key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.get=function(storeName,key,defaultValue){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).get(key,defaultValue)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.getAll=function(storeName){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).getAll()];case 2:return result=_a.sent(),db.close(),[2,result||[]]}})})},Storage.prototype.count=function(storeName,query){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).count(query)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.countByIndex=function(storeName,indexName,key){return __awaiter(this,void 0,void 0,function(){var db,store,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),(store=new Store_1.default(db,storeName)).index=indexName,[4,store.countByIndex(key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage}();exports.default=Storage},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Store=function(){function Store(db,name){this.name=name,this.store=db.transaction(this.name,"readwrite").objectStore(this.name)}return Object.defineProperty(Store.prototype,"index",{set:function(index){this.store.indexNames.contains(index)?this._index=this.store.index(index):console.warn('Index "'+index+'" in ')},enumerable:!0,configurable:!0}),Store.prototype.writeRequestPromise=function(request,result){return new Promise(function(resolve,reject){request.onsuccess=function(){resolve(result)},request.onerror=function(){reject(request.error)}})},Store.prototype.readRequestPromise=function(request,defaultValue){return new Promise(function(resolve,reject){request.onsuccess=function(event){var target=event.target;resolve(target.result||defaultValue)},request.onerror=function(){reject(request.error)}})},Store.prototype.put=function(data,key){var request=this.store.put(data,key);return this.writeRequestPromise(request,key)},Store.prototype.add=function(data,key){return this.put(data,key)},Store.prototype.delete=function(key){var request=this.store.delete(key);return this.writeRequestPromise(request)},Store.prototype.get=function(key,defaultValue){var request=this.store.get(key);return this.readRequestPromise(request,defaultValue)},Store.prototype.getAll=function(){var cursor=this.store.openCursor(),result=[];return new Promise(function(resolve,reject){cursor.onsuccess=function(event){var cursorResult=event.target.result;cursorResult?(result.push(cursorResult.value),cursorResult.continue()):resolve(result)},cursor.onerror=function(){reject(cursor.error)}})},Store.prototype.count=function(query){var request=this.store.count(query);return this.readRequestPromise(request,0)},Store.prototype.countByIndex=function(key){var request=this._index.count(key);return this.readRequestPromise(request,0)},Store}();exports.default=Store},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var JSZip=__webpack_require__(85);exports.getZip=function(url){return __awaiter(this,void 0,void 0,function(){var response,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,fetch(url,{method:"GET"})];case 1:return 200!==(response=_a.sent()).status&&new Error(response.statusText),[4,response.blob()];case 2:return result=_a.sent(),[2,JSZip.loadAsync(result)]}})})}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(89)},function(module,exports,__webpack_require__){"use strict";(function(global,process){var pna=__webpack_require__(29);module.exports=Readable;var Duplex,isArray=__webpack_require__(51);Readable.ReadableState=ReadableState;__webpack_require__(41).EventEmitter;var EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream=__webpack_require__(54),Buffer=__webpack_require__(30).Buffer,OurUint8Array=global.Uint8Array||function(){};var util=Object.create(__webpack_require__(25));util.inherits=__webpack_require__(15);var debugUtil=__webpack_require__(90),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=__webpack_require__(91),destroyImpl=__webpack_require__(55);util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(12),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(readableHwm||0===readableHwm)?readableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(57).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(12),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&("function"==typeof options.read&&(this._read=options.read),"function"==typeof options.destroy&&(this._destroy=options.destroy)),Stream.call(this)}function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var er,state=stream._readableState;null===chunk?(state.reading=!1,function(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}(stream,state)):(skipChunkCheck||(er=function(state,chunk){var er;(function(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array})(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk"));return er}(state,chunk)),er?stream.emit("error",er):state.objectMode||chunk&&chunk.length>0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=function(chunk){return Buffer.from(chunk)}(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1));return function(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||0===state.length)}(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)},Readable.prototype.push=function(chunk,encoding){var skipChunkCheck,state=this._readableState;return state.objectMode?skipChunkCheck=!0:"string"==typeof chunk&&((encoding=encoding||state.defaultEncoding)!==state.encoding&&(chunk=Buffer.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)},Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=__webpack_require__(57).StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!=n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=function(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream.read(0),len!==state.length);)len=state.length;state.readingMore=!1}function nReadingNextTick(self){debug("readable nexttick read 0"),self.read(0)}function resume_(stream,state){state.reading||(debug("resume read 0"),stream.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream.emit("resume"),flow(stream),state.flowing&&!state.reading&&stream.read(0)}function flow(stream){var state=stream._readableState;for(debug("flow",state.flowing);state.flowing&&null!==stream.read(););}function fromList(n,state){return 0===state.length?null:(state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function(n,list,hasStrings){var ret;n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):ret=n===list.head.data.length?list.shift():hasStrings?function(n,list){var p=list.head,c=1,ret=p.data;n-=ret.length;for(;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}(n,list):function(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(0!==n&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n<state.highWaterMark)&&debug("length less than watermark",doRead=!0),state.ended||state.reading?debug("reading or ended",doRead=!1):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state))),null===(ret=n>0?fromList(n,state):null)?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var endFn=(!pipeOpts||!1!==pipeOpts.end)&&dest!==process.stdout&&dest!==process.stderr?onend:unpipe;function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&!1===unpipeInfo.hasUnpiped&&(unpipeInfo.hasUnpiped=!0,debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain())}function onend(){debug("onend"),dest.end()}state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=function(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,0===state.awaitDrain&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}(src);dest.on("drain",ondrain);var cleanedUp=!1;var increasedAwaitDrain=!1;function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&-1!==indexOf(state.pipes,dest))&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}return src.on("data",ondata),function(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i<len;i++)dests[i].emit("unpipe",this,unpipeInfo);return this}var index=indexOf(state.pipes,dest);return-1===index?this:(state.pipes.splice(index,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"===ev)!1!==this._readableState.flowing&&this.resume();else if("readable"===ev){var state=this._readableState;state.endEmitted||state.readableListening||(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,function(stream,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream,state))}(this,state)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(stream){var _this=this,state=this._readableState,paused=!1;for(var i in stream.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream.on("data",function(chunk){(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!state.objectMode||null!==chunk&&void 0!==chunk)&&((state.objectMode||chunk&&chunk.length)&&(_this.push(chunk)||(paused=!0,stream.pause())))}),stream)void 0===this[i]&&"function"==typeof stream[i]&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));for(var n=0;n<kProxyEvents.length;n++)stream.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n){debug("wrapped _read",n),paused&&(paused=!1,stream.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList}).call(this,__webpack_require__(11),__webpack_require__(24))},function(module,exports,__webpack_require__){module.exports=__webpack_require__(41).EventEmitter},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(29);function emitErrorNT(self,err){self.emit("error",err)}module.exports={destroy:function(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):!err||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,err),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err){!cb&&err?(pna.nextTick(emitErrorNT,_this,err),_this._writableState&&(_this._writableState.errorEmitted=!0)):cb&&cb(err)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(module,exports,__webpack_require__){(function(global){var scope=void 0!==global&&global||"undefined"!=typeof self&&self||window,apply=Function.prototype.apply;function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,scope,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,scope,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(scope,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(93),exports.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==global&&global.setImmediate||this&&this.setImmediate,exports.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==global&&global.clearImmediate||this&&this.clearImmediate}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(30).Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch((encoding=""+encoding)&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder(encoding){var nb;switch(this.encoding=function(enc){var nenc=function(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}(enc);if("string"!=typeof nenc&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}(encoding),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(nb)}function utf8CheckByte(byte){return byte<=127?0:byte>>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(self.lastNeed>1&&buf.length>1){if(128!=(192&buf[1]))return self.lastNeed=1,"�";if(self.lastNeed>2&&buf.length>2&&128!=(192&buf[2]))return self.lastNeed=2,"�"}}(this,buf);return void 0!==r?r:this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(buf.copy(this.lastChar,p,0,buf.length),void(this.lastNeed-=buf.length))}function utf16Text(buf,i){if((buf.length-i)%2==0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0===n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(void 0===(r=this.fillLast(buf)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<buf.length?r?r+this.text(buf,i):this.text(buf,i):r||""},StringDecoder.prototype.end=function(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"�":r},StringDecoder.prototype.text=function(buf,i){var total=function(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0)return nb>0&&(self.lastNeed=nb-1),nb;if(--j<i||-2===nb)return 0;if((nb=utf8CheckByte(buf[j]))>=0)return nb>0&&(self.lastNeed=nb-2),nb;if(--j<i||-2===nb)return 0;if((nb=utf8CheckByte(buf[j]))>=0)return nb>0&&(2===nb?nb=0:self.lastNeed=nb-3),nb;return 0}(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)},StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length}},function(module,exports,__webpack_require__){"use strict";module.exports=Transform;var Duplex=__webpack_require__(12),util=Object.create(__webpack_require__(25));function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options),this._transformState={afterTransform:function(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,null!=data&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&("function"==typeof options.transform&&(this._transform=options.transform),"function"==typeof options.flush&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;"function"==typeof this._flush?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}function done(stream,er,data){if(er)return stream.emit("error",er);if(null!=data&&stream.push(data),stream._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream.push(null)}util.inherits=__webpack_require__(15),util.inherits(Transform,Duplex),Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,chunk,encoding)},Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}},Transform.prototype._read=function(n){var ts=this._transformState;null!==ts.writechunk&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0},Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),support=__webpack_require__(7),_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";exports.encode=function(input){for(var chr1,chr2,chr3,enc1,enc2,enc3,enc4,output=[],i=0,len=input.length,remainingBytes=len,isArray="string"!==utils.getTypeOf(input);i<input.length;)remainingBytes=len-i,isArray?(chr1=input[i++],chr2=i<len?input[i++]:0,chr3=i<len?input[i++]:0):(chr1=input.charCodeAt(i++),chr2=i<len?input.charCodeAt(i++):0,chr3=i<len?input.charCodeAt(i++):0),enc1=chr1>>2,enc2=(3&chr1)<<4|chr2>>4,enc3=remainingBytes>1?(15&chr2)<<2|chr3>>6:64,enc4=remainingBytes>2?63&chr3:64,output.push(_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4));return output.join("")},exports.decode=function(input){var chr1,chr2,chr3,enc2,enc3,enc4,i=0,resultIndex=0;if("data:"===input.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var output,totalLength=3*(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(input.charAt(input.length-1)===_keyStr.charAt(64)&&totalLength--,input.charAt(input.length-2)===_keyStr.charAt(64)&&totalLength--,totalLength%1!=0)throw new Error("Invalid base64 input, bad content length.");for(output=support.uint8array?new Uint8Array(0|totalLength):new Array(0|totalLength);i<input.length;)chr1=_keyStr.indexOf(input.charAt(i++))<<2|(enc2=_keyStr.indexOf(input.charAt(i++)))>>4,chr2=(15&enc2)<<4|(enc3=_keyStr.indexOf(input.charAt(i++)))>>2,chr3=(3&enc3)<<6|(enc4=_keyStr.indexOf(input.charAt(i++))),output[resultIndex++]=chr1,64!==enc3&&(output[resultIndex++]=chr2),64!==enc4&&(output[resultIndex++]=chr3);return output}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var utils=__webpack_require__(0),ConvertWorker=__webpack_require__(103),GenericWorker=__webpack_require__(2),base64=__webpack_require__(59),support=__webpack_require__(7),external=__webpack_require__(26),NodejsStreamOutputAdapter=null;if(support.nodestream)try{NodejsStreamOutputAdapter=__webpack_require__(104)}catch(e){}function accumulate(helper,updateCallback){return new external.Promise(function(resolve,reject){var dataArray=[],chunkType=helper._internalType,resultType=helper._outputType,mimeType=helper._mimeType;helper.on("data",function(data,meta){dataArray.push(data),updateCallback&&updateCallback(meta)}).on("error",function(err){dataArray=[],reject(err)}).on("end",function(){try{var result=function(type,content,mimeType){switch(type){case"blob":return utils.newBlob(utils.transformTo("arraybuffer",content),mimeType);case"base64":return base64.encode(content);default:return utils.transformTo(type,content)}}(resultType,function(type,dataArray){var i,index=0,res=null,totalLength=0;for(i=0;i<dataArray.length;i++)totalLength+=dataArray[i].length;switch(type){case"string":return dataArray.join("");case"array":return Array.prototype.concat.apply([],dataArray);case"uint8array":for(res=new Uint8Array(totalLength),i=0;i<dataArray.length;i++)res.set(dataArray[i],index),index+=dataArray[i].length;return res;case"nodebuffer":return Buffer.concat(dataArray);default:throw new Error("concat : unsupported type '"+type+"'")}}(chunkType,dataArray),mimeType);resolve(result)}catch(e){reject(e)}dataArray=[]}).resume()})}function StreamHelper(worker,outputType,mimeType){var internalType=outputType;switch(outputType){case"blob":case"arraybuffer":internalType="uint8array";break;case"base64":internalType="string"}try{this._internalType=internalType,this._outputType=outputType,this._mimeType=mimeType,utils.checkSupport(internalType),this._worker=worker.pipe(new ConvertWorker(internalType)),worker.lock()}catch(e){this._worker=new GenericWorker("error"),this._worker.error(e)}}StreamHelper.prototype={accumulate:function(updateCb){return accumulate(this,updateCb)},on:function(evt,fn){var self=this;return"data"===evt?this._worker.on(evt,function(chunk){fn.call(self,chunk.data,chunk.meta)}):this._worker.on(evt,function(){utils.delay(fn,arguments,self)}),this},resume:function(){return utils.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(updateCb){if(utils.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new NodejsStreamOutputAdapter(this,{objectMode:"nodebuffer"!==this._outputType},updateCb)}},module.exports=StreamHelper}).call(this,__webpack_require__(23).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.base64=!1,exports.binary=!1,exports.dir=!1,exports.createFolders=!0,exports.date=null,exports.compression=null,exports.compressionOptions=null,exports.comment=null,exports.unixPermissions=null,exports.dosPermissions=null},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function DataWorker(dataP){GenericWorker.call(this,"DataWorker");var self=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,dataP.then(function(data){self.dataIsReady=!0,self.data=data,self.max=data&&data.length||0,self.type=utils.getTypeOf(data),self.isPaused||self._tickAndRepeat()},function(e){self.error(e)})}utils.inherits(DataWorker,GenericWorker),DataWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this.data=null},DataWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,utils.delay(this._tickAndRepeat,[],this)),!0)},DataWorker.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(utils.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},DataWorker.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var data=null,nextIndex=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":data=this.data.substring(this.index,nextIndex);break;case"uint8array":data=this.data.subarray(this.index,nextIndex);break;case"array":case"nodebuffer":data=this.data.slice(this.index,nextIndex)}return this.index=nextIndex,this.push({data:data,meta:{percent:this.max?this.index/this.max*100:0}})},module.exports=DataWorker},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function DataLengthProbe(propName){GenericWorker.call(this,"DataLengthProbe for "+propName),this.propName=propName,this.withStreamInfo(propName,0)}utils.inherits(DataLengthProbe,GenericWorker),DataLengthProbe.prototype.processChunk=function(chunk){if(chunk){var length=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=length+chunk.data.length}GenericWorker.prototype.processChunk.call(this,chunk)},module.exports=DataLengthProbe},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2),crc32=__webpack_require__(45);function Crc32Probe(){GenericWorker.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}__webpack_require__(0).inherits(Crc32Probe,GenericWorker),Crc32Probe.prototype.processChunk=function(chunk){this.streamInfo.crc32=crc32(chunk.data,this.streamInfo.crc32||0),this.push(chunk)},module.exports=Crc32Probe},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2);exports.STORE={magic:"\0\0",compressWorker:function(compressionOptions){return new GenericWorker("STORE compression")},uncompressWorker:function(){return new GenericWorker("STORE decompression")}},exports.DEFLATE=__webpack_require__(107)},function(module,exports,__webpack_require__){"use strict";module.exports=function(adler,buf,len,pos){for(var s1=65535&adler|0,s2=adler>>>16&65535|0,n=0;0!==len;){len-=n=len>2e3?2e3:len;do{s2=s2+(s1=s1+buf[pos++]|0)|0}while(--n);s1%=65521,s2%=65521}return s1|s2<<16|0}},function(module,exports,__webpack_require__){"use strict";var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^buf[i])];return-1^crc}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),STR_APPLY_OK=!0,STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,[0])}catch(__){STR_APPLY_OK=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(__){STR_APPLY_UIA_OK=!1}for(var _utf8len=new utils.Buf8(256),q=0;q<256;q++)_utf8len[q]=q>=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1;function buf2binstring(buf,len){if(len<65534&&(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK))return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len));for(var result="",i=0;i<len;i++)result+=String.fromCharCode(buf[i]);return result}_utf8len[254]=_utf8len[254]=1,exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos<str_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),buf_len+=c<128?1:c<2048?2:c<65536?3:4;for(buf=new utils.Buf8(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),c<128?buf[i++]=c:c<2048?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):c<65536?(buf[i++]=224|c>>>12,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|c>>>12&63,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c);return buf},exports.buf2binstring=function(buf){return buf2binstring(buf,buf.length)},exports.binstring2buf=function(str){for(var buf=new utils.Buf8(str.length),i=0,len=buf.length;i<len;i++)buf[i]=str.charCodeAt(i);return buf},exports.buf2string=function(buf,max){var i,out,c,c_len,len=max||buf.length,utf16buf=new Array(2*len);for(out=0,i=0;i<len;)if((c=buf[i++])<128)utf16buf[out++]=c;else if((c_len=_utf8len[c])>4)utf16buf[out++]=65533,i+=c_len-1;else{for(c&=2===c_len?31:3===c_len?15:7;c_len>1&&i<len;)c=c<<6|63&buf[i++],c_len--;c_len>1?utf16buf[out++]=65533:c<65536?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|c>>10&1023,utf16buf[out++]=56320|1023&c)}return buf2binstring(utf16buf,out)},exports.utf8border=function(buf,max){var pos;for((max=max||buf.length)>buf.length&&(max=buf.length),pos=max-1;pos>=0&&128==(192&buf[pos]);)pos--;return pos<0?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(module,exports,__webpack_require__){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(module,exports,__webpack_require__){"use strict";exports.LOCAL_FILE_HEADER="PK",exports.CENTRAL_FILE_HEADER="PK",exports.CENTRAL_DIRECTORY_END="PK",exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",exports.ZIP64_CENTRAL_DIRECTORY_END="PK",exports.DATA_DESCRIPTOR="PK\b"},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),support=__webpack_require__(7),ArrayReader=__webpack_require__(73),StringReader=__webpack_require__(121),NodeBufferReader=__webpack_require__(122),Uint8ArrayReader=__webpack_require__(75);module.exports=function(data){var type=utils.getTypeOf(data);return utils.checkSupport(type),"string"!==type||support.uint8array?"nodebuffer"===type?new NodeBufferReader(data):support.uint8array?new Uint8ArrayReader(utils.transformTo("uint8array",data)):new ArrayReader(utils.transformTo("array",data)):new StringReader(data)}},function(module,exports,__webpack_require__){"use strict";var DataReader=__webpack_require__(74);function ArrayReader(data){DataReader.call(this,data);for(var i=0;i<this.data.length;i++)data[i]=255&data[i]}__webpack_require__(0).inherits(ArrayReader,DataReader),ArrayReader.prototype.byteAt=function(i){return this.data[this.zero+i]},ArrayReader.prototype.lastIndexOfSignature=function(sig){for(var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),i=this.length-4;i>=0;--i)if(this.data[i]===sig0&&this.data[i+1]===sig1&&this.data[i+2]===sig2&&this.data[i+3]===sig3)return i-this.zero;return-1},ArrayReader.prototype.readAndCheckSignature=function(sig){var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),data=this.readData(4);return sig0===data[0]&&sig1===data[1]&&sig2===data[2]&&sig3===data[3]},ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return[];var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=ArrayReader},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0);function DataReader(data){this.data=data,this.length=data.length,this.index=0,this.zero=0}DataReader.prototype={checkOffset:function(offset){this.checkIndex(this.index+offset)},checkIndex:function(newIndex){if(this.length<this.zero+newIndex||newIndex<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+newIndex+"). Corrupted zip ?")},setIndex:function(newIndex){this.checkIndex(newIndex),this.index=newIndex},skip:function(n){this.setIndex(this.index+n)},byteAt:function(i){},readInt:function(size){var i,result=0;for(this.checkOffset(size),i=this.index+size-1;i>=this.index;i--)result=(result<<8)+this.byteAt(i);return this.index+=size,result},readString:function(size){return utils.transformTo("string",this.readData(size))},readData:function(size){},lastIndexOfSignature:function(sig){},readAndCheckSignature:function(sig){},readDate:function(){var dostime=this.readInt(4);return new Date(Date.UTC(1980+(dostime>>25&127),(dostime>>21&15)-1,dostime>>16&31,dostime>>11&31,dostime>>5&63,(31&dostime)<<1))}},module.exports=DataReader},function(module,exports,__webpack_require__){"use strict";var ArrayReader=__webpack_require__(73);function Uint8ArrayReader(data){ArrayReader.call(this,data)}__webpack_require__(0).inherits(Uint8ArrayReader,ArrayReader),Uint8ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return new Uint8Array(0);var result=this.data.subarray(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=Uint8ArrayReader},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE="pushwoosh-subscription-widget"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BELL_POSITION_BOTTOM_RIGHT="bottomRight",exports.BELL_POSITION_BOTTOM_LEFT="bottomLeft",exports.BELL_POSITION_TOP_RIGHT="topRight",exports.BELL_POSITION_TOP_LEFT="topLeft",exports.WIDGET_CONTAINER_ID="pushwooshBellWidget",exports.SUBSCRIBE_WIDGET_DEFAULT_CONFIG={position:exports.BELL_POSITION_BOTTOM_LEFT,bgColor:"#12AE7E",bellColor:"white",bellStrokeColor:"#08754f",bellButtonBorder:"1px solid #379676",shadow:"0px 0px 6px rgba(0, 0, 0, 0.75)",size:"48px",indent:"20px",zIndex:"999999",tooltipText:{successSubscribe:"You are successfully subscribed!",needSubscribe:"Get notifications about important news!",blockSubscribe:"Click to see how to get notifications",alreadySubscribed:"You are already subscribed"}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Pushwoosh_1=__webpack_require__(79);exports.Pushwoosh=Pushwoosh_1.default,__webpack_require__(145),__webpack_require__(151),__webpack_require__(153)},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var uuid_1=__webpack_require__(13),EventBus_1=__webpack_require__(34),Api_1=__webpack_require__(36),Data_1=__webpack_require__(5),ApiClient_1=__webpack_require__(28),PushService_1=__webpack_require__(80),Popup_1=__webpack_require__(82),SubscriptionSegmentsWidget_1=__webpack_require__(84),SubscriptionPromptWidget_1=__webpack_require__(125),CONSTANTS=__webpack_require__(1),functions_1=__webpack_require__(10),PlatformChecker_1=__webpack_require__(21),logger_1=__webpack_require__(4),FacebookModule_1=__webpack_require__(127),InApps_1=__webpack_require__(128),storage_1=__webpack_require__(3),InboxMessages_1=__webpack_require__(47),InboxMessagesPublic_1=__webpack_require__(27),Pushwoosh=function(){function Pushwoosh(){var _this=this;this.ready=!1,this.addEventHandler=function(name,handler){return _this.eventBus.addEventHandler(name,handler)},this.removeEventHandler=function(name,handler){return _this.eventBus.removeEventHandler(name,handler)},this.dispatchEvent=function(name,payload){return _this.eventBus.dispatchEvent(name,payload)},this.debug={showLog:function(){return __awaiter(this,void 0,void 0,function(){var items;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.log.getAll()];case 1:return items=_a.sent(),console.log(items),[2]}})})},showKeyValues:function(){return __awaiter(this,void 0,void 0,function(){var items;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.keyValue.getAll()];case 1:return items=_a.sent(),console.log(items),[2]}})})},showMessages:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.message.getAll()];case 1:return _a.sent().forEach(function(i){return console.log(i)}),[2]}})})}},this.eventBus=new EventBus_1.EventBus,this.data=new Data_1.Data,this.apiClient=new ApiClient_1.ApiClient(this.data),this.api=new Api_1.Api(this.eventBus,this.data,this.apiClient),this.platformChecker=new PlatformChecker_1.PlatformChecker,this.inboxModel=new InboxMessages_1.default(this.eventBus,this.data,this.api),this.pwinbox=new InboxMessagesPublic_1.default(this.data,this.api,this.inboxModel),this.onServiceWorkerMessage=this.onServiceWorkerMessage.bind(this);var popup=new Popup_1.Popup("subscription-segments",function(){return _this.eventBus.dispatchEvent("hide-subscription-widget",{})},{position:"top"});this.subscriptionSegmentWidget=new SubscriptionSegmentsWidget_1.SubscriptionSegmentsWidget(this.eventBus,this.data,this.apiClient,this.api,popup,this),this.subscriptionPromptWidget=new SubscriptionPromptWidget_1.SubscriptionPromptWidget(this.eventBus,this)}return Pushwoosh.prototype.push=function(command){if("function"!=typeof command){if(!Array.isArray(command))throw new Error("Invalid command!");switch(command[0]){case"init":this.initialize(command[1]);break;case CONSTANTS.EVENT_ON_LOAD:case CONSTANTS.EVENT_ON_READY:case CONSTANTS.EVENT_ON_REGISTER:case CONSTANTS.EVENT_ON_SUBSCRIBE:case CONSTANTS.EVENT_ON_UNSUBSCRIBE:case CONSTANTS.EVENT_ON_SW_INIT_ERROR:case CONSTANTS.EVENT_ON_PUSH_DELIVERY:case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:case CONSTANTS.EVENT_ON_CHANGE_COMMUNICATION_ENABLED:case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:case CONSTANTS.EVENT_ON_UPDATE_INBOX_MESSAGES:case CONSTANTS.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG:case CONSTANTS.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG:case CONSTANTS.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET:case CONSTANTS.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET:case CONSTANTS.EVENT_ON_PERMISSION_DENIED:case CONSTANTS.EVENT_ON_PERMISSION_PROMPT:case CONSTANTS.EVENT_ON_PERMISSION_GRANTED:this.subscribeToLegacyEvents(command[0],command[1]);break;default:throw new Error("Unknown command!")}}else this.subscribeToLegacyEvents("onReady",command)},Pushwoosh.prototype.subscribe=function(isForceSubscribe){return void 0===isForceSubscribe&&(isForceSubscribe=!0),__awaiter(this,void 0,void 0,function(){var permission_1,permission,isManualUnsubscribed,isDeviceRegister;return __generator(this,function(_a){switch(_a.label){case 0:return this.isCommunicationDisabled&&logger_1.Logger.error("Communication is disabled!"),this.driver.checkIsPermissionDefault()?(this.eventBus.dispatchEvent("show-notification-permission-dialog",{}),[4,this.driver.askPermission()]):[3,2];case 1:_a.sent(),permission_1=this.driver.getPermission(),this.eventBus.dispatchEvent("hide-notification-permission-dialog",{permission:permission_1}),_a.label=2;case 2:return permission=this.driver.getPermission(),[4,this.data.getStatusManualUnsubscribed()];case 3:return isManualUnsubscribed=_a.sent(),[4,this.api.checkDeviceSubscribeForPushNotifications(!1)];case 4:return isDeviceRegister=_a.sent(),permission!==CONSTANTS.PERMISSION_GRANTED?[3,7]:(this.eventBus.dispatchEvent("permission-granted",{}),!(isForceSubscribe||!isManualUnsubscribed)||isDeviceRegister?[3,6]:[4,this.driver.subscribe()]);case 5:_a.sent(),_a.label=6;case 6:return this.eventBus.dispatchEvent("subscribe",{}),[2];case 7:return permission!==CONSTANTS.PERMISSION_DENIED?[3,10]:(this.eventBus.dispatchEvent("permission-denied",{}),isDeviceRegister?[4,this.driver.unsubscribe()]:[3,9]);case 8:_a.sent(),_a.label=9;case 9:case 10:return[2]}})})},Pushwoosh.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,this.driver.unsubscribe()];case 1:return _a.sent(),[3,3];case 2:return error_1=_a.sent(),logger_1.Logger.error(error_1,"Error occurred during the unsubscribe"),[3,3];case 3:return[2]}})})},Pushwoosh.prototype.forceSubscribe=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.subscribe(!0)];case 1:return _a.sent(),[2]}})})},Pushwoosh.prototype.isDeviceRegistered=function(){return localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS)===CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED},Pushwoosh.prototype.isDeviceUnregistered=function(){return localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS)===CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED},Pushwoosh.prototype.isSubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},Pushwoosh.prototype.isCommunicationEnabled=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusCommunicationDisabled()];case 1:return[2,!_a.sent()]}})})},Pushwoosh.prototype.setCommunicationEnabled=function(isEnabled){return void 0===isEnabled&&(isEnabled=!0),__awaiter(this,void 0,void 0,function(){var deviceType,isPermissionGranted;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),isPermissionGranted=this.driver.checkIsPermissionGranted(),[4,this.data.setStatusCommunicationDisabled(!isEnabled)];case 2:return _a.sent(),isEnabled?[4,this.data.setStatusDropAllData(!1)]:[3,6];case 3:return _a.sent(),isPermissionGranted?[4,this.api.registerDevice()]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[3,8];case 6:return[4,this.api.unregisterDevice()];case 7:_a.sent(),_a.label=8;case 8:return this.eventBus.dispatchEvent("change-enabled-communication",{isEnabled:isEnabled}),[4,this.api.postEvent(CONSTANTS.EVENT_GDPR_CONSENT,{channel:isEnabled,device_type:deviceType})];case 9:return _a.sent(),[2]}})})},Pushwoosh.prototype.removeAllDeviceData=function(){return __awaiter(this,void 0,void 0,function(){var deviceType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),[4,this.api.postEvent(CONSTANTS.EVENT_GDPR_DELETE,{status:!0,device_type:deviceType})];case 2:return _a.sent(),[4,this.api.deleteDevice()];case 3:return _a.sent(),[4,this.data.clearAll()];case 4:return _a.sent(),[4,this.data.setStatusDropAllData(!0)];case 5:return _a.sent(),[2]}})})},Pushwoosh.prototype.getHWID=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getHwid()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.getPushToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getTokens()];case 1:return[2,_a.sent().pushToken]}})})},Pushwoosh.prototype.getUserId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getUserId()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.getParams=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.api.getParams()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.isAvailableNotifications=function(){return this.platformChecker.isAvailableNotifications},Pushwoosh.prototype.sendStatisticsVisitedPage=function(){return __awaiter(this,void 0,void 0,function(){var title,_a,origin,pathname,href;return __generator(this,function(_b){switch(_b.label){case 0:return title=window.document.title,_a=window.location,origin=_a.origin,pathname=_a.pathname,href=_a.href,[4,this.api.pageVisit({title:title,url_path:""+origin+pathname,url:href})];case 1:return _b.sent(),[2]}})})},Pushwoosh.prototype.isEnableChannels=function(){return __awaiter(this,void 0,void 0,function(){var features,channels;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return features=_a.sent(),channels=features&&features.channels,[2,Array.isArray(channels)&&!!channels.length]}})})},Pushwoosh.prototype.initialize=function(params){return __awaiter(this,void 0,void 0,function(){var manualDebug,applicationCode,notSavedApplicationCode,isChangeApplicationCode,id,config,_a,userIdWasChange,inAppsConfig,error_2,error_3,delayedEvent,type,payload,hashReg,hash;return __generator(this,function(_b){switch(_b.label){case 0:return manualDebug=localStorage.getItem(CONSTANTS.MANUAL_SET_LOGGER_LEVEL),logger_1.Logger.setLevel(manualDebug||params.logLevel||"error"),this.platformChecker.isAvailableNotifications?[4,this.data.getApplicationCode()]:[2];case 1:if(applicationCode=_b.sent(),!params.applicationCode)throw new Error("Can't find application code!");return notSavedApplicationCode=!applicationCode,isChangeApplicationCode=applicationCode&&applicationCode!==params.applicationCode,notSavedApplicationCode||isChangeApplicationCode?[4,this.data.clearAll()]:[3,4];case 2:return _b.sent(),[4,this.data.setApplicationCode(params.applicationCode)];case 3:_b.sent(),_b.label=4;case 4:return[4,this.data.getHwid()];case 5:return _b.sent()?[3,7]:(id=params.applicationCode+"_"+uuid_1.v4(),[4,this.data.setHwid(id)]);case 6:return _b.sent(),[3,9];case 7:return[4,this.api.checkDevice()];case 8:_b.sent(),_b.label=9;case 9:return[4,this.data.setDeviceType(this.platformChecker.getPlatformType())];case 10:return _b.sent(),[4,this.data.setDeviceModel(this.platformChecker.getBrowserVersion())];case 11:return _b.sent(),[4,this.data.setLanguage(params.tags&&params.tags.Language||navigator.language)];case 12:return _b.sent(),params.pushwooshUrl?[4,this.data.setApiEntrypoint(params.pushwooshUrl)]:[3,14];case 13:_b.sent(),_b.label=14;case 14:return[4,this.data.setSdkVersion("3.24.0")];case 15:return _b.sent(),[4,this.api.getConfig(["page_visit","vapid_key","web_in_apps","events","subscription_prompt"])];case 16:return config=_b.sent(),this.onGetConfig(config&&config.features),this.subscribeWidgetConfig=__assign({enable:!1},params.subscribeWidget),this.inboxWidgetConfig=__assign({enable:!1},params.inboxWidget),this.subscribePopupConfig=__assign({enable:!1},params.subscribePopup),_a=this,[4,this.data.getStatusCommunicationDisabled()];case 17:return _a.isCommunicationDisabled=_b.sent(),[4,this.open()];case 18:return _b.sent(),[4,this.data.getStatusUserIdWasChanged()];case 19:return userIdWasChange=_b.sent(),!params.userId||"user_id"===params.userId||userIdWasChange?[3,21]:[4,this.api.registerUser(params.userId)];case 20:_b.sent(),_b.label=21;case 21:return params.tags&&this.api.setTags(params.tags),inAppsConfig=__assign({enable:config.features.web_in_apps&&config.features.web_in_apps.enabled},params.inApps),[4,this.initInApp(inAppsConfig)];case 22:return _b.sent(),this.platformChecker.isAvailableNotifications?[4,this.initPushNotifications(params)]:[3,24];case 23:_b.sent(),_b.label=24;case 24:return _b.trys.push([24,26,,27]),[4,this.inboxModel.updateMessages()];case 25:return _b.sent(),[3,27];case 26:return error_2=_b.sent(),logger_1.Logger.write("error",error_2),[3,27];case 27:return _b.trys.push([27,29,,30]),[4,this.initFacebook(params)];case 28:return _b.sent(),[3,30];case 29:return error_3=_b.sent(),logger_1.Logger.write("error",error_3),[3,30];case 30:return this.ready=!0,this.eventBus.dispatchEvent("ready",{}),[4,this.data.getDelayedEvent()];case 31:return(delayedEvent=_b.sent())?(type=delayedEvent.type,payload=delayedEvent.payload,[4,this.emitLegacyEventsFromServiceWorker(type,payload)]):[3,34];case 32:return _b.sent(),[4,this.data.setDelayedEvent(null)];case 33:_b.sent(),_b.label=34;case 34:return"serviceWorker"in navigator&&(navigator.serviceWorker.onmessage=this.onServiceWorkerMessage),localStorage.setItem("pushwoosh-websdk-status","init"),document.dispatchEvent(new CustomEvent("pushwoosh.initialized",{detail:{pw:this}})),this.platformChecker.isSafari&&(hashReg=/#P(.*)/,hash=decodeURIComponent(document.location.hash),hashReg.test(hash)&&this.api.pushStat(hashReg.exec(hash)[1]).then(functions_1.clearLocationHash)),[2]}})})},Pushwoosh.prototype.defaultProcess=function(initParams){return __awaiter(this,void 0,void 0,function(){var permission,isCommunicationDisabled,isDropAllData,isNeedResubscribe,features,currentPromptUseCase,autoSubscribe,isManualUnsubscribed,isRegister,widgetConfig,isDefaultUseCase,isNotSetUseCase,result;return __generator(this,function(_b){switch(_b.label){case 0:return"granted"!==(permission=this.driver.getPermission())?[3,2]:[4,this.data.setLastPermissionStatus(permission)];case 1:_b.sent(),_b.label=2;case 2:return[4,this.data.getStatusCommunicationDisabled()];case 3:return isCommunicationDisabled=_b.sent(),[4,this.data.getStatusDropAllData()];case 4:return isDropAllData=_b.sent(),[4,this.driver.checkIsNeedResubscribe()];case 5:return isNeedResubscribe=_b.sent(),[4,this.data.getFeatures()];case 6:return features=_b.sent(),currentPromptUseCase=features.subscription_prompt&&features.subscription_prompt.use_case,isCommunicationDisabled||isDropAllData?[4,this.unsubscribe()]:[3,8];case 7:return _b.sent(),[2];case 8:return isNeedResubscribe?[4,this.unsubscribe()]:[3,11];case 9:return _b.sent(),[4,this.data.setStatusManualUnsubscribed(!1)];case 10:_b.sent(),_b.label=11;case 11:return autoSubscribe=initParams.autoSubscribe,[4,this.data.getStatusManualUnsubscribed()];case 12:return isManualUnsubscribed=_b.sent(),[4,this.api.checkDeviceSubscribeForPushNotifications(!1)];case 13:switch(isRegister=_b.sent(),permission){case CONSTANTS.PERMISSION_PROMPT:return[3,14];case CONSTANTS.PERMISSION_DENIED:return[3,22];case CONSTANTS.PERMISSION_GRANTED:return[3,25]}return[3,31];case 14:return this.eventBus.dispatchEvent("permission-default",{}),isRegister?[4,this.unsubscribe()]:[3,16];case 15:_b.sent(),_b.label=16;case 16:return[4,this.getWidgetConfig()];case 17:return widgetConfig=_b.sent(),[4,this.checkCanShowByCapping(widgetConfig)];case 18:return _b.sent()?currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED?[4,this.subscriptionSegmentWidget.init()]:[3,20]:[3,31];case 19:_b.sent(),_b.label=20;case 20:return isDefaultUseCase=currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_DEFAULT,isNotSetUseCase=currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_NOT_SET&&autoSubscribe,(isDefaultUseCase||isNotSetUseCase)&&(this.subscriptionPromptWidget.init(widgetConfig),this.subscriptionPromptWidget.show()),[4,this.updateCappingParams()];case 21:return _b.sent(),[3,31];case 22:return this.eventBus.dispatchEvent("permission-denied",{}),isRegister?[4,this.unsubscribe()]:[3,24];case 23:_b.sent(),_b.label=24;case 24:return[3,31];case 25:return this.eventBus.dispatchEvent("permission-granted",{}),isManualUnsubscribed&&isRegister?[4,this.unsubscribe()]:[3,27];case 26:_b.sent(),_b.label=27;case 27:return!isRegister&&!isManualUnsubscribed||isNeedResubscribe?[4,this.subscribe(!0)]:[3,30];case 28:return _b.sent(),currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED?(result=features.channels.map(function(channel){return channel.code}),[4,this.api.setTags({"Subscription Segments":result})]):[3,30];case 29:_b.sent(),_b.label=30;case 30:return[3,31];case 31:return[2]}})})},Pushwoosh.prototype.getWidgetConfig=function(){return __awaiter(this,void 0,void 0,function(){var features,currentConfig,configWithDefaultCapping;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return features=_a.sent(),currentConfig=features.subscription_prompt_widget&&features.subscription_prompt_widget.params,configWithDefaultCapping=__assign({cappingCount:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG.cappingCount,cappingDelay:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG.cappingDelay},currentConfig),[2,currentConfig?configWithDefaultCapping:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG]}})})},Pushwoosh.prototype.checkCanShowByCapping=function(widgetConfig){return __awaiter(this,void 0,void 0,function(){var currentTime,displayCount,lastSeenTime,canShowByCapping,canShowByLastTime;return __generator(this,function(_a){switch(_a.label){case 0:return currentTime=(new Date).getTime(),[4,this.data.getPromptDisplayCount()];case 1:return displayCount=_a.sent(),[4,this.data.getPromptLastSeenTime()];case 2:return lastSeenTime=_a.sent(),canShowByCapping=widgetConfig.cappingCount>displayCount,canShowByLastTime=currentTime-lastSeenTime>widgetConfig.cappingDelay,[2,canShowByCapping&&canShowByLastTime]}})})},Pushwoosh.prototype.updateCappingParams=function(){return __awaiter(this,void 0,void 0,function(){var displayCount,currentTime;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getPromptDisplayCount()];case 1:return displayCount=_a.sent(),currentTime=(new Date).getTime(),[4,this.data.setPromptDisplayCount(displayCount+1)];case 2:return _a.sent(),[4,this.data.setPromptLastSeenTime(currentTime)];case 3:return _a.sent(),[2]}})})},Pushwoosh.prototype.initFacebook=function(initParams){var facebook=__assign({enable:!1,pageId:"",containerClass:""},initParams.facebook);if(facebook&&facebook.enable)try{new FacebookModule_1.default({pageId:facebook.pageId,containerClass:facebook.containerClass,applicationCode:initParams.applicationCode,userId:initParams.userId||""})}catch(error){logger_1.Logger.error(error,"facebook module initialization failed")}},Pushwoosh.prototype.initInApp=function(params){return __awaiter(this,void 0,void 0,function(){var error_4,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(!params||!params.enable)return[3,4];_a.label=1;case 1:return _a.trys.push([1,3,,4]),this.InApps=new InApps_1.InApps(params,this,this.eventBus,this.api),[4,this.InApps.init().then(function(){logger_1.Logger.info("InApps module has been initialized"),_this.eventBus.dispatchEvent("initialize-in-apps-module",{})}).catch(function(error){logger_1.Logger.error(error,"InApps module initialization has been failed")})];case 2:return _a.sent(),[3,4];case 3:return error_4=_a.sent(),logger_1.Logger.error(error_4,"InApp module initialization has been failed"),[3,4];case 4:return[2]}})})},Pushwoosh.prototype.onServiceWorkerMessage=function(event){var _a=(event||{}).data,_b=(void 0===_a?{}:_a)||{},_c=_b.type,type=void 0===_c?"":_c,_d=_b.payload,payload=void 0===_d?{}:_d;this.emitLegacyEventsFromServiceWorker(type,payload)},Pushwoosh.prototype.open=function(isForce){return __awaiter(this,void 0,void 0,function(){var lastApplicationOpenTime,currentTime,isSendingPeriodExceeded;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getLastOpenApplicationTime()];case 1:return lastApplicationOpenTime=_a.sent(),currentTime=Date.now(),lastApplicationOpenTime||(lastApplicationOpenTime=0),isSendingPeriodExceeded=currentTime-lastApplicationOpenTime<CONSTANTS.PERIOD_SEND_APP_OPEN,isForce||!isSendingPeriodExceeded?[4,this.data.setLastOpenApplicationTime(currentTime)]:[2];case 2:return _a.sent(),[4,this.api.applicationOpen()];case 3:return _a.sent(),[2]}})})},Pushwoosh.prototype.onGetConfig=function(features){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setFeatures(features)];case 1:return _a.sent(),features?features.page_visit&&features.page_visit.enabled?[4,storage_1.keyValue.set(CONSTANTS.PAGE_VISITED_URL,features.page_visit.entrypoint)]:[3,3]:[3,5];case 2:_a.sent(),this.sendStatisticsVisitedPage(),_a.label=3;case 3:return features.events&&features.events.length&&features.events.some(function(event){return event===CONSTANTS.EVENT_PW_SITE_OPENED})&&this.sendPostEventVisitedPage(),features.vapid_key?[4,this.data.setApplicationServerKey(features.vapid_key)]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[2]}})})},Pushwoosh.prototype.initPushNotifications=function(params){return __awaiter(this,void 0,void 0,function(){var error_5;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setDefaultNotificationImage(params.defaultNotificationImage)];case 1:return _a.sent(),[4,this.data.setDefaultNotificationTitle(params.defaultNotificationTitle)];case 2:return _a.sent(),[4,this.data.setServiceWorkerUrl(params.serviceWorkerUrl)];case 3:return _a.sent(),[4,this.data.setServiceWorkerScope(params.scope)];case 4:return _a.sent(),[4,this.data.setInitParams(__assign({autoSubscribe:!0},params))];case 5:return _a.sent(),[4,this.initDriver()];case 6:_a.sent(),_a.label=7;case 7:return _a.trys.push([7,9,,10]),[4,this.defaultProcess(params)];case 8:return _a.sent(),[3,10];case 9:return error_5=_a.sent(),logger_1.Logger.error(error_5,"Internal error: defaultProcess fail"),[3,10];case 10:return[2]}})})},Pushwoosh.prototype.initDriver=function(){return __awaiter(this,void 0,void 0,function(){var webSitePushId;return __generator(this,function(_a){switch(_a.label){case 0:return this.platformChecker.isSafari?[4,this.data.getInitParams()]:[3,2];case 1:if(!(webSitePushId=_a.sent().safariWebsitePushID))throw new Error("For work with Safari Push Notification add safariWebsitePushID to initParams!");return this.driver=new PushService_1.PushServiceSafari(this.api,this.data,{webSitePushId:webSitePushId}),[2];case 2:return this.platformChecker.isAvailableServiceWorker?(this.driver=new PushService_1.PushServiceDefault(this.api,this.data,{}),[2]):[2]}})})},Pushwoosh.prototype.sendPostEventVisitedPage=function(){return __awaiter(this,void 0,void 0,function(){var title,href;return __generator(this,function(_a){return title=window.document.title,href=window.location.href,this.api.postEvent(CONSTANTS.EVENT_PW_SITE_OPENED,{url:href,title:title,device_type:this.platformChecker.platform}),[2]})})},Pushwoosh.prototype.subscribeToLegacyEvents=function(type,handler){var _this=this;switch(type){case CONSTANTS.EVENT_ON_LOAD:handler();break;case CONSTANTS.EVENT_ON_READY:if(this.ready){handler(this.api);break}this.eventBus.addEventHandler("ready",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_REGISTER:this.eventBus.addEventHandler("register",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_SUBSCRIBE:this.eventBus.addEventHandler("subscribe",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_UNSUBSCRIBE:this.eventBus.addEventHandler("unsubscribe",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_SW_INIT_ERROR:this.eventBus.addEventHandler("initialize-service-worker-error",function(_a){var error=_a.error;return handler(_this.api,error)});break;case CONSTANTS.EVENT_ON_PUSH_DELIVERY:this.eventBus.addEventHandler("receive-push",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:this.eventBus.addEventHandler("open-notification",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:this.eventBus.addEventHandler("hide-notification",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_CHANGE_COMMUNICATION_ENABLED:this.eventBus.addEventHandler("change-enabled-communication",function(_a){var isEnabled=_a.isEnabled;return handler(_this.api,isEnabled)});break;case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:this.eventBus.addEventHandler("receive-inbox-message",function(_a){var message=_a.message;return handler(_this.api,message)});break;case CONSTANTS.EVENT_ON_UPDATE_INBOX_MESSAGES:this.eventBus.addEventHandler("update-inbox-messages",function(_a){var messages=_a.messages;return handler(_this.api,messages)});break;case CONSTANTS.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG:this.eventBus.addEventHandler("show-notification-permission-dialog",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG:this.eventBus.addEventHandler("hide-notification-permission-dialog",function(_a){var permission=_a.permission;return handler(_this.api,permission)});break;case CONSTANTS.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET:this.eventBus.addEventHandler("show-subscription-widget",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET:this.eventBus.addEventHandler("hide-subscription-widget",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_DENIED:this.eventBus.addEventHandler("permission-denied",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_PROMPT:this.eventBus.addEventHandler("permission-default",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_GRANTED:this.eventBus.addEventHandler("permission-granted",function(){return handler(_this.api)})}},Pushwoosh.prototype.emitLegacyEventsFromServiceWorker=function(type,payload){switch(type){case CONSTANTS.EVENT_ON_PUSH_DELIVERY:this.eventBus.dispatchEvent("receive-push",{notification:payload});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:this.eventBus.dispatchEvent("open-notification",{notification:payload});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:this.eventBus.dispatchEvent("hide-notification",{notification:payload});break;case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:this.eventBus.dispatchEvent("receive-inbox-message",{message:payload})}},Pushwoosh}();exports.default=Pushwoosh},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PushServiceDefault_1=__webpack_require__(40);exports.PushServiceDefault=PushServiceDefault_1.PushServiceDefault;var PushServiceSafari_1=__webpack_require__(81);exports.PushServiceSafari=PushServiceSafari_1.PushServiceSafari},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var logger_1=__webpack_require__(4),CONSTANTS=__webpack_require__(1),PushServiceSafari=function(){function PushServiceSafari(api,data,config){this.api=api,this.config=config,this.data=data}return PushServiceSafari.prototype.getPermission=function(){return this.getPermissionInfo().permission},PushServiceSafari.prototype.checkIsPermissionGranted=function(){return this.getPermission()===CONSTANTS.PERMISSION_GRANTED},PushServiceSafari.prototype.checkIsPermissionDefault=function(){return this.getPermission()===CONSTANTS.PERMISSION_PROMPT},PushServiceSafari.prototype.checkIsManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusManualUnsubscribed()];case 1:return[2,_a.sent()]}})})},PushServiceSafari.prototype.askPermission=function(){return __awaiter(this,void 0,void 0,function(){var application,hwid,payload,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return application=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),payload={application:application,hwid:hwid},[2,new Promise(function(resolve){safari.pushNotification.requestPermission(_this.config.entrypoint||"https://cp.pushwoosh.com/json/1.3/safari",_this.config.webSitePushId,payload,function(){return resolve()})})]}})})},PushServiceSafari.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getTokens()]})})},PushServiceSafari.prototype.subscribe=function(){return __awaiter(this,void 0,void 0,function(){var deviceToken;return __generator(this,function(_a){switch(_a.label){case 0:return this.checkIsPermissionGranted()?[4,this.getPermissionInfo()]:(logger_1.Logger.error("You must have permission granted before subscribe!"),[2]);case 1:return deviceToken=_a.sent().deviceToken,[4,this.data.setTokens({pushToken:deviceToken})];case 2:return _a.sent(),[4,this.api.registerDevice()];case 3:return _a.sent(),[2]}})})},PushServiceSafari.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setTokens({})];case 1:return _a.sent(),[4,this.data.setStatusManualUnsubscribed(!0)];case 2:return _a.sent(),[4,this.api.unregisterDevice()];case 3:return _a.sent(),[2]}})})},PushServiceSafari.prototype.checkIsRegister=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},PushServiceSafari.prototype.checkIsNeedResubscribe=function(){return __awaiter(this,void 0,void 0,function(){var savedWebSitePushId,isChangeWebSitePushId,lastPermission,permission;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getWebSitePushId()];case 1:return savedWebSitePushId=_a.sent(),isChangeWebSitePushId=void 0!==savedWebSitePushId&&this.config.webSitePushId!==savedWebSitePushId,[4,this.data.setWebSitePushId(this.config.webSitePushId)];case 2:return _a.sent(),[4,this.data.getLastPermissionStatus()];case 3:return lastPermission=_a.sent(),permission=this.getPermission(),lastPermission===permission?[3,5]:[4,this.data.setLastPermissionStatus(permission)];case 4:return _a.sent(),[2,!0];case 5:return[2,isChangeWebSitePushId]}})})},PushServiceSafari.prototype.getPermissionInfo=function(){return safari.pushNotification.permission(this.config.webSitePushId)},PushServiceSafari}();exports.PushServiceSafari=PushServiceSafari},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0});var Popup_helpers_1=__webpack_require__(83),Popup=function(){function Popup(namespace,onClickClose,config){if(this.namespace=namespace,this.onClickClose=onClickClose,this.config=__assign({position:"center"},config),!this.getRootElement()){var html=this.createHTML();document.body.insertAdjacentHTML("beforeend",html),this.rootElement=this.getElementWithCheckExist("root");var styles=Popup_helpers_1.getStyles(this.namespace);document.head.appendChild(styles)}this.rootElement.classList.add("pushwoosh-"+this.namespace+"-popup_position_"+this.config.position),this.wrapperElement=this.getElementWithCheckExist("wrapper"),this.innerElement=this.getElementWithCheckExist("inner"),this.bodyElement=this.getElementWithCheckExist("body"),this.closeElement=this.getElementWithCheckExist("close"),this.addEventListeners()}return Popup.prototype.updateContent=function(html){this.bodyElement.innerHTML=html},Popup.prototype.removeContent=function(){this.bodyElement.innerHTML=""},Popup.prototype.show=function(){document.body.style.overflow="hidden",this.rootElement.classList.add("pushwoosh-"+this.namespace+"-popup_show")},Popup.prototype.hide=function(){document.body.style.overflow="auto",this.rootElement.classList.remove("pushwoosh-"+this.namespace+"-popup_show"),this.onClickClose()},Popup.prototype.getRootElement=function(){return document.getElementById("pushwoosh-"+this.namespace+"-popup-root")},Popup.prototype.createHTML=function(){return'\n <div\n id="pushwoosh-'+this.namespace+'-popup-root"\n class="pushwoosh-'+this.namespace+'-popup"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-wrapper"\n class="pushwoosh-'+this.namespace+'-popup__wrapper"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-inner"\n class="pushwoosh-'+this.namespace+'-popup__inner"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-body"\n class="pushwoosh-'+this.namespace+'-popup__body"\n >\n </div>\n </div>\n <button\n id="pushwoosh-'+this.namespace+'-popup-close"\n class="pushwoosh-'+this.namespace+'-popup__close"\n type="button"\n >\n </button>\n </div>\n </div>\n '},Popup.prototype.getElementWithCheckExist=function(type){var element=document.getElementById("pushwoosh-"+this.namespace+"-popup-"+type);if(!element)throw new Error("Can't find element by id \"pushwoosh-"+this.namespace+"-popup-"+type+'"');return element},Popup.prototype.addEventListeners=function(){var _this=this;this.closeElement.addEventListener("click",function(){_this.hide()}),document.addEventListener("click",function(event){var clickInInner=_this.innerElement.contains(event.target),clickInWrapper=_this.wrapperElement.contains(event.target);!clickInInner&&clickInWrapper&&_this.hide()})},Popup}();exports.Popup=Popup},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStyles=function(namespace){var styles=document.createElement("style");return styles.innerHTML="\n .pushwoosh-"+namespace+"-popup {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 2147483648;\n opacity: 0.99;\n }\n \n .pushwoosh-"+namespace+"-popup_show {\n display: block;\n }\n \n .pushwoosh-"+namespace+"-popup__wrapper {\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, .2);\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__wrapper {\n text-align: center;\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__wrapper:after {\n content: '';\n display: inline-block;\n width: 1px;\n height: 100%;\n vertical-align: middle;\n }\n \n .pushwoosh-"+namespace+"-popup__inner {\n min-width: 320px;\n max-width: 380px;\n width: 100%;\n margin: 0 auto;\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__inner {\n display: inline-block;\n vertical-align: middle;\n }\n \n .pushwoosh-"+namespace+"-popup__body {\n background: #fff;\n text-align: left;\n vertical-align: baseline;\n box-shadow: 0px 10px 16px rgba(0, 0, 0, 0.1), 0px 0px 6px rgba(0, 0, 0, 0.06);\n border-radius: 4px;\n }\n \n .pushwoosh-"+namespace+"-popup__close {\n appearance: none;\n border: none;\n background-color: transparent;\n box-shadow: none;\n position: absolute;\n top: 24px;\n right: 24px;\n width: 40px;\n height: 40px;\n cursor: pointer;\n }\n \n .pushwoosh-"+namespace+"-popup__close:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 30px;\n height: 2px;\n background-color: rgba(255, 255, 255, .8);\n transform: translateX(-50%) translateY(-50%) rotate(45deg);\n }\n \n .pushwoosh-"+namespace+"-popup__close:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 30px;\n height: 2px;\n background-color: rgba(255, 255, 255, .8);\n transform: translateX(-50%) translateY(-50%) rotate(-45deg);\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var getZip_1=__webpack_require__(50),logger_1=__webpack_require__(4),SubscriptionSegmentsWidget_helpers_1=__webpack_require__(124),SubscriptionSegmentsWidget=function(){function SubscriptionSegmentsWidget(eventBus,data,apiClient,api,popup,pw){this.eventBus=eventBus,this.data=data,this.apiClient=apiClient,this.api=api,this.popup=popup,this.pw=pw}return SubscriptionSegmentsWidget.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var inAppCode,richMediaUrl,content,segments,sortedSegments,html,styles,denyElement,acceptElement,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getInAppCode()];case 1:return(inAppCode=_a.sent())?[4,this.getRichMediaUrlByInAppCode(inAppCode)]:(logger_1.Logger.error("Internal error: Can't find in-app code for build subscription segment widget!"),[2]);case 2:return(richMediaUrl=_a.sent())?[4,this.getDynamicContent(richMediaUrl)]:(logger_1.Logger.error("Internal error: Can't find rich media url for build subscription segment widget!"),[2]);case 3:return content=_a.sent(),[4,this.getSegments()];case 4:return segments=_a.sent(),content&&segments?(sortedSegments=segments.sort(function(segment1,segment2){return segment1.position-segment2.position}),html=SubscriptionSegmentsWidget_helpers_1.getHTML(content,sortedSegments),styles=SubscriptionSegmentsWidget_helpers_1.getStyles(content),document.head.appendChild(styles),this.popup.updateContent(html),denyElement=document.getElementById("pushwoosh-subscription-segments-deny"),acceptElement=document.getElementById("pushwoosh-subscription-segments-accept"),denyElement&&denyElement.addEventListener("click",function(){_this.hidePopup()}),acceptElement&&acceptElement.addEventListener("click",function(){var result=[],segments=document.getElementsByClassName("pushwoosh-subscription-segments__field");if(_this.hidePopup(),segments){for(var index=0;index<segments.length;index++){var field=segments[index];field.checked&&result.push(field.value)}_this.api.setTags({"Subscription Segments":result}),_this.pw.subscribe()}}),this.showPopup(),[2]):(logger_1.Logger.error("Internal error: Can't get content or segments for build subscription segment widget!"),[2])}})})},SubscriptionSegmentsWidget.prototype.showPopup=function(){this.eventBus.dispatchEvent("show-subscription-widget",{}),this.popup.show()},SubscriptionSegmentsWidget.prototype.hidePopup=function(){this.popup.hide()},SubscriptionSegmentsWidget.prototype.getRichMediaUrlByInAppCode=function(code){return __awaiter(this,void 0,void 0,function(){var inApps,inApp;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getInApps()];case 1:return(inApps=_a.sent())&&(inApp=inApps.find(function(inApp){return inApp.code===code}))?[2,inApp.url]:[2]}})})},SubscriptionSegmentsWidget.prototype.getInAppCode=function(){return __awaiter(this,void 0,void 0,function(){var application,hwid,userId,deviceType,deviceModel,language,version,timezone,date,time,timestampUTC,timestampCurrent,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return application=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getUserId()];case 3:return userId=_a.sent(),[4,this.data.getDeviceType()];case 4:return deviceType=_a.sent(),[4,this.data.getDeviceModel()];case 5:return deviceModel=_a.sent(),[4,this.data.getLanguage()];case 6:return language=_a.sent(),[4,this.data.getSdkVersion()];case 7:return version=_a.sent(),timezone=60*-(new Date).getTimezoneOffset(),date=new Date,time=date.getTime(),timestampUTC=Math.floor(time/1e3),timestampCurrent=timestampUTC-date.getTimezoneOffset()/60*3600,[4,this.apiClient.postEvent({application:application,hwid:hwid,userId:userId||hwid,device_type:deviceType,device_model:deviceModel,language:language,v:version,timezone:timezone,timestampUTC:timestampUTC,timestampCurrent:timestampCurrent,event:"Subscription Segments",attributes:{}})];case 8:return[2,(response=_a.sent())&&response.code]}})})},SubscriptionSegmentsWidget.prototype.getSegments=function(){return __awaiter(this,void 0,void 0,function(){var features;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return[2,(features=_a.sent())&&features.channels]}})})},SubscriptionSegmentsWidget.prototype.getDynamicContent=function(url){return __awaiter(this,void 0,void 0,function(){var jszip,data,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:return[4,getZip_1.getZip(url)];case 1:return jszip=_c.sent(),_b=(_a=JSON).parse,[4,jszip.file("pushwoosh.json").async("text")];case 2:return[2,(data=_b.apply(_a,[_c.sent()]))&&data.localization&&data.default_language&&data.localization[data.default_language]]}})})},SubscriptionSegmentsWidget}();exports.SubscriptionSegmentsWidget=SubscriptionSegmentsWidget},function(module,exports,__webpack_require__){"use strict";function JSZip(){if(!(this instanceof JSZip))return new JSZip;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var newObj=new JSZip;for(var i in this)"function"!=typeof this[i]&&(newObj[i]=this[i]);return newObj}}JSZip.prototype=__webpack_require__(86),JSZip.prototype.loadAsync=__webpack_require__(119),JSZip.support=__webpack_require__(7),JSZip.defaults=__webpack_require__(61),JSZip.version="3.2.0",JSZip.loadAsync=function(content,options){return(new JSZip).loadAsync(content,options)},JSZip.external=__webpack_require__(26),module.exports=JSZip},function(module,exports,__webpack_require__){"use strict";var utf8=__webpack_require__(14),utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),StreamHelper=__webpack_require__(60),defaults=__webpack_require__(61),CompressedObject=__webpack_require__(44),ZipObject=__webpack_require__(105),generate=__webpack_require__(106),nodejsUtils=__webpack_require__(31),NodejsStreamInputAdapter=__webpack_require__(118),fileAdd=function(name,data,originalOptions){var parent,dataType=utils.getTypeOf(data),o=utils.extend(originalOptions||{},defaults);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(name=forceTrailingSlash(name)),o.createFolders&&(parent=parentFolder(name))&&folderAdd.call(this,parent,!0);var isUnicodeString="string"===dataType&&!1===o.binary&&!1===o.base64;originalOptions&&void 0!==originalOptions.binary||(o.binary=!isUnicodeString),(data instanceof CompressedObject&&0===data.uncompressedSize||o.dir||!data||0===data.length)&&(o.base64=!1,o.binary=!0,data="",o.compression="STORE",dataType="string");var zipObjectContent=null;zipObjectContent=data instanceof CompressedObject||data instanceof GenericWorker?data:nodejsUtils.isNode&&nodejsUtils.isStream(data)?new NodejsStreamInputAdapter(name,data):utils.prepareContent(name,data,o.binary,o.optimizedBinaryString,o.base64);var object=new ZipObject(name,zipObjectContent,o);this.files[name]=object},parentFolder=function(path){"/"===path.slice(-1)&&(path=path.substring(0,path.length-1));var lastSlash=path.lastIndexOf("/");return lastSlash>0?path.substring(0,lastSlash):""},forceTrailingSlash=function(path){return"/"!==path.slice(-1)&&(path+="/"),path},folderAdd=function(name,createFolders){return createFolders=void 0!==createFolders?createFolders:defaults.createFolders,name=forceTrailingSlash(name),this.files[name]||fileAdd.call(this,name,null,{dir:!0,createFolders:createFolders}),this.files[name]};function isRegExp(object){return"[object RegExp]"===Object.prototype.toString.call(object)}var out={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(cb){var filename,relativePath,file;for(filename in this.files)this.files.hasOwnProperty(filename)&&(file=this.files[filename],(relativePath=filename.slice(this.root.length,filename.length))&&filename.slice(0,this.root.length)===this.root&&cb(relativePath,file))},filter:function(search){var result=[];return this.forEach(function(relativePath,entry){search(relativePath,entry)&&result.push(entry)}),result},file:function(name,data,o){if(1===arguments.length){if(isRegExp(name)){var regexp=name;return this.filter(function(relativePath,file){return!file.dir&&regexp.test(relativePath)})}var obj=this.files[this.root+name];return obj&&!obj.dir?obj:null}return name=this.root+name,fileAdd.call(this,name,data,o),this},folder:function(arg){if(!arg)return this;if(isRegExp(arg))return this.filter(function(relativePath,file){return file.dir&&arg.test(relativePath)});var name=this.root+arg,newFolder=folderAdd.call(this,name),ret=this.clone();return ret.root=newFolder.name,ret},remove:function(name){name=this.root+name;var file=this.files[name];if(file||("/"!==name.slice(-1)&&(name+="/"),file=this.files[name]),file&&!file.dir)delete this.files[name];else for(var kids=this.filter(function(relativePath,file){return file.name.slice(0,name.length)===name}),i=0;i<kids.length;i++)delete this.files[kids[i].name];return this},generate:function(options){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(options){var worker,opts={};try{if((opts=utils.extend(options||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:utf8.utf8encode})).type=opts.type.toLowerCase(),opts.compression=opts.compression.toUpperCase(),"binarystring"===opts.type&&(opts.type="string"),!opts.type)throw new Error("No output type specified.");utils.checkSupport(opts.type),"darwin"!==opts.platform&&"freebsd"!==opts.platform&&"linux"!==opts.platform&&"sunos"!==opts.platform||(opts.platform="UNIX"),"win32"===opts.platform&&(opts.platform="DOS");var comment=opts.comment||this.comment||"";worker=generate.generateWorker(this,opts,comment)}catch(e){(worker=new GenericWorker("error")).error(e)}return new StreamHelper(worker,opts.type||"string",opts.mimeType)},generateAsync:function(options,onUpdate){return this.generateInternalStream(options).accumulate(onUpdate)},generateNodeStream:function(options,onUpdate){return(options=options||{}).type||(options.type="nodebuffer"),this.generateInternalStream(options).toNodejsStream(onUpdate)}};module.exports=out},function(module,exports,__webpack_require__){"use strict";exports.byteLength=function(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return 3*(validLen+placeHoldersLen)/4-placeHoldersLen},exports.toByteArray=function(b64){var tmp,i,lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(function(b64,validLen,placeHoldersLen){return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}(0,validLen,placeHoldersLen)),curByte=0,len=placeHoldersLen>0?validLen-4:validLen;for(i=0;i<len;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[curByte++]=tmp>>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i<len2;i+=16383)parts.push(encodeChunk(uint8,i,i+16383>len2?len2:i+16383));1===extraBytes?(tmp=uint8[len-1],parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");return-1===validLen&&(validLen=len),[validLen,validLen===len?0:4-validLen%4]}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;i<end;i+=3)tmp=(uint8[i]<<16&16711680)+(uint8[i+1]<<8&65280)+(255&uint8[i+2]),output.push(tripletToBase64(tmp));return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){
8
+ var base64=__webpack_require__(87),ieee754=__webpack_require__(88),isArray=__webpack_require__(49);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(that,length){if(kMaxLength()<length)throw new RangeError("Invalid typed array length");return Buffer.TYPED_ARRAY_SUPPORT?(that=new Uint8Array(length)).__proto__=Buffer.prototype:(null===that&&(that=new Buffer(length)),that.length=length),that}function Buffer(arg,encodingOrOffset,length){if(!(Buffer.TYPED_ARRAY_SUPPORT||this instanceof Buffer))return new Buffer(arg,encodingOrOffset,length);if("number"==typeof arg){if("string"==typeof encodingOrOffset)throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,arg)}return from(this,arg,encodingOrOffset,length)}function from(that,value,encodingOrOffset,length){if("number"==typeof value)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&value instanceof ArrayBuffer?function(that,array,byteOffset,length){if(array.byteLength,byteOffset<0||array.byteLength<byteOffset)throw new RangeError("'offset' is out of bounds");if(array.byteLength<byteOffset+(length||0))throw new RangeError("'length' is out of bounds");array=void 0===byteOffset&&void 0===length?new Uint8Array(array):void 0===length?new Uint8Array(array,byteOffset):new Uint8Array(array,byteOffset,length);Buffer.TYPED_ARRAY_SUPPORT?(that=array).__proto__=Buffer.prototype:that=fromArrayLike(that,array);return that}(that,value,encodingOrOffset,length):"string"==typeof value?function(that,string,encoding){"string"==typeof encoding&&""!==encoding||(encoding="utf8");if(!Buffer.isEncoding(encoding))throw new TypeError('"encoding" must be a valid string encoding');var length=0|byteLength(string,encoding),actual=(that=createBuffer(that,length)).write(string,encoding);actual!==length&&(that=that.slice(0,actual));return that}(that,value,encodingOrOffset):function(that,obj){if(Buffer.isBuffer(obj)){var len=0|checked(obj.length);return 0===(that=createBuffer(that,len)).length?that:(obj.copy(that,0,0,len),that)}if(obj){if("undefined"!=typeof ArrayBuffer&&obj.buffer instanceof ArrayBuffer||"length"in obj)return"number"!=typeof obj.length||function(val){return val!=val}(obj.length)?createBuffer(that,0):fromArrayLike(that,obj);if("Buffer"===obj.type&&isArray(obj.data))return fromArrayLike(that,obj.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(that,value)}function assertSize(size){if("number"!=typeof size)throw new TypeError('"size" argument must be a number');if(size<0)throw new RangeError('"size" argument must not be negative')}function allocUnsafe(that,size){if(assertSize(size),that=createBuffer(that,size<0?0:0|checked(size)),!Buffer.TYPED_ARRAY_SUPPORT)for(var i=0;i<size;++i)that[i]=0;return that}function fromArrayLike(that,array){var length=array.length<0?0:0|checked(array.length);that=createBuffer(that,length);for(var i=0;i<length;i+=1)that[i]=255&array[i];return that}function checked(length){if(length>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|length}function byteLength(string,encoding){if(Buffer.isBuffer(string))return string.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(string)||string instanceof ArrayBuffer))return string.byteLength;"string"!=typeof string&&(string=""+string);var len=string.length;if(0===len)return 0;for(var loweredCase=!1;;)switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":case void 0:return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*len;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase)return utf8ToBytes(string).length;encoding=(""+encoding).toLowerCase(),loweredCase=!0}}function swap(b,n,m){var i=b[n];b[n]=b[m],b[m]=i}function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){if(0===buffer.length)return-1;if("string"==typeof byteOffset?(encoding=byteOffset,byteOffset=0):byteOffset>2147483647?byteOffset=2147483647:byteOffset<-2147483648&&(byteOffset=-2147483648),byteOffset=+byteOffset,isNaN(byteOffset)&&(byteOffset=dir?0:buffer.length-1),byteOffset<0&&(byteOffset=buffer.length+byteOffset),byteOffset>=buffer.length){if(dir)return-1;byteOffset=buffer.length-1}else if(byteOffset<0){if(!dir)return-1;byteOffset=0}if("string"==typeof val&&(val=Buffer.from(val,encoding)),Buffer.isBuffer(val))return 0===val.length?-1:arrayIndexOf(buffer,val,byteOffset,encoding,dir);if("number"==typeof val)return val&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?dir?Uint8Array.prototype.indexOf.call(buffer,val,byteOffset):Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset):arrayIndexOf(buffer,[val],byteOffset,encoding,dir);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){var i,indexSize=1,arrLength=arr.length,valLength=val.length;if(void 0!==encoding&&("ucs2"===(encoding=String(encoding).toLowerCase())||"ucs-2"===encoding||"utf16le"===encoding||"utf-16le"===encoding)){if(arr.length<2||val.length<2)return-1;indexSize=2,arrLength/=2,valLength/=2,byteOffset/=2}function read(buf,i){return 1===indexSize?buf[i]:buf.readUInt16BE(i*indexSize)}if(dir){var foundIndex=-1;for(i=byteOffset;i<arrLength;i++)if(read(arr,i)===read(val,-1===foundIndex?0:i-foundIndex)){if(-1===foundIndex&&(foundIndex=i),i-foundIndex+1===valLength)return foundIndex*indexSize}else-1!==foundIndex&&(i-=i-foundIndex),foundIndex=-1}else for(byteOffset+valLength>arrLength&&(byteOffset=arrLength-valLength),i=byteOffset;i>=0;i--){for(var found=!0,j=0;j<valLength;j++)if(read(arr,i+j)!==read(val,j)){found=!1;break}if(found)return i}return-1}function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;length?(length=Number(length))>remaining&&(length=remaining):length=remaining;var strLen=string.length;if(strLen%2!=0)throw new TypeError("Invalid hex string");length>strLen/2&&(length=strLen/2);for(var i=0;i<length;++i){var parsed=parseInt(string.substr(2*i,2),16);if(isNaN(parsed))return i;buf[offset+i]=parsed}return i}function utf8Write(buf,string,offset,length){return blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length)}function asciiWrite(buf,string,offset,length){return blitBuffer(function(str){for(var byteArray=[],i=0;i<str.length;++i)byteArray.push(255&str.charCodeAt(i));return byteArray}(string),buf,offset,length)}function latin1Write(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){return blitBuffer(base64ToBytes(string),buf,offset,length)}function ucs2Write(buf,string,offset,length){return blitBuffer(function(str,units){for(var c,hi,lo,byteArray=[],i=0;i<str.length&&!((units-=2)<0);++i)c=str.charCodeAt(i),hi=c>>8,lo=c%256,byteArray.push(lo),byteArray.push(hi);return byteArray}(string,buf.length-offset),buf,offset,length)}function base64Slice(buf,start,end){return 0===start&&end===buf.length?base64.fromByteArray(buf):base64.fromByteArray(buf.slice(start,end))}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);for(var res=[],i=start;i<end;){var secondByte,thirdByte,fourthByte,tempCodePoint,firstByte=buf[i],codePoint=null,bytesPerSequence=firstByte>239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end)switch(bytesPerSequence){case 1:firstByte<128&&(codePoint=firstByte);break;case 2:128==(192&(secondByte=buf[i+1]))&&(tempCodePoint=(31&firstByte)<<6|63&secondByte)>127&&(codePoint=tempCodePoint);break;case 3:secondByte=buf[i+1],thirdByte=buf[i+2],128==(192&secondByte)&&128==(192&thirdByte)&&(tempCodePoint=(15&firstByte)<<12|(63&secondByte)<<6|63&thirdByte)>2047&&(tempCodePoint<55296||tempCodePoint>57343)&&(codePoint=tempCodePoint);break;case 4:secondByte=buf[i+1],thirdByte=buf[i+2],fourthByte=buf[i+3],128==(192&secondByte)&&128==(192&thirdByte)&&128==(192&fourthByte)&&(tempCodePoint=(15&firstByte)<<18|(63&secondByte)<<12|(63&thirdByte)<<6|63&fourthByte)>65535&&tempCodePoint<1114112&&(codePoint=tempCodePoint)}null===codePoint?(codePoint=65533,bytesPerSequence=1):codePoint>65535&&(codePoint-=65536,res.push(codePoint>>>10&1023|55296),codePoint=56320|1023&codePoint),res.push(codePoint),i+=bytesPerSequence}return function(codePoints){var len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,codePoints);var res="",i=0;for(;i<len;)res+=String.fromCharCode.apply(String,codePoints.slice(i,i+=MAX_ARGUMENTS_LENGTH));return res}(res)}exports.Buffer=Buffer,exports.SlowBuffer=function(length){+length!=length&&(length=0);return Buffer.alloc(+length)},exports.INSPECT_MAX_BYTES=50,Buffer.TYPED_ARRAY_SUPPORT=void 0!==global.TYPED_ARRAY_SUPPORT?global.TYPED_ARRAY_SUPPORT:function(){try{var arr=new Uint8Array(1);return arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===arr.foo()&&"function"==typeof arr.subarray&&0===arr.subarray(1,1).byteLength}catch(e){return!1}}(),exports.kMaxLength=kMaxLength(),Buffer.poolSize=8192,Buffer._augment=function(arr){return arr.__proto__=Buffer.prototype,arr},Buffer.from=function(value,encodingOrOffset,length){return from(null,value,encodingOrOffset,length)},Buffer.TYPED_ARRAY_SUPPORT&&(Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0})),Buffer.alloc=function(size,fill,encoding){return function(that,size,fill,encoding){return assertSize(size),size<=0?createBuffer(that,size):void 0!==fill?"string"==typeof encoding?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill):createBuffer(that,size)}(null,size,fill,encoding)},Buffer.allocUnsafe=function(size){return allocUnsafe(null,size)},Buffer.allocUnsafeSlow=function(size){return allocUnsafe(null,size)},Buffer.isBuffer=function(b){return!(null==b||!b._isBuffer)},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var x=a.length,y=b.length,i=0,len=Math.min(x,y);i<len;++i)if(a[i]!==b[i]){x=a[i],y=b[i];break}return x<y?-1:y<x?1:0},Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(list,length){if(!isArray(list))throw new TypeError('"list" argument must be an Array of Buffers');if(0===list.length)return Buffer.alloc(0);var i;if(void 0===length)for(length=0,i=0;i<list.length;++i)length+=list[i].length;var buffer=Buffer.allocUnsafe(length),pos=0;for(i=0;i<list.length;++i){var buf=list[i];if(!Buffer.isBuffer(buf))throw new TypeError('"list" argument must be an Array of Buffers');buf.copy(buffer,pos),pos+=buf.length}return buffer},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var len=this.length;if(len%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<len;i+=2)swap(this,i,i+1);return this},Buffer.prototype.swap32=function(){var len=this.length;if(len%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<len;i+=4)swap(this,i,i+3),swap(this,i+1,i+2);return this},Buffer.prototype.swap64=function(){var len=this.length;if(len%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<len;i+=8)swap(this,i,i+7),swap(this,i+1,i+6),swap(this,i+2,i+5),swap(this,i+3,i+4);return this},Buffer.prototype.toString=function(){var length=0|this.length;return 0===length?"":0===arguments.length?utf8Slice(this,0,length):function(encoding,start,end){var loweredCase=!1;if((void 0===start||start<0)&&(start=0),start>this.length)return"";if((void 0===end||end>this.length)&&(end=this.length),end<=0)return"";if((end>>>=0)<=(start>>>=0))return"";for(encoding||(encoding="utf8");;)switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase(),loweredCase=!0}}.apply(this,arguments)},Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===Buffer.compare(this,b)},Buffer.prototype.inspect=function(){var str="",max=exports.INSPECT_MAX_BYTES;return this.length>0&&(str=this.toString("hex",0,max).match(/.{2}/g).join(" "),this.length>max&&(str+=" ... ")),"<Buffer "+str+">"},Buffer.prototype.compare=function(target,start,end,thisStart,thisEnd){if(!Buffer.isBuffer(target))throw new TypeError("Argument must be a Buffer");if(void 0===start&&(start=0),void 0===end&&(end=target?target.length:0),void 0===thisStart&&(thisStart=0),void 0===thisEnd&&(thisEnd=this.length),start<0||end>target.length||thisStart<0||thisEnd>this.length)throw new RangeError("out of range index");if(thisStart>=thisEnd&&start>=end)return 0;if(thisStart>=thisEnd)return-1;if(start>=end)return 1;if(start>>>=0,end>>>=0,thisStart>>>=0,thisEnd>>>=0,this===target)return 0;for(var x=thisEnd-thisStart,y=end-start,len=Math.min(x,y),thisCopy=this.slice(thisStart,thisEnd),targetCopy=target.slice(start,end),i=0;i<len;++i)if(thisCopy[i]!==targetCopy[i]){x=thisCopy[i],y=targetCopy[i];break}return x<y?-1:y<x?1:0},Buffer.prototype.includes=function(val,byteOffset,encoding){return-1!==this.indexOf(val,byteOffset,encoding)},Buffer.prototype.indexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!0)},Buffer.prototype.lastIndexOf=function(val,byteOffset,encoding){return bidirectionalIndexOf(this,val,byteOffset,encoding,!1)},Buffer.prototype.write=function(string,offset,length,encoding){if(void 0===offset)encoding="utf8",length=this.length,offset=0;else if(void 0===length&&"string"==typeof offset)encoding=offset,length=this.length,offset=0;else{if(!isFinite(offset))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");offset|=0,isFinite(length)?(length|=0,void 0===encoding&&(encoding="utf8")):(encoding=length,length=void 0)}var remaining=this.length-offset;if((void 0===length||length>remaining)&&(length=remaining),string.length>0&&(length<0||offset<0)||offset>this.length)throw new RangeError("Attempt to write outside buffer bounds");encoding||(encoding="utf8");for(var loweredCase=!1;;)switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":return asciiWrite(this,string,offset,length);case"latin1":case"binary":return latin1Write(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase(),loweredCase=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(127&buf[i]);return ret}function latin1Slice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;++i)ret+=String.fromCharCode(buf[i]);return ret}function hexSlice(buf,start,end){var len=buf.length;(!start||start<0)&&(start=0),(!end||end<0||end>len)&&(end=len);for(var out="",i=start;i<end;++i)out+=toHex(buf[i]);return out}function utf16leSlice(buf,start,end){for(var bytes=buf.slice(start,end),res="",i=0;i<bytes.length;i+=2)res+=String.fromCharCode(bytes[i]+256*bytes[i+1]);return res}function checkOffset(offset,ext,length){if(offset%1!=0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||value<min)throw new RangeError('"value" argument is out of bounds');if(offset+ext>buf.length)throw new RangeError("Index out of range")}function objectWriteUInt16(buf,value,offset,littleEndian){value<0&&(value=65535+value+1);for(var i=0,j=Math.min(buf.length-offset,2);i<j;++i)buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>8*(littleEndian?i:1-i)}function objectWriteUInt32(buf,value,offset,littleEndian){value<0&&(value=4294967295+value+1);for(var i=0,j=Math.min(buf.length-offset,4);i<j;++i)buf[offset+i]=value>>>8*(littleEndian?i:3-i)&255}function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,4),ieee754.write(buf,value,offset,littleEndian,23,4),offset+4}function writeDouble(buf,value,offset,littleEndian,noAssert){return noAssert||checkIEEE754(buf,0,offset,8),ieee754.write(buf,value,offset,littleEndian,52,8),offset+8}Buffer.prototype.slice=function(start,end){var newBuf,len=this.length;if(start=~~start,end=void 0===end?len:~~end,start<0?(start+=len)<0&&(start=0):start>len&&(start=len),end<0?(end+=len)<0&&(end=0):end>len&&(end=len),end<start&&(end=start),Buffer.TYPED_ARRAY_SUPPORT)(newBuf=this.subarray(start,end)).__proto__=Buffer.prototype;else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,void 0);for(var i=0;i<sliceLen;++i)newBuf[i]=this[i+start]}return newBuf},Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val},Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset+--byteLength],mul=1;byteLength>0&&(mul*=256);)val+=this[offset+--byteLength]*mul;return val},Buffer.prototype.readUInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),this[offset]},Buffer.prototype.readUInt16LE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]|this[offset+1]<<8},Buffer.prototype.readUInt16BE=function(offset,noAssert){return noAssert||checkOffset(offset,2,this.length),this[offset]<<8|this[offset+1]},Buffer.prototype.readUInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+16777216*this[offset+3]},Buffer.prototype.readUInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),16777216*this[offset]+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])},Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var val=this[offset],mul=1,i=0;++i<byteLength&&(mul*=256);)val+=this[offset+i]*mul;return val>=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset|=0,byteLength|=0,noAssert||checkOffset(offset,byteLength,this.length);for(var i=byteLength,mul=1,val=this[offset+--i];i>0&&(mul*=256);)val+=this[offset+--i]*mul;return val>=(mul*=128)&&(val-=Math.pow(2,8*byteLength)),val},Buffer.prototype.readInt8=function(offset,noAssert){return noAssert||checkOffset(offset,1,this.length),128&this[offset]?-1*(255-this[offset]+1):this[offset]},Buffer.prototype.readInt16LE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt16BE=function(offset,noAssert){noAssert||checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return 32768&val?4294901760|val:val},Buffer.prototype.readInt32LE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24},Buffer.prototype.readInt32BE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]},Buffer.prototype.readFloatLE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!0,23,4)},Buffer.prototype.readFloatBE=function(offset,noAssert){return noAssert||checkOffset(offset,4,this.length),ieee754.read(this,offset,!1,23,4)},Buffer.prototype.readDoubleLE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!0,52,8)},Buffer.prototype.readDoubleBE=function(offset,noAssert){return noAssert||checkOffset(offset,8,this.length),ieee754.read(this,offset,!1,52,8)},Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){(value=+value,offset|=0,byteLength|=0,noAssert)||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);var mul=1,i=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){(value=+value,offset|=0,byteLength|=0,noAssert)||checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength)-1,0);var i=byteLength-1,mul=1;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)this[offset+i]=value/mul&255;return offset+byteLength},Buffer.prototype.writeUInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),this[offset]=255&value,offset+1},Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset+3]=value>>>24,this[offset+2]=value>>>16,this[offset+1]=value>>>8,this[offset]=255&value):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=0,mul=1,sub=0;for(this[offset]=255&value;++i<byteLength&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i-1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){if(value=+value,offset|=0,!noAssert){var limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}var i=byteLength-1,mul=1,sub=0;for(this[offset+i]=255&value;--i>=0&&(mul*=256);)value<0&&0===sub&&0!==this[offset+i+1]&&(sub=1),this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength},Buffer.prototype.writeInt8=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(value=Math.floor(value)),value<0&&(value=255+value+1),this[offset]=255&value,offset+1},Buffer.prototype.writeInt16LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8):objectWriteUInt16(this,value,offset,!0),offset+2},Buffer.prototype.writeInt16BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>8,this[offset+1]=255&value):objectWriteUInt16(this,value,offset,!1),offset+2},Buffer.prototype.writeInt32LE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=255&value,this[offset+1]=value>>>8,this[offset+2]=value>>>16,this[offset+3]=value>>>24):objectWriteUInt32(this,value,offset,!0),offset+4},Buffer.prototype.writeInt32BE=function(value,offset,noAssert){return value=+value,offset|=0,noAssert||checkInt(this,value,offset,4,2147483647,-2147483648),value<0&&(value=4294967295+value+1),Buffer.TYPED_ARRAY_SUPPORT?(this[offset]=value>>>24,this[offset+1]=value>>>16,this[offset+2]=value>>>8,this[offset+3]=255&value):objectWriteUInt32(this,value,offset,!1),offset+4},Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,!0,noAssert)},Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,!1,noAssert)},Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,!0,noAssert)},Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,!1,noAssert)},Buffer.prototype.copy=function(target,targetStart,start,end){if(start||(start=0),end||0===end||(end=this.length),targetStart>=target.length&&(targetStart=target.length),targetStart||(targetStart=0),end>0&&end<start&&(end=start),end===start)return 0;if(0===target.length||0===this.length)return 0;if(targetStart<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=this.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");end>this.length&&(end=this.length),target.length-targetStart<end-start&&(end=target.length-targetStart+start);var i,len=end-start;if(this===target&&start<targetStart&&targetStart<end)for(i=len-1;i>=0;--i)target[i+targetStart]=this[i+start];else if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i<len;++i)target[i+targetStart]=this[i+start];else Uint8Array.prototype.set.call(target,this.subarray(start,start+len),targetStart);return len},Buffer.prototype.fill=function(val,start,end,encoding){if("string"==typeof val){if("string"==typeof start?(encoding=start,start=0,end=this.length):"string"==typeof end&&(encoding=end,end=this.length),1===val.length){var code=val.charCodeAt(0);code<256&&(val=code)}if(void 0!==encoding&&"string"!=typeof encoding)throw new TypeError("encoding must be a string");if("string"==typeof encoding&&!Buffer.isEncoding(encoding))throw new TypeError("Unknown encoding: "+encoding)}else"number"==typeof val&&(val&=255);if(start<0||this.length<start||this.length<end)throw new RangeError("Out of range index");if(end<=start)return this;var i;if(start>>>=0,end=void 0===end?this.length:end>>>0,val||(val=0),"number"==typeof val)for(i=start;i<end;++i)this[i]=val;else{var bytes=Buffer.isBuffer(val)?val:utf8ToBytes(new Buffer(val,encoding).toString()),len=bytes.length;for(i=0;i<end-start;++i)this[i+start]=bytes[i%len]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function toHex(n){return n<16?"0"+n.toString(16):n.toString(16)}function utf8ToBytes(string,units){var codePoint;units=units||1/0;for(var length=string.length,leadSurrogate=null,bytes=[],i=0;i<length;++i){if((codePoint=string.charCodeAt(i))>55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){(units-=3)>-1&&bytes.push(239,191,189);continue}if(i+1===length){(units-=3)>-1&&bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){(units-=3)>-1&&bytes.push(239,191,189),leadSurrogate=codePoint;continue}codePoint=65536+(leadSurrogate-55296<<10|codePoint-56320)}else leadSurrogate&&(units-=3)>-1&&bytes.push(239,191,189);if(leadSurrogate=null,codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,63&codePoint|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,63&codePoint|128)}else{if(!(codePoint<1114112))throw new Error("Invalid code point");if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,63&codePoint|128)}}return bytes}function base64ToBytes(str){return base64.toByteArray(function(str){if((str=function(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}(str).replace(INVALID_BASE64_RE,"")).length<2)return"";for(;str.length%4!=0;)str+="=";return str}(str))}function blitBuffer(src,dst,offset,length){for(var i=0;i<length&&!(i+offset>=dst.length||i>=src.length);++i)dst[i+offset]=src[i];return i}}).call(this,__webpack_require__(11))},function(module,exports){var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(fun){if(cachedSetTimeout===setTimeout)return setTimeout(fun,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(fun,0);try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var timeout=runTimeout(cleanUpNextTick);draining=!0;for(var len=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,function(marker){if(cachedClearTimeout===clearTimeout)return clearTimeout(marker);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(marker);try{cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}(timeout)}}function Item(fun,array){this.fun=fun,this.array=array}function noop(){}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)args[i-1]=arguments[i];queue.push(new Item(fun,args)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(name){return[]},process.binding=function(name){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(dir){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}},function(module,exports,__webpack_require__){function objectToString(o){return Object.prototype.toString.call(o)}exports.isArray=function(arg){return Array.isArray?Array.isArray(arg):"[object Array]"===objectToString(arg)},exports.isBoolean=function(arg){return"boolean"==typeof arg},exports.isNull=function(arg){return null===arg},exports.isNullOrUndefined=function(arg){return null==arg},exports.isNumber=function(arg){return"number"==typeof arg},exports.isString=function(arg){return"string"==typeof arg},exports.isSymbol=function(arg){return"symbol"==typeof arg},exports.isUndefined=function(arg){return void 0===arg},exports.isRegExp=function(re){return"[object RegExp]"===objectToString(re)},exports.isObject=function(arg){return"object"==typeof arg&&null!==arg},exports.isDate=function(d){return"[object Date]"===objectToString(d)},exports.isError=function(e){return"[object Error]"===objectToString(e)||e instanceof Error},exports.isFunction=function(arg){return"function"==typeof arg},exports.isPrimitive=function(arg){return null===arg||"boolean"==typeof arg||"number"==typeof arg||"string"==typeof arg||"symbol"==typeof arg||void 0===arg},exports.isBuffer=__webpack_require__(21).Buffer.isBuffer},function(module,exports,__webpack_require__){"use strict";var ES6Promise=null;ES6Promise="undefined"!=typeof Promise?Promise:__webpack_require__(101),module.exports={Promise:ES6Promise}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}},__spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0});var DateModule_1=__webpack_require__(6),InboxMessages=function(){function InboxMessages(data,api,inboxModel,dateModule){void 0===dateModule&&(dateModule=new DateModule_1.default),this.data=data,this.api=api,this.inboxModel=inboxModel,this.dateModule=dateModule,this.publicMessageBuilder=this.publicMessageBuilder.bind(this)}return InboxMessages.prototype.messageTypeFactory=function(actionParams){var messageType=0;return"h"in actionParams||"rm"in actionParams||"r"in actionParams?messageType=1:"l"in actionParams&&null!=actionParams.l&&(messageType=actionParams.l.startsWith("http")?2:3),messageType},InboxMessages.prototype.updateMessagesStatusWithCodes=function(codes,messages,status){return __awaiter(this,void 0,void 0,function(){var updatedMessages,inboxStatusQueries,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return updatedMessages=[],inboxStatusQueries=[],messages.forEach(function(msg){return __awaiter(_this,void 0,void 0,function(){return __generator(this,function(_a){return-1===codes.indexOf(msg.inbox_id)?[2]:(msg.status=status,updatedMessages.push(msg),inboxStatusQueries.push(this.api.inboxStatus(msg.order,msg.status)),[2])})})}),[4,this.inboxModel.putBulkMessages(updatedMessages)];case 1:return _a.sent(),[4,Promise.all(inboxStatusQueries)];case 2:return _a.sent(),[2]}})})},InboxMessages.prototype.publicMessageBuilder=function(message){return __awaiter(this,void 0,void 0,function(){var imageUrl,_a,title,_b;return __generator(this,function(_c){switch(_c.label){case 0:return(_a=message.image)?[3,2]:[4,this.data.getDefaultNotificationImage()];case 1:_a=_c.sent(),_c.label=2;case 2:return imageUrl=_a,(_b=message.title)?[3,4]:[4,this.data.getDefaultNotificationTitle()];case 3:_b=_c.sent(),_c.label=4;case 4:return title=_b,this.dateModule.date=new Date(1e3*parseInt(message.send_date)),this.dateModule.setLocal(),[2,{title:title,imageUrl:imageUrl,code:message.inbox_id,message:message.text,sendDate:this.dateModule.date.toISOString(),type:this.messageTypeFactory(JSON.parse(message.action_params)),isRead:2===message.status||3===message.status,isActionPerformed:3===message.status}]}})})},InboxMessages.prototype.messagesWithNoActionPerformedCount=function(){return this.inboxModel.getDeliveredReadMessagesCount()},InboxMessages.prototype.unreadMessagesCount=function(){return this.inboxModel.getDeliveredMessagesCount()},InboxMessages.prototype.messagesCount=function(){return this.inboxModel.messagesCount()},InboxMessages.prototype.loadMessages=function(){return __awaiter(this,void 0,void 0,function(){var readMessages,unreadMessages,buildMessagePromises;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return readMessages=_a.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return unreadMessages=_a.sent(),buildMessagePromises=__spreadArrays(readMessages,unreadMessages).sort(function(msgA,msgB){return parseInt(msgB.send_date,10)-parseInt(msgA.send_date,10)}).sort(function(msgA,msgB){return parseInt(msgB.order||"0",10)-parseInt(msgA.order||"0",10)}).map(this.publicMessageBuilder),[2,Promise.all(buildMessagePromises)]}})})},InboxMessages.prototype.readMessagesWithCodes=function(codes){return __awaiter(this,void 0,void 0,function(){var unreadMessages,statusRead;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getDeliveredMessages()];case 1:return unreadMessages=_a.sent(),statusRead=2,[4,this.updateMessagesStatusWithCodes(codes,unreadMessages,statusRead)];case 2:return _a.sent(),[2]}})})},InboxMessages.prototype.performActionForMessageWithCode=function(code){return __awaiter(this,void 0,void 0,function(){var message,actionParams,messageType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getMessage(code)];case 1:return message=_a.sent(),actionParams=JSON.parse(message.action_params),2===(messageType=this.messageTypeFactory(actionParams))&&null!=actionParams.l?document.location.href=actionParams.l:3===messageType&&null!=actionParams.l&&window.history.go(actionParams.l),message.status=3,[4,this.inboxModel.putMessage(message)];case 2:return _a.sent(),[4,this.api.inboxStatus(message.order,message.status)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.deleteMessagesWithCodes=function(codes){return __awaiter(this,void 0,void 0,function(){var readMessages,unreadMessages,statusDeleted;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.getReadOpenMessages()];case 1:return readMessages=_a.sent(),[4,this.inboxModel.getDeliveredMessages()];case 2:return unreadMessages=_a.sent(),statusDeleted=4,[4,this.updateMessagesStatusWithCodes(codes,__spreadArrays(readMessages,unreadMessages),statusDeleted)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.syncMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.inboxModel.updateMessages()];case 1:return _a.sent(),[2]}})})},InboxMessages}();exports.default=InboxMessages},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiClient=void 0;var Data_1=__webpack_require__(4),logger_1=__webpack_require__(3),ApiClient=function(){function ApiClient(data,logger){void 0===data&&(data=new Data_1.Data),void 0===logger&&(logger=logger_1.Logger),this.data=data,this.logger=logger}return ApiClient.prototype.checkDevice=function(options){return this.createRequest("checkDevice",options)},ApiClient.prototype.getConfig=function(options){return this.createRequest("getConfig",options)},ApiClient.prototype.applicationOpen=function(options){return this.createRequest("applicationOpen",options)},ApiClient.prototype.registerDevice=function(options){return this.createRequest("registerDevice",options)},ApiClient.prototype.unregisterDevice=function(options){return this.createRequest("unregisterDevice",options)},ApiClient.prototype.deleteDevice=function(options){return this.createRequest("deleteDevice",options)},ApiClient.prototype.messageDeliveryEvent=function(options){return this.createRequest("messageDeliveryEvent",options)},ApiClient.prototype.pushStat=function(options){return this.createRequest("pushStat",options)},ApiClient.prototype.setTags=function(options){return this.createRequest("setTags",options)},ApiClient.prototype.getTags=function(options){return this.createRequest("getTags",options)},ApiClient.prototype.registerUser=function(options){return this.createRequest("registerUser",options)},ApiClient.prototype.postEvent=function(options){return this.createRequest("postEvent",options)},ApiClient.prototype.getInboxMessages=function(options){return this.createRequest("getInboxMessages",options)},ApiClient.prototype.inboxStatus=function(options){return this.createRequest("inboxStatus",options)},ApiClient.prototype.pageVisit=function(options,url){return this.createRequest("pageVisit",options,url)},ApiClient.prototype.getInApps=function(options){return this.createRequest("getInApps",options)},ApiClient.prototype.setPurchase=function(options){return this.createRequest("setPurchase",options)},ApiClient.prototype.createRequest=function(methodName,request,customUrl){return __awaiter(this,void 0,void 0,function(){var entrypoint,response,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApiEntrypoint()];case 1:return entrypoint=_a.sent(),[4,fetch(customUrl||entrypoint+methodName,{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify({request:request})})];case 2:return response=_a.sent(),[4,this.checkResponse(response)];case 3:return(result=_a.sent()).base_url?[4,this.data.setApiEntrypoint(result.base_url)]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[4,this.logger.write("apirequest",methodName+" call with arguments: "+JSON.stringify(request)+" to Pushwoosh has been successful. Result: "+JSON.stringify(result.response))];case 6:return _a.sent(),[2,result.response]}})})},ApiClient.prototype.checkResponse=function(response){return __awaiter(this,void 0,void 0,function(){var data;return __generator(this,function(_a){switch(_a.label){case 0:if(200!==response.status)throw new Error("Error code: "+response.status+". Error text: "+response.statusText);return[4,response.json()];case 1:if(200!==(data=_a.sent()).status_code)throw new Error("Error code: "+data.status_code+". Error text: "+data.status_message);return[2,data]}})})},ApiClient}();exports.ApiClient=ApiClient},function(module,exports,__webpack_require__){"use strict";(function(process){void 0===process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?module.exports={nextTick:function(fn,arg1,arg2,arg3){if("function"!=typeof fn)throw new TypeError('"callback" argument must be a function');var args,i,len=arguments.length;switch(len){case 0:case 1:return process.nextTick(fn);case 2:return process.nextTick(function(){fn.call(null,arg1)});case 3:return process.nextTick(function(){fn.call(null,arg1,arg2)});case 4:return process.nextTick(function(){fn.call(null,arg1,arg2,arg3)});default:for(args=new Array(len-1),i=0;i<args.length;)args[i++]=arguments[i];return process.nextTick(function(){fn.apply(null,args)})}}}:module.exports=process}).call(this,__webpack_require__(22))},function(module,exports,__webpack_require__){var buffer=__webpack_require__(21),Buffer=buffer.Buffer;function copyProps(src,dst){for(var key in src)dst[key]=src[key]}function SafeBuffer(arg,encodingOrOffset,length){return Buffer(arg,encodingOrOffset,length)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(arg,encodingOrOffset,length){if("number"==typeof arg)throw new TypeError("Argument must not be a number");return Buffer(arg,encodingOrOffset,length)},SafeBuffer.alloc=function(size,fill,encoding){if("number"!=typeof size)throw new TypeError("Argument must be a number");var buf=Buffer(size);return void 0!==fill?"string"==typeof encoding?buf.fill(fill,encoding):buf.fill(fill):buf.fill(0),buf},SafeBuffer.allocUnsafe=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return Buffer(size)},SafeBuffer.allocUnsafeSlow=function(size){if("number"!=typeof size)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(size)}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){module.exports={isNode:void 0!==Buffer,newBufferFrom:function(data,encoding){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(data,encoding);if("number"==typeof data)throw new Error('The "data" argument must not be a number');return new Buffer(data,encoding)},allocBuffer:function(size){if(Buffer.alloc)return Buffer.alloc(size);var buf=new Buffer(size);return buf.fill(0),buf},isBuffer:function(b){return Buffer.isBuffer(b)},isStream:function(obj){return obj&&"function"==typeof obj.on&&"function"==typeof obj.pause&&"function"==typeof obj.resume}}}).call(this,__webpack_require__(21).Buffer)},function(module,exports,__webpack_require__){var _nodeId,_clockseq,rng=__webpack_require__(16),bytesToUuid=__webpack_require__(17),_lastMSecs=0,_lastNSecs=0;module.exports=function(options,buf,offset){var i=buf&&offset||0,b=buf||[],node=(options=options||{}).node||_nodeId,clockseq=void 0!==options.clockseq?options.clockseq:_clockseq;if(null==node||null==clockseq){var seedBytes=rng();null==node&&(node=_nodeId=[1|seedBytes[0],seedBytes[1],seedBytes[2],seedBytes[3],seedBytes[4],seedBytes[5]]),null==clockseq&&(clockseq=_clockseq=16383&(seedBytes[6]<<8|seedBytes[7]))}var msecs=void 0!==options.msecs?options.msecs:(new Date).getTime(),nsecs=void 0!==options.nsecs?options.nsecs:_lastNSecs+1,dt=msecs-_lastMSecs+(nsecs-_lastNSecs)/1e4;if(dt<0&&void 0===options.clockseq&&(clockseq=clockseq+1&16383),(dt<0||msecs>_lastMSecs)&&void 0===options.nsecs&&(nsecs=0),nsecs>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");_lastMSecs=msecs,_lastNSecs=nsecs,_clockseq=clockseq;var tl=(1e4*(268435455&(msecs+=122192928e5))+nsecs)%4294967296;b[i++]=tl>>>24&255,b[i++]=tl>>>16&255,b[i++]=tl>>>8&255,b[i++]=255&tl;var tmh=msecs/4294967296*1e4&268435455;b[i++]=tmh>>>8&255,b[i++]=255&tmh,b[i++]=tmh>>>24&15|16,b[i++]=tmh>>>16&255,b[i++]=clockseq>>>8|128,b[i++]=255&clockseq;for(var n=0;n<6;++n)b[i+n]=node[n];return buf||bytesToUuid(b)}},function(module,exports,__webpack_require__){var rng=__webpack_require__(16),bytesToUuid=__webpack_require__(17);module.exports=function(options,buf,offset){var i=buf&&offset||0;"string"==typeof options&&(buf="binary"===options?new Array(16):null,options=null);var rnds=(options=options||{}).random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(var ii=0;ii<16;++ii)buf[i+ii]=rnds[ii];return buf||bytesToUuid(rnds)}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var EventBus_1=__webpack_require__(33);Object.defineProperty(exports,"EventBus",{enumerable:!0,get:function(){return EventBus_1.EventBus}})},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventBus=void 0;var uuid_1=__webpack_require__(13),EventBus=function(){return function(){var _this=this;this.addEventHandler=function(name,handler){var savedEventHandlers=_this.savedEventHandlersMap[name];savedEventHandlers||(savedEventHandlers=[]),savedEventHandlers.push(handler),_this.savedEventHandlersMap[name]=savedEventHandlers},this.removeEventHandler=function(name,handler){var savedEventHandlers=_this.savedEventHandlersMap[name];savedEventHandlers&&(_this.savedEventHandlersMap[name]=savedEventHandlers.filter(function(savedEventHandler){return savedEventHandler!==handler}))},this.dispatchEvent=function(name,payload){var eventId=payload.eventId||uuid_1.v4(),savedEventHandlers=_this.savedEventHandlersMap[name];return savedEventHandlers?(savedEventHandlers.forEach(function(element){"function"==typeof element&&setTimeout(function(){element(__assign(__assign({},payload),{eventId:eventId}))},0)}),eventId):eventId},this.savedEventHandlersMap={}}}();exports.EventBus=EventBus},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Api=void 0;var Data_1=__webpack_require__(4),ApiClient_1=__webpack_require__(26),CONSTANTS=__webpack_require__(1),Api=function(){function Api(eventBus,data,apiClient){void 0===data&&(data=new Data_1.Data),void 0===apiClient&&(apiClient=new ApiClient_1.ApiClient),this.eventBus=eventBus,this.data=data,this.apiClient=apiClient}return Api.prototype.checkDevice=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.checkDevice(params)];case 2:return[2,_a.sent()]}})})},Api.prototype.checkDeviceSubscribeForPushNotifications=function(useCache){return void 0===useCache&&(useCache=!0),__awaiter(this,void 0,void 0,function(){var status,_a,exist,push_token_exist;return __generator(this,function(_b){switch(_b.label){case 0:return void 0!==(status=localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS))&&useCache?[3,2]:[4,this.checkDevice()];case 1:_a=_b.sent(),exist=_a.exist,push_token_exist=_a.push_token_exist,localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,exist&&push_token_exist?CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED:CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),status=localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS),_b.label=2;case 2:return[2,status===CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED]}})})},Api.prototype.getConfig=function(features){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getConfig(__assign(__assign({},params),{features:features}))]}})})},Api.prototype.applicationOpen=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.setLastOpenApplicationTime(Date.now())];case 2:return _a.sent(),[2,this.apiClient.applicationOpen(params)]}})})},Api.prototype.registerDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,tokens,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusCommunicationDisabled()];case 1:if(_a.sent())throw new Error("Can't register device: Communication is disabled!");return[4,this.getRequestParams()];case 2:return params=_a.sent(),[4,this.data.getTokens()];case 3:if(!(tokens=_a.sent()).pushToken)throw new Error("Can't register device: pushToken is not exist!");return[4,this.apiClient.registerDevice(__assign(__assign({},params),{push_token:tokens.pushToken,auth_token:tokens.authToken,public_key:tokens.publicKey,fcm_push_set:tokens.fcmPushSet,fcm_token:tokens.fcmToken}))];case 4:return response=_a.sent(),[4,this.data.setStatusManualUnsubscribed(!1)];case 5:return _a.sent(),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED),this.eventBus.dispatchEvent("register",{}),[2,response]}})})},Api.prototype.unregisterDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),response=this.apiClient.unregisterDevice(params),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),this.eventBus.dispatchEvent("unsubscribe",{}),[2,response]}})})},Api.prototype.deleteDevice=function(){return __awaiter(this,void 0,void 0,function(){var params,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),response=this.apiClient.deleteDevice(params),[4,this.data.setStatusManualUnsubscribed(!0)];case 2:return _a.sent(),localStorage.setItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS,CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED),this.eventBus.dispatchEvent("unsubscribe",{}),[2,response]}})})},Api.prototype.messageDeliveryEvent=function(hash,isTrackingLogOnFailure,metaData){return void 0===metaData&&(metaData={}),__awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return Math.round(+new Date),[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.messageDeliveryEvent(__assign(__assign({},params),{hash:hash,metaData:metaData}))];case 2:return[2,_a.sent()]}})})},Api.prototype.pushStat=function(hash,isTrackingLogOnFailure,metaData){return void 0===metaData&&(metaData={}),__awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return Math.round(+new Date),[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.apiClient.pushStat(__assign(__assign({},params),{hash:hash,metaData:metaData}))];case 2:return[2,_a.sent()]}})})},Api.prototype.setTags=function(tags){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.setTags(__assign(__assign({},params),{tags:tags}))]}})})},Api.prototype.getTags=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getTags(params)]}})})},Api.prototype.registerUser=function(userId){return __awaiter(this,void 0,void 0,function(){var params,deviceType,id,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getDeviceType()];case 2:return deviceType=_a.sent(),id=""+userId,[4,this.apiClient.registerUser(__assign(__assign({},params),{userId:id,ts_offset:60*-(new Date).getTimezoneOffset(),device_type:deviceType}))];case 3:return response=_a.sent(),[4,this.data.setUserId(""+userId)];case 4:return _a.sent(),[4,this.data.setStatusUserIdWasChanged(!0)];case 5:return _a.sent(),[2,response]}})})},Api.prototype.postEvent=function(event,attributes){return __awaiter(this,void 0,void 0,function(){var params,date,time,timestampUTC,timestampCurrent,lastOpenMessage,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),date=new Date,time=date.getTime(),timestampUTC=Math.floor(time/1e3),timestampCurrent=timestampUTC-date.getTimezoneOffset()/60*3600,[4,this.data.getLastOpenMessage()];case 2:if((lastOpenMessage=_a.sent())&&lastOpenMessage.expiry>Date.now()){if(attributes.msgHash)return[2,Promise.reject("attribute msgHash already defined")];attributes=__assign(__assign({},attributes),{msgHash:lastOpenMessage.messageHash})}return[4,this.data.setLastOpenMessage(void 0)];case 3:return _a.sent(),[4,this.apiClient.postEvent(__assign(__assign({},params),{event:event,timestampUTC:timestampUTC,timestampCurrent:timestampCurrent,attributes:attributes}))];case 4:return(response=_a.sent())&&response.code&&this.eventBus.dispatchEvent("receive-in-app-code",{code:response.code}),[2,response]}})})},Api.prototype.getInboxMessages=function(count){return void 0===count&&(count=0),__awaiter(this,void 0,void 0,function(){var params,lastCode,lastRequestTime;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getInboxLastRequestCode()];case 2:return lastCode=_a.sent(),[4,this.data.getInboxLastRequestTime()];case 3:return lastRequestTime=_a.sent(),[2,this.apiClient.getInboxMessages(__assign(__assign({},params),{count:count,last_code:lastCode,last_request_time:lastRequestTime}))]}})})},Api.prototype.inboxStatus=function(order,status){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.inboxStatus(__assign(__assign({},params),{inbox_code:order,status:status,time:(new Date).getTime()}))]}})})},Api.prototype.triggerEvent=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){throw new Error("Method has been deprecated, because we don't aggregate this statistics.")})})},Api.prototype.pageVisit=function(config){return __awaiter(this,void 0,void 0,function(){var params,features,url;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[4,this.data.getFeatures()];case 2:return features=_a.sent(),(url=features&&features.page_visit&&features.page_visit.entrypoint)?[2,this.apiClient.pageVisit(__assign(__assign({},params),config),url)]:[2]}})})},Api.prototype.getInApps=function(){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.getInApps(params)]}})})},Api.prototype.setPurchase=function(attributes){return __awaiter(this,void 0,void 0,function(){var params;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getRequestParams()];case 1:return params=_a.sent(),[2,this.apiClient.setPurchase(__assign(__assign({},params),attributes))]}})})},Api.prototype.getParams=function(){return __awaiter(this,void 0,void 0,function(){var applicationCode,hwid,apiParams,initParams;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return applicationCode=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getTokens()];case 3:return apiParams=_a.sent(),[4,this.data.getInitParams()];case 4:return initParams=_a.sent(),[2,__assign(__assign({applicationCode:applicationCode,hwid:hwid},apiParams),initParams)]}})})},Object.defineProperty(Api.prototype,"params",{get:function(){throw new Error('Property "Pushwoosh.api.params" have been deprecated. Use the async method "Pushwoosh.api.getParams()"')},enumerable:!1,configurable:!0}),Api.prototype.getRequestParams=function(){return __awaiter(this,void 0,void 0,function(){var applicationCode,hwid,userId,deviceType,deviceModel,language,version,timezone;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return applicationCode=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getUserId()];case 3:return userId=_a.sent(),[4,this.data.getDeviceType()];case 4:return deviceType=_a.sent(),[4,this.data.getDeviceModel()];case 5:return deviceModel=_a.sent(),[4,this.data.getLanguage()];case 6:return language=_a.sent(),[4,this.data.getSdkVersion()];case 7:return version=_a.sent(),timezone=60*-(new Date).getTimezoneOffset(),[2,{application:applicationCode,hwid:hwid,userId:userId||hwid,device_type:deviceType,device_model:deviceModel,timezone:timezone,language:language,v:version}]}})})},Api}();exports.Api=Api},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var initial_1=__webpack_require__(36),_26_11_2018_1=__webpack_require__(37),DateModule_1=__webpack_require__(6),Migrations=function(){function Migrations(dateModule){void 0===dateModule&&(dateModule=new DateModule_1.default),this.migrations={initial:initial_1.default,"2018/11/26":_26_11_2018_1.default},this.dateModule=dateModule}return Object.defineProperty(Migrations.prototype,"initial",{get:function(){return this.migrations.initial},enumerable:!1,configurable:!0}),Object.defineProperty(Migrations.prototype,"dateSorted",{get:function(){var _this=this;return Object.keys(this.migrations).filter(function(key){return"initial"!==key}).sort(function(a,b){var dateA=new DateModule_1.default(new Date(a)),dateB=new DateModule_1.default(new Date(b));return dateA.getTimestamp()-dateB.getTimestamp()}).map(function(key){return _this.migrations[key]})},enumerable:!1,configurable:!0}),Migrations}();exports.default=Migrations},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(20),constants_1=__webpack_require__(9);exports.default=[helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_KEY_VALUE,function(database){database.createObjectStore(constants_1.STORE_NAME_KEY_VALUE,{keyPath:"key"})}),helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_MAIN_LOG,function(database){var logStore=database.createObjectStore(constants_1.STORE_NAME_MAIN_LOG,{keyPath:constants_1.KEY_PATH_BASE_INCREMENT,autoIncrement:!0});logStore.createIndex("environment","environment",{unique:!1}),logStore.createIndex("date","date",{unique:!1}),logStore.createIndex("type","type",{unique:!1})}),helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_MESSAGE_LOG,function(database){database.createObjectStore(constants_1.STORE_NAME_MESSAGE_LOG,{keyPath:constants_1.KEY_PATH_BASE_INCREMENT,autoIncrement:!0}).createIndex("date","date",{unique:!1})})]},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(20),constants_1=__webpack_require__(9);exports.default=[helpers_1.storeCreatorDecorator(constants_1.STORE_NAME_INBOX_MESSAGES,function(database){var store=database.createObjectStore(constants_1.STORE_NAME_INBOX_MESSAGES,{keyPath:"inbox_id",autoIncrement:!1});store.createIndex("status","status",{unique:!1,multiEntry:!0}),store.createIndex("rt","rt",{unique:!1,multiEntry:!0})})]},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PushServiceDefault=void 0;var uuid_1=__webpack_require__(13),logger_1=__webpack_require__(3),CONSTANTS=__webpack_require__(1),PushServiceDefault=function(){function PushServiceDefault(api,data,config){this.api=api,this.data=data,this.config=config}return PushServiceDefault.prototype.getPermission=function(){return Notification.permission},PushServiceDefault.prototype.checkIsPermissionGranted=function(){return this.getPermission()===CONSTANTS.PERMISSION_GRANTED},PushServiceDefault.prototype.checkIsPermissionDefault=function(){return this.getPermission()===CONSTANTS.PERMISSION_PROMPT},PushServiceDefault.prototype.checkIsManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getStatusManualUnsubscribed()]})})},PushServiceDefault.prototype.askPermission=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,Notification.requestPermission()];case 1:return _a.sent(),[2]}})})},PushServiceDefault.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getTokens()]})})},PushServiceDefault.prototype.subscribe=function(subscription){return __awaiter(this,void 0,void 0,function(){var currentSubscription,senderId_1,applicationServerKey,senderId,pushToken,_p256dn,_auth,p256dh,auth,_a,token,pushSet;return __generator(this,function(_b){switch(_b.label){case 0:return currentSubscription=subscription,this.checkIsPermissionGranted()?currentSubscription?[3,6]:[4,this.trySubscribe()]:(logger_1.Logger.error("You must have permission granted before subscribe!"),[2]);case 1:return currentSubscription=_b.sent(),[4,this.getSenderIdFromManifest()];case 2:return senderId_1=_b.sent(),[4,this.checkIsChangeSenderId(senderId_1)];case 3:return _b.sent()?[4,this.unsubscribe()]:[3,6];case 4:return _b.sent(),[4,this.data.setSenderId(senderId_1)];case 5:_b.sent(),_b.label=6;case 6:return[4,this.getApplicationServerKey()];case 7:return applicationServerKey=_b.sent(),[4,this.data.getSenderId()];case 8:return senderId=_b.sent(),[4,this.getPushToken(currentSubscription)];case 9:if(pushToken=_b.sent(),_p256dn=currentSubscription.getKey("p256dh"),_auth=currentSubscription.getKey("auth"),!_p256dn||!_auth)throw new Error("Can't get subscription keys!");return p256dh=btoa(String.fromCharCode.apply(String,new Uint8Array(_p256dn))),auth=btoa(String.fromCharCode.apply(String,new Uint8Array(_auth))),[4,this.getFcmKeys({endpoint:currentSubscription.endpoint,application_pub_key:applicationServerKey,encryption_key:p256dh,encryption_auth:auth,authorized_entity:senderId})];case 10:return _a=_b.sent(),token=_a.token,pushSet=_a.pushSet,[4,this.data.setTokens({publicKey:p256dh,pushToken:pushToken,authToken:auth,fcmPushSet:pushSet,fcmToken:token,endpoint:currentSubscription.endpoint})];case 11:return _b.sent(),[4,this.api.registerDevice()];case 12:return _b.sent(),[2]}})})},PushServiceDefault.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){var subscription;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return[4,_a.sent().pushManager.getSubscription()];case 2:return subscription=_a.sent(),[4,this.data.setTokens({})];case 3:return _a.sent(),[4,this.data.setStatusManualUnsubscribed(!0)];case 4:return _a.sent(),[4,this.api.unregisterDevice()];case 5:return _a.sent(),subscription?[4,subscription.unsubscribe()]:[2];case 6:return _a.sent(),[2]}})})},PushServiceDefault.prototype.checkIsRegister=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},PushServiceDefault.prototype.checkIsNeedResubscribe=function(){return __awaiter(this,void 0,void 0,function(){var savedSenderId,isExistSavedSenderId,manifestSenderId,isChangeSenderID,lastPermission,permission,credentials,pushTokenFromSubscription,subscriptionTokensFromStore,pushTokenFromStore;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getSenderId()];case 1:return savedSenderId=_a.sent(),isExistSavedSenderId=void 0!==savedSenderId,[4,this.getSenderIdFromManifest()];case 2:return manifestSenderId=_a.sent(),isChangeSenderID=isExistSavedSenderId&&manifestSenderId!==savedSenderId,[4,this.data.setSenderId(manifestSenderId)];case 3:return _a.sent(),[4,this.data.getLastPermissionStatus()];case 4:return lastPermission=_a.sent(),permission=this.getPermission(),isExistSavedSenderId&&lastPermission!==permission?[4,this.data.setLastPermissionStatus(permission)]:[3,6];case 5:return _a.sent(),[2,!0];case 6:return[4,this.getCredentials()];case 7:return credentials=_a.sent(),[4,this.getPushToken(credentials)];case 8:return pushTokenFromSubscription=_a.sent(),[4,this.data.getTokens()];case 9:return subscriptionTokensFromStore=_a.sent(),pushTokenFromStore=subscriptionTokensFromStore&&subscriptionTokensFromStore.pushToken||"",[2,isChangeSenderID||!(pushTokenFromSubscription===pushTokenFromStore)]}})})},PushServiceDefault.prototype.getServiceWorkerRegistration=function(){return __awaiter(this,void 0,void 0,function(){var url,_a;return __generator(this,function(_b){switch(_b.label){case 0:return this.registration?[3,5]:[4,this.registerServiceWorker()];case 1:return _b.sent(),[4,this.data.getServiceWorkerUrl()];case 2:return url=_b.sent(),_a=this,[4,navigator.serviceWorker.getRegistration(url)];case 3:return _a.registration=_b.sent(),[4,this.registration.update()];case 4:_b.sent(),_b.label=5;case 5:if(!this.registration)throw new Error("Internal Error: Can't register service worker!");return[2,this.registration]}})})},PushServiceDefault.prototype.registerServiceWorker=function(){return __awaiter(this,void 0,void 0,function(){var url,scope,sdkVersion,serviceWorkerVersion,cleanCache;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getServiceWorkerUrl()];case 1:return url=_a.sent(),[4,this.data.getServiceWorkerScope()];case 2:return scope=_a.sent(),[4,this.data.getSdkVersion()];case 3:return sdkVersion=_a.sent(),[4,this.data.getServiceWorkerVersion()];case 4:return serviceWorkerVersion=_a.sent(),cleanCache="",sdkVersion!==serviceWorkerVersion&&(cleanCache="?cache_clean="+uuid_1.v4()),[4,navigator.serviceWorker.register(""+url+cleanCache,{scope:scope})];case 5:return _a.sent(),[2]}})})},PushServiceDefault.prototype.trySubscribe=function(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,4]),[4,this.subscribePushManager()];case 1:return[2,_a.sent()];case 2:return error_1=_a.sent(),console.error(error_1),[4,this.unsubscribe()];case 3:return _a.sent(),[2,this.subscribePushManager()];case 4:return[2]}})})},PushServiceDefault.prototype.subscribePushManager=function(){return __awaiter(this,void 0,void 0,function(){var registration,applicationServerKey;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return registration=_a.sent(),[4,this.getApplicationServerKey()];case 2:return applicationServerKey=_a.sent(),[2,registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:applicationServerKey?this.urlBase64ToUint8Array(applicationServerKey):null})]}})})},PushServiceDefault.prototype.getCredentials=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getServiceWorkerRegistration()];case 1:return[4,_a.sent().pushManager.getSubscription()];case 2:return[2,_a.sent()]}})})},PushServiceDefault.prototype.getFcmKeys=function(config){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,fetch(this.config.entrypoint||"https://fcm.googleapis.com/fcm/connect/subscribe",{method:"POST",headers:{"Content-Type":"text/plain;charset=UTF-8"},body:JSON.stringify(config)})];case 1:return 200!==(response=_a.sent()).status?[3,3]:[4,response.json()];case 2:return[2,_a.sent()];case 3:throw new Error("Internal error: Can't register device in fcm. Status: "+response.status+". Message: "+response.statusText)}})})},PushServiceDefault.prototype.getPushToken=function(subscription){return __awaiter(this,void 0,void 0,function(){var deviceType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),subscription?12===deviceType?[2,subscription.endpoint]:[2,subscription.endpoint.split("/").pop()||""]:[2,""]}})})},PushServiceDefault.prototype.getApplicationServerKey=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return 11!==_a.sent()?[2]:[4,this.data.getApplicationServerKey()];case 2:return[2,_a.sent()]}})})},PushServiceDefault.prototype.getSenderIdFromManifest=function(){return __awaiter(this,void 0,void 0,function(){var manifest,url,response,data,match;return __generator(this,function(_a){switch(_a.label){case 0:if(!(manifest=document.querySelector('link[rel="manifest"]')))throw new Error("Error: manifest.json not found!");if(!(url=manifest.getAttribute("href")))throw new Error("Error: manifest.json url not found!");return[4,fetch(url,{method:"GET",headers:{"Content-Type":"application/json;charset=UTF-8"}})];case 1:if(200!==(response=_a.sent()).status)throw new Error("Error: Can't load manifest.json! "+response.statusText);return[4,response.text()];case 2:if(data=_a.sent(),!(match=data.match(/("|')?gcm_sender_id("|')?:\s*("|')?(\d+)("|')?/))||"string"!=typeof match[4])throw new Error("Error: Can't find gcm_sender_id in manifest.json!");return[2,match[4]]}})})},PushServiceDefault.prototype.checkIsChangeSenderId=function(currentSenderId){return __awaiter(this,void 0,void 0,function(){var senderIdFromIndexedDB;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getSenderId()];case 1:return senderIdFromIndexedDB=_a.sent(),[2,currentSenderId!==senderIdFromIndexedDB]}})})},PushServiceDefault.prototype.urlBase64ToUint8Array=function(base64String){for(var base64=(base64String+"=".repeat((4-base64String.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),rawData=window.atob(base64),outputArray=new Uint8Array(rawData.length),i=0;i<rawData.length;++i)outputArray[i]=rawData.charCodeAt(i);return outputArray},PushServiceDefault}();exports.PushServiceDefault=PushServiceDefault},function(module,exports,__webpack_require__){"use strict";var ReflectOwnKeys,R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function(target,receiver,args){return Function.prototype.apply.call(target,receiver,args)};ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function(target){return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))}:function(target){return Object.getOwnPropertyNames(target)};var NumberIsNaN=Number.isNaN||function(value){return value!=value};function EventEmitter(){EventEmitter.init.call(this)}module.exports=EventEmitter,module.exports.once=function(emitter,name){return new Promise(function(resolve,reject){function errorListener(err){emitter.removeListener(name,resolver),reject(err)}function resolver(){"function"==typeof emitter.removeListener&&emitter.removeListener("error",errorListener),resolve([].slice.call(arguments))}eventTargetAgnosticAddListener(emitter,name,resolver,{once:!0}),"error"!==name&&function(emitter,handler,flags){"function"==typeof emitter.on&&eventTargetAgnosticAddListener(emitter,"error",handler,flags)}(emitter,errorListener,{once:!0})})},EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(listener){if("function"!=typeof listener)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof listener)}function _getMaxListeners(that){return void 0===that._maxListeners?EventEmitter.defaultMaxListeners:that._maxListeners}function _addListener(target,type,listener,prepend){var m,events,existing;if(checkListener(listener),void 0===(events=target._events)?(events=target._events=Object.create(null),target._eventsCount=0):(void 0!==events.newListener&&(target.emit("newListener",type,listener.listener?listener.listener:listener),events=target._events),existing=events[type]),void 0===existing)existing=events[type]=listener,++target._eventsCount;else if("function"==typeof existing?existing=events[type]=prepend?[listener,existing]:[existing,listener]:prepend?existing.unshift(listener):existing.push(listener),(m=_getMaxListeners(target))>0&&existing.length>m&&!existing.warned){existing.warned=!0;var w=new Error("Possible EventEmitter memory leak detected. "+existing.length+" "+String(type)+" listeners added. Use emitter.setMaxListeners() to increase limit");w.name="MaxListenersExceededWarning",w.emitter=target,w.type=type,w.count=existing.length,function(warning){console&&console.warn&&console.warn(warning)}(w)}return target}function _onceWrap(target,type,listener){var state={fired:!1,wrapFn:void 0,target:target,type:type,listener:listener},wrapped=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(state);return wrapped.listener=listener,state.wrapFn=wrapped,wrapped}function _listeners(target,type,unwrap){var events=target._events;if(void 0===events)return[];var evlistener=events[type];return void 0===evlistener?[]:"function"==typeof evlistener?unwrap?[evlistener.listener||evlistener]:[evlistener]:unwrap?function(arr){for(var ret=new Array(arr.length),i=0;i<ret.length;++i)ret[i]=arr[i].listener||arr[i];return ret}(evlistener):arrayClone(evlistener,evlistener.length)}function listenerCount(type){var events=this._events;if(void 0!==events){var evlistener=events[type];if("function"==typeof evlistener)return 1;if(void 0!==evlistener)return evlistener.length}return 0}function arrayClone(arr,n){for(var copy=new Array(n),i=0;i<n;++i)copy[i]=arr[i];return copy}function eventTargetAgnosticAddListener(emitter,name,listener,flags){if("function"==typeof emitter.on)flags.once?emitter.once(name,listener):emitter.on(name,listener);else{if("function"!=typeof emitter.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof emitter);emitter.addEventListener(name,function wrapListener(arg){flags.once&&emitter.removeEventListener(name,wrapListener),listener(arg)})}}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(arg){if("number"!=typeof arg||arg<0||NumberIsNaN(arg))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+arg+".");defaultMaxListeners=arg}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function(n){if("number"!=typeof n||n<0||NumberIsNaN(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this},EventEmitter.prototype.getMaxListeners=function(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function(type){for(var args=[],i=1;i<arguments.length;i++)args.push(arguments[i]);var doError="error"===type,events=this._events;if(void 0!==events)doError=doError&&void 0===events.error;else if(!doError)return!1;if(doError){var er;if(args.length>0&&(er=args[0]),er instanceof Error)throw er;var err=new Error("Unhandled error."+(er?" ("+er.message+")":""));throw err.context=er,err}var handler=events[type];if(void 0===handler)return!1;if("function"==typeof handler)ReflectApply(handler,this,args);else{var len=handler.length,listeners=arrayClone(handler,len);for(i=0;i<len;++i)ReflectApply(listeners[i],this,args)}return!0},EventEmitter.prototype.addListener=function(type,listener){return _addListener(this,type,listener,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function(type,listener){return _addListener(this,type,listener,!0)},EventEmitter.prototype.once=function(type,listener){return checkListener(listener),this.on(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.prependOnceListener=function(type,listener){return checkListener(listener),this.prependListener(type,_onceWrap(this,type,listener)),this},EventEmitter.prototype.removeListener=function(type,listener){var list,events,position,i,originalListener;if(checkListener(listener),void 0===(events=this._events))return this;if(void 0===(list=events[type]))return this;if(list===listener||list.listener===listener)0==--this._eventsCount?this._events=Object.create(null):(delete events[type],events.removeListener&&this.emit("removeListener",type,list.listener||listener));else if("function"!=typeof list){for(position=-1,i=list.length-1;i>=0;i--)if(list[i]===listener||list[i].listener===listener){originalListener=list[i].listener,position=i;break}if(position<0)return this;0===position?list.shift():function(list,index){for(;index+1<list.length;index++)list[index]=list[index+1];list.pop()}(list,position),1===list.length&&(events[type]=list[0]),void 0!==events.removeListener&&this.emit("removeListener",type,originalListener||listener)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function(type){var listeners,events,i;if(void 0===(events=this._events))return this;if(void 0===events.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==events[type]&&(0==--this._eventsCount?this._events=Object.create(null):delete events[type]),this;if(0===arguments.length){var key,keys=Object.keys(events);for(i=0;i<keys.length;++i)"removeListener"!==(key=keys[i])&&this.removeAllListeners(key);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(listeners=events[type]))this.removeListener(type,listeners);else if(void 0!==listeners)for(i=listeners.length-1;i>=0;i--)this.removeListener(type,listeners[i]);return this},EventEmitter.prototype.listeners=function(type){return _listeners(this,type,!0)},EventEmitter.prototype.rawListeners=function(type){return _listeners(this,type,!1)},EventEmitter.listenerCount=function(emitter,type){return"function"==typeof emitter.listenerCount?emitter.listenerCount(type):listenerCount.call(emitter,type)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]}},function(module,exports,__webpack_require__){(exports=module.exports=__webpack_require__(51)).Stream=exports,exports.Readable=exports,exports.Writable=__webpack_require__(41),exports.Duplex=__webpack_require__(12),exports.Transform=__webpack_require__(56),exports.PassThrough=__webpack_require__(95)},function(module,exports,__webpack_require__){"use strict";(function(process,setImmediate,global){var pna=__webpack_require__(27);function CorkedRequest(state){var _this=this;this.next=null,this.entry=null,this.finish=function(){!function(corkReq,state,err){var entry=corkReq.entry;corkReq.entry=null;for(;entry;){var cb=entry.callback;state.pendingcb--,cb(err),entry=entry.next}state.corkedRequestsFree?state.corkedRequestsFree.next=corkReq:state.corkedRequestsFree=corkReq}(_this,state)}}module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(__webpack_require__(23));util.inherits=__webpack_require__(15);var internalUtil={deprecate:__webpack_require__(94)},Stream=__webpack_require__(52),Buffer=__webpack_require__(28).Buffer,OurUint8Array=global.Uint8Array||function(){};var realHasInstance,destroyImpl=__webpack_require__(53);function nop(){}function WritableState(options,stream){Duplex=Duplex||__webpack_require__(12),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.writableObjectMode);var hwm=options.highWaterMark,writableHwm=options.writableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(writableHwm||0===writableHwm)?writableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var noDecode=!1===options.decodeStrings;this.decodeStrings=!noDecode,this.defaultEncoding=options.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(er){!function(stream,er){var state=stream._writableState,sync=state.sync,cb=state.writecb;if(function(state){state.writing=!1,state.writecb=null,state.length-=state.writelen,state.writelen=0}(state),er)!function(stream,state,sync,er,cb){--state.pendingcb,sync?(pna.nextTick(cb,er),pna.nextTick(finishMaybe,stream,state),stream._writableState.errorEmitted=!0,stream.emit("error",er)):(cb(er),stream._writableState.errorEmitted=!0,stream.emit("error",er),finishMaybe(stream,state))}(stream,state,sync,er,cb);else{var finished=needFinish(state);finished||state.corked||state.bufferProcessing||!state.bufferedRequest||clearBuffer(stream,state),sync?asyncWrite(afterWrite,stream,state,finished,cb):afterWrite(stream,state,finished,cb)}}(stream,er)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new CorkedRequest(this)}function Writable(options){if(Duplex=Duplex||__webpack_require__(12),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this),this.writable=!0,options&&("function"==typeof options.write&&(this._write=options.write),"function"==typeof options.writev&&(this._writev=options.writev),"function"==typeof options.destroy&&(this._destroy=options.destroy),"function"==typeof options.final&&(this._final=options.final)),Stream.call(this)}function doWrite(stream,state,writev,len,chunk,encoding,cb){state.writelen=len,state.writecb=cb,state.writing=!0,state.sync=!0,writev?stream._writev(chunk,state.onwrite):stream._write(chunk,encoding,state.onwrite),state.sync=!1}function afterWrite(stream,state,finished,cb){finished||function(stream,state){0===state.length&&state.needDrain&&(state.needDrain=!1,stream.emit("drain"))}(stream,state),state.pendingcb--,cb(),finishMaybe(stream,state)}function clearBuffer(stream,state){state.bufferProcessing=!0;var entry=state.bufferedRequest;if(stream._writev&&entry&&entry.next){var l=state.bufferedRequestCount,buffer=new Array(l),holder=state.corkedRequestsFree;holder.entry=entry;for(var count=0,allBuffers=!0;entry;)buffer[count]=entry,entry.isBuf||(allBuffers=!1),entry=entry.next,count+=1;buffer.allBuffers=allBuffers,doWrite(stream,state,!0,state.length,buffer,"",holder.finish),state.pendingcb++,state.lastBufferedRequest=null,holder.next?(state.corkedRequestsFree=holder.next,holder.next=null):state.corkedRequestsFree=new CorkedRequest(state),state.bufferedRequestCount=0}else{for(;entry;){var chunk=entry.chunk,encoding=entry.encoding,cb=entry.callback;if(doWrite(stream,state,!1,state.objectMode?1:chunk.length,chunk,encoding,cb),entry=entry.next,state.bufferedRequestCount--,state.writing)break}null===entry&&(state.lastBufferedRequest=null)}state.bufferedRequest=entry,state.bufferProcessing=!1}function needFinish(state){return state.ending&&0===state.length&&null===state.bufferedRequest&&!state.finished&&!state.writing}function callFinal(stream,state){stream._final(function(err){state.pendingcb--,err&&stream.emit("error",err),state.prefinished=!0,stream.emit("prefinish"),finishMaybe(stream,state)})}function finishMaybe(stream,state){var need=needFinish(state);return need&&(!function(stream,state){state.prefinished||state.finalCalled||("function"==typeof stream._final?(state.pendingcb++,state.finalCalled=!0,pna.nextTick(callFinal,stream,state)):(state.prefinished=!0,stream.emit("prefinish")))}(stream,state),0===state.pendingcb&&(state.finished=!0,stream.emit("finish"))),need}util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function(){for(var current=this.bufferedRequest,out=[];current;)out.push(current),current=current.next;return out},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(_){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){return!!realHasInstance.call(this,object)||this===Writable&&(object&&object._writableState instanceof WritableState)}})):realHasInstance=function(object){return object instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState,ret=!1,isBuf=!state.objectMode&&function(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array}(chunk);return isBuf&&!Buffer.isBuffer(chunk)&&(chunk=function(chunk){return Buffer.from(chunk)}(chunk)),"function"==typeof encoding&&(cb=encoding,encoding=null),isBuf?encoding="buffer":encoding||(encoding=state.defaultEncoding),"function"!=typeof cb&&(cb=nop),state.ended?function(stream,cb){var er=new Error("write after end");stream.emit("error",er),pna.nextTick(cb,er)}(this,cb):(isBuf||function(stream,state,chunk,cb){var valid=!0,er=!1;return null===chunk?er=new TypeError("May not write null values to stream"):"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk")),er&&(stream.emit("error",er),pna.nextTick(cb,er),valid=!1),valid}(this,state,chunk,cb))&&(state.pendingcb++,ret=function(stream,state,isBuf,chunk,encoding,cb){if(!isBuf){var newChunk=function(state,chunk,encoding){state.objectMode||!1===state.decodeStrings||"string"!=typeof chunk||(chunk=Buffer.from(chunk,encoding));return chunk}(state,chunk,encoding);chunk!==newChunk&&(isBuf=!0,encoding="buffer",chunk=newChunk)}var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;ret||(state.needDrain=!0);if(state.writing||state.corked){var last=state.lastBufferedRequest;state.lastBufferedRequest={chunk:chunk,encoding:encoding,isBuf:isBuf,callback:cb,next:null},last?last.next=state.lastBufferedRequest:state.bufferedRequest=state.lastBufferedRequest,state.bufferedRequestCount+=1}else doWrite(stream,state,!1,len,chunk,encoding,cb);return ret}(this,state,isBuf,chunk,encoding,cb)),ret},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var state=this._writableState;state.corked&&(state.corked--,state.writing||state.corked||state.finished||state.bufferProcessing||!state.bufferedRequest||clearBuffer(this,state))},Writable.prototype.setDefaultEncoding=function(encoding){if("string"==typeof encoding&&(encoding=encoding.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+encoding);return this._writableState.defaultEncoding=encoding,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;"function"==typeof chunk?(cb=chunk,chunk=null,encoding=null):"function"==typeof encoding&&(cb=encoding,encoding=null),null!==chunk&&void 0!==chunk&&this.write(chunk,encoding),state.corked&&(state.corked=1,this.uncork()),state.ending||state.finished||function(stream,state,cb){state.ending=!0,finishMaybe(stream,state),cb&&(state.finished?pna.nextTick(cb):stream.once("finish",cb));state.ended=!0,stream.writable=!1}(this,state,cb)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(value){this._writableState&&(this._writableState.destroyed=value)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(err,cb){this.end(),cb(err)}}).call(this,__webpack_require__(22),__webpack_require__(54).setImmediate,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var external=__webpack_require__(24),DataWorker=__webpack_require__(60),DataLengthProbe=__webpack_require__(61),Crc32Probe=__webpack_require__(62);DataLengthProbe=__webpack_require__(61);function CompressedObject(compressedSize,uncompressedSize,crc32,compression,data){this.compressedSize=compressedSize,this.uncompressedSize=uncompressedSize,this.crc32=crc32,this.compression=compression,this.compressedContent=data}CompressedObject.prototype={getContentWorker:function(){var worker=new DataWorker(external.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new DataLengthProbe("data_length")),that=this;return worker.on("end",function(){if(this.streamInfo.data_length!==that.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),worker},getCompressedWorker:function(){return new DataWorker(external.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},CompressedObject.createWorkerFrom=function(uncompressedWorker,compression,compressionOptions){return uncompressedWorker.pipe(new Crc32Probe).pipe(new DataLengthProbe("uncompressedSize")).pipe(compression.compressWorker(compressionOptions)).pipe(new DataLengthProbe("compressedSize")).withStreamInfo("compression",compression)},module.exports=CompressedObject},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0);var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(input,crc){return void 0!==input&&input.length?"string"!==utils.getTypeOf(input)?function(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^buf[i])];return-1^crc}(0|crc,input,input.length,0):function(crc,str,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^str.charCodeAt(i))];return-1^crc}(0|crc,input,input.length,0):0}},function(module,exports,__webpack_require__){"use strict";module.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Storage_1=__webpack_require__(46),DateModule_1=__webpack_require__(6),InboxMessagesPublic_1=__webpack_require__(25),InboxMessages=function(){function InboxMessages(eventBus,data,api,storage,dateModule){void 0===storage&&(storage=new Storage_1.default),void 0===dateModule&&(dateModule=new DateModule_1.default),this.eventBus=eventBus,this.data=data,this.api=api,this.storage=storage,this.storeName="inboxMessages",this.dateModule=dateModule}return InboxMessages.prototype.getInboxMessages=function(){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.api.getInboxMessages()];case 1:return response=_a.sent(),[4,this.storeGetInboxMessagesRequestParams(response.next,response.new_inbox)];case 2:return _a.sent(),[2,response]}})})},InboxMessages.prototype.storeGetInboxMessagesRequestParams=function(next,newMessagesCount){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return this.dateModule.date=new Date,[4,this.data.setInboxLastRequestTime(this.dateModule.getUtcTimestamp())];case 1:return _a.sent(),[4,this.data.setInboxLastRequestCode(next)];case 2:return _a.sent(),[4,this.data.setInboxNewMessagesCount(newMessagesCount)];case 3:return _a.sent(),[2]}})})},InboxMessages.prototype.putServerMessages=function(messages){return __awaiter(this,void 0,void 0,function(){var putTransactions,_this=this;return __generator(this,function(_a){return putTransactions=messages.map(function(message){return __awaiter(_this,void 0,void 0,function(){var localMessage;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.get(this.storeName,message.inbox_id,{})];case 1:return"status"in(localMessage=_a.sent())&&(message.status=localMessage.status),[2,this.putMessage(message)]}})})}),[2,Promise.all(putTransactions)]})})},InboxMessages.prototype.putMessage=function(message){return this.storage.put(this.storeName,message)},InboxMessages.prototype.putBulkMessages=function(messages){var _this=this,putTransactions=messages.map(function(message){return _this.putMessage(message)});return Promise.all(putTransactions)},InboxMessages.prototype.deleteMessages=function(codes){var _this=this,deleteTransactions=codes.map(function(code){return _this.storage.delete(_this.storeName,code)});return Promise.all(deleteTransactions)},InboxMessages.prototype.deleteExpiredMessages=function(){return __awaiter(this,void 0,void 0,function(){var upperBound,allMessages,codesToDelete;return __generator(this,function(_a){switch(_a.label){case 0:return this.dateModule.date=new Date,upperBound=this.dateModule.getTimestamp().toString(),[4,this.storage.getAll(this.storeName)];case 1:return allMessages=_a.sent(),codesToDelete=allMessages.filter(function(msg){return msg.rt>upperBound}).map(function(msg){return msg.inbox_id}),[2,this.deleteMessages(codesToDelete)]}})})},InboxMessages.prototype.getMessage=function(code){return this.storage.get(this.storeName,code)},InboxMessages.prototype.getReadOpenMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,_a.sent().filter(function(msg){return 2===msg.status||3===msg.status})]}})})},InboxMessages.prototype.getDeliveredMessages=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.storage.getAll(this.storeName)];case 1:return[2,_a.sent().filter(function(msg){return 1===msg.status})]}})})},InboxMessages.prototype.messagesCount=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.storage.count(this.storeName)]})})},InboxMessages.prototype.getDeliveredMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var deliveredStatus,statusIndexName;return __generator(this,function(_a){return deliveredStatus=1,statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,deliveredStatus)]})})},InboxMessages.prototype.getReadMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var readStatus,statusIndexName;return __generator(this,function(_a){return readStatus=2,statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,readStatus)]})})},InboxMessages.prototype.getDeliveredReadMessagesCount=function(){return __awaiter(this,void 0,void 0,function(){var _a,readStatus,openStatus,keyRange,statusIndexName;return __generator(this,function(_b){return readStatus=(_a=[2,3])[0],openStatus=_a[1],keyRange=IDBKeyRange.bound(readStatus,openStatus),statusIndexName="status",[2,this.storage.countByIndex(this.storeName,statusIndexName,keyRange)]})})},InboxMessages.prototype.updateMessages=function(){return __awaiter(this,void 0,void 0,function(){var response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getInboxMessages()];case 1:return response=_a.sent(),[4,this.deleteExpiredMessages()];case 2:return _a.sent(),[4,this.deleteMessages(response.deleted)];case 3:return _a.sent(),[4,this.putServerMessages(response.messages)];case 4:return _a.sent(),this.eventBus.dispatchEvent("update-inbox-messages",{messages:new InboxMessagesPublic_1.default(this.data,this.api,this)}),[2]}})})},InboxMessages}();exports.default=InboxMessages},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var version_1=__webpack_require__(18),MigrationExecutor_1=__webpack_require__(19),Store_1=__webpack_require__(47),Storage=function(){function Storage(){}return Storage.prototype.dbVersionChangeHandler=function(db,event){console.info("onversionchange",event),db.close()},Storage.prototype.dbRequestSuccessHandler=function(resolve,event){var _this=this,database=event.target.result;database.onversionchange=function(event){_this.dbVersionChangeHandler(database,event)},resolve(database)},Storage.prototype.dbRequestUpgradeNeededHandler=function(event){var _this=this,database=event.target.result;database.onversionchange=function(event){_this.dbVersionChangeHandler(database,event)},new MigrationExecutor_1.default(database).applyMigrations()},Storage.prototype.getDB=function(){var _this=this;return new Promise(function(resolve,reject){var request=indexedDB.open("PUSHWOOSH_SDK_STORE",version_1.default);request.onsuccess=function(event){_this.dbRequestSuccessHandler(resolve,event)},request.onupgradeneeded=function(event){_this.dbRequestUpgradeNeededHandler(event)},request.onerror=function(){return reject(request.error)}})},Storage.prototype.put=function(storeName,data,key){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).put(data,key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.delete=function(storeName,key){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).delete(key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.get=function(storeName,key,defaultValue){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).get(key,defaultValue)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.getAll=function(storeName){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).getAll()];case 2:return result=_a.sent(),db.close(),[2,result||[]]}})})},Storage.prototype.count=function(storeName,query){return __awaiter(this,void 0,void 0,function(){var db,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),[4,new Store_1.default(db,storeName).count(query)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage.prototype.countByIndex=function(storeName,indexName,key){return __awaiter(this,void 0,void 0,function(){var db,store,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getDB()];case 1:return db=_a.sent(),(store=new Store_1.default(db,storeName)).index=indexName,[4,store.countByIndex(key)];case 2:return result=_a.sent(),db.close(),[2,result]}})})},Storage}();exports.default=Storage},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Store=function(){function Store(db,name){this.name=name,this.store=db.transaction(this.name,"readwrite").objectStore(this.name)}return Object.defineProperty(Store.prototype,"index",{set:function(index){this.store.indexNames.contains(index)?this._index=this.store.index(index):console.warn('Index "'+index+'" in ')},enumerable:!1,configurable:!0}),Store.prototype.writeRequestPromise=function(request,result){return new Promise(function(resolve,reject){request.onsuccess=function(){resolve(result)},request.onerror=function(){reject(request.error)}})},Store.prototype.readRequestPromise=function(request,defaultValue){return new Promise(function(resolve,reject){request.onsuccess=function(event){var target=event.target;resolve(target.result||defaultValue)},request.onerror=function(){reject(request.error)}})},Store.prototype.put=function(data,key){var request=this.store.put(data,key);return this.writeRequestPromise(request,key)},Store.prototype.add=function(data,key){return this.put(data,key)},Store.prototype.delete=function(key){var request=this.store.delete(key);return this.writeRequestPromise(request)},Store.prototype.get=function(key,defaultValue){var request=this.store.get(key);return this.readRequestPromise(request,defaultValue)},Store.prototype.getAll=function(){var cursor=this.store.openCursor(),result=[];return new Promise(function(resolve,reject){cursor.onsuccess=function(event){var cursorResult=event.target.result;cursorResult?(result.push(cursorResult.value),cursorResult.continue()):resolve(result)},cursor.onerror=function(){reject(cursor.error)}})},Store.prototype.count=function(query){var request=this.store.count(query);return this.readRequestPromise(request,0)},Store.prototype.countByIndex=function(key){var request=this._index.count(key);return this.readRequestPromise(request,0)},Store}();exports.default=Store},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getZip=void 0;var JSZip=__webpack_require__(85);exports.getZip=function(url){return __awaiter(this,void 0,void 0,function(){var response,result;return __generator(this,function(_a){switch(_a.label){case 0:return[4,fetch(url,{method:"GET"})];case 1:return 200!==(response=_a.sent()).status&&new Error(response.statusText),[4,response.blob()];case 2:return result=_a.sent(),[2,JSZip.loadAsync(result)]}})})}},function(module,exports){var toString={}.toString;module.exports=Array.isArray||function(arr){return"[object Array]"==toString.call(arr)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(89)},function(module,exports,__webpack_require__){"use strict";(function(global,process){var pna=__webpack_require__(27);module.exports=Readable;var Duplex,isArray=__webpack_require__(49);Readable.ReadableState=ReadableState;__webpack_require__(39).EventEmitter;var EElistenerCount=function(emitter,type){return emitter.listeners(type).length},Stream=__webpack_require__(52),Buffer=__webpack_require__(28).Buffer,OurUint8Array=global.Uint8Array||function(){};var util=Object.create(__webpack_require__(23));util.inherits=__webpack_require__(15);var debugUtil=__webpack_require__(90),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=__webpack_require__(91),destroyImpl=__webpack_require__(53);util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];function ReadableState(options,stream){Duplex=Duplex||__webpack_require__(12),options=options||{};var isDuplex=stream instanceof Duplex;this.objectMode=!!options.objectMode,isDuplex&&(this.objectMode=this.objectMode||!!options.readableObjectMode);var hwm=options.highWaterMark,readableHwm=options.readableHighWaterMark,defaultHwm=this.objectMode?16:16384;this.highWaterMark=hwm||0===hwm?hwm:isDuplex&&(readableHwm||0===readableHwm)?readableHwm:defaultHwm,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=options.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,options.encoding&&(StringDecoder||(StringDecoder=__webpack_require__(55).StringDecoder),this.decoder=new StringDecoder(options.encoding),this.encoding=options.encoding)}function Readable(options){if(Duplex=Duplex||__webpack_require__(12),!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this),this.readable=!0,options&&("function"==typeof options.read&&(this._read=options.read),"function"==typeof options.destroy&&(this._destroy=options.destroy)),Stream.call(this)}function readableAddChunk(stream,chunk,encoding,addToFront,skipChunkCheck){var er,state=stream._readableState;null===chunk?(state.reading=!1,function(stream,state){if(state.ended)return;if(state.decoder){var chunk=state.decoder.end();chunk&&chunk.length&&(state.buffer.push(chunk),state.length+=state.objectMode?1:chunk.length)}state.ended=!0,emitReadable(stream)}(stream,state)):(skipChunkCheck||(er=function(state,chunk){var er;(function(obj){return Buffer.isBuffer(obj)||obj instanceof OurUint8Array})(chunk)||"string"==typeof chunk||void 0===chunk||state.objectMode||(er=new TypeError("Invalid non-string/buffer chunk"));return er}(state,chunk)),er?stream.emit("error",er):state.objectMode||chunk&&chunk.length>0?("string"==typeof chunk||state.objectMode||Object.getPrototypeOf(chunk)===Buffer.prototype||(chunk=function(chunk){return Buffer.from(chunk)}(chunk)),addToFront?state.endEmitted?stream.emit("error",new Error("stream.unshift() after end event")):addChunk(stream,state,chunk,!0):state.ended?stream.emit("error",new Error("stream.push() after EOF")):(state.reading=!1,state.decoder&&!encoding?(chunk=state.decoder.write(chunk),state.objectMode||0!==chunk.length?addChunk(stream,state,chunk,!1):maybeReadMore(stream,state)):addChunk(stream,state,chunk,!1))):addToFront||(state.reading=!1));return function(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||0===state.length)}(state)}function addChunk(stream,state,chunk,addToFront){state.flowing&&0===state.length&&!state.sync?(stream.emit("data",chunk),stream.read(0)):(state.length+=state.objectMode?1:chunk.length,addToFront?state.buffer.unshift(chunk):state.buffer.push(chunk),state.needReadable&&emitReadable(stream)),maybeReadMore(stream,state)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(value){this._readableState&&(this._readableState.destroyed=value)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(err,cb){this.push(null),cb(err)},Readable.prototype.push=function(chunk,encoding){var skipChunkCheck,state=this._readableState;return state.objectMode?skipChunkCheck=!0:"string"==typeof chunk&&((encoding=encoding||state.defaultEncoding)!==state.encoding&&(chunk=Buffer.from(chunk,encoding),encoding=""),skipChunkCheck=!0),readableAddChunk(this,chunk,encoding,!1,skipChunkCheck)},Readable.prototype.unshift=function(chunk){return readableAddChunk(this,chunk,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(enc){return StringDecoder||(StringDecoder=__webpack_require__(55).StringDecoder),this._readableState.decoder=new StringDecoder(enc),this._readableState.encoding=enc,this};var MAX_HWM=8388608;function howMuchToRead(n,state){return n<=0||0===state.length&&state.ended?0:state.objectMode?1:n!=n?state.flowing&&state.length?state.buffer.head.data.length:state.length:(n>state.highWaterMark&&(state.highWaterMark=function(n){return n>=MAX_HWM?n=MAX_HWM:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}(n)),n<=state.length?n:state.ended?state.length:(state.needReadable=!0,0))}function emitReadable(stream){var state=stream._readableState;state.needReadable=!1,state.emittedReadable||(debug("emitReadable",state.flowing),state.emittedReadable=!0,state.sync?pna.nextTick(emitReadable_,stream):emitReadable_(stream))}function emitReadable_(stream){debug("emit readable"),stream.emit("readable"),flow(stream)}function maybeReadMore(stream,state){state.readingMore||(state.readingMore=!0,pna.nextTick(maybeReadMore_,stream,state))}function maybeReadMore_(stream,state){for(var len=state.length;!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark&&(debug("maybeReadMore read 0"),stream.read(0),len!==state.length);)len=state.length;state.readingMore=!1}function nReadingNextTick(self){debug("readable nexttick read 0"),self.read(0)}function resume_(stream,state){state.reading||(debug("resume read 0"),stream.read(0)),state.resumeScheduled=!1,state.awaitDrain=0,stream.emit("resume"),flow(stream),state.flowing&&!state.reading&&stream.read(0)}function flow(stream){var state=stream._readableState;for(debug("flow",state.flowing);state.flowing&&null!==stream.read(););}function fromList(n,state){return 0===state.length?null:(state.objectMode?ret=state.buffer.shift():!n||n>=state.length?(ret=state.decoder?state.buffer.join(""):1===state.buffer.length?state.buffer.head.data:state.buffer.concat(state.length),state.buffer.clear()):ret=function(n,list,hasStrings){var ret;n<list.head.data.length?(ret=list.head.data.slice(0,n),list.head.data=list.head.data.slice(n)):ret=n===list.head.data.length?list.shift():hasStrings?function(n,list){var p=list.head,c=1,ret=p.data;n-=ret.length;for(;p=p.next;){var str=p.data,nb=n>str.length?str.length:n;if(nb===str.length?ret+=str:ret+=str.slice(0,n),0===(n-=nb)){nb===str.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=str.slice(nb));break}++c}return list.length-=c,ret}(n,list):function(n,list){var ret=Buffer.allocUnsafe(n),p=list.head,c=1;p.data.copy(ret),n-=p.data.length;for(;p=p.next;){var buf=p.data,nb=n>buf.length?buf.length:n;if(buf.copy(ret,ret.length-n,0,nb),0===(n-=nb)){nb===buf.length?(++c,p.next?list.head=p.next:list.head=list.tail=null):(list.head=p,p.data=buf.slice(nb));break}++c}return list.length-=c,ret}(n,list);return ret}(n,state.buffer,state.decoder),ret);var ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error('"endReadable()" called on non-empty stream');state.endEmitted||(state.ended=!0,pna.nextTick(endReadableNT,state,stream))}function endReadableNT(state,stream){state.endEmitted||0!==state.length||(state.endEmitted=!0,stream.readable=!1,stream.emit("end"))}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++)if(xs[i]===x)return i;return-1}Readable.prototype.read=function(n){debug("read",n),n=parseInt(n,10);var state=this._readableState,nOrig=n;if(0!==n&&(state.emittedReadable=!1),0===n&&state.needReadable&&(state.length>=state.highWaterMark||state.ended))return debug("read: emitReadable",state.length,state.ended),0===state.length&&state.ended?endReadable(this):emitReadable(this),null;if(0===(n=howMuchToRead(n,state))&&state.ended)return 0===state.length&&endReadable(this),null;var ret,doRead=state.needReadable;return debug("need readable",doRead),(0===state.length||state.length-n<state.highWaterMark)&&debug("length less than watermark",doRead=!0),state.ended||state.reading?debug("reading or ended",doRead=!1):doRead&&(debug("do read"),state.reading=!0,state.sync=!0,0===state.length&&(state.needReadable=!0),this._read(state.highWaterMark),state.sync=!1,state.reading||(n=howMuchToRead(nOrig,state))),null===(ret=n>0?fromList(n,state):null)?(state.needReadable=!0,n=0):state.length-=n,0===state.length&&(state.ended||(state.needReadable=!0),nOrig!==n&&state.ended&&endReadable(this)),null!==ret&&this.emit("data",ret),ret},Readable.prototype._read=function(n){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(dest,pipeOpts){var src=this,state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest)}state.pipesCount+=1,debug("pipe count=%d opts=%j",state.pipesCount,pipeOpts);var endFn=(!pipeOpts||!1!==pipeOpts.end)&&dest!==process.stdout&&dest!==process.stderr?onend:unpipe;function onunpipe(readable,unpipeInfo){debug("onunpipe"),readable===src&&unpipeInfo&&!1===unpipeInfo.hasUnpiped&&(unpipeInfo.hasUnpiped=!0,debug("cleanup"),dest.removeListener("close",onclose),dest.removeListener("finish",onfinish),dest.removeListener("drain",ondrain),dest.removeListener("error",onerror),dest.removeListener("unpipe",onunpipe),src.removeListener("end",onend),src.removeListener("end",unpipe),src.removeListener("data",ondata),cleanedUp=!0,!state.awaitDrain||dest._writableState&&!dest._writableState.needDrain||ondrain())}function onend(){debug("onend"),dest.end()}state.endEmitted?pna.nextTick(endFn):src.once("end",endFn),dest.on("unpipe",onunpipe);var ondrain=function(src){return function(){var state=src._readableState;debug("pipeOnDrain",state.awaitDrain),state.awaitDrain&&state.awaitDrain--,0===state.awaitDrain&&EElistenerCount(src,"data")&&(state.flowing=!0,flow(src))}}(src);dest.on("drain",ondrain);var cleanedUp=!1;var increasedAwaitDrain=!1;function ondata(chunk){debug("ondata"),increasedAwaitDrain=!1,!1!==dest.write(chunk)||increasedAwaitDrain||((1===state.pipesCount&&state.pipes===dest||state.pipesCount>1&&-1!==indexOf(state.pipes,dest))&&!cleanedUp&&(debug("false write response, pause",src._readableState.awaitDrain),src._readableState.awaitDrain++,increasedAwaitDrain=!0),src.pause())}function onerror(er){debug("onerror",er),unpipe(),dest.removeListener("error",onerror),0===EElistenerCount(dest,"error")&&dest.emit("error",er)}function onclose(){dest.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),dest.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),src.unpipe(dest)}return src.on("data",ondata),function(emitter,event,fn){if("function"==typeof emitter.prependListener)return emitter.prependListener(event,fn);emitter._events&&emitter._events[event]?isArray(emitter._events[event])?emitter._events[event].unshift(fn):emitter._events[event]=[fn,emitter._events[event]]:emitter.on(event,fn)}(dest,"error",onerror),dest.once("close",onclose),dest.once("finish",onfinish),dest.emit("pipe",src),state.flowing||(debug("pipe resume"),src.resume()),dest},Readable.prototype.unpipe=function(dest){var state=this._readableState,unpipeInfo={hasUnpiped:!1};if(0===state.pipesCount)return this;if(1===state.pipesCount)return dest&&dest!==state.pipes?this:(dest||(dest=state.pipes),state.pipes=null,state.pipesCount=0,state.flowing=!1,dest&&dest.emit("unpipe",this,unpipeInfo),this);if(!dest){var dests=state.pipes,len=state.pipesCount;state.pipes=null,state.pipesCount=0,state.flowing=!1;for(var i=0;i<len;i++)dests[i].emit("unpipe",this,unpipeInfo);return this}var index=indexOf(state.pipes,dest);return-1===index?this:(state.pipes.splice(index,1),state.pipesCount-=1,1===state.pipesCount&&(state.pipes=state.pipes[0]),dest.emit("unpipe",this,unpipeInfo),this)},Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if("data"===ev)!1!==this._readableState.flowing&&this.resume();else if("readable"===ev){var state=this._readableState;state.endEmitted||state.readableListening||(state.readableListening=state.needReadable=!0,state.emittedReadable=!1,state.reading?state.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return res},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var state=this._readableState;return state.flowing||(debug("resume"),state.flowing=!0,function(stream,state){state.resumeScheduled||(state.resumeScheduled=!0,pna.nextTick(resume_,stream,state))}(this,state)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(stream){var _this=this,state=this._readableState,paused=!1;for(var i in stream.on("end",function(){if(debug("wrapped end"),state.decoder&&!state.ended){var chunk=state.decoder.end();chunk&&chunk.length&&_this.push(chunk)}_this.push(null)}),stream.on("data",function(chunk){(debug("wrapped data"),state.decoder&&(chunk=state.decoder.write(chunk)),!state.objectMode||null!==chunk&&void 0!==chunk)&&((state.objectMode||chunk&&chunk.length)&&(_this.push(chunk)||(paused=!0,stream.pause())))}),stream)void 0===this[i]&&"function"==typeof stream[i]&&(this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i));for(var n=0;n<kProxyEvents.length;n++)stream.on(kProxyEvents[n],this.emit.bind(this,kProxyEvents[n]));return this._read=function(n){debug("wrapped _read",n),paused&&(paused=!1,stream.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList}).call(this,__webpack_require__(11),__webpack_require__(22))},function(module,exports,__webpack_require__){module.exports=__webpack_require__(39).EventEmitter},function(module,exports,__webpack_require__){"use strict";var pna=__webpack_require__(27);function emitErrorNT(self,err){self.emit("error",err)}module.exports={destroy:function(err,cb){var _this=this,readableDestroyed=this._readableState&&this._readableState.destroyed,writableDestroyed=this._writableState&&this._writableState.destroyed;return readableDestroyed||writableDestroyed?(cb?cb(err):!err||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,err),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(err||null,function(err){!cb&&err?(pna.nextTick(emitErrorNT,_this,err),_this._writableState&&(_this._writableState.errorEmitted=!0)):cb&&cb(err)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(module,exports,__webpack_require__){(function(global){var scope=void 0!==global&&global||"undefined"!=typeof self&&self||window,apply=Function.prototype.apply;function Timeout(id,clearFn){this._id=id,this._clearFn=clearFn}exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,scope,arguments),clearTimeout)},exports.setInterval=function(){return new Timeout(apply.call(setInterval,scope,arguments),clearInterval)},exports.clearTimeout=exports.clearInterval=function(timeout){timeout&&timeout.close()},Timeout.prototype.unref=Timeout.prototype.ref=function(){},Timeout.prototype.close=function(){this._clearFn.call(scope,this._id)},exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId),item._idleTimeout=msecs},exports.unenroll=function(item){clearTimeout(item._idleTimeoutId),item._idleTimeout=-1},exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;msecs>=0&&(item._idleTimeoutId=setTimeout(function(){item._onTimeout&&item._onTimeout()},msecs))},__webpack_require__(93),exports.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==global&&global.setImmediate||this&&this.setImmediate,exports.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==global&&global.clearImmediate||this&&this.clearImmediate}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(28).Buffer,isEncoding=Buffer.isEncoding||function(encoding){switch((encoding=""+encoding)&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function StringDecoder(encoding){var nb;switch(this.encoding=function(enc){var nenc=function(enc){if(!enc)return"utf8";for(var retried;;)switch(enc){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return enc;default:if(retried)return;enc=(""+enc).toLowerCase(),retried=!0}}(enc);if("string"!=typeof nenc&&(Buffer.isEncoding===isEncoding||!isEncoding(enc)))throw new Error("Unknown encoding: "+enc);return nenc||enc}(encoding),this.encoding){case"utf16le":this.text=utf16Text,this.end=utf16End,nb=4;break;case"utf8":this.fillLast=utf8FillLast,nb=4;break;case"base64":this.text=base64Text,this.end=base64End,nb=3;break;default:return this.write=simpleWrite,void(this.end=simpleEnd)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(nb)}function utf8CheckByte(byte){return byte<=127?0:byte>>5==6?2:byte>>4==14?3:byte>>3==30?4:byte>>6==2?-1:-2}function utf8FillLast(buf){var p=this.lastTotal-this.lastNeed,r=function(self,buf,p){if(128!=(192&buf[0]))return self.lastNeed=0,"�";if(self.lastNeed>1&&buf.length>1){if(128!=(192&buf[1]))return self.lastNeed=1,"�";if(self.lastNeed>2&&buf.length>2&&128!=(192&buf[2]))return self.lastNeed=2,"�"}}(this,buf);return void 0!==r?r:this.lastNeed<=buf.length?(buf.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(buf.copy(this.lastChar,p,0,buf.length),void(this.lastNeed-=buf.length))}function utf16Text(buf,i){if((buf.length-i)%2==0){var r=buf.toString("utf16le",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=buf[buf.length-1],buf.toString("utf16le",i,buf.length-1)}function utf16End(buf){var r=buf&&buf.length?this.write(buf):"";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString("utf16le",0,end)}return r}function base64Text(buf,i){var n=(buf.length-i)%3;return 0===n?buf.toString("base64",i):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=buf[buf.length-1]:(this.lastChar[0]=buf[buf.length-2],this.lastChar[1]=buf[buf.length-1]),buf.toString("base64",i,buf.length-n))}function base64End(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+this.lastChar.toString("base64",0,3-this.lastNeed):r}function simpleWrite(buf){return buf.toString(this.encoding)}function simpleEnd(buf){return buf&&buf.length?this.write(buf):""}exports.StringDecoder=StringDecoder,StringDecoder.prototype.write=function(buf){if(0===buf.length)return"";var r,i;if(this.lastNeed){if(void 0===(r=this.fillLast(buf)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<buf.length?r?r+this.text(buf,i):this.text(buf,i):r||""},StringDecoder.prototype.end=function(buf){var r=buf&&buf.length?this.write(buf):"";return this.lastNeed?r+"�":r},StringDecoder.prototype.text=function(buf,i){var total=function(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0)return nb>0&&(self.lastNeed=nb-1),nb;if(--j<i||-2===nb)return 0;if((nb=utf8CheckByte(buf[j]))>=0)return nb>0&&(self.lastNeed=nb-2),nb;if(--j<i||-2===nb)return 0;if((nb=utf8CheckByte(buf[j]))>=0)return nb>0&&(2===nb?nb=0:self.lastNeed=nb-3),nb;return 0}(this,buf,i);if(!this.lastNeed)return buf.toString("utf8",i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);return buf.copy(this.lastChar,0,end),buf.toString("utf8",i,end)},StringDecoder.prototype.fillLast=function(buf){if(this.lastNeed<=buf.length)return buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);buf.copy(this.lastChar,this.lastTotal-this.lastNeed,0,buf.length),this.lastNeed-=buf.length}},function(module,exports,__webpack_require__){"use strict";module.exports=Transform;var Duplex=__webpack_require__(12),util=Object.create(__webpack_require__(23));function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options),this._transformState={afterTransform:function(er,data){var ts=this._transformState;ts.transforming=!1;var cb=ts.writecb;if(!cb)return this.emit("error",new Error("write callback called multiple times"));ts.writechunk=null,ts.writecb=null,null!=data&&this.push(data),cb(er);var rs=this._readableState;rs.reading=!1,(rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,options&&("function"==typeof options.transform&&(this._transform=options.transform),"function"==typeof options.flush&&(this._flush=options.flush)),this.on("prefinish",prefinish)}function prefinish(){var _this=this;"function"==typeof this._flush?this._flush(function(er,data){done(_this,er,data)}):done(this,null,null)}function done(stream,er,data){if(er)return stream.emit("error",er);if(null!=data&&stream.push(data),stream._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(stream._transformState.transforming)throw new Error("Calling transform done when still transforming");return stream.push(null)}util.inherits=__webpack_require__(15),util.inherits(Transform,Duplex),Transform.prototype.push=function(chunk,encoding){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,chunk,encoding)},Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;if(ts.writecb=cb,ts.writechunk=chunk,ts.writeencoding=encoding,!ts.transforming){var rs=this._readableState;(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)&&this._read(rs.highWaterMark)}},Transform.prototype._read=function(n){var ts=this._transformState;null!==ts.writechunk&&ts.writecb&&!ts.transforming?(ts.transforming=!0,this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)):ts.needTransform=!0},Transform.prototype._destroy=function(err,cb){var _this2=this;Duplex.prototype._destroy.call(this,err,function(err2){cb(err2),_this2.emit("close")})}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),support=__webpack_require__(7),_keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";exports.encode=function(input){for(var chr1,chr2,chr3,enc1,enc2,enc3,enc4,output=[],i=0,len=input.length,remainingBytes=len,isArray="string"!==utils.getTypeOf(input);i<input.length;)remainingBytes=len-i,isArray?(chr1=input[i++],chr2=i<len?input[i++]:0,chr3=i<len?input[i++]:0):(chr1=input.charCodeAt(i++),chr2=i<len?input.charCodeAt(i++):0,chr3=i<len?input.charCodeAt(i++):0),enc1=chr1>>2,enc2=(3&chr1)<<4|chr2>>4,enc3=remainingBytes>1?(15&chr2)<<2|chr3>>6:64,enc4=remainingBytes>2?63&chr3:64,output.push(_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4));return output.join("")},exports.decode=function(input){var chr1,chr2,chr3,enc2,enc3,enc4,i=0,resultIndex=0;if("data:"===input.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var output,totalLength=3*(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(input.charAt(input.length-1)===_keyStr.charAt(64)&&totalLength--,input.charAt(input.length-2)===_keyStr.charAt(64)&&totalLength--,totalLength%1!=0)throw new Error("Invalid base64 input, bad content length.");for(output=support.uint8array?new Uint8Array(0|totalLength):new Array(0|totalLength);i<input.length;)chr1=_keyStr.indexOf(input.charAt(i++))<<2|(enc2=_keyStr.indexOf(input.charAt(i++)))>>4,chr2=(15&enc2)<<4|(enc3=_keyStr.indexOf(input.charAt(i++)))>>2,chr3=(3&enc3)<<6|(enc4=_keyStr.indexOf(input.charAt(i++))),output[resultIndex++]=chr1,64!==enc3&&(output[resultIndex++]=chr2),64!==enc4&&(output[resultIndex++]=chr3);return output}},function(module,exports,__webpack_require__){"use strict";(function(Buffer){var utils=__webpack_require__(0),ConvertWorker=__webpack_require__(103),GenericWorker=__webpack_require__(2),base64=__webpack_require__(57),support=__webpack_require__(7),external=__webpack_require__(24),NodejsStreamOutputAdapter=null;if(support.nodestream)try{NodejsStreamOutputAdapter=__webpack_require__(104)}catch(e){}function accumulate(helper,updateCallback){return new external.Promise(function(resolve,reject){var dataArray=[],chunkType=helper._internalType,resultType=helper._outputType,mimeType=helper._mimeType;helper.on("data",function(data,meta){dataArray.push(data),updateCallback&&updateCallback(meta)}).on("error",function(err){dataArray=[],reject(err)}).on("end",function(){try{var result=function(type,content,mimeType){switch(type){case"blob":return utils.newBlob(utils.transformTo("arraybuffer",content),mimeType);case"base64":return base64.encode(content);default:return utils.transformTo(type,content)}}(resultType,function(type,dataArray){var i,index=0,res=null,totalLength=0;for(i=0;i<dataArray.length;i++)totalLength+=dataArray[i].length;switch(type){case"string":return dataArray.join("");case"array":return Array.prototype.concat.apply([],dataArray);case"uint8array":for(res=new Uint8Array(totalLength),i=0;i<dataArray.length;i++)res.set(dataArray[i],index),index+=dataArray[i].length;return res;case"nodebuffer":return Buffer.concat(dataArray);default:throw new Error("concat : unsupported type '"+type+"'")}}(chunkType,dataArray),mimeType);resolve(result)}catch(e){reject(e)}dataArray=[]}).resume()})}function StreamHelper(worker,outputType,mimeType){var internalType=outputType;switch(outputType){case"blob":case"arraybuffer":internalType="uint8array";break;case"base64":internalType="string"}try{this._internalType=internalType,this._outputType=outputType,this._mimeType=mimeType,utils.checkSupport(internalType),this._worker=worker.pipe(new ConvertWorker(internalType)),worker.lock()}catch(e){this._worker=new GenericWorker("error"),this._worker.error(e)}}StreamHelper.prototype={accumulate:function(updateCb){return accumulate(this,updateCb)},on:function(evt,fn){var self=this;return"data"===evt?this._worker.on(evt,function(chunk){fn.call(self,chunk.data,chunk.meta)}):this._worker.on(evt,function(){utils.delay(fn,arguments,self)}),this},resume:function(){return utils.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(updateCb){if(utils.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new NodejsStreamOutputAdapter(this,{objectMode:"nodebuffer"!==this._outputType},updateCb)}},module.exports=StreamHelper}).call(this,__webpack_require__(21).Buffer)},function(module,exports,__webpack_require__){"use strict";exports.base64=!1,exports.binary=!1,exports.dir=!1,exports.createFolders=!0,exports.date=null,exports.compression=null,exports.compressionOptions=null,exports.comment=null,exports.unixPermissions=null,exports.dosPermissions=null},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function DataWorker(dataP){GenericWorker.call(this,"DataWorker");var self=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,dataP.then(function(data){self.dataIsReady=!0,self.data=data,self.max=data&&data.length||0,self.type=utils.getTypeOf(data),self.isPaused||self._tickAndRepeat()},function(e){self.error(e)})}utils.inherits(DataWorker,GenericWorker),DataWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this.data=null},DataWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,utils.delay(this._tickAndRepeat,[],this)),!0)},DataWorker.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(utils.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},DataWorker.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var data=null,nextIndex=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":data=this.data.substring(this.index,nextIndex);break;case"uint8array":data=this.data.subarray(this.index,nextIndex);break;case"array":case"nodebuffer":data=this.data.slice(this.index,nextIndex)}return this.index=nextIndex,this.push({data:data,meta:{percent:this.max?this.index/this.max*100:0}})},module.exports=DataWorker},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function DataLengthProbe(propName){GenericWorker.call(this,"DataLengthProbe for "+propName),this.propName=propName,this.withStreamInfo(propName,0)}utils.inherits(DataLengthProbe,GenericWorker),DataLengthProbe.prototype.processChunk=function(chunk){if(chunk){var length=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=length+chunk.data.length}GenericWorker.prototype.processChunk.call(this,chunk)},module.exports=DataLengthProbe},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2),crc32=__webpack_require__(43);function Crc32Probe(){GenericWorker.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}__webpack_require__(0).inherits(Crc32Probe,GenericWorker),Crc32Probe.prototype.processChunk=function(chunk){this.streamInfo.crc32=crc32(chunk.data,this.streamInfo.crc32||0),this.push(chunk)},module.exports=Crc32Probe},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2);exports.STORE={magic:"\0\0",compressWorker:function(compressionOptions){return new GenericWorker("STORE compression")},uncompressWorker:function(){return new GenericWorker("STORE decompression")}},exports.DEFLATE=__webpack_require__(107)},function(module,exports,__webpack_require__){"use strict";module.exports=function(adler,buf,len,pos){for(var s1=65535&adler|0,s2=adler>>>16&65535|0,n=0;0!==len;){len-=n=len>2e3?2e3:len;do{s2=s2+(s1=s1+buf[pos++]|0)|0}while(--n);s1%=65521,s2%=65521}return s1|s2<<16|0}},function(module,exports,__webpack_require__){"use strict";var crcTable=function(){for(var c,table=[],n=0;n<256;n++){c=n;for(var k=0;k<8;k++)c=1&c?3988292384^c>>>1:c>>>1;table[n]=c}return table}();module.exports=function(crc,buf,len,pos){var t=crcTable,end=pos+len;crc^=-1;for(var i=pos;i<end;i++)crc=crc>>>8^t[255&(crc^buf[i])];return-1^crc}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),STR_APPLY_OK=!0,STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,[0])}catch(__){STR_APPLY_OK=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(__){STR_APPLY_UIA_OK=!1}for(var _utf8len=new utils.Buf8(256),q=0;q<256;q++)_utf8len[q]=q>=252?6:q>=248?5:q>=240?4:q>=224?3:q>=192?2:1;function buf2binstring(buf,len){if(len<65534&&(buf.subarray&&STR_APPLY_UIA_OK||!buf.subarray&&STR_APPLY_OK))return String.fromCharCode.apply(null,utils.shrinkBuf(buf,len));for(var result="",i=0;i<len;i++)result+=String.fromCharCode(buf[i]);return result}_utf8len[254]=_utf8len[254]=1,exports.string2buf=function(str){var buf,c,c2,m_pos,i,str_len=str.length,buf_len=0;for(m_pos=0;m_pos<str_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),buf_len+=c<128?1:c<2048?2:c<65536?3:4;for(buf=new utils.Buf8(buf_len),i=0,m_pos=0;i<buf_len;m_pos++)55296==(64512&(c=str.charCodeAt(m_pos)))&&m_pos+1<str_len&&56320==(64512&(c2=str.charCodeAt(m_pos+1)))&&(c=65536+(c-55296<<10)+(c2-56320),m_pos++),c<128?buf[i++]=c:c<2048?(buf[i++]=192|c>>>6,buf[i++]=128|63&c):c<65536?(buf[i++]=224|c>>>12,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c):(buf[i++]=240|c>>>18,buf[i++]=128|c>>>12&63,buf[i++]=128|c>>>6&63,buf[i++]=128|63&c);return buf},exports.buf2binstring=function(buf){return buf2binstring(buf,buf.length)},exports.binstring2buf=function(str){for(var buf=new utils.Buf8(str.length),i=0,len=buf.length;i<len;i++)buf[i]=str.charCodeAt(i);return buf},exports.buf2string=function(buf,max){var i,out,c,c_len,len=max||buf.length,utf16buf=new Array(2*len);for(out=0,i=0;i<len;)if((c=buf[i++])<128)utf16buf[out++]=c;else if((c_len=_utf8len[c])>4)utf16buf[out++]=65533,i+=c_len-1;else{for(c&=2===c_len?31:3===c_len?15:7;c_len>1&&i<len;)c=c<<6|63&buf[i++],c_len--;c_len>1?utf16buf[out++]=65533:c<65536?utf16buf[out++]=c:(c-=65536,utf16buf[out++]=55296|c>>10&1023,utf16buf[out++]=56320|1023&c)}return buf2binstring(utf16buf,out)},exports.utf8border=function(buf,max){var pos;for((max=max||buf.length)>buf.length&&(max=buf.length),pos=max-1;pos>=0&&128==(192&buf[pos]);)pos--;return pos<0?max:0===pos?max:pos+_utf8len[buf[pos]]>max?pos:max}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(module,exports,__webpack_require__){"use strict";module.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(module,exports,__webpack_require__){"use strict";exports.LOCAL_FILE_HEADER="PK",exports.CENTRAL_FILE_HEADER="PK",exports.CENTRAL_DIRECTORY_END="PK",exports.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",exports.ZIP64_CENTRAL_DIRECTORY_END="PK",exports.DATA_DESCRIPTOR="PK\b"},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),support=__webpack_require__(7),ArrayReader=__webpack_require__(71),StringReader=__webpack_require__(121),NodeBufferReader=__webpack_require__(122),Uint8ArrayReader=__webpack_require__(73);module.exports=function(data){var type=utils.getTypeOf(data);return utils.checkSupport(type),"string"!==type||support.uint8array?"nodebuffer"===type?new NodeBufferReader(data):support.uint8array?new Uint8ArrayReader(utils.transformTo("uint8array",data)):new ArrayReader(utils.transformTo("array",data)):new StringReader(data)}},function(module,exports,__webpack_require__){"use strict";var DataReader=__webpack_require__(72);function ArrayReader(data){DataReader.call(this,data);for(var i=0;i<this.data.length;i++)data[i]=255&data[i]}__webpack_require__(0).inherits(ArrayReader,DataReader),ArrayReader.prototype.byteAt=function(i){return this.data[this.zero+i]},ArrayReader.prototype.lastIndexOfSignature=function(sig){for(var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),i=this.length-4;i>=0;--i)if(this.data[i]===sig0&&this.data[i+1]===sig1&&this.data[i+2]===sig2&&this.data[i+3]===sig3)return i-this.zero;return-1},ArrayReader.prototype.readAndCheckSignature=function(sig){var sig0=sig.charCodeAt(0),sig1=sig.charCodeAt(1),sig2=sig.charCodeAt(2),sig3=sig.charCodeAt(3),data=this.readData(4);return sig0===data[0]&&sig1===data[1]&&sig2===data[2]&&sig3===data[3]},ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return[];var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=ArrayReader},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0);function DataReader(data){this.data=data,this.length=data.length,this.index=0,this.zero=0}DataReader.prototype={checkOffset:function(offset){this.checkIndex(this.index+offset)},checkIndex:function(newIndex){if(this.length<this.zero+newIndex||newIndex<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+newIndex+"). Corrupted zip ?")},setIndex:function(newIndex){this.checkIndex(newIndex),this.index=newIndex},skip:function(n){this.setIndex(this.index+n)},byteAt:function(i){},readInt:function(size){var i,result=0;for(this.checkOffset(size),i=this.index+size-1;i>=this.index;i--)result=(result<<8)+this.byteAt(i);return this.index+=size,result},readString:function(size){return utils.transformTo("string",this.readData(size))},readData:function(size){},lastIndexOfSignature:function(sig){},readAndCheckSignature:function(sig){},readDate:function(){var dostime=this.readInt(4);return new Date(Date.UTC(1980+(dostime>>25&127),(dostime>>21&15)-1,dostime>>16&31,dostime>>11&31,dostime>>5&63,(31&dostime)<<1))}},module.exports=DataReader},function(module,exports,__webpack_require__){"use strict";var ArrayReader=__webpack_require__(71);function Uint8ArrayReader(data){ArrayReader.call(this,data)}__webpack_require__(0).inherits(Uint8ArrayReader,ArrayReader),Uint8ArrayReader.prototype.readData=function(size){if(this.checkOffset(size),0===size)return new Uint8Array(0);var result=this.data.subarray(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=Uint8ArrayReader},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE=void 0,exports.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE="pushwoosh-subscription-widget"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PlatformChecker_1=__webpack_require__(76),PlatformChecker_2=__webpack_require__(76);Object.defineProperty(exports,"PlatformChecker",{enumerable:!0,get:function(){return PlatformChecker_2.PlatformChecker}}),exports.default=PlatformChecker_1.platformChecker},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.platformChecker=exports.PlatformChecker=void 0;var PlatformChecker=function(){function PlatformChecker(global){void 0===global&&(global=window),this.global=global,this._isSafari=this.isSafariBrowser(),this._isOpera=this.isOperaBrowser(),this._isEdge=this.isEdgeBrowser(),this._isFirefox=this.isFirefoxBrowser(),this._isChrome=this.isChromeBrowser(),this._isMacOS=this.isMacOS(),this._isAvailablePromise=this.canUsePromise(),this._isAvailableServiceWorker=this.canUseServiceWorkers(),this._isAvailableNotifications=this.canReceiveNotifications(),this._platform=this.getPlatformType(),this._browserVersion=this.getBrowserVersion()}return Object.defineProperty(PlatformChecker.prototype,"isEdge",{get:function(){return this._isEdge},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isSafari",{get:function(){return this._isSafari},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isOpera",{get:function(){return this._isOpera},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailablePromise",{get:function(){return this._isAvailablePromise},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailableServiceWorker",{get:function(){return this._isAvailableServiceWorker},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"isAvailableNotifications",{get:function(){return this._isAvailableNotifications},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"platform",{get:function(){return this._platform},enumerable:!1,configurable:!0}),Object.defineProperty(PlatformChecker.prototype,"browserVersion",{get:function(){return this._browserVersion},enumerable:!1,configurable:!0}),PlatformChecker.prototype.isSafariBrowser=function(){return"safari"in this.global&&navigator.userAgent.indexOf("Safari")>-1},PlatformChecker.prototype.isOperaBrowser=function(){return-1!==navigator.userAgent.indexOf("Opera")||-1!==navigator.userAgent.indexOf("OPR")},PlatformChecker.prototype.isEdgeBrowser=function(){return navigator.userAgent.indexOf("Edge")>-1},PlatformChecker.prototype.isFirefoxBrowser=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("firefox")},PlatformChecker.prototype.isChromeBrowser=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)&&!this._isOpera&&!this._isEdge},PlatformChecker.prototype.isMacOS=function(){return"platform"in navigator&&-1!==navigator.platform.toLowerCase().indexOf("mac")},PlatformChecker.prototype.canUseServiceWorkers=function(){return!!navigator.serviceWorker&&"PushManager"in this.global&&"Notification"in this.global},PlatformChecker.prototype.canUsePromise=function(){return"Promise"in this.global},PlatformChecker.prototype.canReceiveNotifications=function(){return this._isSafari&&this._isMacOS||this._isAvailableServiceWorker&&!this._isEdge},PlatformChecker.prototype.getPlatformType=function(){var platform=11;switch(!0){case this._isSafari:platform=10;break;case this._isOpera||this._isChrome:platform=11;break;case this._isFirefox:platform=12;break;case this._isEdge:platform=150}return platform},PlatformChecker.prototype.getBrowserVersion=function(){var userAgent=navigator.userAgent,matchOperaVersion=userAgent.match(/\bOPR\/(\d+)/);if(null!==matchOperaVersion)return"Opera "+matchOperaVersion[1];var matchEdgeVersion=userAgent.match(/\bEdge\/(\d+)/);if(null!==matchEdgeVersion)return"Edge "+matchEdgeVersion[1];var matchEdgVersion=userAgent.match(/\bEdg\/(\d+)/);if(null!==matchEdgVersion)return"Edge "+matchEdgVersion[1];var match=userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[],_a=(match[0],match[1]),browser=void 0===_a?"":_a;if(/trident/i.test(userAgent)){var matchIeVersion=/trident\/([.\d]+)/gi.exec(userAgent)||[];return"IE "+(("7.0"===matchIeVersion[1]?"11":matchIeVersion[1])||"")}match=match[2]?[browser,match[2]]:[navigator.appName,navigator.appVersion,"-?"];var version=userAgent.match(/version\/([.\d]+)/i);return null!==version&&match.splice(1,1,version[1]),match.join(" ")},PlatformChecker}();exports.PlatformChecker=PlatformChecker,exports.platformChecker=new PlatformChecker(Function("return this")())},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SUBSCRIBE_WIDGET_DEFAULT_CONFIG=exports.WIDGET_CONTAINER_ID=exports.BELL_POSITION_TOP_LEFT=exports.BELL_POSITION_TOP_RIGHT=exports.BELL_POSITION_BOTTOM_LEFT=exports.BELL_POSITION_BOTTOM_RIGHT=void 0,exports.BELL_POSITION_BOTTOM_RIGHT="bottomRight",exports.BELL_POSITION_BOTTOM_LEFT="bottomLeft",exports.BELL_POSITION_TOP_RIGHT="topRight",exports.BELL_POSITION_TOP_LEFT="topLeft",exports.WIDGET_CONTAINER_ID="pushwooshBellWidget",exports.SUBSCRIBE_WIDGET_DEFAULT_CONFIG={position:exports.BELL_POSITION_BOTTOM_LEFT,bgColor:"#12AE7E",bellColor:"white",bellStrokeColor:"#08754f",bellButtonBorder:"1px solid #379676",shadow:"0px 0px 6px rgba(0, 0, 0, 0.75)",size:"48px",indent:"20px",zIndex:"999999",tooltipText:{successSubscribe:"You are successfully subscribed!",needSubscribe:"Get notifications about important news!",blockSubscribe:"Click to see how to get notifications",alreadySubscribed:"You are already subscribed"}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Pushwoosh_1=__webpack_require__(79);Object.defineProperty(exports,"Pushwoosh",{enumerable:!0,get:function(){return Pushwoosh_1.default}}),__webpack_require__(145),__webpack_require__(151),__webpack_require__(153)},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var uuid_1=__webpack_require__(13),EventBus_1=__webpack_require__(32),Api_1=__webpack_require__(34),Data_1=__webpack_require__(4),ApiClient_1=__webpack_require__(26),PushService_1=__webpack_require__(80),Popup_1=__webpack_require__(82),SubscriptionSegmentsWidget_1=__webpack_require__(84),SubscriptionPromptWidget_1=__webpack_require__(125),CONSTANTS=__webpack_require__(1),functions_1=__webpack_require__(10),PlatformChecker_1=__webpack_require__(75),logger_1=__webpack_require__(3),FacebookModule_1=__webpack_require__(127),InApps_1=__webpack_require__(128),storage_1=__webpack_require__(5),InboxMessages_1=__webpack_require__(45),InboxMessagesPublic_1=__webpack_require__(25),Pushwoosh=function(){function Pushwoosh(){var _this=this;this.ready=!1,this.addEventHandler=function(name,handler){return _this.eventBus.addEventHandler(name,handler)},this.removeEventHandler=function(name,handler){return _this.eventBus.removeEventHandler(name,handler)},this.dispatchEvent=function(name,payload){return _this.eventBus.dispatchEvent(name,payload)},this.debug={showLog:function(){return __awaiter(this,void 0,void 0,function(){var items;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.log.getAll()];case 1:return items=_a.sent(),console.log(items),[2]}})})},showKeyValues:function(){return __awaiter(this,void 0,void 0,function(){var items;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.keyValue.getAll()];case 1:return items=_a.sent(),console.log(items),[2]}})})},showMessages:function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.message.getAll()];case 1:return _a.sent().forEach(function(i){return console.log(i)}),[2]}})})}},this.eventBus=new EventBus_1.EventBus,this.data=new Data_1.Data,this.apiClient=new ApiClient_1.ApiClient(this.data),this.api=new Api_1.Api(this.eventBus,this.data,this.apiClient),this.platformChecker=new PlatformChecker_1.PlatformChecker,this.inboxModel=new InboxMessages_1.default(this.eventBus,this.data,this.api),this.pwinbox=new InboxMessagesPublic_1.default(this.data,this.api,this.inboxModel),this.onServiceWorkerMessage=this.onServiceWorkerMessage.bind(this);var popup=new Popup_1.Popup("subscription-segments",function(){return _this.eventBus.dispatchEvent("hide-subscription-widget",{})},{position:"top"});this.subscriptionSegmentWidget=new SubscriptionSegmentsWidget_1.SubscriptionSegmentsWidget(this.eventBus,this.data,this.apiClient,this.api,popup,this),this.subscriptionPromptWidget=new SubscriptionPromptWidget_1.SubscriptionPromptWidget(this.eventBus,this)}return Pushwoosh.prototype.push=function(command){if("function"!=typeof command){if(!Array.isArray(command))throw new Error("Invalid command!");switch(command[0]){case"init":this.initialize(command[1]);break;case CONSTANTS.EVENT_ON_LOAD:case CONSTANTS.EVENT_ON_READY:case CONSTANTS.EVENT_ON_REGISTER:case CONSTANTS.EVENT_ON_SUBSCRIBE:case CONSTANTS.EVENT_ON_UNSUBSCRIBE:case CONSTANTS.EVENT_ON_SW_INIT_ERROR:case CONSTANTS.EVENT_ON_PUSH_DELIVERY:case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:case CONSTANTS.EVENT_ON_CHANGE_COMMUNICATION_ENABLED:case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:case CONSTANTS.EVENT_ON_UPDATE_INBOX_MESSAGES:case CONSTANTS.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG:case CONSTANTS.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG:case CONSTANTS.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET:case CONSTANTS.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET:case CONSTANTS.EVENT_ON_PERMISSION_DENIED:case CONSTANTS.EVENT_ON_PERMISSION_PROMPT:case CONSTANTS.EVENT_ON_PERMISSION_GRANTED:this.subscribeToLegacyEvents(command[0],command[1]);break;default:throw new Error("Unknown command!")}}else this.subscribeToLegacyEvents("onReady",command)},Pushwoosh.prototype.subscribe=function(isForceSubscribe){return void 0===isForceSubscribe&&(isForceSubscribe=!0),__awaiter(this,void 0,void 0,function(){var permission_1,permission,isManualUnsubscribed,isDeviceRegister;return __generator(this,function(_a){switch(_a.label){case 0:return this.isCommunicationDisabled&&logger_1.Logger.error("Communication is disabled!"),this.driver.checkIsPermissionDefault()?(this.eventBus.dispatchEvent("show-notification-permission-dialog",{}),[4,this.driver.askPermission()]):[3,2];case 1:_a.sent(),permission_1=this.driver.getPermission(),this.eventBus.dispatchEvent("hide-notification-permission-dialog",{permission:permission_1}),_a.label=2;case 2:return permission=this.driver.getPermission(),[4,this.data.getStatusManualUnsubscribed()];case 3:return isManualUnsubscribed=_a.sent(),[4,this.api.checkDeviceSubscribeForPushNotifications(!1)];case 4:return isDeviceRegister=_a.sent(),permission!==CONSTANTS.PERMISSION_GRANTED?[3,7]:(this.eventBus.dispatchEvent("permission-granted",{}),!(isForceSubscribe||!isManualUnsubscribed)||isDeviceRegister?[3,6]:[4,this.driver.subscribe()]);case 5:_a.sent(),_a.label=6;case 6:return this.eventBus.dispatchEvent("subscribe",{}),[2];case 7:return permission!==CONSTANTS.PERMISSION_DENIED?[3,10]:(this.eventBus.dispatchEvent("permission-denied",{}),isDeviceRegister?[4,this.driver.unsubscribe()]:[3,9]);case 8:_a.sent(),_a.label=9;case 9:case 10:return[2]}})})},Pushwoosh.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){var error_1;return __generator(this,function(_a){switch(_a.label){case 0:return _a.trys.push([0,2,,3]),[4,this.driver.unsubscribe()];case 1:return _a.sent(),[3,3];case 2:return error_1=_a.sent(),logger_1.Logger.error(error_1,"Error occurred during the unsubscribe"),[3,3];case 3:return[2]}})})},Pushwoosh.prototype.forceSubscribe=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.subscribe(!0)];case 1:return _a.sent(),[2]}})})},Pushwoosh.prototype.isDeviceRegistered=function(){return localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS)===CONSTANTS.DEVICE_REGISTRATION_STATUS_REGISTERED},Pushwoosh.prototype.isDeviceUnregistered=function(){return localStorage.getItem(CONSTANTS.KEY_DEVICE_REGISTRATION_STATUS)===CONSTANTS.DEVICE_REGISTRATION_STATUS_UNREGISTERED},Pushwoosh.prototype.isSubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},Pushwoosh.prototype.isCommunicationEnabled=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusCommunicationDisabled()];case 1:return[2,!_a.sent()]}})})},Pushwoosh.prototype.setCommunicationEnabled=function(isEnabled){return void 0===isEnabled&&(isEnabled=!0),__awaiter(this,void 0,void 0,function(){var deviceType,isPermissionGranted;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),isPermissionGranted=this.driver.checkIsPermissionGranted(),[4,this.data.setStatusCommunicationDisabled(!isEnabled)];case 2:return _a.sent(),isEnabled?[4,this.data.setStatusDropAllData(!1)]:[3,6];case 3:return _a.sent(),isPermissionGranted?[4,this.api.registerDevice()]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[3,8];case 6:return[4,this.api.unregisterDevice()];case 7:_a.sent(),_a.label=8;case 8:return this.eventBus.dispatchEvent("change-enabled-communication",{isEnabled:isEnabled}),[4,this.api.postEvent(CONSTANTS.EVENT_GDPR_CONSENT,{channel:isEnabled,device_type:deviceType})];case 9:return _a.sent(),[2]}})})},Pushwoosh.prototype.removeAllDeviceData=function(){return __awaiter(this,void 0,void 0,function(){var deviceType;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getDeviceType()];case 1:return deviceType=_a.sent(),[4,this.api.postEvent(CONSTANTS.EVENT_GDPR_DELETE,{status:!0,device_type:deviceType})];case 2:return _a.sent(),[4,this.api.deleteDevice()];case 3:return _a.sent(),[4,this.data.clearAll()];case 4:return _a.sent(),[4,this.data.setStatusDropAllData(!0)];case 5:return _a.sent(),[2]}})})},Pushwoosh.prototype.getHWID=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getHwid()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.getPushToken=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getTokens()];case 1:return[2,_a.sent().pushToken]}})})},Pushwoosh.prototype.getUserId=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getUserId()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.getParams=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.api.getParams()];case 1:return[2,_a.sent()]}})})},Pushwoosh.prototype.isAvailableNotifications=function(){return this.platformChecker.isAvailableNotifications},Pushwoosh.prototype.sendStatisticsVisitedPage=function(){return __awaiter(this,void 0,void 0,function(){var title,_a,origin,pathname,href;return __generator(this,function(_b){switch(_b.label){case 0:return title=window.document.title,_a=window.location,origin=_a.origin,pathname=_a.pathname,href=_a.href,[4,this.api.pageVisit({title:title,url_path:""+origin+pathname,url:href})];case 1:return _b.sent(),[2]}})})},Pushwoosh.prototype.isEnableChannels=function(){return __awaiter(this,void 0,void 0,function(){var features,channels;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return features=_a.sent(),channels=features&&features.channels,[2,Array.isArray(channels)&&!!channels.length]}})})},Pushwoosh.prototype.initialize=function(params){return __awaiter(this,void 0,void 0,function(){var manualDebug,applicationCode,notSavedApplicationCode,isChangeApplicationCode,id,config,_a,userIdWasChange,inAppsConfig,error_2,error_3,delayedEvent,type,payload,hashReg,hash;return __generator(this,function(_b){switch(_b.label){case 0:return manualDebug=localStorage.getItem(CONSTANTS.MANUAL_SET_LOGGER_LEVEL),logger_1.Logger.setLevel(manualDebug||params.logLevel||"error"),this.platformChecker.isAvailableNotifications?[4,this.data.getApplicationCode()]:[2];case 1:if(applicationCode=_b.sent(),!params.applicationCode)throw new Error("Can't find application code!");return notSavedApplicationCode=!applicationCode,isChangeApplicationCode=applicationCode&&applicationCode!==params.applicationCode,notSavedApplicationCode||isChangeApplicationCode?[4,this.data.clearAll()]:[3,4];case 2:return _b.sent(),[4,this.data.setApplicationCode(params.applicationCode)];case 3:_b.sent(),_b.label=4;case 4:return[4,this.data.getHwid()];case 5:return _b.sent()?[3,7]:(id=params.applicationCode+"_"+uuid_1.v4(),[4,this.data.setHwid(id)]);case 6:_b.sent(),_b.label=7;case 7:return[4,this.data.setDeviceType(this.platformChecker.getPlatformType())];case 8:return _b.sent(),[4,this.data.setDeviceModel(this.platformChecker.getBrowserVersion())];case 9:return _b.sent(),[4,this.data.setLanguage(params.tags&&params.tags.Language||navigator.language)];case 10:return _b.sent(),params.pushwooshUrl?[4,this.data.setApiEntrypoint(params.pushwooshUrl)]:[3,12];case 11:_b.sent(),_b.label=12;case 12:return[4,this.data.setSdkVersion("3.28.0")];case 13:return _b.sent(),[4,this.api.getConfig(["page_visit","vapid_key","web_in_apps","events","subscription_prompt"])];case 14:return config=_b.sent(),this.onGetConfig(config&&config.features),this.subscribeWidgetConfig=__assign({enable:!1},params.subscribeWidget),this.inboxWidgetConfig=__assign({enable:!1},params.inboxWidget),this.subscribePopupConfig=__assign({enable:!1},params.subscribePopup),_a=this,[4,this.data.getStatusCommunicationDisabled()];case 15:return _a.isCommunicationDisabled=_b.sent(),[4,this.open()];case 16:return _b.sent(),[4,this.data.getStatusUserIdWasChanged()];case 17:return userIdWasChange=_b.sent(),!params.userId||"user_id"===params.userId||userIdWasChange?[3,19]:[4,this.api.registerUser(params.userId)];case 18:_b.sent(),_b.label=19;case 19:return params.tags&&this.api.setTags(params.tags),inAppsConfig=__assign({enable:config.features.web_in_apps&&config.features.web_in_apps.enabled},params.inApps),[4,this.initInApp(inAppsConfig)];case 20:return _b.sent(),this.platformChecker.isAvailableNotifications?[4,this.initPushNotifications(params)]:[3,22];case 21:_b.sent(),_b.label=22;case 22:return _b.trys.push([22,24,,25]),[4,this.inboxModel.updateMessages()];case 23:return _b.sent(),[3,25];case 24:return error_2=_b.sent(),logger_1.Logger.write("error",error_2),[3,25];case 25:return _b.trys.push([25,27,,28]),[4,this.initFacebook(params)];case 26:return _b.sent(),[3,28];case 27:return error_3=_b.sent(),logger_1.Logger.write("error",error_3),[3,28];case 28:return this.ready=!0,this.eventBus.dispatchEvent("ready",{}),[4,this.data.getDelayedEvent()];case 29:return(delayedEvent=_b.sent())?(type=delayedEvent.type,payload=delayedEvent.payload,[4,this.emitLegacyEventsFromServiceWorker(type,payload)]):[3,32];case 30:return _b.sent(),[4,this.data.setDelayedEvent(null)];case 31:_b.sent(),_b.label=32;case 32:return"serviceWorker"in navigator&&(navigator.serviceWorker.onmessage=this.onServiceWorkerMessage),localStorage.setItem("pushwoosh-websdk-status","init"),document.dispatchEvent(new CustomEvent("pushwoosh.initialized",{detail:{pw:this}})),this.platformChecker.isSafari&&(hashReg=/#P(.*)/,hash=decodeURIComponent(document.location.hash),hashReg.test(hash)&&this.api.pushStat(hashReg.exec(hash)[1]).then(functions_1.clearLocationHash)),[2]}})})},Pushwoosh.prototype.defaultProcess=function(initParams){return __awaiter(this,void 0,void 0,function(){var permission,isCommunicationDisabled,isDropAllData,isNeedResubscribe,features,currentPromptUseCase,autoSubscribe,isManualUnsubscribed,isRegister,widgetConfig,isDefaultUseCase,isNotSetUseCase,result;return __generator(this,function(_b){switch(_b.label){case 0:return"granted"!==(permission=this.driver.getPermission())?[3,2]:[4,this.data.setLastPermissionStatus(permission)];case 1:_b.sent(),_b.label=2;case 2:return[4,this.data.getStatusCommunicationDisabled()];case 3:return isCommunicationDisabled=_b.sent(),[4,this.data.getStatusDropAllData()];case 4:return isDropAllData=_b.sent(),[4,this.driver.checkIsNeedResubscribe()];case 5:return isNeedResubscribe=_b.sent(),[4,this.data.getFeatures()];case 6:return features=_b.sent(),currentPromptUseCase=features.subscription_prompt&&features.subscription_prompt.use_case,isCommunicationDisabled||isDropAllData?[4,this.unsubscribe()]:[3,8];case 7:return _b.sent(),[2];case 8:return isNeedResubscribe?[4,this.unsubscribe()]:[3,11];case 9:return _b.sent(),[4,this.data.setStatusManualUnsubscribed(!1)];case 10:_b.sent(),_b.label=11;case 11:return autoSubscribe=initParams.autoSubscribe,[4,this.data.getStatusManualUnsubscribed()];case 12:return isManualUnsubscribed=_b.sent(),[4,this.api.checkDeviceSubscribeForPushNotifications(!1)];case 13:switch(isRegister=_b.sent(),permission){case CONSTANTS.PERMISSION_PROMPT:return[3,14];case CONSTANTS.PERMISSION_DENIED:return[3,22];case CONSTANTS.PERMISSION_GRANTED:return[3,25]}return[3,31];case 14:return this.eventBus.dispatchEvent("permission-default",{}),isRegister?[4,this.unsubscribe()]:[3,16];case 15:_b.sent(),_b.label=16;case 16:return[4,this.getWidgetConfig()];case 17:return widgetConfig=_b.sent(),[4,this.checkCanShowByCapping(widgetConfig)];case 18:return _b.sent()?currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED?[4,this.subscriptionSegmentWidget.init()]:[3,20]:[3,31];case 19:_b.sent(),_b.label=20;case 20:return isDefaultUseCase=currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_DEFAULT,isNotSetUseCase=currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_NOT_SET&&autoSubscribe,(isDefaultUseCase||isNotSetUseCase)&&(this.subscriptionPromptWidget.init(widgetConfig),this.subscriptionPromptWidget.show()),[4,this.updateCappingParams()];case 21:return _b.sent(),[3,31];case 22:return this.eventBus.dispatchEvent("permission-denied",{}),isRegister?[4,this.unsubscribe()]:[3,24];case 23:_b.sent(),_b.label=24;case 24:return[3,31];case 25:return this.eventBus.dispatchEvent("permission-granted",{}),isManualUnsubscribed&&isRegister?[4,this.unsubscribe()]:[3,27];case 26:_b.sent(),_b.label=27;case 27:return!isRegister&&!isManualUnsubscribed||isNeedResubscribe?[4,this.subscribe(!0)]:[3,30];case 28:return _b.sent(),currentPromptUseCase===CONSTANTS.SUBSCRIPTION_WIDGET_USE_CASE_TOPIC_BASED?(result=features.channels.map(function(channel){return channel.code}),[4,this.api.setTags({"Subscription Segments":result})]):[3,30];case 29:_b.sent(),_b.label=30;case 30:return[3,31];case 31:return[2]}})})},Pushwoosh.prototype.getWidgetConfig=function(){return __awaiter(this,void 0,void 0,function(){var features,currentConfig,configWithDefaultCapping;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return features=_a.sent(),currentConfig=features.subscription_prompt_widget&&features.subscription_prompt_widget.params,configWithDefaultCapping=__assign({cappingCount:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG.cappingCount,cappingDelay:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG.cappingDelay},currentConfig),[2,currentConfig?configWithDefaultCapping:CONSTANTS.SUBSCRIPTION_PROMPT_WIDGET_DEFAULT_CONFIG]}})})},Pushwoosh.prototype.checkCanShowByCapping=function(widgetConfig){return __awaiter(this,void 0,void 0,function(){var currentTime,displayCount,lastSeenTime,canShowByCapping,canShowByLastTime;return __generator(this,function(_a){switch(_a.label){case 0:return currentTime=(new Date).getTime(),[4,this.data.getPromptDisplayCount()];case 1:return displayCount=_a.sent(),[4,this.data.getPromptLastSeenTime()];case 2:return lastSeenTime=_a.sent(),canShowByCapping=widgetConfig.cappingCount>displayCount,canShowByLastTime=currentTime-lastSeenTime>widgetConfig.cappingDelay,[2,canShowByCapping&&canShowByLastTime]}})})},Pushwoosh.prototype.updateCappingParams=function(){return __awaiter(this,void 0,void 0,function(){var displayCount,currentTime;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getPromptDisplayCount()];case 1:return displayCount=_a.sent(),currentTime=(new Date).getTime(),[4,this.data.setPromptDisplayCount(displayCount+1)];case 2:return _a.sent(),[4,this.data.setPromptLastSeenTime(currentTime)];case 3:return _a.sent(),[2]}})})},Pushwoosh.prototype.initFacebook=function(initParams){var facebook=__assign({enable:!1,pageId:"",containerClass:""},initParams.facebook);if(facebook&&facebook.enable)try{new FacebookModule_1.default({pageId:facebook.pageId,containerClass:facebook.containerClass,applicationCode:initParams.applicationCode,userId:initParams.userId||""})}catch(error){logger_1.Logger.error(error,"facebook module initialization failed")}},Pushwoosh.prototype.initInApp=function(params){return __awaiter(this,void 0,void 0,function(){var error_4,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(!params||!params.enable)return[3,4];_a.label=1;case 1:return _a.trys.push([1,3,,4]),this.InApps=new InApps_1.InApps(params,this,this.eventBus,this.api),[4,this.InApps.init().then(function(){logger_1.Logger.info("InApps module has been initialized"),_this.eventBus.dispatchEvent("initialize-in-apps-module",{})}).catch(function(error){logger_1.Logger.error(error,"InApps module initialization has been failed")})];case 2:return _a.sent(),[3,4];case 3:return error_4=_a.sent(),logger_1.Logger.error(error_4,"InApp module initialization has been failed"),[3,4];case 4:return[2]}})})},Pushwoosh.prototype.onServiceWorkerMessage=function(event){var _a=(event||{}).data,_b=(void 0===_a?{}:_a)||{},_c=_b.type,type=void 0===_c?"":_c,_d=_b.payload,payload=void 0===_d?{}:_d;this.emitLegacyEventsFromServiceWorker(type,payload)},Pushwoosh.prototype.open=function(isForce){return __awaiter(this,void 0,void 0,function(){var lastApplicationOpenTime,currentTime,isSendingPeriodExceeded;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getLastOpenApplicationTime()];case 1:return lastApplicationOpenTime=_a.sent(),currentTime=Date.now(),lastApplicationOpenTime||(lastApplicationOpenTime=0),isSendingPeriodExceeded=currentTime-lastApplicationOpenTime<CONSTANTS.PERIOD_SEND_APP_OPEN,isForce||!isSendingPeriodExceeded?[4,this.data.setLastOpenApplicationTime(currentTime)]:[2];case 2:return _a.sent(),[4,this.api.applicationOpen()];case 3:return _a.sent(),[2]}})})},Pushwoosh.prototype.onGetConfig=function(features){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setFeatures(features)];case 1:return _a.sent(),features?features.page_visit&&features.page_visit.enabled?[4,storage_1.keyValue.set(CONSTANTS.PAGE_VISITED_URL,features.page_visit.entrypoint)]:[3,3]:[3,5];case 2:_a.sent(),this.sendStatisticsVisitedPage(),_a.label=3;case 3:return features.events&&features.events.length&&features.events.some(function(event){return event===CONSTANTS.EVENT_PW_SITE_OPENED})&&this.sendPostEventVisitedPage(),features.vapid_key?[4,this.data.setApplicationServerKey(features.vapid_key)]:[3,5];case 4:_a.sent(),_a.label=5;case 5:return[2]}})})},Pushwoosh.prototype.initPushNotifications=function(params){return __awaiter(this,void 0,void 0,function(){var error_5;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setDefaultNotificationImage(params.defaultNotificationImage)];case 1:return _a.sent(),[4,this.data.setDefaultNotificationTitle(params.defaultNotificationTitle)];case 2:return _a.sent(),[4,this.data.setServiceWorkerUrl(params.serviceWorkerUrl)];case 3:return _a.sent(),[4,this.data.setServiceWorkerScope(params.scope)];case 4:return _a.sent(),[4,this.data.setInitParams(__assign({autoSubscribe:!0},params))];case 5:return _a.sent(),[4,this.initDriver()];case 6:_a.sent(),_a.label=7;case 7:return _a.trys.push([7,9,,10]),[4,this.defaultProcess(params)];case 8:return _a.sent(),[3,10];case 9:return error_5=_a.sent(),logger_1.Logger.error(error_5,"Internal error: defaultProcess fail"),[3,10];case 10:return[2]}})})},Pushwoosh.prototype.initDriver=function(){return __awaiter(this,void 0,void 0,function(){var webSitePushId;return __generator(this,function(_a){switch(_a.label){case 0:return this.platformChecker.isSafari?[4,this.data.getInitParams()]:[3,2];case 1:if(!(webSitePushId=_a.sent().safariWebsitePushID))throw new Error("For work with Safari Push Notification add safariWebsitePushID to initParams!");return this.driver=new PushService_1.PushServiceSafari(this.api,this.data,{webSitePushId:webSitePushId}),[2];case 2:return this.platformChecker.isAvailableServiceWorker?(this.driver=new PushService_1.PushServiceDefault(this.api,this.data,{}),[2]):[2]}})})},Pushwoosh.prototype.sendPostEventVisitedPage=function(){return __awaiter(this,void 0,void 0,function(){var title,href;return __generator(this,function(_a){return title=window.document.title,href=window.location.href,this.api.postEvent(CONSTANTS.EVENT_PW_SITE_OPENED,{url:href,title:title,device_type:this.platformChecker.platform}),[2]})})},Pushwoosh.prototype.subscribeToLegacyEvents=function(type,handler){var _this=this;switch(type){case CONSTANTS.EVENT_ON_LOAD:handler();break;case CONSTANTS.EVENT_ON_READY:if(this.ready){handler(this.api);break}this.eventBus.addEventHandler("ready",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_REGISTER:this.eventBus.addEventHandler("register",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_SUBSCRIBE:this.eventBus.addEventHandler("subscribe",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_UNSUBSCRIBE:this.eventBus.addEventHandler("unsubscribe",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_SW_INIT_ERROR:this.eventBus.addEventHandler("initialize-service-worker-error",function(_a){var error=_a.error;return handler(_this.api,error)});break;case CONSTANTS.EVENT_ON_PUSH_DELIVERY:this.eventBus.addEventHandler("receive-push",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:this.eventBus.addEventHandler("open-notification",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:this.eventBus.addEventHandler("hide-notification",function(_a){var notification=_a.notification;return handler(_this.api,notification)});break;case CONSTANTS.EVENT_ON_CHANGE_COMMUNICATION_ENABLED:this.eventBus.addEventHandler("change-enabled-communication",function(_a){var isEnabled=_a.isEnabled;return handler(_this.api,isEnabled)});break;case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:this.eventBus.addEventHandler("receive-inbox-message",function(_a){var message=_a.message;return handler(_this.api,message)});break;case CONSTANTS.EVENT_ON_UPDATE_INBOX_MESSAGES:this.eventBus.addEventHandler("update-inbox-messages",function(_a){var messages=_a.messages;return handler(_this.api,messages)});break;case CONSTANTS.EVENT_ON_SHOW_NOTIFICATION_PERMISSION_DIALOG:this.eventBus.addEventHandler("show-notification-permission-dialog",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_HIDE_NOTIFICATION_PERMISSION_DIALOG:this.eventBus.addEventHandler("hide-notification-permission-dialog",function(_a){var permission=_a.permission;return handler(_this.api,permission)});break;case CONSTANTS.EVENT_ON_SHOW_SUBSCRIPTION_WIDGET:this.eventBus.addEventHandler("show-subscription-widget",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_HIDE_SUBSCRIPTION_WIDGET:this.eventBus.addEventHandler("hide-subscription-widget",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_DENIED:this.eventBus.addEventHandler("permission-denied",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_PROMPT:this.eventBus.addEventHandler("permission-default",function(){return handler(_this.api)});break;case CONSTANTS.EVENT_ON_PERMISSION_GRANTED:this.eventBus.addEventHandler("permission-granted",function(){return handler(_this.api)})}},Pushwoosh.prototype.emitLegacyEventsFromServiceWorker=function(type,payload){switch(type){case CONSTANTS.EVENT_ON_PUSH_DELIVERY:this.eventBus.dispatchEvent("receive-push",{notification:payload});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLICK:this.eventBus.dispatchEvent("open-notification",{notification:payload});break;case CONSTANTS.EVENT_ON_NOTIFICATION_CLOSE:this.eventBus.dispatchEvent("hide-notification",{notification:payload});break;case CONSTANTS.EVENT_ON_PUT_NEW_MESSAGE_TO_INBOX_STORE:this.eventBus.dispatchEvent("receive-inbox-message",{message:payload})}},Pushwoosh}();exports.default=Pushwoosh},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var PushServiceDefault_1=__webpack_require__(38);Object.defineProperty(exports,"PushServiceDefault",{enumerable:!0,get:function(){return PushServiceDefault_1.PushServiceDefault}});var PushServiceSafari_1=__webpack_require__(81);Object.defineProperty(exports,"PushServiceSafari",{enumerable:!0,get:function(){return PushServiceSafari_1.PushServiceSafari}})},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PushServiceSafari=void 0;var logger_1=__webpack_require__(3),CONSTANTS=__webpack_require__(1),PushServiceSafari=function(){function PushServiceSafari(api,data,config){this.api=api,this.config=config,this.data=data}return PushServiceSafari.prototype.getPermission=function(){return this.getPermissionInfo().permission},PushServiceSafari.prototype.checkIsPermissionGranted=function(){return this.getPermission()===CONSTANTS.PERMISSION_GRANTED},PushServiceSafari.prototype.checkIsPermissionDefault=function(){return this.getPermission()===CONSTANTS.PERMISSION_PROMPT},PushServiceSafari.prototype.checkIsManualUnsubscribed=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getStatusManualUnsubscribed()];case 1:return[2,_a.sent()]}})})},PushServiceSafari.prototype.askPermission=function(){return __awaiter(this,void 0,void 0,function(){var application,hwid,payload,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return application=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),payload={application:application,hwid:hwid},[2,new Promise(function(resolve){safari.pushNotification.requestPermission(_this.config.entrypoint||"https://cp.pushwoosh.com/json/1.3/safari",_this.config.webSitePushId,payload,function(){return resolve()})})]}})})},PushServiceSafari.prototype.getTokens=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.data.getTokens()]})})},PushServiceSafari.prototype.subscribe=function(){return __awaiter(this,void 0,void 0,function(){var deviceToken;return __generator(this,function(_a){switch(_a.label){case 0:return this.checkIsPermissionGranted()?[4,this.getPermissionInfo()]:(logger_1.Logger.error("You must have permission granted before subscribe!"),[2]);case 1:return deviceToken=_a.sent().deviceToken,[4,this.data.setTokens({pushToken:deviceToken})];case 2:return _a.sent(),[4,this.api.registerDevice()];case 3:return _a.sent(),[2]}})})},PushServiceSafari.prototype.unsubscribe=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.setTokens({})];case 1:return _a.sent(),[4,this.data.setStatusManualUnsubscribed(!0)];case 2:return _a.sent(),[4,this.api.unregisterDevice()];case 3:return _a.sent(),[2]}})})},PushServiceSafari.prototype.checkIsRegister=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.checkDeviceSubscribeForPushNotifications()]})})},PushServiceSafari.prototype.checkIsNeedResubscribe=function(){return __awaiter(this,void 0,void 0,function(){var savedWebSitePushId,isChangeWebSitePushId,lastPermission,permission;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getWebSitePushId()];case 1:return savedWebSitePushId=_a.sent(),isChangeWebSitePushId=void 0!==savedWebSitePushId&&this.config.webSitePushId!==savedWebSitePushId,[4,this.data.setWebSitePushId(this.config.webSitePushId)];case 2:return _a.sent(),[4,this.data.getLastPermissionStatus()];case 3:return lastPermission=_a.sent(),permission=this.getPermission(),lastPermission===permission?[3,5]:[4,this.data.setLastPermissionStatus(permission)];case 4:return _a.sent(),[2,!0];case 5:return[2,isChangeWebSitePushId]}})})},PushServiceSafari.prototype.getPermissionInfo=function(){return safari.pushNotification.permission(this.config.webSitePushId)},PushServiceSafari}();exports.PushServiceSafari=PushServiceSafari},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Popup=void 0;var Popup_helpers_1=__webpack_require__(83),Popup=function(){function Popup(namespace,onClickClose,config){if(this.namespace=namespace,this.onClickClose=onClickClose,this.config=__assign({position:"center"},config),!this.getRootElement()){var html=this.createHTML();document.body.insertAdjacentHTML("beforeend",html),this.rootElement=this.getElementWithCheckExist("root");var styles=Popup_helpers_1.getStyles(this.namespace);document.head.appendChild(styles)}this.rootElement.classList.add("pushwoosh-"+this.namespace+"-popup_position_"+this.config.position),this.wrapperElement=this.getElementWithCheckExist("wrapper"),this.innerElement=this.getElementWithCheckExist("inner"),this.bodyElement=this.getElementWithCheckExist("body"),this.closeElement=this.getElementWithCheckExist("close"),this.addEventListeners()}return Popup.prototype.updateContent=function(html){this.bodyElement.innerHTML=html},Popup.prototype.removeContent=function(){this.bodyElement.innerHTML=""},Popup.prototype.show=function(){document.body.style.overflow="hidden",this.rootElement.classList.add("pushwoosh-"+this.namespace+"-popup_show")},Popup.prototype.hide=function(){document.body.style.overflow="auto",this.rootElement.classList.remove("pushwoosh-"+this.namespace+"-popup_show"),this.onClickClose()},Popup.prototype.getRootElement=function(){return document.getElementById("pushwoosh-"+this.namespace+"-popup-root")},Popup.prototype.createHTML=function(){return'\n <div\n id="pushwoosh-'+this.namespace+'-popup-root"\n class="pushwoosh-'+this.namespace+'-popup"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-wrapper"\n class="pushwoosh-'+this.namespace+'-popup__wrapper"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-inner"\n class="pushwoosh-'+this.namespace+'-popup__inner"\n >\n <div\n id="pushwoosh-'+this.namespace+'-popup-body"\n class="pushwoosh-'+this.namespace+'-popup__body"\n >\n </div>\n </div>\n <button\n id="pushwoosh-'+this.namespace+'-popup-close"\n class="pushwoosh-'+this.namespace+'-popup__close"\n type="button"\n >\n </button>\n </div>\n </div>\n '},Popup.prototype.getElementWithCheckExist=function(type){var element=document.getElementById("pushwoosh-"+this.namespace+"-popup-"+type);if(!element)throw new Error("Can't find element by id \"pushwoosh-"+this.namespace+"-popup-"+type+'"');return element},Popup.prototype.addEventListeners=function(){var _this=this;this.closeElement.addEventListener("click",function(){_this.hide()}),document.addEventListener("click",function(event){var clickInInner=_this.innerElement.contains(event.target),clickInWrapper=_this.wrapperElement.contains(event.target);!clickInInner&&clickInWrapper&&_this.hide()})},Popup}();exports.Popup=Popup},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStyles=void 0,exports.getStyles=function(namespace){var styles=document.createElement("style");return styles.innerHTML="\n .pushwoosh-"+namespace+"-popup {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: none;\n z-index: 2147483648;\n opacity: 0.99;\n }\n \n .pushwoosh-"+namespace+"-popup_show {\n display: block;\n }\n \n .pushwoosh-"+namespace+"-popup__wrapper {\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, .2);\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__wrapper {\n text-align: center;\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__wrapper:after {\n content: '';\n display: inline-block;\n width: 1px;\n height: 100%;\n vertical-align: middle;\n }\n \n .pushwoosh-"+namespace+"-popup__inner {\n min-width: 320px;\n max-width: 380px;\n width: 100%;\n margin: 0 auto;\n }\n \n .pushwoosh-"+namespace+"-popup_position_center .pushwoosh-"+namespace+"-popup__inner {\n display: inline-block;\n vertical-align: middle;\n }\n \n .pushwoosh-"+namespace+"-popup__body {\n background: #fff;\n text-align: left;\n vertical-align: baseline;\n box-shadow: 0px 10px 16px rgba(0, 0, 0, 0.1), 0px 0px 6px rgba(0, 0, 0, 0.06);\n border-radius: 4px;\n }\n \n .pushwoosh-"+namespace+"-popup__close {\n appearance: none;\n border: none;\n background-color: transparent;\n box-shadow: none;\n position: absolute;\n top: 24px;\n right: 24px;\n width: 40px;\n height: 40px;\n cursor: pointer;\n }\n \n .pushwoosh-"+namespace+"-popup__close:before {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 30px;\n height: 2px;\n background-color: rgba(255, 255, 255, .8);\n transform: translateX(-50%) translateY(-50%) rotate(45deg);\n }\n \n .pushwoosh-"+namespace+"-popup__close:after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n width: 30px;\n height: 2px;\n background-color: rgba(255, 255, 255, .8);\n transform: translateX(-50%) translateY(-50%) rotate(-45deg);\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubscriptionSegmentsWidget=void 0;var getZip_1=__webpack_require__(48),logger_1=__webpack_require__(3),SubscriptionSegmentsWidget_helpers_1=__webpack_require__(124),SubscriptionSegmentsWidget=function(){function SubscriptionSegmentsWidget(eventBus,data,apiClient,api,popup,pw){this.eventBus=eventBus,this.data=data,this.apiClient=apiClient,this.api=api,this.popup=popup,this.pw=pw}return SubscriptionSegmentsWidget.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var inAppCode,richMediaUrl,content,segments,sortedSegments,html,styles,denyElement,acceptElement,_a,_b,_c,_d,_this=this;return __generator(this,function(_e){switch(_e.label){case 0:return[4,this.getInAppCode()];case 1:return(inAppCode=_e.sent())?[4,this.getRichMediaUrlByInAppCode(inAppCode)]:(logger_1.Logger.error("Internal error: Can't find in-app code for build subscription segment widget!"),[2]);case 2:return(richMediaUrl=_e.sent())?[4,this.getDynamicContent(richMediaUrl)]:(logger_1.Logger.error("Internal error: Can't find rich media url for build subscription segment widget!"),[2]);case 3:return content=_e.sent(),[4,this.getSegments()];case 4:return segments=_e.sent(),content&&segments?(sortedSegments=segments.sort(function(segment1,segment2){return segment1.position-segment2.position}),html=SubscriptionSegmentsWidget_helpers_1.getHTML(content,sortedSegments),styles=SubscriptionSegmentsWidget_helpers_1.getStyles(content),document.head.appendChild(styles),this.popup.updateContent(html),denyElement=document.getElementById("pushwoosh-subscription-segments-deny"),acceptElement=document.getElementById("pushwoosh-subscription-segments-accept"),denyElement&&denyElement.addEventListener("click",function(){_this.hidePopup()}),acceptElement&&acceptElement.addEventListener("click",function(){var result=[],segments=document.getElementsByClassName("pushwoosh-subscription-segments__field");if(_this.hidePopup(),segments){for(var index=0;index<segments.length;index++){var field=segments[index];field.checked&&result.push(field.value)}_this.api.setTags({"Subscription Segments":result}),_this.pw.subscribe()}}),this.showPopup(),_b=(_a=this.apiClient).postEvent,_c={application:"34B24-F3ED9",event:"SubscriptionTopicUsed",userId:"kkonev@pushwoosh.com"},_d={},[4,this.data.getApplicationCode()]):(logger_1.Logger.error("Internal error: Can't get content or segments for build subscription segment widget!"),[2]);case 5:return _b.apply(_a,[(_c.attributes=(_d.appCode=_e.sent(),_d),_c)]),[2]}})})},SubscriptionSegmentsWidget.prototype.showPopup=function(){this.eventBus.dispatchEvent("show-subscription-widget",{}),this.popup.show()},SubscriptionSegmentsWidget.prototype.hidePopup=function(){this.popup.hide()},SubscriptionSegmentsWidget.prototype.getRichMediaUrlByInAppCode=function(code){return __awaiter(this,void 0,void 0,function(){var inApps,inApp;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getInApps()];case 1:return(inApps=_a.sent())&&(inApp=inApps.find(function(inApp){return inApp.code===code}))?[2,inApp.url]:[2]}})})},SubscriptionSegmentsWidget.prototype.getInAppCode=function(){return __awaiter(this,void 0,void 0,function(){var application,hwid,userId,deviceType,deviceModel,language,version,timezone,date,time,timestampUTC,timestampCurrent,response;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getApplicationCode()];case 1:return application=_a.sent(),[4,this.data.getHwid()];case 2:return hwid=_a.sent(),[4,this.data.getUserId()];case 3:return userId=_a.sent(),[4,this.data.getDeviceType()];case 4:return deviceType=_a.sent(),[4,this.data.getDeviceModel()];case 5:return deviceModel=_a.sent(),[4,this.data.getLanguage()];case 6:return language=_a.sent(),[4,this.data.getSdkVersion()];case 7:return version=_a.sent(),timezone=60*-(new Date).getTimezoneOffset(),date=new Date,time=date.getTime(),timestampUTC=Math.floor(time/1e3),timestampCurrent=timestampUTC-date.getTimezoneOffset()/60*3600,[4,this.apiClient.postEvent({application:application,hwid:hwid,userId:userId||hwid,device_type:deviceType,device_model:deviceModel,language:language,v:version,timezone:timezone,timestampUTC:timestampUTC,timestampCurrent:timestampCurrent,event:"Subscription Segments",attributes:{}})];case 8:return[2,(response=_a.sent())&&response.code]}})})},SubscriptionSegmentsWidget.prototype.getSegments=function(){return __awaiter(this,void 0,void 0,function(){var features;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.data.getFeatures()];case 1:return[2,(features=_a.sent())&&features.channels]}})})},SubscriptionSegmentsWidget.prototype.getDynamicContent=function(url){return __awaiter(this,void 0,void 0,function(){var jszip,data,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:return[4,getZip_1.getZip(url)];case 1:return jszip=_c.sent(),_b=(_a=JSON).parse,[4,jszip.file("pushwoosh.json").async("text")];case 2:return[2,(data=_b.apply(_a,[_c.sent()]))&&data.localization&&data.default_language&&data.localization[data.default_language]]}})})},SubscriptionSegmentsWidget}();exports.SubscriptionSegmentsWidget=SubscriptionSegmentsWidget},function(module,exports,__webpack_require__){"use strict";function JSZip(){if(!(this instanceof JSZip))return new JSZip;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var newObj=new JSZip;for(var i in this)"function"!=typeof this[i]&&(newObj[i]=this[i]);return newObj}}JSZip.prototype=__webpack_require__(86),JSZip.prototype.loadAsync=__webpack_require__(119),JSZip.support=__webpack_require__(7),JSZip.defaults=__webpack_require__(59),JSZip.version="3.2.0",JSZip.loadAsync=function(content,options){return(new JSZip).loadAsync(content,options)},JSZip.external=__webpack_require__(24),module.exports=JSZip},function(module,exports,__webpack_require__){"use strict";var utf8=__webpack_require__(14),utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),StreamHelper=__webpack_require__(58),defaults=__webpack_require__(59),CompressedObject=__webpack_require__(42),ZipObject=__webpack_require__(105),generate=__webpack_require__(106),nodejsUtils=__webpack_require__(29),NodejsStreamInputAdapter=__webpack_require__(118),fileAdd=function(name,data,originalOptions){var parent,dataType=utils.getTypeOf(data),o=utils.extend(originalOptions||{},defaults);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(name=forceTrailingSlash(name)),o.createFolders&&(parent=parentFolder(name))&&folderAdd.call(this,parent,!0);var isUnicodeString="string"===dataType&&!1===o.binary&&!1===o.base64;originalOptions&&void 0!==originalOptions.binary||(o.binary=!isUnicodeString),(data instanceof CompressedObject&&0===data.uncompressedSize||o.dir||!data||0===data.length)&&(o.base64=!1,o.binary=!0,data="",o.compression="STORE",dataType="string");var zipObjectContent=null;zipObjectContent=data instanceof CompressedObject||data instanceof GenericWorker?data:nodejsUtils.isNode&&nodejsUtils.isStream(data)?new NodejsStreamInputAdapter(name,data):utils.prepareContent(name,data,o.binary,o.optimizedBinaryString,o.base64);var object=new ZipObject(name,zipObjectContent,o);this.files[name]=object},parentFolder=function(path){"/"===path.slice(-1)&&(path=path.substring(0,path.length-1));var lastSlash=path.lastIndexOf("/");return lastSlash>0?path.substring(0,lastSlash):""},forceTrailingSlash=function(path){return"/"!==path.slice(-1)&&(path+="/"),path},folderAdd=function(name,createFolders){return createFolders=void 0!==createFolders?createFolders:defaults.createFolders,name=forceTrailingSlash(name),this.files[name]||fileAdd.call(this,name,null,{dir:!0,createFolders:createFolders}),this.files[name]};function isRegExp(object){return"[object RegExp]"===Object.prototype.toString.call(object)}var out={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(cb){var filename,relativePath,file;for(filename in this.files)this.files.hasOwnProperty(filename)&&(file=this.files[filename],(relativePath=filename.slice(this.root.length,filename.length))&&filename.slice(0,this.root.length)===this.root&&cb(relativePath,file))},filter:function(search){var result=[];return this.forEach(function(relativePath,entry){search(relativePath,entry)&&result.push(entry)}),result},file:function(name,data,o){if(1===arguments.length){if(isRegExp(name)){var regexp=name;return this.filter(function(relativePath,file){return!file.dir&&regexp.test(relativePath)})}var obj=this.files[this.root+name];return obj&&!obj.dir?obj:null}return name=this.root+name,fileAdd.call(this,name,data,o),this},folder:function(arg){if(!arg)return this;if(isRegExp(arg))return this.filter(function(relativePath,file){return file.dir&&arg.test(relativePath)});var name=this.root+arg,newFolder=folderAdd.call(this,name),ret=this.clone();return ret.root=newFolder.name,ret},remove:function(name){name=this.root+name;var file=this.files[name];if(file||("/"!==name.slice(-1)&&(name+="/"),file=this.files[name]),file&&!file.dir)delete this.files[name];else for(var kids=this.filter(function(relativePath,file){return file.name.slice(0,name.length)===name}),i=0;i<kids.length;i++)delete this.files[kids[i].name];return this},generate:function(options){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(options){var worker,opts={};try{if((opts=utils.extend(options||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:utf8.utf8encode})).type=opts.type.toLowerCase(),opts.compression=opts.compression.toUpperCase(),"binarystring"===opts.type&&(opts.type="string"),!opts.type)throw new Error("No output type specified.");utils.checkSupport(opts.type),"darwin"!==opts.platform&&"freebsd"!==opts.platform&&"linux"!==opts.platform&&"sunos"!==opts.platform||(opts.platform="UNIX"),"win32"===opts.platform&&(opts.platform="DOS");var comment=opts.comment||this.comment||"";worker=generate.generateWorker(this,opts,comment)}catch(e){(worker=new GenericWorker("error")).error(e)}return new StreamHelper(worker,opts.type||"string",opts.mimeType)},generateAsync:function(options,onUpdate){return this.generateInternalStream(options).accumulate(onUpdate)},generateNodeStream:function(options,onUpdate){return(options=options||{}).type||(options.type="nodebuffer"),this.generateInternalStream(options).toNodejsStream(onUpdate)}};module.exports=out},function(module,exports,__webpack_require__){"use strict";exports.byteLength=function(b64){var lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1];return 3*(validLen+placeHoldersLen)/4-placeHoldersLen},exports.toByteArray=function(b64){var tmp,i,lens=getLens(b64),validLen=lens[0],placeHoldersLen=lens[1],arr=new Arr(function(b64,validLen,placeHoldersLen){return 3*(validLen+placeHoldersLen)/4-placeHoldersLen}(0,validLen,placeHoldersLen)),curByte=0,len=placeHoldersLen>0?validLen-4:validLen;for(i=0;i<len;i+=4)tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)],arr[curByte++]=tmp>>16&255,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp;2===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4,arr[curByte++]=255&tmp);1===placeHoldersLen&&(tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2,arr[curByte++]=tmp>>8&255,arr[curByte++]=255&tmp);return arr},exports.fromByteArray=function(uint8){for(var tmp,len=uint8.length,extraBytes=len%3,parts=[],i=0,len2=len-extraBytes;i<len2;i+=16383)parts.push(encodeChunk(uint8,i,i+16383>len2?len2:i+16383));1===extraBytes?(tmp=uint8[len-1],parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")):2===extraBytes&&(tmp=(uint8[len-2]<<8)+uint8[len-1],parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"="));return parts.join("")};for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(b64){var len=b64.length;if(len%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var validLen=b64.indexOf("=");return-1===validLen&&(validLen=len),[validLen,validLen===len?0:4-validLen%4]}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[63&num]}function encodeChunk(uint8,start,end){for(var tmp,output=[],i=start;i<end;i+=3)tmp=(uint8[i]<<16&16711680)+(uint8[i+1]<<8&65280)+(255&uint8[i+2]),output.push(tripletToBase64(tmp));return output.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63},function(module,exports){
9
9
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
10
- exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),(value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias))*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;eLen>0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){module.exports=Stream;var EE=__webpack_require__(41).EventEmitter;function Stream(){EE.call(this)}__webpack_require__(15)(Stream,EE),Stream.Readable=__webpack_require__(42),Stream.Writable=__webpack_require__(96),Stream.Duplex=__webpack_require__(97),Stream.Transform=__webpack_require__(98),Stream.PassThrough=__webpack_require__(99),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&!1===options.end||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports){},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(30).Buffer,util=__webpack_require__(92);function copyBuffer(src,target,offset){src.copy(target,offset)}module.exports=function(){function BufferList(){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";if(!global.setImmediate){var registerImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?registerImmediate=function(handle){process.nextTick(function(){runIfPresent(handle)})}:function(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}()?function(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),registerImmediate=function(handle){global.postMessage(messagePrefix+handle,"*")}}():global.MessageChannel?function(){var channel=new MessageChannel;channel.port1.onmessage=function(event){runIfPresent(event.data)},registerImmediate=function(handle){channel.port2.postMessage(handle)}}():doc&&"onreadystatechange"in doc.createElement("script")?function(){var html=doc.documentElement;registerImmediate=function(handle){var script=doc.createElement("script");script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script)}}():registerImmediate=function(handle){setTimeout(runIfPresent,0,handle)},attachTo.setImmediate=function(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i<args.length;i++)args[i]=arguments[i+1];var task={callback:callback,args:args};return tasksByHandle[nextHandle]=task,registerImmediate(nextHandle),nextHandle++},attachTo.clearImmediate=clearImmediate}function clearImmediate(handle){delete tasksByHandle[handle]}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(runIfPresent,0,handle);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{!function(task){var callback=task.callback,args=task.args;switch(args.length){case 0:callback();break;case 1:callback(args[0]);break;case 2:callback(args[0],args[1]);break;case 3:callback(args[0],args[1],args[2]);break;default:callback.apply(undefined,args)}}(task)}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}}("undefined"==typeof self?void 0===global?this:global:self)}).call(this,__webpack_require__(11),__webpack_require__(24))},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(58),util=Object.create(__webpack_require__(25));function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(15),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(43)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(12)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(42).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(42).PassThrough},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){module.exports="function"==typeof setImmediate?setImmediate:function(){var args=[].slice.apply(arguments);args.splice(1,0,0),setTimeout.apply(null,args)}}).call(this,__webpack_require__(56).setImmediate)},function(module,exports,__webpack_require__){"use strict";var immediate=__webpack_require__(102);function INTERNAL(){}var handlers={},REJECTED=["REJECTED"],FULFILLED=["FULFILLED"],PENDING=["PENDING"];function Promise(resolver){if("function"!=typeof resolver)throw new TypeError("resolver must be a function");this.state=PENDING,this.queue=[],this.outcome=void 0,resolver!==INTERNAL&&safelyResolveThenable(this,resolver)}function QueueItem(promise,onFulfilled,onRejected){this.promise=promise,"function"==typeof onFulfilled&&(this.onFulfilled=onFulfilled,this.callFulfilled=this.otherCallFulfilled),"function"==typeof onRejected&&(this.onRejected=onRejected,this.callRejected=this.otherCallRejected)}function unwrap(promise,func,value){immediate(function(){var returnValue;try{returnValue=func(value)}catch(e){return handlers.reject(promise,e)}returnValue===promise?handlers.reject(promise,new TypeError("Cannot resolve promise with itself")):handlers.resolve(promise,returnValue)})}function getThen(obj){var then=obj&&obj.then;if(obj&&("object"==typeof obj||"function"==typeof obj)&&"function"==typeof then)return function(){then.apply(obj,arguments)}}function safelyResolveThenable(self,thenable){var called=!1;function onError(value){called||(called=!0,handlers.reject(self,value))}function onSuccess(value){called||(called=!0,handlers.resolve(self,value))}var result=tryCatch(function(){thenable(onSuccess,onError)});"error"===result.status&&onError(result.value)}function tryCatch(func,value){var out={};try{out.value=func(value),out.status="success"}catch(e){out.status="error",out.value=e}return out}module.exports=Promise,Promise.prototype.finally=function(callback){if("function"!=typeof callback)return this;var p=this.constructor;return this.then(function(value){return p.resolve(callback()).then(function(){return value})},function(reason){return p.resolve(callback()).then(function(){throw reason})})},Promise.prototype.catch=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){if("function"!=typeof onFulfilled&&this.state===FULFILLED||"function"!=typeof onRejected&&this.state===REJECTED)return this;var promise=new this.constructor(INTERNAL);this.state!==PENDING?unwrap(promise,this.state===FULFILLED?onFulfilled:onRejected,this.outcome):this.queue.push(new QueueItem(promise,onFulfilled,onRejected));return promise},QueueItem.prototype.callFulfilled=function(value){handlers.resolve(this.promise,value)},QueueItem.prototype.otherCallFulfilled=function(value){unwrap(this.promise,this.onFulfilled,value)},QueueItem.prototype.callRejected=function(value){handlers.reject(this.promise,value)},QueueItem.prototype.otherCallRejected=function(value){unwrap(this.promise,this.onRejected,value)},handlers.resolve=function(self,value){var result=tryCatch(getThen,value);if("error"===result.status)return handlers.reject(self,result.value);var thenable=result.value;if(thenable)safelyResolveThenable(self,thenable);else{self.state=FULFILLED,self.outcome=value;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callFulfilled(value)}return self},handlers.reject=function(self,error){self.state=REJECTED,self.outcome=error;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callRejected(error);return self},Promise.resolve=function(value){if(value instanceof this)return value;return handlers.resolve(new this(INTERNAL),value)},Promise.reject=function(reason){var promise=new this(INTERNAL);return handlers.reject(promise,reason)},Promise.all=function(iterable){var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);var values=new Array(len),resolved=0,i=-1,promise=new this(INTERNAL);for(;++i<len;)allResolver(iterable[i],i);return promise;function allResolver(value,i){self.resolve(value).then(function(outValue){values[i]=outValue,++resolved!==len||called||(called=!0,handlers.resolve(promise,values))},function(error){called||(called=!0,handlers.reject(promise,error))})}},Promise.race=function(iterable){var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);var i=-1,promise=new this(INTERNAL);for(;++i<len;)resolver(iterable[i]);return promise;function resolver(value){self.resolve(value).then(function(response){called||(called=!0,handlers.resolve(promise,response))},function(error){called||(called=!0,handlers.reject(promise,error))})}}},function(module,exports,__webpack_require__){"use strict";(function(global){var scheduleDrain,draining,Mutation=global.MutationObserver||global.WebKitMutationObserver;if(Mutation){var called=0,observer=new Mutation(nextTick),element=global.document.createTextNode("");observer.observe(element,{characterData:!0}),scheduleDrain=function(){element.data=called=++called%2}}else if(global.setImmediate||void 0===global.MessageChannel)scheduleDrain="document"in global&&"onreadystatechange"in global.document.createElement("script")?function(){var scriptEl=global.document.createElement("script");scriptEl.onreadystatechange=function(){nextTick(),scriptEl.onreadystatechange=null,scriptEl.parentNode.removeChild(scriptEl),scriptEl=null},global.document.documentElement.appendChild(scriptEl)}:function(){setTimeout(nextTick,0)};else{var channel=new global.MessageChannel;channel.port1.onmessage=nextTick,scheduleDrain=function(){channel.port2.postMessage(0)}}var queue=[];function nextTick(){var i,oldQueue;draining=!0;for(var len=queue.length;len;){for(oldQueue=queue,queue=[],i=-1;++i<len;)oldQueue[i]();len=queue.length}draining=!1}module.exports=function(task){1!==queue.push(task)||draining||scheduleDrain()}}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2),utils=__webpack_require__(0);function ConvertWorker(destType){GenericWorker.call(this,"ConvertWorker to "+destType),this.destType=destType}utils.inherits(ConvertWorker,GenericWorker),ConvertWorker.prototype.processChunk=function(chunk){this.push({data:utils.transformTo(this.destType,chunk.data),meta:chunk.meta})},module.exports=ConvertWorker},function(module,exports,__webpack_require__){"use strict";var Readable=__webpack_require__(52).Readable;function NodejsStreamOutputAdapter(helper,options,updateCb){Readable.call(this,options),this._helper=helper;var self=this;helper.on("data",function(data,meta){self.push(data)||self._helper.pause(),updateCb&&updateCb(meta)}).on("error",function(e){self.emit("error",e)}).on("end",function(){self.push(null)})}__webpack_require__(0).inherits(NodejsStreamOutputAdapter,Readable),NodejsStreamOutputAdapter.prototype._read=function(){this._helper.resume()},module.exports=NodejsStreamOutputAdapter},function(module,exports,__webpack_require__){"use strict";var StreamHelper=__webpack_require__(60),DataWorker=__webpack_require__(62),utf8=__webpack_require__(14),CompressedObject=__webpack_require__(44),GenericWorker=__webpack_require__(2),ZipObject=function(name,data,options){this.name=name,this.dir=options.dir,this.date=options.date,this.comment=options.comment,this.unixPermissions=options.unixPermissions,this.dosPermissions=options.dosPermissions,this._data=data,this._dataBinary=options.binary,this.options={compression:options.compression,compressionOptions:options.compressionOptions}};ZipObject.prototype={internalStream:function(type){var result=null,outputType="string";try{if(!type)throw new Error("No output type specified.");var askUnicodeString="string"===(outputType=type.toLowerCase())||"text"===outputType;"binarystring"!==outputType&&"text"!==outputType||(outputType="string"),result=this._decompressWorker();var isUnicodeString=!this._dataBinary;isUnicodeString&&!askUnicodeString&&(result=result.pipe(new utf8.Utf8EncodeWorker)),!isUnicodeString&&askUnicodeString&&(result=result.pipe(new utf8.Utf8DecodeWorker))}catch(e){(result=new GenericWorker("error")).error(e)}return new StreamHelper(result,outputType,"")},async:function(type,onUpdate){return this.internalStream(type).accumulate(onUpdate)},nodeStream:function(type,onUpdate){return this.internalStream(type||"nodebuffer").toNodejsStream(onUpdate)},_compressWorker:function(compression,compressionOptions){if(this._data instanceof CompressedObject&&this._data.compression.magic===compression.magic)return this._data.getCompressedWorker();var result=this._decompressWorker();return this._dataBinary||(result=result.pipe(new utf8.Utf8EncodeWorker)),CompressedObject.createWorkerFrom(result,compression,compressionOptions)},_decompressWorker:function(){return this._data instanceof CompressedObject?this._data.getContentWorker():this._data instanceof GenericWorker?this._data:new DataWorker(this._data)}};for(var removedMethods=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],removedFn=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<removedMethods.length;i++)ZipObject.prototype[removedMethods[i]]=removedFn;module.exports=ZipObject},function(module,exports,__webpack_require__){"use strict";var compressions=__webpack_require__(65),ZipFileWorker=__webpack_require__(117);exports.generateWorker=function(zip,options,comment){var zipFileWorker=new ZipFileWorker(options.streamFiles,comment,options.platform,options.encodeFileName),entriesCount=0;try{zip.forEach(function(relativePath,file){entriesCount++;var compression=function(fileCompression,zipCompression){var compressionName=fileCompression||zipCompression,compression=compressions[compressionName];if(!compression)throw new Error(compressionName+" is not a valid compression method !");return compression}(file.options.compression,options.compression),compressionOptions=file.options.compressionOptions||options.compressionOptions||{},dir=file.dir,date=file.date;file._compressWorker(compression,compressionOptions).withStreamInfo("file",{name:relativePath,dir:dir,date:date,comment:file.comment||"",unixPermissions:file.unixPermissions,dosPermissions:file.dosPermissions}).pipe(zipFileWorker)}),zipFileWorker.entriesCount=entriesCount}catch(e){zipFileWorker.error(e)}return zipFileWorker}},function(module,exports,__webpack_require__){"use strict";var USE_TYPEDARRAY="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,pako=__webpack_require__(108),utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),ARRAY_TYPE=USE_TYPEDARRAY?"uint8array":"array";function FlateWorker(action,options){GenericWorker.call(this,"FlateWorker/"+action),this._pako=null,this._pakoAction=action,this._pakoOptions=options,this.meta={}}exports.magic="\b\0",utils.inherits(FlateWorker,GenericWorker),FlateWorker.prototype.processChunk=function(chunk){this.meta=chunk.meta,null===this._pako&&this._createPako(),this._pako.push(utils.transformTo(ARRAY_TYPE,chunk.data),!1)},FlateWorker.prototype.flush=function(){GenericWorker.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},FlateWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this._pako=null},FlateWorker.prototype._createPako=function(){this._pako=new pako[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var self=this;this._pako.onData=function(data){self.push({data:data,meta:self.meta})}},exports.compressWorker=function(compressionOptions){return new FlateWorker("Deflate",compressionOptions)},exports.uncompressWorker=function(){return new FlateWorker("Inflate",{})}},function(module,exports,__webpack_require__){"use strict";var pako={};(0,__webpack_require__(8).assign)(pako,__webpack_require__(109),__webpack_require__(112),__webpack_require__(70)),module.exports=pako},function(module,exports,__webpack_require__){"use strict";var zlib_deflate=__webpack_require__(110),utils=__webpack_require__(8),strings=__webpack_require__(68),msg=__webpack_require__(46),ZStream=__webpack_require__(69),toString=Object.prototype.toString,Z_OK=0,Z_DEFAULT_COMPRESSION=-1,Z_DEFAULT_STRATEGY=0,Z_DEFLATED=8;function Deflate(options){if(!(this instanceof Deflate))return new Deflate(options);this.options=utils.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY,to:""},options||{});var opt=this.options;opt.raw&&opt.windowBits>0?opt.windowBits=-opt.windowBits:opt.gzip&&opt.windowBits>0&&opt.windowBits<16&&(opt.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK)throw new Error(msg[status]);if(opt.header&&zlib_deflate.deflateSetHeader(this.strm,opt.header),opt.dictionary){var dict;if(dict="string"==typeof opt.dictionary?strings.string2buf(opt.dictionary):"[object ArrayBuffer]"===toString.call(opt.dictionary)?new Uint8Array(opt.dictionary):opt.dictionary,(status=zlib_deflate.deflateSetDictionary(this.strm,dict))!==Z_OK)throw new Error(msg[status]);this._dict_set=!0}}function deflate(input,options){var deflator=new Deflate(options);if(deflator.push(input,!0),deflator.err)throw deflator.msg||msg[deflator.err];return deflator.result}Deflate.prototype.push=function(data,mode){var status,_mode,strm=this.strm,chunkSize=this.options.chunkSize;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?4:0,"string"==typeof data?strm.input=strings.string2buf(data):"[object ArrayBuffer]"===toString.call(data)?strm.input=new Uint8Array(data):strm.input=data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),1!==(status=zlib_deflate.deflate(strm,_mode))&&status!==Z_OK)return this.onEnd(status),this.ended=!0,!1;0!==strm.avail_out&&(0!==strm.avail_in||4!==_mode&&2!==_mode)||("string"===this.options.to?this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out))):this.onData(utils.shrinkBuf(strm.output,strm.next_out)))}while((strm.avail_in>0||0===strm.avail_out)&&1!==status);return 4===_mode?(status=zlib_deflate.deflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===Z_OK):2!==_mode||(this.onEnd(Z_OK),strm.avail_out=0,!0)},Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Deflate.prototype.onEnd=function(status){status===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Deflate=Deflate,exports.deflate=deflate,exports.deflateRaw=function(input,options){return(options=options||{}).raw=!0,deflate(input,options)},exports.gzip=function(input,options){return(options=options||{}).gzip=!0,deflate(input,options)}},function(module,exports,__webpack_require__){"use strict";var configuration_table,utils=__webpack_require__(8),trees=__webpack_require__(111),adler32=__webpack_require__(66),crc32=__webpack_require__(67),msg=__webpack_require__(46),Z_NO_FLUSH=0,Z_PARTIAL_FLUSH=1,Z_FULL_FLUSH=3,Z_FINISH=4,Z_BLOCK=5,Z_OK=0,Z_STREAM_END=1,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_BUF_ERROR=-5,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_RLE=3,Z_FIXED=4,Z_DEFAULT_STRATEGY=0,Z_UNKNOWN=2,Z_DEFLATED=8,MAX_MEM_LEVEL=9,MAX_WBITS=15,DEF_MEM_LEVEL=8,L_CODES=286,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3;function err(strm,errorCode){return strm.msg=msg[errorCode],errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function flush_pending(strm){var s=strm.state,len=s.pending;len>strm.avail_out&&(len=strm.avail_out),0!==len&&(utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out),strm.next_out+=len,s.pending_out+=len,strm.total_out+=len,strm.avail_out-=len,s.pending-=len,0===s.pending&&(s.pending_out=0))}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last),s.block_start=s.strstart,flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255,s.pending_buf[s.pending++]=255&b}function read_buf(strm,buf,start,size){var len=strm.avail_in;return len>size&&(len=size),0===len?0:(strm.avail_in-=len,utils.arraySet(buf,strm.input,strm.next_in,len,start),1===strm.state.wrap?strm.adler=adler32(strm.adler,buf,len,start):2===strm.state.wrap&&(strm.adler=crc32(strm.adler,buf,len,start)),strm.next_in+=len,strm.total_in+=len,len)}function longest_match(s,cur_match){var match,len,chain_length=s.max_chain_length,scan=s.strstart,best_len=s.prev_length,nice_match=s.nice_match,limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0,_win=s.window,wmask=s.w_mask,prev=s.prev,strend=s.strstart+MAX_MATCH,scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len];s.prev_length>=s.good_match&&(chain_length>>=2),nice_match>s.lookahead&&(nice_match=s.lookahead);do{if(_win[(match=cur_match)+best_len]===scan_end&&_win[match+best_len-1]===scan_end1&&_win[match]===_win[scan]&&_win[++match]===_win[scan+1]){scan+=2,match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scan<strend);if(len=MAX_MATCH-(strend-scan),scan=strend-MAX_MATCH,len>best_len){if(s.match_start=cur_match,best_len=len,len>=nice_match)break;scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len]}}}while((cur_match=prev[cur_match&wmask])>limit&&0!=--chain_length);return best_len<=s.lookahead?best_len:s.lookahead}function fill_window(s){var p,n,m,more,str,_w_size=s.w_size;do{if(more=s.window_size-s.lookahead-s.strstart,s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0),s.match_start-=_w_size,s.strstart-=_w_size,s.block_start-=_w_size,p=n=s.hash_size;do{m=s.head[--p],s.head[p]=m>=_w_size?m-_w_size:0}while(--n);p=n=_w_size;do{m=s.prev[--p],s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(0===s.strm.avail_in)break;if(n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more),s.lookahead+=n,s.lookahead+s.insert>=MIN_MATCH)for(str=s.strstart-s.insert,s.ins_h=s.window[str],s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+1])&s.hash_mask;s.insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++,s.insert--,!(s.lookahead+s.insert<MIN_MATCH)););}while(s.lookahead<MIN_LOOKAHEAD&&0!==s.strm.avail_in)}function deflate_fast(s,flush){for(var hash_head,bflush;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),0!==hash_head&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head)),s.match_length>=MIN_MATCH)if(bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++,s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart}while(0!=--s.match_length);s.strstart++}else s.strstart+=s.match_length,s.match_length=0,s.ins_h=s.window[s.strstart],s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;else bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++;if(bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_slow(s,flush){for(var hash_head,bflush,max_insert;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),s.prev_length=s.match_length,s.prev_match=s.match_start,s.match_length=MIN_MATCH-1,0!==hash_head&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head),s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096)&&(s.match_length=MIN_MATCH-1)),s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH,bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH),s.lookahead-=s.prev_length-1,s.prev_length-=2;do{++s.strstart<=max_insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart)}while(0!=--s.prev_length);if(s.match_available=0,s.match_length=MIN_MATCH-1,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}else if(s.match_available){if((bflush=trees._tr_tally(s,0,s.window[s.strstart-1]))&&flush_block_only(s,!1),s.strstart++,s.lookahead--,0===s.strm.avail_out)return BS_NEED_MORE}else s.match_available=1,s.strstart++,s.lookahead--}return s.match_available&&(bflush=trees._tr_tally(s,0,s.window[s.strstart-1]),s.match_available=0),s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length,this.max_lazy=max_lazy,this.nice_length=nice_length,this.max_chain=max_chain,this.func=func}function deflateResetKeep(strm){var s;return strm&&strm.state?(strm.total_in=strm.total_out=0,strm.data_type=Z_UNKNOWN,(s=strm.state).pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?INIT_STATE:BUSY_STATE,strm.adler=2===s.wrap?0:1,s.last_flush=Z_NO_FLUSH,trees._tr_init(s),Z_OK):err(strm,Z_STREAM_ERROR)}function deflateReset(strm){var ret=deflateResetKeep(strm);return ret===Z_OK&&function(s){s.window_size=2*s.w_size,zero(s.head),s.max_lazy_match=configuration_table[s.level].max_lazy,s.good_match=configuration_table[s.level].good_length,s.nice_match=configuration_table[s.level].nice_length,s.max_chain_length=configuration_table[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,s.ins_h=0}(strm.state),ret}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION&&(level=6),windowBits<0?(wrap=0,windowBits=-windowBits):windowBits>15&&(wrap=2,windowBits-=16),memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm,Z_STREAM_ERROR);8===windowBits&&(windowBits=9);var s=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new utils.Buf16(2*HEAP_SIZE),this.dyn_dtree=new utils.Buf16(2*(2*D_CODES+1)),this.bl_tree=new utils.Buf16(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new utils.Buf16(MAX_BITS+1),this.heap=new utils.Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new utils.Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return strm.state=s,s.strm=strm,s.wrap=wrap,s.gzhead=null,s.w_bits=windowBits,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=memLevel+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new utils.Buf8(2*s.w_size),s.head=new utils.Buf16(s.hash_size),s.prev=new utils.Buf16(s.w_size),s.lit_bufsize=1<<memLevel+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new utils.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=level,s.strategy=strategy,s.method=method,deflateReset(strm)}configuration_table=[new Config(0,0,0,0,function(s,flush){var max_block_size=65535;for(max_block_size>s.pending_buf_size-5&&(max_block_size=s.pending_buf_size-5);;){if(s.lookahead<=1){if(fill_window(s),0===s.lookahead&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}s.strstart+=s.lookahead,s.lookahead=0;var max_start=s.block_start+max_block_size;if((0===s.strstart||s.strstart>=max_start)&&(s.lookahead=s.strstart-max_start,s.strstart=max_start,flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE;if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):(s.strstart>s.block_start&&(flush_block_only(s,!1),s.strm.avail_out),BS_NEED_MORE)}),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],exports.deflateInit=function(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)},exports.deflateInit2=deflateInit2,exports.deflateReset=deflateReset,exports.deflateResetKeep=deflateResetKeep,exports.deflateSetHeader=function(strm,head){return strm&&strm.state?2!==strm.state.wrap?Z_STREAM_ERROR:(strm.state.gzhead=head,Z_OK):Z_STREAM_ERROR},exports.deflate=function(strm,flush){var old_flush,s,beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;if(s=strm.state,!strm.output||!strm.input&&0!==strm.avail_in||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm,0===strm.avail_out?Z_BUF_ERROR:Z_STREAM_ERROR);if(s.strm=strm,old_flush=s.last_flush,s.last_flush=flush,s.status===INIT_STATE)if(2===s.wrap)strm.adler=0,put_byte(s,31),put_byte(s,139),put_byte(s,8),s.gzhead?(put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),put_byte(s,255&s.gzhead.time),put_byte(s,s.gzhead.time>>8&255),put_byte(s,s.gzhead.time>>16&255),put_byte(s,s.gzhead.time>>24&255),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(put_byte(s,255&s.gzhead.extra.length),put_byte(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=EXTRA_STATE):(put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,OS_CODE),s.status=BUSY_STATE);else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8;header|=(s.strategy>=Z_HUFFMAN_ONLY||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(header|=PRESET_DICT),header+=31-header%31,s.status=BUSY_STATE,putShortMSB(s,header),0!==s.strstart&&(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){for(beg=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending!==s.pending_buf_size));)put_byte(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=NAME_STATE)}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.gzindex=0,s.status=COMMENT_STATE)}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.status=HCRC_STATE)}else s.status=HCRC_STATE;if(s.status===HCRC_STATE&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&flush_pending(strm),s.pending+2<=s.pending_buf_size&&(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),strm.adler=0,s.status=BUSY_STATE)):s.status=BUSY_STATE),0!==s.pending){if(flush_pending(strm),0===strm.avail_out)return s.last_flush=-1,Z_OK}else if(0===strm.avail_in&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&0!==strm.avail_in)return err(strm,Z_BUF_ERROR);if(0!==strm.avail_in||0!==s.lookahead||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?function(s,flush){for(var bflush;;){if(0===s.lookahead&&(fill_window(s),0===s.lookahead)){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}if(s.match_length=0,bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}(s,flush):s.strategy===Z_RLE?function(s,flush){for(var bflush,prev,scan,strend,_win=s.window;;){if(s.lookahead<=MAX_MATCH){if(fill_window(s),s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(s.match_length=0,s.lookahead>=MIN_MATCH&&s.strstart>0&&(prev=_win[scan=s.strstart-1])===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan),s.match_length>s.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=MIN_MATCH?(bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}(s,flush):configuration_table[s.level].func(s,flush);if(bstate!==BS_FINISH_STARTED&&bstate!==BS_FINISH_DONE||(s.status=FINISH_STATE),bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED)return 0===strm.avail_out&&(s.last_flush=-1),Z_OK;if(bstate===BS_BLOCK_DONE&&(flush===Z_PARTIAL_FLUSH?trees._tr_align(s):flush!==Z_BLOCK&&(trees._tr_stored_block(s,0,0,!1),flush===Z_FULL_FLUSH&&(zero(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),flush_pending(strm),0===strm.avail_out))return s.last_flush=-1,Z_OK}return flush!==Z_FINISH?Z_OK:s.wrap<=0?Z_STREAM_END:(2===s.wrap?(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),put_byte(s,strm.adler>>16&255),put_byte(s,strm.adler>>24&255),put_byte(s,255&strm.total_in),put_byte(s,strm.total_in>>8&255),put_byte(s,strm.total_in>>16&255),put_byte(s,strm.total_in>>24&255)):(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),flush_pending(strm),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?Z_OK:Z_STREAM_END)},exports.deflateEnd=function(strm){var status;return strm&&strm.state?(status=strm.state.status)!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE?err(strm,Z_STREAM_ERROR):(strm.state=null,status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK):Z_STREAM_ERROR},exports.deflateSetDictionary=function(strm,dictionary){var s,str,n,wrap,avail,next,input,tmpDict,dictLength=dictionary.length;if(!strm||!strm.state)return Z_STREAM_ERROR;if(2===(wrap=(s=strm.state).wrap)||1===wrap&&s.status!==INIT_STATE||s.lookahead)return Z_STREAM_ERROR;for(1===wrap&&(strm.adler=adler32(strm.adler,dictionary,dictLength,0)),s.wrap=0,dictLength>=s.w_size&&(0===wrap&&(zero(s.head),s.strstart=0,s.block_start=0,s.insert=0),tmpDict=new utils.Buf8(s.w_size),utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0),dictionary=tmpDict,dictLength=s.w_size),avail=strm.avail_in,next=strm.next_in,input=strm.input,strm.avail_in=dictLength,strm.next_in=0,strm.input=dictionary,fill_window(s);s.lookahead>=MIN_MATCH;){str=s.strstart,n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++}while(--n);s.strstart=str,s.lookahead=MIN_MATCH-1,fill_window(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,strm.next_in=next,strm.input=input,strm.avail_in=avail,s.wrap=wrap,Z_OK},exports.deflateInfo="pako deflate (from Nodeca project)"},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),Z_FIXED=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2;function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}var STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],static_ltree=new Array(2*(L_CODES+2));zero(static_ltree);var static_dtree=new Array(2*D_CODES);zero(static_dtree);var _dist_code=new Array(512);zero(_dist_code);var _length_code=new Array(256);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var static_l_desc,static_d_desc,static_bl_desc,base_dist=new Array(D_CODES);function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree,this.extra_bits=extra_bits,this.extra_base=extra_base,this.elems=elems,this.max_length=max_length,this.has_stree=static_tree&&static_tree.length}function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree,this.max_code=0,this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){s.bi_valid>Buf_size-length?(s.bi_buf|=value<<s.bi_valid&65535,put_short(s,s.bi_buf),s.bi_buf=value>>Buf_size-s.bi_valid,s.bi_valid+=length-Buf_size):(s.bi_buf|=value<<s.bi_valid&65535,s.bi_valid+=length)}function send_code(s,c,tree){send_bits(s,tree[2*c],tree[2*c+1])}function bi_reverse(code,len){var res=0;do{res|=1&code,code>>>=1,res<<=1}while(--len>0);return res>>>1}function gen_codes(tree,max_code,bl_count){var bits,n,next_code=new Array(MAX_BITS+1),code=0;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[2*n+1];0!==len&&(tree[2*n]=bi_reverse(next_code[len]++,len))}}function init_block(s){var n;for(n=0;n<L_CODES;n++)s.dyn_ltree[2*n]=0;for(n=0;n<D_CODES;n++)s.dyn_dtree[2*n]=0;for(n=0;n<BL_CODES;n++)s.bl_tree[2*n]=0;s.dyn_ltree[2*END_BLOCK]=1,s.opt_len=s.static_len=0,s.last_lit=s.matches=0}function bi_windup(s){s.bi_valid>8?put_short(s,s.bi_buf):s.bi_valid>0&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function smaller(tree,n,m,depth){var _n2=2*n,_m2=2*m;return tree[_n2]<tree[_m2]||tree[_n2]===tree[_m2]&&depth[n]<=depth[m]}function pqdownheap(s,tree,k){for(var v=s.heap[k],j=k<<1;j<=s.heap_len&&(j<s.heap_len&&smaller(tree,s.heap[j+1],s.heap[j],s.depth)&&j++,!smaller(tree,v,s.heap[j],s.depth));)s.heap[k]=s.heap[j],k=j,j<<=1;s.heap[k]=v}function compress_block(s,ltree,dtree){var dist,lc,code,extra,lx=0;if(0!==s.last_lit)do{dist=s.pending_buf[s.d_buf+2*lx]<<8|s.pending_buf[s.d_buf+2*lx+1],lc=s.pending_buf[s.l_buf+lx],lx++,0===dist?send_code(s,lc,ltree):(send_code(s,(code=_length_code[lc])+LITERALS+1,ltree),0!==(extra=extra_lbits[code])&&send_bits(s,lc-=base_length[code],extra),send_code(s,code=d_code(--dist),dtree),0!==(extra=extra_dbits[code])&&send_bits(s,dist-=base_dist[code],extra))}while(lx<s.last_lit);send_code(s,END_BLOCK,ltree)}function build_tree(s,desc){var n,m,node,tree=desc.dyn_tree,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,elems=desc.stat_desc.elems,max_code=-1;for(s.heap_len=0,s.heap_max=HEAP_SIZE,n=0;n<elems;n++)0!==tree[2*n]?(s.heap[++s.heap_len]=max_code=n,s.depth[n]=0):tree[2*n+1]=0;for(;s.heap_len<2;)tree[2*(node=s.heap[++s.heap_len]=max_code<2?++max_code:0)]=1,s.depth[node]=0,s.opt_len--,has_stree&&(s.static_len-=stree[2*node+1]);for(desc.max_code=max_code,n=s.heap_len>>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1],s.heap[1]=s.heap[s.heap_len--],pqdownheap(s,tree,1),m=s.heap[1],s.heap[--s.heap_max]=n,s.heap[--s.heap_max]=m,tree[2*node]=tree[2*n]+tree[2*m],s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1,tree[2*n+1]=tree[2*m+1]=node,s.heap[1]=node++,pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1],function(s,desc){var h,n,m,bits,xbits,f,tree=desc.dyn_tree,max_code=desc.max_code,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,extra=desc.stat_desc.extra_bits,base=desc.stat_desc.extra_base,max_length=desc.stat_desc.max_length,overflow=0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0;for(tree[2*s.heap[s.heap_max]+1]=0,h=s.heap_max+1;h<HEAP_SIZE;h++)(bits=tree[2*tree[2*(n=s.heap[h])+1]+1]+1)>max_length&&(bits=max_length,overflow++),tree[2*n+1]=bits,n>max_code||(s.bl_count[bits]++,xbits=0,n>=base&&(xbits=extra[n-base]),f=tree[2*n],s.opt_len+=f*(bits+xbits),has_stree&&(s.static_len+=f*(stree[2*n+1]+xbits)));if(0!==overflow){do{for(bits=max_length-1;0===s.bl_count[bits];)bits--;s.bl_count[bits]--,s.bl_count[bits+1]+=2,s.bl_count[max_length]--,overflow-=2}while(overflow>0);for(bits=max_length;0!==bits;bits--)for(n=s.bl_count[bits];0!==n;)(m=s.heap[--h])>max_code||(tree[2*m+1]!==bits&&(s.opt_len+=(bits-tree[2*m+1])*tree[2*m],tree[2*m+1]=bits),n--)}}(s,desc),gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),tree[2*(max_code+1)+1]=65535,n=0;n<=max_code;n++)curlen=nextlen,nextlen=tree[2*(n+1)+1],++count<max_count&&curlen===nextlen||(count<min_count?s.bl_tree[2*curlen]+=count:0!==curlen?(curlen!==prevlen&&s.bl_tree[2*curlen]++,s.bl_tree[2*REP_3_6]++):count<=10?s.bl_tree[2*REPZ_3_10]++:s.bl_tree[2*REPZ_11_138]++,count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4))}function send_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),n=0;n<=max_code;n++)if(curlen=nextlen,nextlen=tree[2*(n+1)+1],!(++count<max_count&&curlen===nextlen)){if(count<min_count)do{send_code(s,curlen,s.bl_tree)}while(0!=--count);else 0!==curlen?(curlen!==prevlen&&(send_code(s,curlen,s.bl_tree),count--),send_code(s,REP_3_6,s.bl_tree),send_bits(s,count-3,2)):count<=10?(send_code(s,REPZ_3_10,s.bl_tree),send_bits(s,count-3,3)):(send_code(s,REPZ_11_138,s.bl_tree),send_bits(s,count-11,7));count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4)}}zero(base_dist);var static_init_done=!1;function _tr_stored_block(s,buf,stored_len,last){send_bits(s,(STORED_BLOCK<<1)+(last?1:0),3),function(s,buf,len,header){bi_windup(s),header&&(put_short(s,len),put_short(s,~len)),utils.arraySet(s.pending_buf,s.window,buf,len,s.pending),s.pending+=len}(s,buf,stored_len,!0)}exports._tr_init=function(s){static_init_done||(function(){var n,bits,length,code,dist,bl_count=new Array(MAX_BITS+1);for(length=0,code=0;code<LENGTH_CODES-1;code++)for(base_length[code]=length,n=0;n<1<<extra_lbits[code];n++)_length_code[length++]=code;for(_length_code[length-1]=code,dist=0,code=0;code<16;code++)for(base_dist[code]=dist,n=0;n<1<<extra_dbits[code];n++)_dist_code[dist++]=code;for(dist>>=7;code<D_CODES;code++)for(base_dist[code]=dist<<7,n=0;n<1<<extra_dbits[code]-7;n++)_dist_code[256+dist++]=code;for(bits=0;bits<=MAX_BITS;bits++)bl_count[bits]=0;for(n=0;n<=143;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(;n<=255;)static_ltree[2*n+1]=9,n++,bl_count[9]++;for(;n<=279;)static_ltree[2*n+1]=7,n++,bl_count[7]++;for(;n<=287;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(gen_codes(static_ltree,L_CODES+1,bl_count),n=0;n<D_CODES;n++)static_dtree[2*n+1]=5,static_dtree[2*n]=bi_reverse(n,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS+1,L_CODES,MAX_BITS),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES,MAX_BITS),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES,MAX_BL_BITS)}(),static_init_done=!0),s.l_desc=new TreeDesc(s.dyn_ltree,static_l_desc),s.d_desc=new TreeDesc(s.dyn_dtree,static_d_desc),s.bl_desc=new TreeDesc(s.bl_tree,static_bl_desc),s.bi_buf=0,s.bi_valid=0,init_block(s)},exports._tr_stored_block=_tr_stored_block,exports._tr_flush_block=function(s,buf,stored_len,last){var opt_lenb,static_lenb,max_blindex=0;s.level>0?(s.strm.data_type===Z_UNKNOWN&&(s.strm.data_type=function(s){var n,black_mask=4093624447;for(n=0;n<=31;n++,black_mask>>>=1)if(1&black_mask&&0!==s.dyn_ltree[2*n])return Z_BINARY;if(0!==s.dyn_ltree[18]||0!==s.dyn_ltree[20]||0!==s.dyn_ltree[26])return Z_TEXT;for(n=32;n<LITERALS;n++)if(0!==s.dyn_ltree[2*n])return Z_TEXT;return Z_BINARY}(s)),build_tree(s,s.l_desc),build_tree(s,s.d_desc),max_blindex=function(s){var max_blindex;for(scan_tree(s,s.dyn_ltree,s.l_desc.max_code),scan_tree(s,s.dyn_dtree,s.d_desc.max_code),build_tree(s,s.bl_desc),max_blindex=BL_CODES-1;max_blindex>=3&&0===s.bl_tree[2*bl_order[max_blindex]+1];max_blindex--);return s.opt_len+=3*(max_blindex+1)+5+5+4,max_blindex}(s),opt_lenb=s.opt_len+3+7>>>3,(static_lenb=s.static_len+3+7>>>3)<=opt_lenb&&(opt_lenb=static_lenb)):opt_lenb=static_lenb=stored_len+5,stored_len+4<=opt_lenb&&-1!==buf?_tr_stored_block(s,buf,stored_len,last):s.strategy===Z_FIXED||static_lenb===opt_lenb?(send_bits(s,(STATIC_TREES<<1)+(last?1:0),3),compress_block(s,static_ltree,static_dtree)):(send_bits(s,(DYN_TREES<<1)+(last?1:0),3),function(s,lcodes,dcodes,blcodes){var rank;for(send_bits(s,lcodes-257,5),send_bits(s,dcodes-1,5),send_bits(s,blcodes-4,4),rank=0;rank<blcodes;rank++)send_bits(s,s.bl_tree[2*bl_order[rank]+1],3);send_tree(s,s.dyn_ltree,lcodes-1),send_tree(s,s.dyn_dtree,dcodes-1)}(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1),compress_block(s,s.dyn_ltree,s.dyn_dtree)),init_block(s),last&&bi_windup(s)},exports._tr_tally=function(s,dist,lc){return s.pending_buf[s.d_buf+2*s.last_lit]=dist>>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&dist,s.pending_buf[s.l_buf+s.last_lit]=255&lc,s.last_lit++,0===dist?s.dyn_ltree[2*lc]++:(s.matches++,dist--,s.dyn_ltree[2*(_length_code[lc]+LITERALS+1)]++,s.dyn_dtree[2*d_code(dist)]++),s.last_lit===s.lit_bufsize-1},exports._tr_align=function(s){send_bits(s,STATIC_TREES<<1,3),send_code(s,END_BLOCK,static_ltree),function(s){16===s.bi_valid?(put_short(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)}(s)}},function(module,exports,__webpack_require__){"use strict";var zlib_inflate=__webpack_require__(113),utils=__webpack_require__(8),strings=__webpack_require__(68),c=__webpack_require__(70),msg=__webpack_require__(46),ZStream=__webpack_require__(69),GZheader=__webpack_require__(116),toString=Object.prototype.toString;function Inflate(options){if(!(this instanceof Inflate))return new Inflate(options);this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;opt.raw&&opt.windowBits>=0&&opt.windowBits<16&&(opt.windowBits=-opt.windowBits,0===opt.windowBits&&(opt.windowBits=-15)),!(opt.windowBits>=0&&opt.windowBits<16)||options&&options.windowBits||(opt.windowBits+=32),opt.windowBits>15&&opt.windowBits<48&&0==(15&opt.windowBits)&&(opt.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK)throw new Error(msg[status]);if(this.header=new GZheader,zlib_inflate.inflateGetHeader(this.strm,this.header),opt.dictionary&&("string"==typeof opt.dictionary?opt.dictionary=strings.string2buf(opt.dictionary):"[object ArrayBuffer]"===toString.call(opt.dictionary)&&(opt.dictionary=new Uint8Array(opt.dictionary)),opt.raw&&(status=zlib_inflate.inflateSetDictionary(this.strm,opt.dictionary))!==c.Z_OK))throw new Error(msg[status])}function inflate(input,options){var inflator=new Inflate(options);if(inflator.push(input,!0),inflator.err)throw inflator.msg||msg[inflator.err];return inflator.result}Inflate.prototype.push=function(data,mode){var status,_mode,next_out_utf8,tail,utf8str,strm=this.strm,chunkSize=this.options.chunkSize,dictionary=this.options.dictionary,allowBufError=!1;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof data?strm.input=strings.binstring2buf(data):"[object ArrayBuffer]"===toString.call(data)?strm.input=new Uint8Array(data):strm.input=data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),(status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&dictionary&&(status=zlib_inflate.inflateSetDictionary(this.strm,dictionary)),status===c.Z_BUF_ERROR&&!0===allowBufError&&(status=c.Z_OK,allowBufError=!1),status!==c.Z_STREAM_END&&status!==c.Z_OK)return this.onEnd(status),this.ended=!0,!1;strm.next_out&&(0!==strm.avail_out&&status!==c.Z_STREAM_END&&(0!==strm.avail_in||_mode!==c.Z_FINISH&&_mode!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(next_out_utf8=strings.utf8border(strm.output,strm.next_out),tail=strm.next_out-next_out_utf8,utf8str=strings.buf2string(strm.output,next_out_utf8),strm.next_out=tail,strm.avail_out=chunkSize-tail,tail&&utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0),this.onData(utf8str)):this.onData(utils.shrinkBuf(strm.output,strm.next_out)))),0===strm.avail_in&&0===strm.avail_out&&(allowBufError=!0)}while((strm.avail_in>0||0===strm.avail_out)&&status!==c.Z_STREAM_END);return status===c.Z_STREAM_END&&(_mode=c.Z_FINISH),_mode===c.Z_FINISH?(status=zlib_inflate.inflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===c.Z_OK):_mode!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),strm.avail_out=0,!0)},Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Inflate.prototype.onEnd=function(status){status===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Inflate=Inflate,exports.inflate=inflate,exports.inflateRaw=function(input,options){return(options=options||{}).raw=!0,inflate(input,options)},exports.ungzip=inflate},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),adler32=__webpack_require__(66),crc32=__webpack_require__(67),inflate_fast=__webpack_require__(114),inflate_table=__webpack_require__(115),CODES=0,LENS=1,DISTS=2,Z_FINISH=4,Z_BLOCK=5,Z_TREES=6,Z_OK=0,Z_STREAM_END=1,Z_NEED_DICT=2,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_MEM_ERROR=-4,Z_BUF_ERROR=-5,Z_DEFLATED=8,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592,DEF_WBITS=15;function zswap32(q){return(q>>>24&255)+(q>>>8&65280)+((65280&q)<<8)+((255&q)<<24)}function inflateResetKeep(strm){var state;return strm&&strm.state?(state=strm.state,strm.total_in=strm.total_out=state.total=0,strm.msg="",state.wrap&&(strm.adler=1&state.wrap),state.mode=HEAD,state.last=0,state.havedict=0,state.dmax=32768,state.head=null,state.hold=0,state.bits=0,state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS),state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS),state.sane=1,state.back=-1,Z_OK):Z_STREAM_ERROR}function inflateReset(strm){var state;return strm&&strm.state?((state=strm.state).wsize=0,state.whave=0,state.wnext=0,inflateResetKeep(strm)):Z_STREAM_ERROR}function inflateReset2(strm,windowBits){var wrap,state;return strm&&strm.state?(state=strm.state,windowBits<0?(wrap=0,windowBits=-windowBits):(wrap=1+(windowBits>>4),windowBits<48&&(windowBits&=15)),windowBits&&(windowBits<8||windowBits>15)?Z_STREAM_ERROR:(null!==state.window&&state.wbits!==windowBits&&(state.window=null),state.wrap=wrap,state.wbits=windowBits,inflateReset(strm))):Z_STREAM_ERROR}function inflateInit2(strm,windowBits){var ret,state;return strm?(state=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new utils.Buf16(320),this.work=new utils.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},strm.state=state,state.window=null,(ret=inflateReset2(strm,windowBits))!==Z_OK&&(strm.state=null),ret):Z_STREAM_ERROR}var lenfix,distfix,virgin=!0;function fixedtables(state){if(virgin){var sym;for(lenfix=new utils.Buf32(512),distfix=new utils.Buf32(32),sym=0;sym<144;)state.lens[sym++]=8;for(;sym<256;)state.lens[sym++]=9;for(;sym<280;)state.lens[sym++]=7;for(;sym<288;)state.lens[sym++]=8;for(inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9}),sym=0;sym<32;)state.lens[sym++]=5;inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5}),virgin=!1}state.lencode=lenfix,state.lenbits=9,state.distcode=distfix,state.distbits=5}function updatewindow(strm,src,end,copy){var dist,state=strm.state;return null===state.window&&(state.wsize=1<<state.wbits,state.wnext=0,state.whave=0,state.window=new utils.Buf8(state.wsize)),copy>=state.wsize?(utils.arraySet(state.window,src,end-state.wsize,state.wsize,0),state.wnext=0,state.whave=state.wsize):((dist=state.wsize-state.wnext)>copy&&(dist=copy),utils.arraySet(state.window,src,end-copy,dist,state.wnext),(copy-=dist)?(utils.arraySet(state.window,src,end-copy,copy,0),state.wnext=copy,state.whave=state.wsize):(state.wnext+=dist,state.wnext===state.wsize&&(state.wnext=0),state.whave<state.wsize&&(state.whave+=dist))),0}exports.inflateReset=inflateReset,exports.inflateReset2=inflateReset2,exports.inflateResetKeep=inflateResetKeep,exports.inflateInit=function(strm){return inflateInit2(strm,DEF_WBITS)},exports.inflateInit2=inflateInit2,exports.inflate=function(strm,flush){var state,input,output,next,put,have,left,hold,bits,_in,_out,copy,from,from_source,here_bits,here_op,here_val,last_bits,last_op,last_val,len,ret,opts,n,here=0,hbuf=new utils.Buf8(4),order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!strm||!strm.state||!strm.output||!strm.input&&0!==strm.avail_in)return Z_STREAM_ERROR;(state=strm.state).mode===TYPE&&(state.mode=TYPEDO),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,_in=have,_out=left,ret=Z_OK;inf_leave:for(;;)switch(state.mode){case HEAD:if(0===state.wrap){state.mode=TYPEDO;break}for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(2&state.wrap&&35615===hold){state.check=0,hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0),hold=0,bits=0,state.mode=FLAGS;break}if(state.flags=0,state.head&&(state.head.done=!1),!(1&state.wrap)||(((255&hold)<<8)+(hold>>8))%31){strm.msg="incorrect header check",state.mode=BAD;break}if((15&hold)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(bits-=4,len=8+(15&(hold>>>=4)),0===state.wbits)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size",state.mode=BAD;break}state.dmax=1<<len,strm.adler=state.check=1,state.mode=512&hold?DICTID:TYPE,hold=0,bits=0;break;case FLAGS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.flags=hold,(255&state.flags)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(57344&state.flags){strm.msg="unknown header flags set",state.mode=BAD;break}state.head&&(state.head.text=hold>>8&1),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=TIME;case TIME:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.time=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,hbuf[2]=hold>>>16&255,hbuf[3]=hold>>>24&255,state.check=crc32(state.check,hbuf,4,0)),hold=0,bits=0,state.mode=OS;case OS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.xflags=255&hold,state.head.os=hold>>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=EXLEN;case EXLEN:if(1024&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length=hold,state.head&&(state.head.extra_len=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0}else state.head&&(state.head.extra=null);state.mode=EXTRA;case EXTRA:if(1024&state.flags&&((copy=state.length)>have&&(copy=have),copy&&(state.head&&(len=state.head.extra_len-state.length,state.head.extra||(state.head.extra=new Array(state.head.extra_len)),utils.arraySet(state.head.extra,input,next,copy,len)),512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,state.length-=copy),state.length))break inf_leave;state.length=0,state.mode=NAME;case NAME:if(2048&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.name+=String.fromCharCode(len))}while(len&&copy<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.name=null);state.length=0,state.mode=COMMENT;case COMMENT:if(4096&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.comment+=String.fromCharCode(len))}while(len&&copy<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.comment=null);state.mode=HCRC;case HCRC:if(512&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(65535&state.check)){strm.msg="header crc mismatch",state.mode=BAD;break}hold=0,bits=0}state.head&&(state.head.hcrc=state.flags>>9&1,state.head.done=!0),strm.adler=state.check=0,state.mode=TYPE;break;case DICTID:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}strm.adler=state.check=zswap32(hold),hold=0,bits=0,state.mode=DICT;case DICT:if(0===state.havedict)return strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,Z_NEED_DICT;strm.adler=state.check=1,state.mode=TYPE;case TYPE:if(flush===Z_BLOCK||flush===Z_TREES)break inf_leave;case TYPEDO:if(state.last){hold>>>=7&bits,bits-=7&bits,state.mode=CHECK;break}for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}switch(state.last=1&hold,bits-=1,3&(hold>>>=1)){case 0:state.mode=STORED;break;case 1:if(fixedtables(state),state.mode=LEN_,flush===Z_TREES){hold>>>=2,bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type",state.mode=BAD}hold>>>=2,bits-=2;break;case STORED:for(hold>>>=7&bits,bits-=7&bits;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if((65535&hold)!=(hold>>>16^65535)){strm.msg="invalid stored block lengths",state.mode=BAD;break}if(state.length=65535&hold,hold=0,bits=0,state.mode=COPY_,flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:if(copy=state.length){if(copy>have&&(copy=have),copy>left&&(copy=left),0===copy)break inf_leave;utils.arraySet(output,input,next,copy,put),have-=copy,next+=copy,left-=copy,put+=copy,state.length-=copy;break}state.mode=TYPE;break;case TABLE:for(;bits<14;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.nlen=257+(31&hold),hold>>>=5,bits-=5,state.ndist=1+(31&hold),hold>>>=5,bits-=5,state.ncode=4+(15&hold),hold>>>=4,bits-=4,state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols",state.mode=BAD;break}state.have=0,state.mode=LENLENS;case LENLENS:for(;state.have<state.ncode;){for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.lens[order[state.have++]]=7&hold,hold>>>=3,bits-=3}for(;state.have<19;)state.lens[order[state.have++]]=0;if(state.lencode=state.lendyn,state.lenbits=7,opts={bits:state.lenbits},ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid code lengths set",state.mode=BAD;break}state.have=0,state.mode=CODELENS;case CODELENS:for(;state.have<state.nlen+state.ndist;){for(;here_op=(here=state.lencode[hold&(1<<state.lenbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(here_val<16)hold>>>=here_bits,bits-=here_bits,state.lens[state.have++]=here_val;else{if(16===here_val){for(n=here_bits+2;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold>>>=here_bits,bits-=here_bits,0===state.have){strm.msg="invalid bit length repeat",state.mode=BAD;break}len=state.lens[state.have-1],copy=3+(3&hold),hold>>>=2,bits-=2}else if(17===here_val){for(n=here_bits+3;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}bits-=here_bits,len=0,copy=3+(7&(hold>>>=here_bits)),hold>>>=3,bits-=3}else{for(n=here_bits+7;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}bits-=here_bits,len=0,copy=11+(127&(hold>>>=here_bits)),hold>>>=7,bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat",state.mode=BAD;break}for(;copy--;)state.lens[state.have++]=len}}if(state.mode===BAD)break;if(0===state.lens[256]){strm.msg="invalid code -- missing end-of-block",state.mode=BAD;break}if(state.lenbits=9,opts={bits:state.lenbits},ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid literal/lengths set",state.mode=BAD;break}if(state.distbits=6,state.distcode=state.distdyn,opts={bits:state.distbits},ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts),state.distbits=opts.bits,ret){strm.msg="invalid distances set",state.mode=BAD;break}if(state.mode=LEN_,flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,inflate_fast(strm,_out),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,state.mode===TYPE&&(state.back=-1);break}for(state.back=0;here_op=(here=state.lencode[hold&(1<<state.lenbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(here_op&&0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;here_op=(here=state.lencode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)])>>>16&255,here_val=65535&here,!(last_bits+(here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,state.length=here_val,0===here_op){state.mode=LIT;break}if(32&here_op){state.back=-1,state.mode=TYPE;break}if(64&here_op){strm.msg="invalid literal/length code",state.mode=BAD;break}state.extra=15&here_op,state.mode=LENEXT;case LENEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}state.was=state.length,state.mode=DIST;case DIST:for(;here_op=(here=state.distcode[hold&(1<<state.distbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;here_op=(here=state.distcode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)])>>>16&255,here_val=65535&here,!(last_bits+(here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,64&here_op){strm.msg="invalid distance code",state.mode=BAD;break}state.offset=here_val,state.extra=15&here_op,state.mode=DISTEXT;case DISTEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.offset+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back",state.mode=BAD;break}state.mode=MATCH;case MATCH:if(0===left)break inf_leave;if(copy=_out-left,state.offset>copy){if((copy=state.offset-copy)>state.whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break}copy>state.wnext?(copy-=state.wnext,from=state.wsize-copy):from=state.wnext-copy,copy>state.length&&(copy=state.length),from_source=state.window}else from_source=output,from=put-state.offset,copy=state.length;copy>left&&(copy=left),left-=copy,state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);0===state.length&&(state.mode=LEN);break;case LIT:if(0===left)break inf_leave;output[put++]=state.length,left--,state.mode=LEN;break;case CHECK:if(state.wrap){for(;bits<32;){if(0===have)break inf_leave;have--,hold|=input[next++]<<bits,bits+=8}if(_out-=left,strm.total_out+=_out,state.total+=_out,_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,put-_out):adler32(state.check,output,_out,put-_out)),_out=left,(state.flags?hold:zswap32(hold))!==state.check){strm.msg="incorrect data check",state.mode=BAD;break}hold=0,bits=0}state.mode=LENGTH;case LENGTH:if(state.wrap&&state.flags){for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(4294967295&state.total)){strm.msg="incorrect length check",state.mode=BAD;break}hold=0,bits=0}state.mode=DONE;case DONE:ret=Z_STREAM_END;break inf_leave;case BAD:ret=Z_DATA_ERROR;break inf_leave;case MEM:return Z_MEM_ERROR;case SYNC:default:return Z_STREAM_ERROR}return strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,(state.wsize||_out!==strm.avail_out&&state.mode<BAD&&(state.mode<CHECK||flush!==Z_FINISH))&&updatewindow(strm,strm.output,strm.next_out,_out-strm.avail_out)?(state.mode=MEM,Z_MEM_ERROR):(_in-=strm.avail_in,_out-=strm.avail_out,strm.total_in+=_in,strm.total_out+=_out,state.total+=_out,state.wrap&&_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,strm.next_out-_out):adler32(state.check,output,_out,strm.next_out-_out)),strm.data_type=state.bits+(state.last?64:0)+(state.mode===TYPE?128:0)+(state.mode===LEN_||state.mode===COPY_?256:0),(0===_in&&0===_out||flush===Z_FINISH)&&ret===Z_OK&&(ret=Z_BUF_ERROR),ret)},exports.inflateEnd=function(strm){if(!strm||!strm.state)return Z_STREAM_ERROR;var state=strm.state;return state.window&&(state.window=null),strm.state=null,Z_OK},exports.inflateGetHeader=function(strm,head){var state;return strm&&strm.state?0==(2&(state=strm.state).wrap)?Z_STREAM_ERROR:(state.head=head,head.done=!1,Z_OK):Z_STREAM_ERROR},exports.inflateSetDictionary=function(strm,dictionary){var state,dictLength=dictionary.length;return strm&&strm.state?0!==(state=strm.state).wrap&&state.mode!==DICT?Z_STREAM_ERROR:state.mode===DICT&&adler32(1,dictionary,dictLength,0)!==state.check?Z_DATA_ERROR:updatewindow(strm,dictionary,dictLength,dictLength)?(state.mode=MEM,Z_MEM_ERROR):(state.havedict=1,Z_OK):Z_STREAM_ERROR},exports.inflateInfo="pako inflate (from Nodeca project)"},function(module,exports,__webpack_require__){"use strict";module.exports=function(strm,start){var state,_in,last,_out,beg,end,dmax,wsize,whave,wnext,s_window,hold,bits,lcode,dcode,lmask,dmask,here,op,len,dist,from,from_source,input,output;state=strm.state,_in=strm.next_in,input=strm.input,last=_in+(strm.avail_in-5),_out=strm.next_out,output=strm.output,beg=_out-(start-strm.avail_out),end=_out+(strm.avail_out-257),dmax=state.dmax,wsize=state.wsize,whave=state.whave,wnext=state.wnext,s_window=state.window,hold=state.hold,bits=state.bits,lcode=state.lencode,dcode=state.distcode,lmask=(1<<state.lenbits)-1,dmask=(1<<state.distbits)-1;top:do{bits<15&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=lcode[hold&lmask];dolen:for(;;){if(hold>>>=op=here>>>24,bits-=op,0===(op=here>>>16&255))output[_out++]=65535&here;else{if(!(16&op)){if(0==(64&op)){here=lcode[(65535&here)+(hold&(1<<op)-1)];continue dolen}if(32&op){state.mode=12;break top}strm.msg="invalid literal/length code",state.mode=30;break top}len=65535&here,(op&=15)&&(bits<op&&(hold+=input[_in++]<<bits,bits+=8),len+=hold&(1<<op)-1,hold>>>=op,bits-=op),bits<15&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=dcode[hold&dmask];dodist:for(;;){if(hold>>>=op=here>>>24,bits-=op,!(16&(op=here>>>16&255))){if(0==(64&op)){here=dcode[(65535&here)+(hold&(1<<op)-1)];continue dodist}strm.msg="invalid distance code",state.mode=30;break top}if(dist=65535&here,bits<(op&=15)&&(hold+=input[_in++]<<bits,(bits+=8)<op&&(hold+=input[_in++]<<bits,bits+=8)),(dist+=hold&(1<<op)-1)>dmax){strm.msg="invalid distance too far back",state.mode=30;break top}if(hold>>>=op,bits-=op,dist>(op=_out-beg)){if((op=dist-op)>whave&&state.sane){strm.msg="invalid distance too far back",state.mode=30;break top}if(from=0,from_source=s_window,0===wnext){if(from+=wsize-op,op<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}}else if(wnext<op){if(from+=wsize+wnext-op,(op-=wnext)<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);if(from=0,wnext<len){len-=op=wnext;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}}}else if(from+=wnext-op,op<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}for(;len>2;)output[_out++]=from_source[from++],output[_out++]=from_source[from++],output[_out++]=from_source[from++],len-=3;len&&(output[_out++]=from_source[from++],len>1&&(output[_out++]=from_source[from++]))}else{from=_out-dist;do{output[_out++]=output[from++],output[_out++]=output[from++],output[_out++]=output[from++],len-=3}while(len>2);len&&(output[_out++]=output[from++],len>1&&(output[_out++]=output[from++]))}break}}break}}while(_in<last&&_out<end);_in-=len=bits>>3,hold&=(1<<(bits-=len<<3))-1,strm.next_in=_in,strm.next_out=_out,strm.avail_in=_in<last?last-_in+5:5-(_in-last),strm.avail_out=_out<end?end-_out+257:257-(_out-end),state.hold=hold,state.bits=bits}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];module.exports=function(type,lens,lens_index,codes,table,table_index,work,opts){var incr,fill,low,mask,next,end,here_bits,here_op,here_val,bits=opts.bits,len=0,sym=0,min=0,max=0,root=0,curr=0,drop=0,left=0,used=0,huff=0,base=null,base_index=0,count=new utils.Buf16(16),offs=new utils.Buf16(16),extra=null,extra_index=0;for(len=0;len<=15;len++)count[len]=0;for(sym=0;sym<codes;sym++)count[lens[lens_index+sym]]++;for(root=bits,max=15;max>=1&&0===count[max];max--);if(root>max&&(root=max),0===max)return table[table_index++]=20971520,table[table_index++]=20971520,opts.bits=1,0;for(min=1;min<max&&0===count[min];min++);for(root<min&&(root=min),left=1,len=1;len<=15;len++)if(left<<=1,(left-=count[len])<0)return-1;if(left>0&&(0===type||1!==max))return-1;for(offs[1]=0,len=1;len<15;len++)offs[len+1]=offs[len]+count[len];for(sym=0;sym<codes;sym++)0!==lens[lens_index+sym]&&(work[offs[lens[lens_index+sym]]++]=sym);if(0===type?(base=extra=work,end=19):1===type?(base=lbase,base_index-=257,extra=lext,extra_index-=257,end=256):(base=dbase,extra=dext,end=-1),huff=0,sym=0,len=min,next=table_index,curr=root,drop=0,low=-1,mask=(used=1<<root)-1,1===type&&used>852||2===type&&used>592)return 1;for(;;){here_bits=len-drop,work[sym]<end?(here_op=0,here_val=work[sym]):work[sym]>end?(here_op=extra[extra_index+work[sym]],here_val=base[base_index+work[sym]]):(here_op=96,here_val=0),incr=1<<len-drop,min=fill=1<<curr;do{table[next+(huff>>drop)+(fill-=incr)]=here_bits<<24|here_op<<16|here_val|0}while(0!==fill);for(incr=1<<len-1;huff&incr;)incr>>=1;if(0!==incr?(huff&=incr-1,huff+=incr):huff=0,sym++,0==--count[len]){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){for(0===drop&&(drop=root),next+=min,left=1<<(curr=len-drop);curr+drop<max&&!((left-=count[curr+drop])<=0);)curr++,left<<=1;if(used+=1<<curr,1===type&&used>852||2===type&&used>592)return 1;table[low=huff&mask]=root<<24|curr<<16|next-table_index|0}}return 0!==huff&&(table[next+huff]=len-drop<<24|64<<16|0),opts.bits=root,0}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),utf8=__webpack_require__(14),crc32=__webpack_require__(45),signature=__webpack_require__(71),decToHex=function(dec,bytes){var i,hex="";for(i=0;i<bytes;i++)hex+=String.fromCharCode(255&dec),dec>>>=8;return hex},generateZipParts=function(streamInfo,streamedContent,streamingEnded,offset,platform,encodeFileName){var dosTime,dosDate,file=streamInfo.file,compression=streamInfo.compression,useCustomEncoding=encodeFileName!==utf8.utf8encode,encodedFileName=utils.transformTo("string",encodeFileName(file.name)),utfEncodedFileName=utils.transformTo("string",utf8.utf8encode(file.name)),comment=file.comment,encodedComment=utils.transformTo("string",encodeFileName(comment)),utfEncodedComment=utils.transformTo("string",utf8.utf8encode(comment)),useUTF8ForFileName=utfEncodedFileName.length!==file.name.length,useUTF8ForComment=utfEncodedComment.length!==comment.length,extraFields="",unicodePathExtraField="",unicodeCommentExtraField="",dir=file.dir,date=file.date,dataInfo={crc32:0,compressedSize:0,uncompressedSize:0};streamedContent&&!streamingEnded||(dataInfo.crc32=streamInfo.crc32,dataInfo.compressedSize=streamInfo.compressedSize,dataInfo.uncompressedSize=streamInfo.uncompressedSize);var bitflag=0;streamedContent&&(bitflag|=8),useCustomEncoding||!useUTF8ForFileName&&!useUTF8ForComment||(bitflag|=2048);var extFileAttr=0,versionMadeBy=0;dir&&(extFileAttr|=16),"UNIX"===platform?(versionMadeBy=798,extFileAttr|=function(unixPermissions,isDir){var result=unixPermissions;return unixPermissions||(result=isDir?16893:33204),(65535&result)<<16}(file.unixPermissions,dir)):(versionMadeBy=20,extFileAttr|=function(dosPermissions,isDir){return 63&(dosPermissions||0)}(file.dosPermissions)),dosTime=date.getUTCHours(),dosTime<<=6,dosTime|=date.getUTCMinutes(),dosTime<<=5,dosTime|=date.getUTCSeconds()/2,dosDate=date.getUTCFullYear()-1980,dosDate<<=4,dosDate|=date.getUTCMonth()+1,dosDate<<=5,dosDate|=date.getUTCDate(),useUTF8ForFileName&&(unicodePathExtraField=decToHex(1,1)+decToHex(crc32(encodedFileName),4)+utfEncodedFileName,extraFields+="up"+decToHex(unicodePathExtraField.length,2)+unicodePathExtraField),useUTF8ForComment&&(unicodeCommentExtraField=decToHex(1,1)+decToHex(crc32(encodedComment),4)+utfEncodedComment,extraFields+="uc"+decToHex(unicodeCommentExtraField.length,2)+unicodeCommentExtraField);var header="";return header+="\n\0",header+=decToHex(bitflag,2),header+=compression.magic,header+=decToHex(dosTime,2),header+=decToHex(dosDate,2),header+=decToHex(dataInfo.crc32,4),header+=decToHex(dataInfo.compressedSize,4),header+=decToHex(dataInfo.uncompressedSize,4),header+=decToHex(encodedFileName.length,2),header+=decToHex(extraFields.length,2),{fileRecord:signature.LOCAL_FILE_HEADER+header+encodedFileName+extraFields,dirRecord:signature.CENTRAL_FILE_HEADER+decToHex(versionMadeBy,2)+header+decToHex(encodedComment.length,2)+"\0\0\0\0"+decToHex(extFileAttr,4)+decToHex(offset,4)+encodedFileName+extraFields+encodedComment}};function ZipFileWorker(streamFiles,comment,platform,encodeFileName){GenericWorker.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=comment,this.zipPlatform=platform,this.encodeFileName=encodeFileName,this.streamFiles=streamFiles,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}utils.inherits(ZipFileWorker,GenericWorker),ZipFileWorker.prototype.push=function(chunk){var currentFilePercent=chunk.meta.percent||0,entriesCount=this.entriesCount,remainingFiles=this._sources.length;this.accumulate?this.contentBuffer.push(chunk):(this.bytesWritten+=chunk.data.length,GenericWorker.prototype.push.call(this,{data:chunk.data,meta:{currentFile:this.currentFile,percent:entriesCount?(currentFilePercent+100*(entriesCount-remainingFiles-1))/entriesCount:100}}))},ZipFileWorker.prototype.openedSource=function(streamInfo){this.currentSourceOffset=this.bytesWritten,this.currentFile=streamInfo.file.name;var streamedContent=this.streamFiles&&!streamInfo.file.dir;if(streamedContent){var record=generateZipParts(streamInfo,streamedContent,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:record.fileRecord,meta:{percent:0}})}else this.accumulate=!0},ZipFileWorker.prototype.closedSource=function(streamInfo){this.accumulate=!1;var streamedContent=this.streamFiles&&!streamInfo.file.dir,record=generateZipParts(streamInfo,streamedContent,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(record.dirRecord),streamedContent)this.push({data:function(streamInfo){return signature.DATA_DESCRIPTOR+decToHex(streamInfo.crc32,4)+decToHex(streamInfo.compressedSize,4)+decToHex(streamInfo.uncompressedSize,4)}(streamInfo),meta:{percent:100}});else for(this.push({data:record.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},ZipFileWorker.prototype.flush=function(){for(var localDirLength=this.bytesWritten,i=0;i<this.dirRecords.length;i++)this.push({data:this.dirRecords[i],meta:{percent:100}});var centralDirLength=this.bytesWritten-localDirLength,dirEnd=function(entriesCount,centralDirLength,localDirLength,comment,encodeFileName){var encodedComment=utils.transformTo("string",encodeFileName(comment));return signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+decToHex(entriesCount,2)+decToHex(entriesCount,2)+decToHex(centralDirLength,4)+decToHex(localDirLength,4)+decToHex(encodedComment.length,2)+encodedComment}(this.dirRecords.length,centralDirLength,localDirLength,this.zipComment,this.encodeFileName);this.push({data:dirEnd,meta:{percent:100}})},ZipFileWorker.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},ZipFileWorker.prototype.registerPrevious=function(previous){this._sources.push(previous);var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.closedSource(self.previous.streamInfo),self._sources.length?self.prepareNextSource():self.end()}),previous.on("error",function(e){self.error(e)}),this},ZipFileWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},ZipFileWorker.prototype.error=function(e){var sources=this._sources;if(!GenericWorker.prototype.error.call(this,e))return!1;for(var i=0;i<sources.length;i++)try{sources[i].error(e)}catch(e){}return!0},ZipFileWorker.prototype.lock=function(){GenericWorker.prototype.lock.call(this);for(var sources=this._sources,i=0;i<sources.length;i++)sources[i].lock()},module.exports=ZipFileWorker},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function NodejsStreamInputAdapter(filename,stream){GenericWorker.call(this,"Nodejs stream input adapter for "+filename),this._upstreamEnded=!1,this._bindStream(stream)}utils.inherits(NodejsStreamInputAdapter,GenericWorker),NodejsStreamInputAdapter.prototype._bindStream=function(stream){var self=this;this._stream=stream,stream.pause(),stream.on("data",function(chunk){self.push({data:chunk,meta:{percent:0}})}).on("error",function(e){self.isPaused?this.generatedError=e:self.error(e)}).on("end",function(){self.isPaused?self._upstreamEnded=!0:self.end()})},NodejsStreamInputAdapter.prototype.pause=function(){return!!GenericWorker.prototype.pause.call(this)&&(this._stream.pause(),!0)},NodejsStreamInputAdapter.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},module.exports=NodejsStreamInputAdapter},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),external=__webpack_require__(26),utf8=__webpack_require__(14),ZipEntries=(utils=__webpack_require__(0),__webpack_require__(120)),Crc32Probe=__webpack_require__(64),nodejsUtils=__webpack_require__(31);function checkEntryCRC32(zipEntry){return new external.Promise(function(resolve,reject){var worker=zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);worker.on("error",function(e){reject(e)}).on("end",function(){worker.streamInfo.crc32!==zipEntry.decompressed.crc32?reject(new Error("Corrupted zip : CRC32 mismatch")):resolve()}).resume()})}module.exports=function(data,options){var zip=this;return options=utils.extend(options||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:utf8.utf8decode}),nodejsUtils.isNode&&nodejsUtils.isStream(data)?external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):utils.prepareContent("the loaded zip file",data,!0,options.optimizedBinaryString,options.base64).then(function(data){var zipEntries=new ZipEntries(options);return zipEntries.load(data),zipEntries}).then(function(zipEntries){var promises=[external.Promise.resolve(zipEntries)],files=zipEntries.files;if(options.checkCRC32)for(var i=0;i<files.length;i++)promises.push(checkEntryCRC32(files[i]));return external.Promise.all(promises)}).then(function(results){for(var zipEntries=results.shift(),files=zipEntries.files,i=0;i<files.length;i++){var input=files[i];zip.file(input.fileNameStr,input.decompressed,{binary:!0,optimizedBinaryString:!0,date:input.date,dir:input.dir,comment:input.fileCommentStr.length?input.fileCommentStr:null,unixPermissions:input.unixPermissions,dosPermissions:input.dosPermissions,createFolders:options.createFolders})}return zipEntries.zipComment.length&&(zip.comment=zipEntries.zipComment),zip})}},function(module,exports,__webpack_require__){"use strict";var readerFor=__webpack_require__(72),utils=__webpack_require__(0),sig=__webpack_require__(71),ZipEntry=__webpack_require__(123),support=(__webpack_require__(14),__webpack_require__(7));function ZipEntries(loadOptions){this.files=[],this.loadOptions=loadOptions}ZipEntries.prototype={checkSignature:function(expectedSignature){if(!this.reader.readAndCheckSignature(expectedSignature)){this.reader.index-=4;var signature=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},isSignature:function(askedIndex,expectedSignature){var currentIndex=this.reader.index;this.reader.setIndex(askedIndex);var result=this.reader.readString(4)===expectedSignature;return this.reader.setIndex(currentIndex),result},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var zipComment=this.reader.readData(this.zipCommentLength),decodeParamType=support.uint8array?"uint8array":"array",decodeContent=utils.transformTo(decodeParamType,zipComment);this.zipComment=this.loadOptions.decodeFileName(decodeContent)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var extraFieldId,extraFieldLength,extraFieldValue,extraDataSize=this.zip64EndOfCentralSize-44;0<extraDataSize;)extraFieldId=this.reader.readInt(2),extraFieldLength=this.reader.readInt(4),extraFieldValue=this.reader.readData(extraFieldLength),this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var i,file;for(i=0;i<this.files.length;i++)file=this.files[i],this.reader.setIndex(file.localHeaderOffset),this.checkSignature(sig.LOCAL_FILE_HEADER),file.readLocalPart(this.reader),file.handleUTF8(),file.processAttributes()},readCentralDir:function(){var file;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER);)(file=new ZipEntry({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(file);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var offset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(offset<0)throw!this.isSignature(0,sig.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(offset);var endOfCentralDirOffset=offset;if(this.checkSignature(sig.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){if(this.zip64=!0,(offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(offset),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,sig.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var expectedEndOfCentralDirOffset=this.centralDirOffset+this.centralDirSize;this.zip64&&(expectedEndOfCentralDirOffset+=20,expectedEndOfCentralDirOffset+=12+this.zip64EndOfCentralSize);var extraBytes=endOfCentralDirOffset-expectedEndOfCentralDirOffset;if(extraBytes>0)this.isSignature(endOfCentralDirOffset,sig.CENTRAL_FILE_HEADER)||(this.reader.zero=extraBytes);else if(extraBytes<0)throw new Error("Corrupted zip: missing "+Math.abs(extraBytes)+" bytes.")},prepareReader:function(data){this.reader=readerFor(data)},load:function(data){this.prepareReader(data),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},module.exports=ZipEntries},function(module,exports,__webpack_require__){"use strict";var DataReader=__webpack_require__(74);function StringReader(data){DataReader.call(this,data)}__webpack_require__(0).inherits(StringReader,DataReader),StringReader.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},StringReader.prototype.lastIndexOfSignature=function(sig){return this.data.lastIndexOf(sig)-this.zero},StringReader.prototype.readAndCheckSignature=function(sig){return sig===this.readData(4)},StringReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=StringReader},function(module,exports,__webpack_require__){"use strict";var Uint8ArrayReader=__webpack_require__(75);function NodeBufferReader(data){Uint8ArrayReader.call(this,data)}__webpack_require__(0).inherits(NodeBufferReader,Uint8ArrayReader),NodeBufferReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=NodeBufferReader},function(module,exports,__webpack_require__){"use strict";var readerFor=__webpack_require__(72),utils=__webpack_require__(0),CompressedObject=__webpack_require__(44),crc32fn=__webpack_require__(45),utf8=__webpack_require__(14),compressions=__webpack_require__(65),support=__webpack_require__(7);function ZipEntry(options,loadOptions){this.options=options,this.loadOptions=loadOptions}ZipEntry.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(reader){var compression,localExtraFieldsLength;if(reader.skip(22),this.fileNameLength=reader.readInt(2),localExtraFieldsLength=reader.readInt(2),this.fileName=reader.readData(this.fileNameLength),reader.skip(localExtraFieldsLength),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(compression=function(compressionMethod){for(var method in compressions)if(compressions.hasOwnProperty(method)&&compressions[method].magic===compressionMethod)return compressions[method];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+utils.pretty(this.compressionMethod)+" unknown (inner file : "+utils.transformTo("string",this.fileName)+")");this.decompressed=new CompressedObject(this.compressedSize,this.uncompressedSize,this.crc32,compression,reader.readData(this.compressedSize))},readCentralPart:function(reader){this.versionMadeBy=reader.readInt(2),reader.skip(2),this.bitFlag=reader.readInt(2),this.compressionMethod=reader.readString(2),this.date=reader.readDate(),this.crc32=reader.readInt(4),this.compressedSize=reader.readInt(4),this.uncompressedSize=reader.readInt(4);var fileNameLength=reader.readInt(2);if(this.extraFieldsLength=reader.readInt(2),this.fileCommentLength=reader.readInt(2),this.diskNumberStart=reader.readInt(2),this.internalFileAttributes=reader.readInt(2),this.externalFileAttributes=reader.readInt(4),this.localHeaderOffset=reader.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");reader.skip(fileNameLength),this.readExtraFields(reader),this.parseZIP64ExtraField(reader),this.fileComment=reader.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var madeBy=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===madeBy&&(this.dosPermissions=63&this.externalFileAttributes),3===madeBy&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(reader){if(this.extraFields[1]){var extraReader=readerFor(this.extraFields[1].value);this.uncompressedSize===utils.MAX_VALUE_32BITS&&(this.uncompressedSize=extraReader.readInt(8)),this.compressedSize===utils.MAX_VALUE_32BITS&&(this.compressedSize=extraReader.readInt(8)),this.localHeaderOffset===utils.MAX_VALUE_32BITS&&(this.localHeaderOffset=extraReader.readInt(8)),this.diskNumberStart===utils.MAX_VALUE_32BITS&&(this.diskNumberStart=extraReader.readInt(4))}},readExtraFields:function(reader){var extraFieldId,extraFieldLength,extraFieldValue,end=reader.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});reader.index<end;)extraFieldId=reader.readInt(2),extraFieldLength=reader.readInt(2),extraFieldValue=reader.readData(extraFieldLength),this.extraFields[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},handleUTF8:function(){var decodeParamType=support.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=utf8.utf8decode(this.fileName),this.fileCommentStr=utf8.utf8decode(this.fileComment);else{var upath=this.findExtraFieldUnicodePath();if(null!==upath)this.fileNameStr=upath;else{var fileNameByteArray=utils.transformTo(decodeParamType,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(fileNameByteArray)}var ucomment=this.findExtraFieldUnicodeComment();if(null!==ucomment)this.fileCommentStr=ucomment;else{var commentByteArray=utils.transformTo(decodeParamType,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(commentByteArray)}}},findExtraFieldUnicodePath:function(){var upathField=this.extraFields[28789];if(upathField){var extraReader=readerFor(upathField.value);return 1!==extraReader.readInt(1)?null:crc32fn(this.fileName)!==extraReader.readInt(4)?null:utf8.utf8decode(extraReader.readData(upathField.length-5))}return null},findExtraFieldUnicodeComment:function(){var ucommentField=this.extraFields[25461];if(ucommentField){var extraReader=readerFor(ucommentField.value);return 1!==extraReader.readInt(1)?null:crc32fn(this.fileComment)!==extraReader.readInt(4)?null:utf8.utf8decode(extraReader.readData(ucommentField.length-5))}return null}},module.exports=ZipEntry},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHTML=function(content,segments){return'\n <div class="pushwoosh-subscription-segments">\n <div class="pushwoosh-subscription-segments__header">\n '+content.headerText+'\n </div>\n <div class="pushwoosh-subscription-segments__body">\n <div class="pushwoosh-subscription-segments__sub-header">\n '+(content.subHeaderText?content.subHeaderText:"")+'\n </div>\n <div class="pushwoosh-subscription-segments__channels">\n '+segments.reduce(function(result,segment){return result+'<div class="pushwoosh-subscription-segments__channel">\n <label class="pushwoosh-subscription-segments__label">\n <input\n class="pushwoosh-subscription-segments__field" \n type="checkbox" \n value="'+segment.code+'"\n checked="true"\n />\n <span class="pushwoosh-subscription-segments__icon">\n <svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M18.0303 8.46967C18.3232 8.76256 18.3232 9.23744 18.0303 9.53033L11.0303 16.5303C10.7374 16.8232 10.2626 16.8232 9.96967 16.5303L6.96967 13.5303C6.67678 13.2374 6.67678 12.7626 6.96967 12.4697C7.26256 12.1768 7.73744 12.1768 8.03033 12.4697L10.5 14.9393L16.9697 8.46967C17.2626 8.17678 17.7374 8.17678 18.0303 8.46967Z" fill="currentColor"/>\n </svg>\n </span>\n <span class="pushwoosh-subscription-segments__text">\n '+segment.name+"\n </span>\n </label>\n </div>"},"")+'\n </div>\n <div class="pushwoosh-subscription-segments__controls">\n <button type="button" id="pushwoosh-subscription-segments-deny" class="pushwoosh-subscription-segments__control pushwoosh-subscription-segments__control_deny">\n '+content.controlsDenyButtonText+'\n </button>\n <button type="button" id="pushwoosh-subscription-segments-accept" class="pushwoosh-subscription-segments__control pushwoosh-subscription-segments__control_accept">\n '+content.controlsButtonText+"\n </button>\n </div>\n </div>\n </div>\n "},exports.getStyles=function(content){var styles=document.createElement("style");return styles.innerHTML="\n .pushwoosh-subscription-segments * {\n box-sizing: border-box!important;\n }\n \n .pushwoosh-subscription-segments {\n padding: 24px 16px 16px 24px!important;\n user-select: none!important;\n }\n \n .pushwoosh-subscription-segments__header {\n font-weight: bold!important;\n font-size: 20px!important;\n line-height: 23px!important;\n }\n \n .pushwoosh-subscription-segments__sub-header {\n margin-top: 16px!important;\n font-size: 16px!important;\n line-height: 24px!important;\n color: rgba(0, 0, 0, 0.54)!important;\n }\n \n .pushwoosh-subscription-segments__sub-header:empty {\n display:none!important;\n }\n \n .pushwoosh-subscription-segments__channels {\n margin-top: 16px!important;\n font-size: 16px!important;\n line-height: 24px!important;\n }\n \n .pushwoosh-subscription-segments__channel + .pushwoosh-subscription-segments__channel {\n margin-top: 8px!important;\n }\n \n .pushwoosh-subscription-segments__label {\n display: inline-flex!important;\n align-items: flex-start!important;\n cursor: pointer!important;\n }\n \n .pushwoosh-subscription-segments__field {\n display: none!important;\n }\n \n .pushwoosh-subscription-segments__icon {\n display: block!important;\n line-height: 0!important;\n width: 20px!important;\n height: 20px!important;\n border: 1px solid #ddd!important;\n border-radius: 4px!important;\n color: #fff!important;\n margin: 2px 8px 0 0!important;\n }\n \n .pushwoosh-subscription-segments__text {\n color: "+content.channelsTextColor+"!important;\n }\n \n .pushwoosh-subscription-segments__controls {\n margin-top: 24px!important;\n text-align: right!important;\n }\n \n .pushwoosh-subscription-segments__field:checked + .pushwoosh-subscription-segments__icon {\n background: "+content.channelsToggleColor+"!important;\n border: 1px solid transparent!important;\n }\n \n .pushwoosh-subscription-segments__control {\n appearance: none!important;\n height: 36px!important;\n border-radius: 4px!important;\n padding: 0 16px!important;\n font-weight: bold!important;\n font-size: 14px!important;\n line-height: 16px!important;\n cursor: pointer!important;\n }\n \n .pushwoosh-subscription-segments__control + .pushwoosh-subscription-segments__control {\n margin: 0 0 0 4px!important;\n }\n \n .pushwoosh-subscription-segments__control.pushwoosh-subscription-segments__control_deny {\n border: none!important;\n color: "+content.controlsDenyButtonTextColor+"!important;\n background-color: "+content.controlsDenyButtonBackgroundColor+"!important;\n border-radius: "+content.controlsDenyButtonRound+"!important;\n }\n \n .pushwoosh-subscription-segments__control.pushwoosh-subscription-segments__control_accept {\n border: none!important;\n color: "+content.controlsButtonTextColor+"!important;\n background-color: "+content.controlsButtonBackgroundColor+"!important;\n border-radius: "+content.controlsButtonRound+"!important;\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var SubscriptionPromptWidget_helpers_1=__webpack_require__(126),SubscriptionPromptWidget_constants_1=__webpack_require__(76),SubscriptionPromptWidget=function(){function SubscriptionPromptWidget(eventBus,pw){this.eventBus=eventBus,this.pw=pw}return SubscriptionPromptWidget.prototype.init=function(params){if(!this.getRootElement()){var html=SubscriptionPromptWidget_helpers_1.getHTML(params),styles=SubscriptionPromptWidget_helpers_1.getStyles(params);document.body.insertAdjacentHTML("beforeend",html),document.head.appendChild(styles)}this.addEventListeners()},SubscriptionPromptWidget.prototype.show=function(){var rootElement=this.getRootElementWithCheckExist();this.eventBus.dispatchEvent("show-subscription-widget",{}),rootElement.classList.add(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show")},SubscriptionPromptWidget.prototype.hide=function(){var rootElement=this.getRootElementWithCheckExist();rootElement.classList.contains(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show")&&(this.eventBus.dispatchEvent("hide-subscription-widget",{}),rootElement.classList.remove(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show"))},SubscriptionPromptWidget.prototype.getRootElement=function(){return document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-root")},SubscriptionPromptWidget.prototype.getRootElementWithCheckExist=function(){var element=this.getRootElement();if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-root", please use method init first.');return element},SubscriptionPromptWidget.prototype.getDeclineButtonWithCheckExist=function(){var element=document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-decline");if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-decline", please use method init first.');return element},SubscriptionPromptWidget.prototype.getAcceptButtonWithCheckExist=function(){var element=document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-accept");if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-accept", please use method init first.');return element},SubscriptionPromptWidget.prototype.addEventListeners=function(){var _this=this,rootElement=this.getRootElementWithCheckExist(),declineElement=this.getDeclineButtonWithCheckExist(),acceptElement=this.getAcceptButtonWithCheckExist();document.addEventListener("click",function(event){rootElement.contains(event.target)||_this.hide()}),declineElement.addEventListener("click",function(){_this.hide()}),acceptElement.addEventListener("click",function(){_this.hide(),_this.pw.subscribe()})},SubscriptionPromptWidget}();exports.SubscriptionPromptWidget=SubscriptionPromptWidget},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var SubscriptionPromptWidget_constants_1=__webpack_require__(76);exports.getHTML=function(params){return'\n <div id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-root" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'">\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__body">\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__header">\n '+params.headerText+'\n </div>\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__description">\n '+params.subheaderText+'\n </div>\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__controls">\n <button type="button" id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-decline" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control "+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__control_decline">\n '+params.buttonCancelText+'\n </button>\n <button type="button" id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-accept" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control "+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__control_accept">\n '+params.buttonAcceptText+"\n </button>\n </div>\n </div>\n </div>\n "},exports.getStyles=function(params){var styles=document.createElement("style");return styles.innerHTML="\n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+" * {\n box-sizing: border-box!important;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+" {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 320px;\n display: none;\n z-index: 2147483648;\n opacity: 0.99;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show {\n display: block;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__body {\n width: 320px;\n background-color: "+(params.backgroundColor?params.backgroundColor:"#FFFFFF")+";\n box-shadow: 0 9px 15px rgba(0, 0, 0, 0.1), 0 0 6px rgba(0, 0, 0, 0.06);\n border-radius: 4px;\n padding: 20px 20px 12px;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__header {\n color: "+params.headerTextColor+";\n font-size: 18px;\n font-weight: bold; \n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__description {\n color: "+params.subheaderTextColor+";\n font-size: 14px;\n line-height: 1.5;\n margin-top: 14px;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__description:empty {\n display: none;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__controls {\n display: flex;\n flex-wrap: nowrap;\n justify-content: flex-end;\n margin: 20px 0 0;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control {\n -webkit-appearance: none;\n border: 1px solid transparent;\n font-size: 12px;\n font-weight: bold;\n padding: 0 20px;\n height: 32px;\n cursor: pointer;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control_decline {\n color: "+params.buttonCancelTextColor+";\n background-color: "+params.buttonCancelBackgroundColor+";\n border-radius: "+params.buttonCancelRound+";\n border-color: "+params.buttonCancelBorderColor+";\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control_accept {\n color: "+params.buttonAcceptTextColor+";\n background-color: "+params.buttonAcceptBackgroundColor+";\n border-radius: "+params.buttonAcceptRound+";\n border-color: "+params.buttonAcceptBorderColor+";\n margin: 0 0 0 12px;\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1),functions_1=__webpack_require__(10),storage_1=__webpack_require__(3),FacebookModule=function(){function FacebookModule(config){this.userRef=functions_1.generateUUID(),this.config=config,this.init()}return FacebookModule.prototype.init=function(){this.renderCheckbox(),this.initFacebookSDK(),this.loadFacebookSDK()},FacebookModule.prototype.renderCheckbox=function(){for(var _a=this.config,pageId=_a.pageId,containerClass=_a.containerClass,attributes=[{name:"messenger_app_id",value:constants_1.FACEBOOK_APP_ID},{name:"class",value:"fb-messenger-checkbox"},{name:"page_id",value:pageId},{name:"origin",value:window.location.protocol+"//"+window.location.hostname},{name:"user_ref",value:this.userRef},{name:"allow_login",value:"true"},{name:"size",value:"large"},{name:"skin",value:"light"},{name:"center_align",value:"false"}],nodes=document.getElementsByClassName(containerClass),_loop_1=function(index){var node=document.createElement("div");attributes.forEach(function(attribute){node.setAttribute(attribute.name,attribute.value)}),nodes[index].appendChild(node)},index=0;index<nodes.length;index++)_loop_1(index)},FacebookModule.prototype.getHWID=function(){return __awaiter(this,void 0,void 0,function(){var hwid,applicationCode,newHWID;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.keyValue.get(constants_1.FACEBOOK_HWID_KEY)];case 1:return(hwid=_a.sent())?[3,3]:(applicationCode=this.config.applicationCode,newHWID=applicationCode+"_"+functions_1.generateUUID()+"_fb",[4,storage_1.keyValue.set(constants_1.FACEBOOK_HWID_KEY,newHWID)]);case 2:return _a.sent(),[2,newHWID];case 3:return[2,hwid]}})})},FacebookModule.prototype.userConfirm=function(){return __awaiter(this,void 0,void 0,function(){var _a,pageId,applicationCode,userId,FB,facebookHwid;return __generator(this,function(_b){switch(_b.label){case 0:return _a=this.config,pageId=_a.pageId,applicationCode=_a.applicationCode,userId=_a.userId,FB=window.FB,[4,this.getHWID()];case 1:return facebookHwid=_b.sent(),FB&&FB.AppEvents.logEvent("MessengerCheckboxUserConfirmation",null,{app_id:constants_1.FACEBOOK_APP_ID,page_id:pageId,ref:JSON.stringify({applicationCode:applicationCode,userId:userId,hwid:facebookHwid}),user_ref:this.userRef}),[2]}})})},FacebookModule.prototype.initFacebookSDK=function(){var _this=this;window.fbAsyncInit=function(){window.FB.init({appId:constants_1.FACEBOOK_APP_ID,xfbml:!0,version:"v3.2"}),window.FB.Event.subscribe("messenger_checkbox",function(_a){"checkbox"===_a.event&&_this.userConfirm()})}},FacebookModule.prototype.loadFacebookSDK=function(){var language=navigator.language||"en_US";!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];d.getElementById(id)||((js=d.createElement(s)).id=id,js.src="https://connect.facebook.net/"+language+"/sdk.js",fjs&&fjs.parentNode.insertBefore(js,fjs))}(document,"script","facebook-jssdk")},FacebookModule}();exports.default=FacebookModule},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Modal_1=__webpack_require__(129),RichMedia_1=__webpack_require__(131),expanders_1=__webpack_require__(141),Data_1=__webpack_require__(5),InApps=function(){function InApps(options,pw,eventBus,api){this.delayInApps=[],this.isLoadedInAppsList=!1,this.pw=pw,this.options=options,this.eventBus=eventBus,this.api=api,this.modal=new Modal_1.Modal(this.options&&this.options.modal?this.options.modal:{}),this.data=new Data_1.Data}return InApps.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var inApps,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return this.subscribeToReceiveMessageFromIFrame(),this.eventBus.addEventHandler("receive-in-app-code",function(_a){var code=_a.code;_this.isLoadedInAppsList?_this.showInApp(code):_this.delayInApps.push(code)}),[4,this.getList()];case 1:return inApps=_a.sent().inApps,this.delayInApps.length&&this.delayInApps.forEach(function(code){_this.showInApp(code)}),this.isLoadedInAppsList=!0,[4,this.data.setInApps(inApps)];case 2:return _a.sent(),this.inApps=inApps,[2]}})})},InApps.prototype.subscribeToReceiveMessageFromIFrame=function(){var _this=this;window.addEventListener("message",function(event){if(event.source&&(event.source===window||"parent"in event.source&&event.source.parent===window))try{var data=JSON.parse(event.data);data&&"object"==typeof data&&_this.onReceiveNewMessageFromIFrame(data)}catch(e){}})},InApps.prototype.onReceiveNewMessageFromIFrame=function(message){var _this=this;switch(message.method){case"subscribe":this.pw.subscribe().then(function(){_this.modal.postMessage({code:message.code})});break;case"unsubscribe":this.pw.unsubscribe().then(function(){_this.modal.postMessage({code:message.code})});break;case"getTags":this.pw.api.getTags().then(function(_a){var result=_a.result;_this.modal.postMessage({code:message.code,tags:result})});break;case"setTags":this.pw.api.setTags(message.options.tags).then(function(){_this.modal.postMessage({code:message.code})});break;case"getChannels":this.data.getFeatures().then(function(_a){var channels=_a.channels;_this.modal.postMessage({code:message.code,channels:channels})});break;case"checkSubscription":this.api.checkDeviceSubscribeForPushNotifications().then(function(state){_this.modal.postMessage({code:message.code,state:state})});break;case"checkManualUnsubscribed":this.data.getStatusManualUnsubscribed().then(function(state){_this.modal.postMessage({code:message.code,state:state})});break;case"closeInApp":this.modal.hide();break;case"openLink":window.open(message.options.href,"_blank")}},InApps.prototype.showInApp=function(code){return __awaiter(this,void 0,void 0,function(){var filteredRichMedia,currentRichMedia,inAppContent;return __generator(this,function(_a){switch(_a.label){case 0:if(1!==(filteredRichMedia=this.inApps.filter(function(inApp){return inApp.code===code})).length)throw new Error("Can't find Rich Media");return this.modal.setLoading().show(),currentRichMedia=filteredRichMedia[0],[4,new RichMedia_1.RichMedia(currentRichMedia.url,this.api,[expanders_1.ExpanderPushwooshSendMessage,expanders_1.ExpanderPushwoosh,expanders_1.ExpanderPushManager]).getContent()];case 1:return inAppContent=_a.sent(),[4,this.modal.setContent(inAppContent)];case 2:return _a.sent(),this.modal.removeLoading().showContent(),[2]}})})},InApps.prototype.getList=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.getInApps()]})})},InApps}();exports.InApps=InApps},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var Modal_constants_1=__webpack_require__(130),Modal=function(){function Modal(options){var _this=this;void 0===options&&(options={});var wrapper=document.getElementById(Modal_constants_1.MODAL_WRAPPER_NAMESPACE),inner=document.getElementById(Modal_constants_1.MODAL_INNER_NAMESPACE),loader=document.getElementById(Modal_constants_1.MODAL_LOADER_NAMESPACE),iframe=document.getElementById(Modal_constants_1.MODAL_IFRAME_NAMESPACE),close=document.getElementById(Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE);if(this.option=__assign(__assign({},Modal_constants_1.MODAL_DEFAILT_OPTIONS),options),!(wrapper&&inner&&loader&&iframe&&close)){(wrapper=document.createElement("div")).id=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,(inner=document.createElement("div")).id=Modal_constants_1.MODAL_INNER_NAMESPACE,inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,(loader=document.createElement("div")).id=Modal_constants_1.MODAL_LOADER_NAMESPACE,loader.className=Modal_constants_1.MODAL_LOADER_NAMESPACE,(close=document.createElement("button")).id=Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE,close.className=Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE,(iframe=document.createElement("iframe")).id=Modal_constants_1.MODAL_IFRAME_NAMESPACE,iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE,inner.appendChild(iframe),inner.appendChild(close),this.option.isShowPreloader&&inner.appendChild(loader),wrapper.appendChild(inner),document.body.appendChild(wrapper);var style=document.createElement("style");style.innerHTML="\n ."+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+" {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2147483648;\n opacity: 0.999;\n display:none;\n }\n\n ."+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+"_state-show {\n display: block;\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+" {\n width: 100%;\n height: 100%;\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading {\n background-color: "+this.option.backgroundColor+";\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+" {\n appearance: none;\n border: none;\n background-color: transparent;\n box-shadow: none;\n position: absolute;\n top: 20px;\n right: 20px;\n width: 40px;\n height: 40px;\n cursor: pointer;\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+":after {\n content: '';\n position: absolute;\n top: 50%;\n left:50%;\n width: 30px;\n height: 2px;\n background-color: "+this.option.closeButtonColor+";\n transform: translateX(-50%) translateY(-50%) rotate(-45deg);\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+":before {\n content: '';\n position: absolute;\n top: 50%;\n left:50%;\n width: 30px;\n height: 2px;\n background-color: "+this.option.closeButtonColor+";\n transform: translateX(-50%) translateY(-50%) rotate(45deg);\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n display: none;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+",\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before,\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n border-radius: 50%;\n width: 2.5em;\n height: 2.5em;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n -webkit-animation: "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" 1.8s infinite ease-in-out;\n animation: "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" 1.8s infinite ease-in-out;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n color: #ffffff;\n font-size: 10px;\n text-indent: -9999em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation-delay: -0.16s;\n animation-delay: -0.16s;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before,\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n content: '';\n position: absolute;\n top: 0;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before {\n left: -3.5em;\n -webkit-animation-delay: -0.32s;\n animation-delay: -0.32s;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n left: 3.5em;\n }\n\n @-webkit-keyframes "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n 0%,\n 80%,\n 100% {\n box-shadow: 0 2.5em 0 -1.3em "+this.option.preloaderColor+";\n }\n 40% {\n box-shadow: 0 2.5em 0 0 "+this.option.preloaderColor+";\n }\n }\n\n @keyframes "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n 0%,\n 80%,\n 100% {\n box-shadow: 0 2.5em 0 -1.3em "+this.option.preloaderColor+";\n }\n 40% {\n box-shadow: 0 2.5em 0 0 "+this.option.preloaderColor+";\n }\n }\n\n ."+Modal_constants_1.MODAL_IFRAME_NAMESPACE+" {\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n display: none;\n }\n\n ."+Modal_constants_1.MODAL_IFRAME_NAMESPACE+"_state-show {\n display: block;\n }\n ",document.head.appendChild(style)}this.wrapper=wrapper,this.inner=inner,this.iframe=iframe,close.addEventListener("click",function(){_this.hide()})}return Modal.prototype.postMessage=function(data){this.iframe.contentWindow.postMessage(JSON.stringify(data),"*")},Modal.prototype.show=function(){return this.wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE+" "+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+"_state-show",document.body.style.overflow="hidden",this},Modal.prototype.hide=function(){return this.wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,document.body.style.overflow="auto",this},Modal.prototype.setLoading=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE+" "+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading",this.iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE,this},Modal.prototype.removeLoading=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,this},Modal.prototype.setContent=function(content){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return this.iframe.srcdoc=content,[2,new Promise(function(resolve,reject){_this.iframe.onload=resolve,_this.iframe.onerror=reject})]})})},Modal.prototype.showContent=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,this.iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE+" "+Modal_constants_1.MODAL_IFRAME_NAMESPACE+"_state-show",this},Modal}();exports.Modal=Modal},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MODAL_WRAPPER_NAMESPACE="pushwoosh-in-app-modal-wrapper",exports.MODAL_INNER_NAMESPACE="pushwoosh-in-app-modal-inner",exports.MODAL_LOADER_NAMESPACE="pushwoosh-in-app-modal-loader",exports.MODAL_CLOSE_BUTTON_NAMESPACE="pushwoosh-in-app-modal-close-button",exports.MODAL_IFRAME_NAMESPACE="pushwoosh-in-app-modal-iframe",exports.MODAL_DEFAILT_OPTIONS={backgroundColor:"rgba(0, 0, 0, .8)",closeButtonColor:"rgba(255, 255, 255, .8)",closeButtonHoverColor:"rgba(255, 255, 1)",isShowPreloader:!0,preloaderColor:"rgba(255, 255, 255, 1)"}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var detect_browser_1=__webpack_require__(132),getZip_1=__webpack_require__(50),DynamicContent_1=__webpack_require__(133),RichMediaExpander_1=__webpack_require__(135),ExternalResources_1=__webpack_require__(136),RichMedia=function(){function RichMedia(url,api,expanders){this.url=url,this.api=api,this.expanders=expanders}return RichMedia.prototype.getContent=function(){return __awaiter(this,void 0,void 0,function(){var language,jszip,values,_a,_b,content,browser,context;return __generator(this,function(_c){switch(_c.label){case 0:return[4,this.api.getTags()];case 1:return language=_c.sent().result.Language,[4,getZip_1.getZip(this.url)];case 2:if(!(jszip=_c.sent()).files["index.html"])throw new Error("Can't find index.html");if(!jszip.files["pushwoosh.json"])throw new Error("Can't find pushwoosh.json");return _b=(_a=JSON).parse,[4,jszip.file("pushwoosh.json").async("text")];case 3:return values=_b.apply(_a,[_c.sent()]),[4,jszip.file("index.html").async("text")];case 4:return content=_c.sent(),browser=detect_browser_1.detect(),context={platform:"web",browser:browser&&browser.name||"unknown",os:browser&&browser.os||"unknown",isMobileBrowser:this.checkIsMobileBrowser()},content=new DynamicContent_1.DynamicContent(content,values,language).getReplacedContent(),[4,new ExternalResources_1.ExternalResources(content,jszip).getReplacedContent()];case 5:return content=_c.sent(),content=new DynamicContent_1.DynamicContent(content,values,language).getReplacedContent(),content=new RichMediaExpander_1.RichMediaExpander(content,['<script type="text/javascript">\n window.pushwoosh.platform = \''+context.platform.replace(" ","").toLowerCase()+"';\n window.pushwoosh.browser = '"+context.browser.replace(" ","").toLowerCase()+"';\n window.pushwoosh.os = '"+context.os.replace(" ","").toLowerCase()+"';\n window.pushwoosh.isMobileBrowser = "+context.isMobileBrowser+";\n <\/script>"]).uploadExpanders(),[2,content=new RichMediaExpander_1.RichMediaExpander(content,this.expanders).uploadExpanders()]}})})},RichMedia.prototype.checkIsMobileBrowser=function(){var isMobileBrowser=!1;return function(str){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(str)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(str.substr(0,4)))&&(isMobileBrowser=!0)}(navigator.userAgent||navigator.vendor||window.opera),isMobileBrowser},RichMedia}();exports.RichMedia=RichMedia},function(module,exports,__webpack_require__){"use strict";(function(process){var __spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0});var BrowserInfo=function(){return function(name,version,os){this.name=name,this.version=version,this.os=os}}();exports.BrowserInfo=BrowserInfo;var NodeInfo=function(){return function(version){this.version=version,this.name="node",this.os=process.platform}}();exports.NodeInfo=NodeInfo;var BotInfo=function(){return function(){this.bot=!0,this.name="bot",this.version=null,this.os=null}}();exports.BotInfo=BotInfo;var REQUIRED_VERSION_PARTS=3,userAgentRules=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["vivaldi",/Vivaldi\/([0-9\.]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/Edg\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/],["Search Bot",/(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\/Teoma)|(ia_archiver)/]];function parseUserAgent(ua){var matchedRule=""!==ua&&userAgentRules.reduce(function(matched,_a){var browser=_a[0],regex=_a[1];if(matched)return matched;var uaMatch=regex.exec(ua);return!!uaMatch&&[browser,uaMatch]},!1);if(!matchedRule)return null;var name=matchedRule[0],match=matchedRule[1];if("searchbot"===name)return new BotInfo;var versionParts=match[1]&&match[1].split(/[._]/).slice(0,3);return versionParts?versionParts.length<REQUIRED_VERSION_PARTS&&(versionParts=__spreadArrays(versionParts,function(count){for(var output=[],ii=0;ii<count;ii++)output.push("0");return output}(REQUIRED_VERSION_PARTS-versionParts.length))):versionParts=[],new BrowserInfo(name,versionParts.join("."),detectOS(ua))}function detectOS(ua){for(var ii=0,count=operatingSystemRules.length;ii<count;ii++){var _a=operatingSystemRules[ii],os=_a[0];if(_a[1].test(ua))return os}return null}function getNodeVersion(){return void 0!==process&&process.version?new NodeInfo(process.version.slice(1)):null}exports.detect=function(userAgent){return userAgent?parseUserAgent(userAgent):"undefined"!=typeof navigator?parseUserAgent(navigator.userAgent):getNodeVersion()},exports.parseUserAgent=parseUserAgent,exports.detectOS=detectOS,exports.getNodeVersion=getNodeVersion}).call(this,__webpack_require__(24))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var DynamicContent_constants_1=__webpack_require__(134),DynamicContent=function(){function DynamicContent(content,values,language){this.content=content,this.values=values,this.language=language}return DynamicContent.prototype.getReplacedContent=function(){var _this=this,regexp=new RegExp("\\{\\{[^\\}\\}]*}}","gm");return this.content.replace(regexp,function(substring){var pattern=substring.replace("}}","").replace("{{","");return _this.getResultingContent(pattern)})},DynamicContent.prototype.getResultingContent=function(pattern){var _a=pattern.split("|"),name=_a[0],modifier=_a[1],_b=_a[2],value=void 0===_b?"":_b,hasReplacedValueByCurrentLanguage=this.values.localization&&this.values.localization[this.language]&&this.values.localization[this.language][name],hasReplacedValueByDefaultLanguage=this.values.localization&&this.values.localization[this.values.default_language]&&this.values.localization[this.values.default_language][name];return hasReplacedValueByCurrentLanguage?value=this.values.localization[this.language][name]:hasReplacedValueByDefaultLanguage&&(value=this.values.localization[this.values.default_language][name]),this.updateStringByModifier(value,modifier)},DynamicContent.prototype.updateStringByModifier=function(string,modifier){switch(modifier.toLowerCase()){case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_FIRST:return string=(string=string.toLowerCase()).charAt(0).toUpperCase()+string.substring(1);case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_ALL_FIRST:for(var arrLetters=string.toLowerCase().split(" "),i=0;i<arrLetters.length;i++)arrLetters[i]=arrLetters[i].charAt(0).toUpperCase()+arrLetters[i].substring(1);return string=arrLetters.join(" ");case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_UPPERCASE:return string.toUpperCase();case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_LOWERCASE:return string.toLowerCase();default:return string}},DynamicContent}();exports.DynamicContent=DynamicContent},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_FIRST="capitalizefirst",exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_ALL_FIRST="capitalizeallfirst",exports.DYNAMIC_CONTENT_MODIFIER_UPPERCASE="uppercase",exports.DYNAMIC_CONTENT_MODIFIER_LOWERCASE="lowercase"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var RichMediaExpander=function(){function RichMediaExpander(content,expanders){void 0===expanders&&(expanders=[]),this.content=content,this.expanders=expanders}return RichMediaExpander.prototype.uploadExpanders=function(){var merge=this.expanders.join("\r\n");return this.content.replace("<head>","<head>"+merge)},RichMediaExpander}();exports.RichMediaExpander=RichMediaExpander},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var logger_1=__webpack_require__(4),UrlParser_1=__webpack_require__(137),ExternalResources_constants_1=__webpack_require__(140),ExternalResources=function(){function ExternalResources(content,jszip){this.content=content,this.jszip=jszip}return ExternalResources.prototype.getReplacedContent=function(){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return[2,this.replaceExternalStyles(this.content).then(function(content){return _this.replaceExternalBackgroundUrl(content)}).then(function(content){return _this.replaceExternalImage(content)}).then(function(content){return _this.replaceExternalScript(content)})]})})},ExternalResources.prototype.replaceExternalStyles=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("style"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,relative;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("text")]:[2,substring];case 2:return content=_a.sent(),relative=path.split("/").splice(-1,1).join("/"),[4,this.replaceExternalBackgroundUrl(content,relative)];case 3:return[2,'<style type="text/css">'+_a.sent().replace("\n","")+"</style>"]}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalBackgroundUrl=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("backgroundUrl"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,extension;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("base64")]:[2,substring];case 2:return content=_a.sent(),[2,'url("data:image/'+("svg"===(extension=path.split(".").pop())?"svg+xml":extension)+";base64,"+content+'")']}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalImage=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("image"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,extension;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("base64")]:[2,substring];case 2:return content=_a.sent(),[2,'<img src="data:image/'+("svg"===(extension=path.split(".").pop())?"svg+xml":extension)+";base64,"+content+'" alt="">']}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalScript=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("script"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("text")]:[2,substring];case 2:return[2,"<script>"+_a.sent()+"<\/script>"]}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.getSearchPattern=function(type){switch(type){case"style":return"<link[^>]*href=('|\")([^>]*.(css))('|\")[^>]*>";case"backgroundUrl":return"url\\s*\\(('|\")?([^)]*\\.(gif|jpg|jpeg|png|svg))('|\")?\\s*\\)";case"image":return"<img[^\\/?>]*src=('|\")([^>]*\\.(gif|jpg|jpeg|png|svg))('|\")[^\\/?>]*>";case"script":return"<script[^>]*src=('|\")(.*\\.js)('|\")[^>]*>(\\n|\\r|\\s)*<\\/script>"}},ExternalResources.prototype.replacer=function(content,pattern,callback){return __awaiter(this,void 0,void 0,function(){var arPromises,regexp,replaces;return __generator(this,function(_a){switch(_a.label){case 0:return arPromises=[],regexp=new RegExp(pattern,"g"),content.replace(regexp,function(substring){return arPromises.push(callback(substring)),substring}),[4,Promise.all(arPromises)];case 1:return replaces=_a.sent(),[2,content.replace(regexp,function(){return replaces.shift()||""})]}})})},ExternalResources.prototype.getReplacedFilePath=function(substring,pattern,matchPosition,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var regexp,matches,match,url,path;return __generator(this,function(_a){return regexp=new RegExp(pattern),(matches=substring.match(regexp))&&matches.length?(match=matches[matchPosition],(url=new UrlParser_1.UrlParser(match,base)).checkIsAbsolutePath()?[2]:(path=url.getRelativePath(),this.jszip.files[path]?[2,path]:(logger_1.Logger.write("error",'Not found file: "'+path+'" for replace.'),[2]))):[2]})})},ExternalResources}();exports.ExternalResources=ExternalResources},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var resolver=__webpack_require__(138),UrlParser_constants_1=__webpack_require__(139),UrlParser=function(){function UrlParser(url,base){void 0===base&&(base="/"),this.url=url,this.base=base}return UrlParser.prototype.checkIsAbsolutePath=function(){return new RegExp("^(?:[a-z]+:)?//","i").test(this.url)},UrlParser.prototype.getRelativePath=function(){var pathWithBase=resolver(UrlParser_constants_1.URL_PARSER_PSEUDO_DOMAIN,this.base);return resolver(pathWithBase,this.url).replace(UrlParser_constants_1.URL_PARSER_PSEUDO_DOMAIN,"")},UrlParser}();exports.UrlParser=UrlParser},function(module,exports,__webpack_require__){"use strict";function _addSlash(url){return url+("/"===url[url.length-1]?"":"/")}function _pathResolve(path){var pathSplit=path.split("/");""===pathSplit[0]&&(pathSplit=pathSplit.slice(1));var resultArray=[];return pathSplit.forEach(function(current,index){"."!==current&&(".."===current?resultArray.pop():""!==current&&resultArray.push(current))}),"/"+resultArray.join("/")}module.exports=function(base,relative){if(base=base.trim(),(relative=relative.trim()).startsWith("about:"))return relative;if(""===base)return _shouldAddSlash(relative)?_addSlash(relative):relative;var baseObj=function(base){var resultObject={host:"",path:"",query:"",protocol:""},path=base,protocolEndIndex=base.indexOf("//");if(-1===protocolEndIndex)throw new Error("Error, protocol is not specified");resultObject.protocol=path.substring(0,protocolEndIndex),protocolEndIndex+=2;var pathIndex=base.indexOf("/",protocolEndIndex),queryIndex=base.indexOf("?"),hashIndex=base.indexOf("#");-1!==hashIndex&&(path=path.substring(0,hashIndex));if(-1!==queryIndex){var query=path.substring(queryIndex);resultObject.query=query,path=path.substring(0,queryIndex)}if(-1!==pathIndex){var host=path.substring(0,pathIndex);resultObject.host=host,path=path.substring(pathIndex),resultObject.path=path}else resultObject.host=path;return resultObject}(base);if(""===relative){var host=baseObj.host,path=baseObj.path,query=baseObj.query;return path||query?host+path+query:_addSlash(host)}var relativeObj=function(relative){var resultObject={href:relative,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(_isAbsolute.test(relative))return resultObject.netPath=!0,resultObject;"/"===relative[0]?resultObject.absolutePath=!0:resultObject.relativePath=!0;var path=relative,queryIndex=relative.indexOf("?"),hashIndex=relative.indexOf("#");if(-1!==hashIndex){var hash=path.substring(hashIndex);resultObject.hash=hash,path=path.substring(0,hashIndex)}if(-1!==queryIndex){var query=path.substring(queryIndex);resultObject.query=query,path=path.substring(0,queryIndex)}return resultObject.path=path,resultObject}(relative);if(relativeObj.netPath)return function(url){return url.startsWith("//")}(relativeObj.href)&&(relativeObj.href=baseObj.protocol+relativeObj.href),_shouldAddSlash(relativeObj.href)?_addSlash(relativeObj.href):relativeObj.href;if(relativeObj.absolutePath){var _path=relativeObj.path,_query=relativeObj.query,hash=relativeObj.hash;return baseObj.host+_pathResolve(_path)+_query+hash}if(relativeObj.relativePath){var resolvePath,_path2=relativeObj.path,_query2=relativeObj.query,_hash=relativeObj.hash,basePath=baseObj.path,resultString=baseObj.host;return 0===_path2.length?resolvePath=basePath:(basePath=basePath.substring(0,basePath.lastIndexOf("/")),resolvePath=_pathResolve(basePath+"/"+_path2)),resultString+=""!==resolvePath||_query2||_hash?resolvePath+_query2+_hash:"/"}};var _isAbsolute=new RegExp("^(".concat("[a-z][a-z0-9+.-]*",":)?//"),"i");function _shouldAddSlash(url){var protocolIndex=url.indexOf("//")+2,noPath=!url.includes("/",protocolIndex),noQuery=!url.includes("?",protocolIndex),noHash=!url.includes("#",protocolIndex);return noPath&&noQuery&&noHash}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.URL_PARSER_PSEUDO_DOMAIN="https://pushwoosh.com/"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP=2},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var RichMediaPushwooshSendMessage_html_1=__webpack_require__(142);exports.ExpanderPushwooshSendMessage=RichMediaPushwooshSendMessage_html_1.default;var RichMediaPushwoosh_html_1=__webpack_require__(143);exports.ExpanderPushwoosh=RichMediaPushwoosh_html_1.default;var RichMediaPushManager_html_1=__webpack_require__(144);exports.ExpanderPushManager=RichMediaPushManager_html_1.default},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default='<script type="text/javascript">\n function PushwooshSendMessage(message, success, failure) {\n var code = uuidv4();\n\n if (success) {\n window.addEventListener(\'message\', function (event) {\n if (!event.source) {\n return;\n }\n\n if (window.top === event.source.parent) {\n try {\n const data = JSON.parse(event.data);\n\n if (data && data.code === code) {\n success && success(data);\n }\n } catch (error) {\n failure && failure(error);\n }\n }\n });\n }\n\n var data = Object.assign(\n message,\n {\n code: code\n }\n );\n\n window.parent.postMessage(JSON.stringify(data), "*");\n\n function uuidv4() {\n return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {\n var r = (Math.random() * 16) | 0,\n v = c == "x" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n }\n<\/script>\n'},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default="<script type=\"text/javascript\">\n function PushwooshBridge() {\n var self = this;\n\n self.isWebSDK = true;\n self.isSafari = navigator.userAgent.toLowerCase().indexOf('safari') !== -1\n && navigator.userAgent.toLowerCase().indexOf('chrome') === -1;\n\n self.registerForPushNotifications = function () {\n PushwooshSendMessage({\n method: 'subscribe',\n })\n };\n\n self.unregisterForPushNotifications = function () {\n PushwooshSendMessage({\n method: 'unsubscribe',\n });\n };\n\n self.getTags = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'getTags',\n }, function (result) {\n onSuccessCallback(result && result.tags);\n })\n };\n\n self.sendTags = function (tags) {\n PushwooshSendMessage({\n method: 'setTags',\n options: {\n tags: tags\n },\n });\n };\n\n self.isRegisteredForPushNotifications = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'checkSubscription',\n }, function (result) {\n onSuccessCallback(result.state)\n });\n };\n\n self.isManualUnregisterForPushNotifications = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'checkManualUnsubscribed',\n }, function (result) {\n onSuccessCallback(result.state)\n });\n };\n\n self.getChannels = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'getChannels',\n }, function (result) {\n onSuccessCallback(result.channels)\n });\n };\n }\n\n window.pushwoosh = new PushwooshBridge();\n<\/script>\n"},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default="<script type=\"text/javascript\">\n function PushwooshPushManagerBridge() {\n var self = this;\n var absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');\n\n self.closeInApp = function (options) {\n PushwooshSendMessage({\n method: 'closeInApp',\n options: options,\n });\n };\n\n self.openLink = function (options) {\n PushwooshSendMessage({\n method: 'openLink',\n options: options,\n });\n };\n\n window.addEventListener('load', function () {\n var closeLinks = document.querySelectorAll('a[href=\"pushwoosh://close\"]');\n var otherLinks = document.querySelectorAll('a:not([href=\"pushwoosh://close\"])');\n\n for (var i = 0; i < closeLinks.length; i++) {\n closeLinks[i].addEventListener('click', function (event) {\n event.preventDefault();\n\n self.closeInApp();\n });\n }\n\n for (var j = 0; j < otherLinks.length; j++) {\n var href = otherLinks[j].getAttribute('href');\n\n if (absoluteURLPattern.test(href)) {\n otherLinks[j].addEventListener('click', function (event) {\n event.preventDefault();\n\n self.openLink({\n href: event.target.href\n });\n\n self.closeInApp();\n });\n }\n }\n });\n }\n\n window.pushManager = new PushwooshPushManagerBridge();\n<\/script>\n"},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1),PlatformChecker_1=__webpack_require__(21),constants_2=__webpack_require__(77),positioning_1=__webpack_require__(146),bell_1=__webpack_require__(147),storage_1=__webpack_require__(3),SubscribeWidget=function(){function SubscribeWidget(pw){var _this=this;if(this.pw=pw,PlatformChecker_1.default.isAvailableNotifications){this.clickBell=this.clickBell.bind(this),this.onSubscribeEvent=this.onSubscribeEvent.bind(this),this.onUnsubscribeEvent=this.onUnsubscribeEvent.bind(this),this.onPermissionDeniedEvent=this.onPermissionDeniedEvent.bind(this),this.clickOutOfPopover=this.clickOutOfPopover.bind(this),this.onClickBellIfEnableChannels=this.onClickBellIfEnableChannels.bind(this);var tooltipText=Object.assign(constants_2.SUBSCRIBE_WIDGET_DEFAULT_CONFIG.tooltipText,pw.subscribeWidgetConfig.tooltipText);this.config=Object.assign({},constants_2.SUBSCRIBE_WIDGET_DEFAULT_CONFIG,pw.subscribeWidgetConfig),this.config.tooltipText=tooltipText;var arrActions=[],isEnableChannels=pw.isEnableChannels(),isSubscribed=pw.isSubscribed();arrActions.push(isEnableChannels),arrActions.push(isSubscribed),Promise.all(arrActions).then(function(_a){var isEnableChannels=_a[0],isSubscribed=_a[1];isEnableChannels&&(_this.isEnableChannels=!0),isSubscribed&&!isEnableChannels||_this.render()})}else console.warn("Browser does not support push notifications")}return SubscribeWidget.prototype.addStylesToElement=function(styles,element){Object.keys(styles).forEach(function(st){element.style[st]=styles[st]})},SubscribeWidget.prototype.createContainer=function(){var container=document.createElement("div");container.id=constants_2.WIDGET_CONTAINER_ID,container.className="pushwoosh-subscribe-widget";var position=positioning_1.default.getBellPosition(this.config.position,this.config.indent),styles=Object.assign({zIndex:this.config.zIndex},position);return this.addStylesToElement(styles,container),container},SubscribeWidget.prototype.createStyle=function(){var styles=__webpack_require__(148),styleNode=document.createElement("style");return styleNode.innerHTML=styles,styleNode},SubscribeWidget.prototype.createBell=function(){var bell,config=this.config;return config.buttonImage?(bell=document.createElement("img")).src=config.buttonImage:(bell=document.createElement("div"),this.addStylesToElement({backgroundColor:config.bgColor,boxShadow:config.shadow,lineHeight:config.size,border:config.bellButtonBorder},bell),bell.innerHTML=bell_1.default(config.bellColor,config.bellStrokeColor)),this.addStylesToElement({width:config.size,height:config.size},bell),bell.className="pushwoosh-subscribe-widget__bell-button",bell},SubscribeWidget.prototype.createTooltip=function(){return __awaiter(this,void 0,void 0,function(){var tooltip,_a,position,modification,_b,_c;return __generator(this,function(_d){switch(_d.label){case 0:return tooltip=document.createElement("div"),_a=positioning_1.default.getTooltipPosition(this.config.position,this.config.size),position=_a[0],modification=_a[1],tooltip.className="pushwoosh-subscribe-widget__tooltip pushwoosh-subscribe-widget__tooltip__"+modification,this.addStylesToElement(position,tooltip),_c=(_b=tooltip).appendChild,[4,this.createTooltipContent()];case 1:return _c.apply(_b,[_d.sent()]),[2,tooltip]}})})},SubscribeWidget.prototype.createTooltipContent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return tooltipContent=document.createElement("div"),_a=tooltipContent,[4,this.tooltipTextFactory()];case 1:return _a.innerText=_b.sent(),tooltipContent.className="pushwoosh-subscribe-widget__tooltip-content",[2,tooltipContent]}})})},SubscribeWidget.prototype.tooltipTextFactory=function(){return __awaiter(this,void 0,void 0,function(){var permission,tooltipText,isManuallyUnsubscribed;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.pw.driver.getPermission()];case 1:return permission=_a.sent(),tooltipText=this.config.tooltipText,[4,storage_1.keyValue.get(constants_1.MANUAL_UNSUBSCRIBE)];case 2:switch(isManuallyUnsubscribed=_a.sent(),permission){case constants_1.PERMISSION_GRANTED:return[2,isManuallyUnsubscribed?tooltipText.needSubscribe:tooltipText.alreadySubscribed];case constants_1.PERMISSION_PROMPT:return[2,tooltipText.needSubscribe];case constants_1.PERMISSION_DENIED:return[2,tooltipText.blockSubscribe];default:return[2,tooltipText.needSubscribe]}return[2]}})})},SubscribeWidget.prototype.createPopover=function(){var popoverContentWrapper=document.createElement("div"),popover=document.createElement("div"),_a=positioning_1.default.getPopoverPosition(this.config.position,this.config.size),position=_a[0],modification=_a[1];popover.className="pushwoosh-subscribe-widget__popover pushwoosh-subscribe-widget__popover__"+modification,popoverContentWrapper.className="pushwoosh-subscribe-widget__popover-content-wrapper",this.style.innerHTML+=positioning_1.default.getPopoverArrowPosition(this.config.position,this.config.size);var styles=Object.assign({maxWidth:"calc(100vw - "+this.config.indent+" - "+this.config.indent+")"},position);return this.addStylesToElement(styles,popover),popoverContentWrapper.appendChild(this.createPopoverContent()),popover.appendChild(popoverContentWrapper),popover},SubscribeWidget.prototype.getBrowserName=function(){return PlatformChecker_1.default.isOpera?"opera":11===PlatformChecker_1.default.platform&&navigator.userAgent.match(/Android/i)?"mobileChrome":12===PlatformChecker_1.default.platform?"firefox":10===PlatformChecker_1.default.platform?"safari":150===PlatformChecker_1.default.platform?"edge":"chrome"},SubscribeWidget.prototype.createPopoverContent=function(){var config=this.config,popoverContent=document.createElement("div");popoverContent.className="pushwoosh-subscribe-widget__popover-content";var browser=this.getBrowserName(),userImageSrc=config.contentImages&&config.contentImages[browser];if(userImageSrc){var image=document.createElement("img");image.src=userImageSrc,popoverContent.appendChild(image)}else{var standardImage={opera:"opera",mobileChrome:"mobile_chrome",firefox:"FF",safari:"safari"}[browser]||"chrome";[{src:this.getImageSrc(standardImage),width:500,height:130},{src:this.getImageSrc(standardImage+"_unlock"),width:500,height:230}].forEach(function(imageAttrs){var image=document.createElement("img");Object.assign(image,imageAttrs),popoverContent.appendChild(image)})}return popoverContent},SubscribeWidget.prototype.getImageSrc=function(img){return"https://cdn.pushwoosh.com/webpush/img/"+img+".jpg"},SubscribeWidget.prototype.render=function(){return __awaiter(this,void 0,void 0,function(){var bell,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:return this.widget=this.createContainer(),this.style=this.createStyle(),bell=this.createBell(),_a=this,[4,this.createTooltip()];case 1:return _a.tooltip=_c.sent(),_b=this,[4,this.createPopover()];case 2:return _b.popover=_c.sent(),this.widget.appendChild(this.style),this.widget.appendChild(bell),this.widget.appendChild(this.tooltip),this.widget.appendChild(this.popover),document.body.appendChild(this.widget),this.pw.push(["onSubscribe",this.onSubscribeEvent]),this.pw.push(["onUnsubscribe",this.onUnsubscribeEvent]),this.pw.push(["onPermissionDenied",this.onPermissionDeniedEvent]),this.isEnableChannels?(this.widget.addEventListener("click",this.onClickBellIfEnableChannels),[2]):(this.addEventListenersIfDisabledChannels(),[2])}})})},SubscribeWidget.prototype.onClickBellIfEnableChannels=function(){var _this=this;this.pw.push(function(api){_this.pw.driver.checkIsPermissionDefault()?_this.pw.subscriptionSegmentWidget.init():api.postEvent(constants_1.SUBSCRIPTION_SEGMENT_EVENT,{})})},SubscribeWidget.prototype.addEventListenersIfDisabledChannels=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return this.widget.addEventListener("click",this.clickBell),window.addEventListener("click",this.clickOutOfPopover),[4,this.triggerPwEvent(constants_1.EVENT_SHOW_SUBSCRIBE_BUTTON,constants_1.KEY_SHOW_SUBSCRIBE_WIDGET)];case 1:return _a.sent(),[2]}})})},SubscribeWidget.prototype.toggleHelpPopover=function(){this.popover.classList.toggle("pushwoosh-subscribe-widget__popover__visible")},SubscribeWidget.prototype.clickBell=function(){return __awaiter(this,void 0,void 0,function(){var permission;return __generator(this,function(_b){switch(_b.label){case 0:switch(permission=this.pw.driver.getPermission(),permission){case constants_1.PERMISSION_GRANTED:return[3,1];case constants_1.PERMISSION_PROMPT:return[3,3];case constants_1.PERMISSION_DENIED:return[3,5]}return[3,6];case 1:return[4,this.pw.subscribe()];case 2:return _b.sent(),[3,7];case 3:return[4,this.pw.subscribe()];case 4:return _b.sent(),[3,7];case 5:return this.toggleHelpPopover(),[3,7];case 6:console.warn("Unknown browser notification permission"),_b.label=7;case 7:return[4,this.triggerPwEvent(constants_1.EVENT_CLICK_SUBSCRIBE_BUTTON,constants_1.KEY_CLICK_SUBSCRIBE_WIDGET)];case 8:return _b.sent(),[2]}})})},SubscribeWidget.prototype.onSubscribeEvent=function(){return __awaiter(this,void 0,void 0,function(){var isEnableChannels,tooltipContent,_this=this;return __generator(this,function(_a){return isEnableChannels=this.pw.isEnableChannels(),null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(tooltipContent.innerText=this.config.tooltipText.successSubscribe,this.tooltip.classList.add("pushwoosh-subscribe-widget__tooltip__visible"),setTimeout(function(){return __awaiter(_this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:return this.tooltip.classList.remove("pushwoosh-subscribe-widget__tooltip__visible"),_a=tooltipContent,[4,this.tooltipTextFactory()];case 1:return _a.innerText=_b.sent(),isEnableChannels||this.widget.classList.add("pushwoosh-subscribe-widget__subscribed"),[2]}})})},2e3),[2])})})},SubscribeWidget.prototype.onPermissionDeniedEvent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return[4,this.pw.isEnableChannels()];case 1:return _b.sent()&&(this.widget.removeEventListener("click",this.onClickBellIfEnableChannels),this.addEventListenersIfDisabledChannels()),null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(_a=tooltipContent,[4,this.tooltipTextFactory()]);case 2:return _a.innerText=_b.sent(),[2]}})})},SubscribeWidget.prototype.clickOutOfPopover=function(ev){this.popover.classList.contains("pushwoosh-subscribe-widget__popover__visible")&&!ev.target.classList.contains("pushwoosh-subscribe-widget__popover")&&null===ev.target.closest(".pushwoosh-subscribe-widget__popover")&&!ev.target.classList.contains("pushwoosh-subscribe-widget__bell-button")&&null===ev.target.closest(".pushwoosh-subscribe-widget__bell-button")&&this.popover.classList.remove("pushwoosh-subscribe-widget__popover__visible")},SubscribeWidget.prototype.triggerPwEvent=function(event,widget){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2]})})},SubscribeWidget.prototype.onUnsubscribeEvent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(_a=tooltipContent,[4,this.tooltipTextFactory()]);case 1:return _a.innerText=_b.sent(),[2]}})})},SubscribeWidget}();document.addEventListener("pushwoosh.initialized",function(ev){ev.detail.pw.subscribeWidgetConfig.enable&&new SubscribeWidget(ev.detail.pw)})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(77),Positioning=function(){function Positioning(){}return Positioning.getBellPosition=function(position,indent){var positionStyles;switch(position){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={top:"auto",left:"auto",bottom:indent,right:indent};break;case constants_1.BELL_POSITION_BOTTOM_LEFT:positionStyles={top:"auto",left:indent,bottom:indent,right:"auto"};break;case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={top:indent,left:indent,bottom:"auto",right:"auto"};break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={top:indent,left:"auto",bottom:"auto",right:indent};break;default:positionStyles={top:"auto",left:"auto",bottom:indent,right:indent}}return positionStyles},Positioning.getTooltipPosition=function(bellPosition,bellSize){var positionStyles,tooltipModification,increaseIndent=parseInt(bellSize)+12+"px";switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={right:increaseIndent},tooltipModification="right";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={left:increaseIndent},tooltipModification="left";break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={right:increaseIndent},tooltipModification="right";break;default:positionStyles={right:increaseIndent},tooltipModification="right"}return[positionStyles,tooltipModification]},Positioning.getPopoverPosition=function(bellPosition,bellSize){var positionStyles,popoverModification,increaseIndent=parseInt(bellSize)+15+"px";switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={bottom:increaseIndent,right:"0",left:"auto",top:"auto"},popoverModification="bottom";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:positionStyles={bottom:increaseIndent,left:"0",right:"auto",top:"auto"},popoverModification="bottom";break;case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={top:increaseIndent,left:"0",right:"auto",bottom:"auto"},popoverModification="top";break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={top:increaseIndent,right:"0",left:"auto",bottom:"auto"},popoverModification="top";break;default:positionStyles={bottom:increaseIndent,right:"0",left:"auto",top:"auto"},popoverModification="bottom"}return[positionStyles,popoverModification]},Positioning.getPopoverArrowPosition=function(bellPosition,bellSize){var arrowAdditionalStyles;switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {right: auto; left: "+(parseInt(bellSize)/2-12)+"px";break;case constants_1.BELL_POSITION_TOP_LEFT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__top:after {right: auto; left: "+(parseInt(bellSize)/2-12)+"px";break;case constants_1.BELL_POSITION_TOP_RIGHT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__top:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px";break;default:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px"}return arrowAdditionalStyles},Positioning}();exports.default=Positioning},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(fillColor,strokeColor){return'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n version="1.1"\n id="Capa_1"\n x="0px"\n y="0px"\n viewBox="0 0 346.013 346.013"\n style="enable-background:new 0 0 346.013 346.013;width: 80%; height: auto; vertical-align: middle;"\n xml:space="preserve"\n inkscape:version="0.91 r13725"\n sodipodi:docname="alarm_white.svg"><metadata\n id="metadata51"><rdf:RDF><cc:Work\n rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs\n id="defs49" /><sodipodi:namedview\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="1618"\n inkscape:window-height="828"\n id="namedview47"\n showgrid="false"\n inkscape:zoom="0.6820553"\n inkscape:cx="173.0065"\n inkscape:cy="173.0065"\n inkscape:window-x="0"\n inkscape:window-y="0"\n inkscape:window-maximized="0"\n inkscape:current-layer="g3" /><g\n id="g3"><path\n d="m 256.76227,220.19006 c -1.77513,-2.69766 -3.45154,-5.24564 -3.98966,-7.46382 -0.042,-0.17861 -0.0911,-0.36128 -0.16237,-0.61436 -2.28354,-7.67647 0.69147,-24.43921 2.46886,-34.45124 0.26788,-1.50394 0.52274,-2.94197 0.75286,-4.29035 0.0232,-0.13675 0.044,-0.27211 0.0724,-0.48006 1.95582,-15.28051 2.58811,-37.91956 -5.51044,-58.99147 -5.6032,-14.57978 -14.45978,-25.82612 -26.3559,-33.48393 1.26598,-9.812938 -4.85967,-19.343691 -14.66682,-22.0511 -9.80715,-2.70741 -19.95724,2.33226 -23.90298,11.405413 -14.1382,0.467533 -27.51111,5.577097 -39.80114,15.219267 -17.76129,13.9298 -28.83431,33.68757 -34.99389,47.80757 l -0.0479,0.11335 c -0.0512,0.12175 -0.0998,0.24114 -0.13249,0.32962 -0.49733,1.28292 -1.01552,2.64514 -1.55689,4.07255 -3.61311,9.51043 -9.66004,25.42824 -15.611995,30.89342 -0.106524,0.10027 -0.208228,0.20187 -0.362362,0.35435 -1.636243,1.66563 -4.382941,2.99463 -7.288979,4.40101 -7.145531,3.45301 -22.013613,10.64166 -17.206389,31.67844 0.929154,4.07105 4.008437,7.29057 8.033861,8.40185 l 167.570804,46.2604 c 4.02253,1.11048 8.31521,-0.0729 11.2052,-3.08958 14.91617,-15.58874 5.84693,-29.38668 1.48625,-36.02133 z"\n id="path5"\n inkscape:connector-curvature="0"\n vector-effect="non-scaling-stroke"\n style="fill:'+fillColor+"; stroke: "+strokeColor+'; stroke-width: 1; " /><path\n vector-effect="non-scaling-stroke"\n d="m 174.26737,259.72378 -38.76399,-10.70137 c -1.59243,-0.43962 -3.28183,-0.15596 -4.63548,0.7754 -2.53909,1.7494 -2.84182,4.93159 -3.02304,6.83188 l -0.0151,0.15247 c -1.22819,12.67106 6.79854,24.33046 19.08688,27.72284 12.51583,3.45518 25.8324,-2.91586 30.9681,-14.80385 l 0.0935,-0.19205 c 0.52305,-1.06418 1.74613,-3.55554 0.50882,-6.31116 -0.44302,-0.98439 -1.5794,-2.74529 -4.21964,-3.47416 z"\n id="path7"\n inkscape:connector-curvature="0"\n style="fill:'+fillColor+"; stroke: "+strokeColor+'; stroke-width: 1;" /></g><g\n id="g17" /><g\n id="g19" /><g\n id="g21" /><g\n id="g23" /><g\n id="g25" /><g\n id="g27" /><g\n id="g29" /><g\n id="g31" /><g\n id="g33" /><g\n id="g35" /><g\n id="g37" /><g\n id="g39" /><g\n id="g41" /><g\n id="g43" /><g\n id="g45" /></svg>'}},function(module,exports,__webpack_require__){var result=__webpack_require__(149);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(150)(void 0)).push([module.i,'/* Widget */\n.pushwoosh-subscribe-widget {\n position: fixed;\n display: block;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.pushwoosh-subscribe-widget__subscribed {\n display: none;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button {\n -webkit-border-radius: 50%;\n border-radius: 50%;\n cursor: pointer;\n font-size: 0;\n text-align: center;\n -webkit-transform: scale(0.9) translate3d(0, 0, 0);\n transform: scale(0.9) translate3d(0, 0, 0);\n -webkit-transition: -webkit-transform .3s ease-in-out;\n transition: -webkit-transform .3s ease-in-out;\n -o-transition: transform .3s ease-in-out;\n transition: transform .3s ease-in-out;\n transition: transform .3s ease-in-out, -webkit-transform .3s ease-in-out;\n position: relative;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button:hover {\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n}\n\n/* Tooltip */\n.pushwoosh-subscribe-widget__tooltip {\n position: absolute;\n height: 48px;\n max-width: 300px;\n min-width: 200px;\n padding: 5px 7px;\n background-color: #3b444b;\n color: #ffffff;\n text-align: center;\n vertical-align: middle;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n line-height: 38px;\n font-size: 0;\n font-weight: normal;\n visibility: hidden;\n opacity: 0;\n -webkit-transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n -o-transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n top: 50%;\n -webkit-transform: translate(0, -50%);\n -ms-transform: translate(0, -50%);\n transform: translate(0, -50%);\n -webkit-box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after,\n.pushwoosh-subscribe-widget__tooltip__left:after {\n content: "";\n top: 50%;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n background: #3b444b;\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after {\n left: calc(100% - 7px);\n border-top: 5px solid #3b444b;\n border-left: 5px solid #3b444b;\n border-right: 5px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__tooltip__left:after {\n left: -7px;\n border-top: 5px solid #3b444b;\n border-right: 5px solid #3b444b;\n border-left: 5px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__bell-button:hover + .pushwoosh-subscribe-widget__tooltip,\n.pushwoosh-subscribe-widget__tooltip.pushwoosh-subscribe-widget__tooltip__visible {\n display: block;\n visibility: visible;\n opacity: 1;\n -webkit-transition-delay: 0s;\n -o-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__tooltip-content {\n display: inline-block;\n vertical-align: middle;\n font-size: 14px;\n line-height: 1.4;\n white-space: nowrap;\n overflow: hidden;\n padding-right: 5px;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n/* Popover */\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover {\n position: absolute;\n right: auto;\n -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: #9ca8b1;\n visibility: hidden;\n opacity: 0;\n -webkit-transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n -o-transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover__visible {\n display: block;\n visibility: visible;\n opacity: 1;\n -webkit-transition-delay: 0s;\n -o-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after,\n.pushwoosh-subscribe-widget__popover__top:after {\n content: "";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-right: 8px solid transparent;\n border-left: 8px solid #9ca8b1;\n background: #9ca8b1;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after {\n border-bottom: 8px solid #9ca8b1;\n border-top: 8px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n bottom: -16px;\n}\n\n.pushwoosh-subscribe-widget__popover__top:after {\n top: 0;\n border-top: 8px solid #9ca8b1;\n border-bottom: 8px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__popover-content-wrapper {\n overflow: auto;\n max-width: 100%;\n}\n\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n padding: 14px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n float: left;\n min-width: 100%;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n display: block;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-bottom: 14px;\n}\n\n@media (max-width: 767px) and (orientation: portrait) {\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n max-width: 280px;\n height: auto;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-right: 0;\n margin-bottom: 14px;\n }\n}\n@media (max-width: 767px) and (orientation: landscape) {\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n max-width: 280px;\n height: auto;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-right: 14px;\n margin-bottom: 0;\n }\n}\n',""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var pwInboxWidget=__webpack_require__(152);document.addEventListener("pushwoosh.initialized",function(ev){ev.detail.pw.pwinbox&&ev.detail.pw.inboxWidgetConfig.enable&&(ev.detail.pw.pwinboxWidget=new pwInboxWidget.PWInboxWidget(ev.detail.pw))})},function(module,exports,__webpack_require__){module.exports=function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1);exports.isElementFixed=function isElementFixed(element){var isFixed="fixed"===window.getComputedStyle(element).position;return!isFixed&&element.parentElement&&(isFixed=isElementFixed(element.parentElement)),isFixed},exports.getGlobal=function(){return Function("return this")()},exports.getMessageTime=function(date){var localDate=new Date(date),localTime=localDate.getHours()+localDate.getTimezoneOffset()/60;localDate.setHours(localTime);var gap=(new Date).getTime()-localDate.getTime();return gap<=6e4?"Just now":gap<constants_1.MILLISECONDS_IN_HOUR&&gap>0?Math.floor(gap/6e4)+" minutes ago":gap<constants_1.MILLISECONDS_IN_DAY&&gap>0?Math.floor(gap/36e5)+" hours ago":localDate.getDate()+" "+constants_1.MONTHS[localDate.getMonth()]+" "+localDate.getFullYear()+", "+localDate.getHours()+":"+("0"+localDate.getMinutes().toString()).slice(-2)},exports.getValidColor=function(color){return"transparent"===color?color:constants_1.COLOR_TEST_REGEXP.test(color)?color:"#333"},exports.compareBySendDate=function(dateOne,dateTwo){var localDateOne=new Date(dateOne),localTimeOne=localDateOne.getHours()+localDateOne.getTimezoneOffset()/60,localDateTwo=new Date(dateTwo),localTimeTwo=localDateTwo.getHours()+localDateTwo.getTimezoneOffset()/60;return localDateOne.setHours(localTimeOne),localDateTwo.setHours(localTimeTwo),localDateTwo.getTime()-localDateOne.getTime()}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MILLISECONDS_IN_DAY=864e5,exports.MILLISECONDS_IN_HOUR=36e5,exports.MONTHS=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],exports.CONFIG_STYLES=[{name:"widgetWidth",type:"size"},{name:"borderRadius",type:"size"},{name:"zIndex",type:"number"},{name:"fontFamily",type:"string"},{name:"bgColor",type:"color"},{name:"textColor",type:"color"},{name:"arrowBorderColor",type:"color"},{name:"borderColor",type:"color"},{name:"badgeBgColor",type:"color"},{name:"badgeTextColor",type:"color"},{name:"timeTextColor",type:"color"},{name:"messageTitleColor",type:"color"},{name:"emptyInboxTitleColor",type:"color"},{name:"emptyInboxTextColor",type:"color"}],exports.DEFAULT_CONFIG={enable:!1,triggerId:"pwInbox",position:"bottom",appendTo:"body",title:"Inbox",bgColor:"#ffffff",textColor:"#333333",fontFamily:"inherit",borderRadius:4,borderColor:"transparent",badgeBgColor:"#ff4c00",badgeTextColor:"#ffffff",widgetWidth:350,zIndex:100,messageTitleColor:"#7a7a7a",timeTextColor:"#c4c4c4",emptyInboxTitle:"You're all caught up",emptyInboxTitleColor:"#333333",emptyInboxText:"There are no new messages. Stay tuned!",emptyInboxTextColor:"#7a7a7a",emptyInboxIconUrl:"https://pushon.pushwoosh.com/images/icon-empty-inbox.png",arrowBorderColor:"rgba(0,0,0,.1)"},exports.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var InboxWidget_1=__webpack_require__(3);exports.PWInboxWidget=InboxWidget_1.default},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t};Object.defineProperty(exports,"__esModule",{value:!0});var widgetTemplates_1=__webpack_require__(4),constants_1=__webpack_require__(1),helpers_1=__webpack_require__(0),InboxWidget=function(){function InboxWidget(pw){this.pw=pw,this.config=__assign({},constants_1.DEFAULT_CONFIG,{arrowBorderColor:this.pw.inboxWidgetConfig.borderColor&&"transparent"!==this.pw.inboxWidgetConfig.borderColor?this.pw.inboxWidgetConfig.borderColor:"rgba(0,0,0,.1)"},this.pw.inboxWidgetConfig),this.updateInbox=this.updateInbox.bind(this),this.markVisibleItemsAsRead=this.markVisibleItemsAsRead.bind(this),this.onWidgetClickHandler=this.onWidgetClickHandler.bind(this),this.onTriggerClickHandler=this.onTriggerClickHandler.bind(this),this.onWindowScrollHandler=this.onWindowScrollHandler.bind(this),this.toggle=this.toggle.bind(this);try{this.initTrigger(),this.updateInbox(),this.addListeners()}catch(err){console.warn(err)}}return InboxWidget.prototype.toggle=function(isOpened){(void 0===isOpened?!this.isOpened:isOpened)?this.openWidget():this.closeWidget()},InboxWidget.prototype.initTrigger=function(){if(!this.pw.pwinbox)throw new Error("Web inbox is not allowed.");var trigger=document.getElementById(this.config.triggerId);if(!trigger)throw new Error("Inbox trigger element doesn't exist. You must set triggerId in inboxWidget config. See the documentation.");this.trigger=trigger,this.trigger.classList.add("pw-inbox-trigger"),this.defaultMargin=12,this.messagesElements={},this.messages=[],this.readItems=[],this.updateCounter(0),this.isOpened=!1,this.renderWidget(),this.isFixed=helpers_1.isElementFixed(this.trigger)},InboxWidget.prototype.renderWidget=function(){this.widget=document.createElement("div"),this.widget.id="pwInboxWidget",this.widget.className="pw-inbox-widget",this.widget.classList.toggle("pw-open",this.isOpened),this.widgetParent=document.querySelector(this.config.appendTo)||document.body,this.widgetParent.appendChild(this.widget),this.widgetParent.appendChild(this.getStyle()),this.renderWidgetInner()},InboxWidget.prototype.getStyle=function(){var styles=__webpack_require__(5),styleNode=document.createElement("style");return styleNode.innerHTML=this.configureStyle(styles),styleNode},InboxWidget.prototype.configureStyle=function(styles){var _this=this,resultStyles=styles.toString();return constants_1.CONFIG_STYLES.forEach(function(style){var template=new RegExp("var\\(--"+style.name+"\\)","ig"),result=_this.getStyleFormatter(style);resultStyles=resultStyles.replace(template,result)}),resultStyles},InboxWidget.prototype.getStyleFormatter=function(style){switch(style.type){case"size":return(this.config[style.name]||0)+"px";case"number":return parseFloat(this.config[style.name].toString()).toString();case"string":return this.config[style.name].toString();case"color":return helpers_1.getValidColor(this.config[style.name].toString());default:return"none"}},InboxWidget.prototype.renderWidgetInner=function(){if(this.messages.length>0)this.widget.classList.remove("pw-inbox-widget--empty"),this.widget.innerHTML=widgetTemplates_1.widgetTemplate(this.config.title),this.renderMessages();else{this.widget.classList.add("pw-inbox-widget--empty");var _a=this.config,emptyInboxTitle=_a.emptyInboxTitle,emptyInboxText=_a.emptyInboxText,emptyInboxIconUrl=_a.emptyInboxIconUrl;this.widget.innerHTML=widgetTemplates_1.widgetTemplateEmpty(emptyInboxIconUrl,emptyInboxTitle,emptyInboxText)}},InboxWidget.prototype.renderMessages=function(){var _this=this;this.list=this.widget.querySelector(".pw-inbox_list")||document.createElement("ul"),this.messages.forEach(function(message){var messageElement=document.createElement("li");messageElement.className="pw-inbox_item",messageElement.classList.toggle("pw-new",!message.isRead),messageElement.classList.toggle("pw-unread",!message.isActionPerformed),messageElement.setAttribute("data-pw-inbox-message-id",message.code),messageElement.innerHTML=widgetTemplates_1.messageTemplate(message),_this.list.appendChild(messageElement),_this.messagesElements[message.code]=messageElement})},InboxWidget.prototype.updateCounter=function(count){this.count=count,this.trigger.setAttribute("data-pw-count",""+this.count),this.trigger.classList.toggle("pw-empty",0===this.count)},InboxWidget.prototype.updateInboxMessages=function(messages){this.messages=messages.sort(function(_a,_b){var sendDateOne=_a.sendDate,sendDateTwo=_b.sendDate;return helpers_1.compareBySendDate(sendDateOne,sendDateTwo)}),this.renderWidgetInner()},InboxWidget.prototype.openWidget=function(){this.isOpened=!0,this.widget.classList.add("pw-open"),document.addEventListener("click",this.onWidgetClickHandler),window.addEventListener("scroll",this.onWindowScrollHandler),window.addEventListener("resize",this.onWindowScrollHandler),this.markVisibleItemsAsRead(),this.messages.length>0&&this.list.addEventListener("scroll",this.markVisibleItemsAsRead),this.positionWidget()},InboxWidget.prototype.closeWidget=function(){this.isOpened=!1,document.removeEventListener("click",this.onWidgetClickHandler),document.removeEventListener("click",this.onWindowScrollHandler),window.removeEventListener("resize",this.onWindowScrollHandler),this.updateReadStatus(),this.messages.length>0&&this.list.removeEventListener("scroll",this.markVisibleItemsAsRead),this.widget.classList.remove("pw-open","pw-top","pw-bottom","pw-right","pw-left"),this.widget.removeAttribute("style")},InboxWidget.prototype.positionWidget=function(){this.isOpened&&(this.widgetParent===document.body?this.defaultPlaceWidget():this.customPlaceWidget())},InboxWidget.prototype.customPlaceWidget=function(){var position=this.config.position;this.widgetParent.style.position="relative",this.widget.classList.add("pw-inbox-widget--inset"),this.widget.classList.add("pw-"+position)},InboxWidget.prototype.defaultPlaceWidget=function(){var position=this.pw.inboxWidgetConfig.position?this.config.position:this.getDefaultPosition(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0);switch(widgetRect.width+2*this.defaultMargin>windowWidth&&(this.widget.style.width=windowWidth-2*this.defaultMargin+"px"),widgetRect.height+24>windowHeight&&(this.widget.style.height=windowHeight-2*this.defaultMargin+"px"),position){case"top":this.alignWidgetTop();break;case"right":this.alignWidgetRight();break;case"left":this.alignWidgetLeft();break;case"bottom":this.alignWidgetBottom()}}},InboxWidget.prototype.alignWidgetTop=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-top");var left=pageXOffset+triggerRect.left+Math.floor(triggerRect.width/2)-Math.floor(widgetRect.width/2),isUnderLeft=left<pageXOffset,isUnderRight=left+widgetRect.width>pageXOffset+windowWidth;isUnderLeft&&(left=pageXOffset+this.defaultMargin),isUnderRight&&(left=pageXOffset+windowWidth-widgetRect.width-this.defaultMargin);var top=pageYOffset+triggerRect.top-widgetRect.height;this.alignWidgetElement(left,top),arrow.style.left=triggerRect.left+Math.floor(triggerRect.width/2)-left+"px";var topMargin=this.widget.getBoundingClientRect().top;if(topMargin<0){var newHeight=this.widget.getBoundingClientRect().height+topMargin-this.defaultMargin,newTop=this.widget.getBoundingClientRect().top-topMargin+this.defaultMargin;this.widget.style.height=newHeight+"px",this.widget.style.top=newTop+"px"}}},InboxWidget.prototype.alignWidgetRight=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-right");var top=pageYOffset+triggerRect.top+Math.floor(triggerRect.height/2)-Math.floor(widgetRect.height/2),isUnderTop=top<pageYOffset,isUnderBottom=pageYOffset+windowHeight<top+widgetRect.height;isUnderTop&&(top=pageYOffset+this.defaultMargin),isUnderBottom&&(top=pageYOffset+windowHeight-widgetRect.height-this.defaultMargin);var left=pageXOffset+triggerRect.left+triggerRect.width;this.alignWidgetElement(left,top),arrow.style.top=triggerRect.top+Math.floor(triggerRect.height/2)-top+"px";var rightMargin=windowWidth-this.widget.getBoundingClientRect().right;if(rightMargin<this.defaultMargin){var newWidth=this.widget.getBoundingClientRect().width+rightMargin-this.defaultMargin;this.widget.style.width=newWidth+"px"}}},InboxWidget.prototype.alignWidgetLeft=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-left");var top=pageYOffset+triggerRect.top+Math.floor(triggerRect.height/2)-Math.floor(widgetRect.height/2),isUnderTop=top<pageYOffset,isUnderBottom=pageYOffset+windowHeight<top+widgetRect.height;isUnderTop&&(top=pageYOffset+this.defaultMargin),isUnderBottom&&(top=pageYOffset+windowHeight-widgetRect.height-this.defaultMargin);var left=pageXOffset+triggerRect.left-widgetRect.width;this.alignWidgetElement(left,top),arrow.style.top=triggerRect.top+Math.floor(triggerRect.height/2)-top+"px";var leftMargin=this.widget.getBoundingClientRect().left;if(leftMargin<0){var newWidth=this.widget.getBoundingClientRect().width+leftMargin-this.defaultMargin,newLeft=this.widget.getBoundingClientRect().left-leftMargin;this.widget.style.width=newWidth+"px",this.widget.style.left=newLeft+"px"}}},InboxWidget.prototype.alignWidgetBottom=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-bottom");var left=pageXOffset+triggerRect.left+Math.floor(triggerRect.width/2)-Math.floor(widgetRect.width/2),isUnderLeft=left<pageXOffset,isUnderRight=left+widgetRect.width>pageXOffset+windowWidth;isUnderLeft&&(left=pageXOffset+this.defaultMargin),isUnderRight&&(left=pageXOffset+windowWidth-widgetRect.width-12);var top=pageYOffset+triggerRect.top+triggerRect.height;this.alignWidgetElement(left,top),arrow.style.left=triggerRect.left+Math.floor(triggerRect.width/2)-left+"px";var bottomRange=windowHeight-this.widget.getBoundingClientRect().bottom;if(bottomRange<this.defaultMargin){var newHeight=this.widget.getBoundingClientRect().height+bottomRange-this.defaultMargin;this.widget.style.height=newHeight+"px"}}},InboxWidget.prototype.alignWidgetElement=function(left,top){this.widget.style.left=left+"px",this.widget.style.top=top+"px"},InboxWidget.prototype.getDefaultPosition=function(){var _a=this.trigger.getBoundingClientRect(),left=_a.left,top=_a.top,width=_a.width,height=_a.height;if(!document.documentElement)return"";var antiMargins={right:left,bottom:top,left:Math.max(document.documentElement.clientWidth,window.innerWidth||0)-(left+width),top:Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(top+height)},leastMargin=Math.min(left,top,antiMargins.left,antiMargins.top),position="bottom";return Object.keys(antiMargins).forEach(function(key){antiMargins[key]===leastMargin&&(position=key)}),position},InboxWidget.prototype.addListeners=function(){var _this=this;this.trigger.addEventListener("click",this.onTriggerClickHandler),this.pw.push(["onPutNewMessageToInboxStore",function(){_this.updateInbox()}]),this.pw.push(["onUpdateInboxMessages",function(){_this.updateInbox()}])},InboxWidget.prototype.markVisibleItemsAsRead=function(){var _this=this;if(0!==this.messages.length){var scrollTop=this.list.clientHeight+this.list.scrollTop-50;Object.keys(this.messagesElements).forEach(function(code){if(_this.messagesElements[code]&&!(_this.messagesElements[code].offsetTop>scrollTop)){var message=_this.messages.find(function(message){return message.code===code});!message||message.isRead||_this.readItems.indexOf(code)+1||_this.readItems.push(code)}})}},InboxWidget.prototype.updateReadStatus=function(){this.pw.pwinbox.readMessagesWithCodes(this.readItems).then(this.updateInbox)},InboxWidget.prototype.updateInbox=function(){var _this=this;this.pw.pwinbox.loadMessages().then(function(messages){_this.updateInboxMessages(messages)}),this.pw.pwinbox.unreadMessagesCount().then(function(count){_this.updateCounter(count)})},InboxWidget.prototype.performMessageAction=function(code){var _this=this;this.pw.pwinbox.performActionForMessageWithCode(code).then(function(){_this.updateInbox()})},InboxWidget.prototype.removeMessages=function(messages){var _this=this;messages.forEach(function(code){_this.readItems=_this.readItems.slice(_this.readItems.indexOf(code),1)}),this.pw.pwinbox.deleteMessagesWithCodes(messages).then(function(){_this.updateInbox()})},InboxWidget.prototype.onTriggerClickHandler=function(event){event.stopPropagation(),event.target&&this.toggle()},InboxWidget.prototype.onWidgetClickHandler=function(event){if(event.target){var itemElement=event.target.closest(".pw-inbox_item");if(itemElement){var messageCode=itemElement.getAttribute("data-pw-inbox-message-id");messageCode&&(event.target.closest(".pw-inbox_item-remove")?this.removeMessages([messageCode]):this.performMessageAction(messageCode))}else this.toggle()}},InboxWidget.prototype.onWindowScrollHandler=function(){this.isFixed&&this.isOpened?this.toggle():this.positionWidget()},InboxWidget}();exports.default=InboxWidget},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(0);exports.widgetTemplate=function(title){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_inner">\n <div class="pw-inbox_title">\n '+title+'\n </div>\n <ul class="pw-inbox_list">\n \n </ul>\n</div>'},exports.widgetTemplateEmpty=function(emptyInboxIconUrl,emptyInboxTitle,emptyInboxText){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_list--empty">\n <div class="pw-inbox_list-icon">\n <img src="'+emptyInboxIconUrl+'" alt="'+emptyInboxTitle+'">\n </div>\n <div class="pw-inbox_list-title">\n '+emptyInboxTitle+'\n </div>\n <div class="ipw-inbox_list-body">\n '+emptyInboxText+"\n </div>\n</div>"},exports.messageTemplate=function(_a){var imageUrl=_a.imageUrl,title=_a.title,message=_a.message,sendDate=_a.sendDate;return'\n<div class="pw-inbox_item-inner">\n <div class="pw-inbox_icon">\n <img src="'+imageUrl+'" alt="'+(title||message)+'" class="pw-inbox_message-image">\n </div>\n <div class="pw-inbox_content">\n '+(title?'<div class="pw-inbox_item-title">\n '+title+"\n </div>":null)+'\n <div class="pw-inbox_item-body">\n '+message+'\n </div>\n <div class="pw-inbox_item-time">\n '+helpers_1.getMessageTime(sendDate)+'\n </div>\n </div>\n</div>\n<span class="pw-inbox_item-remove"></span>'}},function(module,exports,__webpack_require__){var result=__webpack_require__(6);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(7)(void 0)).push([module.i,".pw-inbox-trigger {\n position: relative;\n cursor: pointer;\n}\n\n.pw-inbox-trigger:after {\n content: attr(data-pw-count);\n display: block;\n position: absolute;\n right: 0;\n top: 0;\n background: var(--badgeBgColor);\n -webkit-border-radius: 8px;\n border-radius: 8px;\n color: var(--badgeTextColor);\n font-size: 10px;\n font-weight: normal;\n line-height: 16px;\n width: 16px;\n padding: 0 2px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n text-align: center;\n}\n\n.pw-inbox-trigger.pw-empty:after {\n display: none;\n}\n\n.pw-inbox-widget * {\n position: static;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: 1em;\n outline: none;\n font-family: var(--fontFamily);\n}\n.pw-inbox-widget {\n font-size: 14px;\n position: absolute;\n top: 0;\n left: -1000px;\n background: var(--bgColor);\n border: solid 1px var(--borderColor);\n -webkit-border-radius: var(--borderRadius);\n border-radius: var(--borderRadius);\n width: var(--widgetWidth);\n -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n z-index: var(--zIndex);\n opacity: 0;\n -webkit-transition: opacity .6s ease;\n -o-transition: opacity .6s ease;\n transition: opacity .6s ease;\n -webkit-transition-delay: 100ms;\n -o-transition-delay: 100ms;\n transition-delay: 100ms;\n}\n.pw-inbox-widget.pw-open {\n opacity: 1;\n -webkit-transition-delay: 0ms;\n -o-transition-delay: 0ms;\n transition-delay: 0ms;\n}\n.pw-inbox-widget.pw-inbox-widget--inset {\n top: auto;\n left: auto;\n display: none;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-open {\n display: block;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-bottom {\n top: 100%;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-top {\n bottom: 100%;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-right {\n left: 100%;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-left {\n right: 100%;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--empty {\n max-height: none;\n}\n.pw-inbox-widget .pw-inbox__arrow {\n display: block;\n width: 0;\n height: 0;\n border-width: 10px;\n border-style: solid;\n border-color: transparent;\n position: absolute;\n}\n.pw-inbox-widget .pw-inbox__arrow:before {\n content: \"\";\n display: block;\n width: 0;\n height: 0;\n border-width: 10px;\n border-style: solid;\n border-color: transparent;\n position: absolute;\n}\n.pw-inbox-widget.pw-top {\n margin-top: -12px;\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow {\n border-top-color: var(--arrowBorderColor);\n bottom: -21px;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow:before {\n border-top-color: var(--bgColor);\n top: -11px;\n left: -10px;\n}\n.pw-inbox-widget.pw-bottom {\n margin-top: 12px;\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow {\n border-bottom-color: var(--arrowBorderColor);\n top: -21px;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow:before {\n border-bottom-color: var(--bgColor);\n bottom: -11px;\n left: -10px;\n}\n.pw-inbox-widget.pw-left {\n margin-left: -12px;\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow {\n border-left-color: var(--arrowBorderColor);\n right: -21px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow:before {\n border-left-color: var(--bgColor);\n left: -11px;\n top: -10px;\n}\n.pw-inbox-widget.pw-right {\n margin-left: 12px;\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow {\n border-right-color: var(--arrowBorderColor);\n left: -21px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow:before {\n border-right-color: var(--bgColor);\n right: -11px;\n top: -10px;\n}\n.pw-inbox_inner {\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n height: 100%;\n}\n.pw-inbox_title {\n color: var(--textColor);\n margin: 0;\n padding: 28px 32px 12px;\n font-size: 24px;\n font-weight: 500;\n line-height: 1.1;\n text-align: left;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 66px;\n flex: 0 0 66px;\n}\n.pw-inbox_list {\n overflow-x: hidden;\n overflow-y: auto;\n min-width: 200px;\n max-height: 300px;\n padding: 0;\n margin: 0;\n list-style: none;\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n\n.pw-inbox_item {\n position: relative;\n padding: 8px 32px;\n margin: 0;\n text-align: left;\n}\n.pw-inbox_item-inner {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n cursor: pointer;\n}\n.pw-inbox_icon {\n -webkit-box-flex: 0;\n -ms-flex: 0 0 40px;\n flex: 0 0 40px;\n}\n.pw-inbox_message-image {\n width: 28px;\n}\n.pw-inbox_content {\n -webkit-box-flex: 0;\n -ms-flex: 0 1 100%;\n flex: 0 1 100%;\n}\n.pw-inbox_item-title {\n color: var(--messageTitleColor);\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n}\n.pw-inbox_item-body {\n color: var(--textColor);\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n}\n.pw-inbox_item-time {\n color: var(--timeTextColor);\n font-size: 12px;\n line-height: 17px;\n}\n.pw-inbox_item-remove {\n position: absolute;\n z-index: 2;\n top: 8px;\n right: 8px;\n display: none;\n width: 10px;\n height: 10px;\n background: transparent url('https://cdn.pushwoosh.com/webpush/img/iconClose.svg') 50% no-repeat;\n cursor: pointer;\n}\n.pw-inbox_item:hover .pw-inbox_item-remove {\n display: block;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-title {\n color: var(--textColor);\n font-weight: 700;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-body {\n font-weight: 700;\n}\n\n.pw-inbox_list--empty {\n padding: 50px 16px;\n text-align: center;\n max-height: 100%;\n overflow: auto;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-icon {\n text-align: center;\n margin-bottom: 30px;\n}\n.pw-inbox_list--empty .pw-inbox_list-icon img {\n max-width: 100%;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-title {\n font-size: 28px;\n line-height: 36px;\n color: var(--emptyInboxTitleColor);\n margin-bottom: 20px;\n}\n\n.pw-inbox_list--empty .ipw-inbox_list-body {\n font-size: 14px;\n line-height: 18px;\n color: var(--emptyInboxTextColor);\n}\n",""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var web_push_subscribe_popup_1=__webpack_require__(154);document.addEventListener("pushwoosh.initialized",function(ev){if(ev.detail.pw.subscribePopupConfig&&ev.detail.pw.subscribePopupConfig.enable){var popup_1=new web_push_subscribe_popup_1.PWSubscribePopup(ev.detail.pw);popup_1.initPopup().then(function(){ev.detail.pw.subscribePopup=popup_1})}})},function(module,exports,__webpack_require__){module.exports=function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_CONFIG={text:"Don’t miss out on our news and updates! Enable push notifications",askLaterButtonText:"Not now",confirmSubscriptionButtonText:"Subscribe",delay:60,retryOffset:604800,overlay:!1,position:"top",bgColor:"#fff",borderColor:"transparent",boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)",textColor:"#000",textSize:"inherit",fontFamily:"inherit",subscribeBtnBgColor:"#4285f4",subscribeBtnTextColor:"#fff",askLaterBtnBgColor:"transparent",askLaterBtnTextColor:"#000",theme:"material",viewport:"html"},exports.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/,exports.PERMISSION_DENIED="denied",exports.PERMISSION_GRANTED="granted",exports.CONFIG_STYLES=[{name:"bgColor",type:"color"},{name:"borderColor",type:"color"},{name:"boxShadow",type:"string"},{name:"textColor",type:"color"},{name:"textSize",type:"string"},{name:"fontFamily",type:"string"},{name:"subscribeBtnBgColor",type:"color"},{name:"subscribeBtnTextColor",type:"color"},{name:"askLaterBtnBgColor",type:"color"},{name:"askLaterBtnTextColor",type:"color"}]},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var SubscribePopup_1=__webpack_require__(2);exports.PWSubscribePopup=SubscribePopup_1.default},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(0),popupTemplates_1=__webpack_require__(3),constants_2=__webpack_require__(0),helpers_1=__webpack_require__(4),SubscribePopup=function(){function SubscribePopup(pw){this.pw=pw,this.config=__assign({},constants_1.DEFAULT_CONFIG,this.pw.subscribePopupConfig),this.onAskLaterClick=this.onAskLaterClick.bind(this),this.onSubscribeClick=this.onSubscribeClick.bind(this)}return SubscribePopup.prototype.initPopup=function(){return __awaiter(this,void 0,void 0,function(){var isSubscribed,isManualUnsubscribed,permission,lastPopupOpen,lastPopupOpenTime,now,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.pw.isSubscribed()];case 1:return isSubscribed=_a.sent(),[4,this.pw.data.getStatusManualUnsubscribed()];case 2:return isManualUnsubscribed=_a.sent(),isSubscribed||isManualUnsubscribed?[2]:[4,this.pw.driver.getPermission()];case 3:return(permission=_a.sent())===constants_2.PERMISSION_GRANTED||permission===constants_2.PERMISSION_DENIED?[2]:(this.renderPopup(),this.appendStyles(),lastPopupOpen=localStorage.getItem("LAST_OPEN_SUBSCRIPTION_POPUP"),lastPopupOpenTime=lastPopupOpen?parseInt(lastPopupOpen):0,now=(new Date).getTime(),lastPopupOpenTime+1e3*this.config.retryOffset<now&&setTimeout(function(){_this.toggle(!0)},1e3*this.config.delay),[2])}})})},SubscribePopup.prototype.toggle=function(isShown){("boolean"==typeof isShown?isShown:!this.isShown)?(this.showPopup(),this.pw.eventBus.dispatchEvent("subscribe-popup-show",{})):(this.closePopup(),this.pw.eventBus.dispatchEvent("subscribe-popup-hide",{}))},SubscribePopup.prototype.showPopup=function(){this.isShown=!0,this.popup.classList.add("pw-show"),document.body.classList.add("pw-popup-opened");var event=new CustomEvent("showPopup",{bubbles:!1,cancelable:!1,detail:{popup:this.popup}});if(this.popup.dispatchEvent(event),!(Math.max(document.documentElement.clientWidth,window.innerWidth||0)<541)){var _a=this.config,theme=_a.theme,viewport=_a.viewport,position=_a.position;if("topbar"===theme&&"top"===position){var viewportElement=document.querySelector(viewport)||document.createElement("div"),currentMarginTop=window.getComputedStyle(viewportElement).marginTop||"0";viewportElement.style.transition="margin-top .3s ease-out",viewportElement.style.marginTop=parseInt(currentMarginTop)+this.popup.getBoundingClientRect().height+"px"}}},SubscribePopup.prototype.closePopup=function(){this.isShown=!1,this.popup.classList.remove("pw-show"),document.body.classList.remove("pw-popup-opened");var event=new CustomEvent("hidePopup",{bubbles:!1,cancelable:!1,detail:{popup:this.popup}});this.popup.dispatchEvent(event);var now=(new Date).getTime().toString();if(localStorage.setItem("LAST_OPEN_SUBSCRIPTION_POPUP",now),!(Math.max(document.documentElement.clientWidth,window.innerWidth||0)<541)){var _a=this.config,theme=_a.theme,viewport=_a.viewport,position=_a.position;if("topbar"===theme&&"top"===position){var viewportElement=document.querySelector(viewport)||document.createElement("div"),currentMarginTop=window.getComputedStyle(viewportElement).marginTop||"0";viewportElement.style.marginTop=parseInt(currentMarginTop)-this.popup.getBoundingClientRect().height+"px"}}},SubscribePopup.prototype.renderPopup=function(){this.popup=document.createElement("div"),this.popup.id="pwSubscribePopup";var _a=this.config,text=_a.text,askLaterButtonText=_a.askLaterButtonText,confirmSubscriptionButtonText=_a.confirmSubscriptionButtonText,iconUrl=_a.iconUrl,position=_a.position,overlay=_a.overlay,theme=_a.theme;this.popup.className="pw-subscribe-popup pw-position-"+position+" pw-subscribe-popup-"+theme,this.popup.classList.toggle("pw-subscribe-popup__overlay",overlay),this.popup.innerHTML=popupTemplates_1.innerTemplate({text:text,askLaterButtonText:askLaterButtonText,confirmSubscriptionButtonText:confirmSubscriptionButtonText,iconUrl:iconUrl}),document.body.appendChild(this.popup),this.addListeners()},SubscribePopup.prototype.appendStyles=function(){var styles=__webpack_require__(5),style=document.createElement("style");style.innerHTML=this.configureStyle(styles),document.body.appendChild(style)},SubscribePopup.prototype.getStyleFormatter=function(style){switch(style.type){case"size":return(this.config[style.name]||0)+"px";case"number":return parseFloat(this.config[style.name].toString()).toString();case"string":return this.config[style.name].toString();case"color":return helpers_1.getValidColor(this.config[style.name].toString());default:return"none"}},SubscribePopup.prototype.configureStyle=function(styles){var _this=this,resultStyles=styles.toString();return constants_1.CONFIG_STYLES.forEach(function(style){var template=new RegExp("var\\(--"+style.name+"\\)","ig"),result=_this.getStyleFormatter(style);resultStyles=resultStyles.replace(template,result)}),resultStyles},SubscribePopup.prototype.addListeners=function(){var askLaterButton=this.popup.querySelector('button[name="pwAskLater"]')||document.createElement("button"),subscribeButton=this.popup.querySelector('button[name="pwSubscribe"]')||document.createElement("button");askLaterButton.addEventListener("click",this.onAskLaterClick),subscribeButton.addEventListener("click",this.onSubscribeClick)},SubscribePopup.prototype.onAskLaterClick=function(){this.toggle(!1),this.pw.eventBus.dispatchEvent("subscribe-popup-decline",{})},SubscribePopup.prototype.onSubscribeClick=function(){this.toggle(!1),this.pw.eventBus.dispatchEvent("subscribe-popup-accept",{}),this.pw.subscribe()},SubscribePopup}();exports.default=SubscribePopup},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.innerTemplate=function(_a){var iconUrl=_a.iconUrl,text=_a.text,askLaterButtonText=_a.askLaterButtonText,confirmSubscriptionButtonText=_a.confirmSubscriptionButtonText;return'<div class="pw-subscription-popup-inner">\n <div class="pw-subscription-popup-content">\n '+(iconUrl?'<div class="pw-subscription-popup-icon">\n <img src="'+iconUrl+'">\n </div>':"")+'\n <div class="pw-subscription-popup-text">\n '+text+'\n </div>\n </div>\n <div class="pw-subscription-popup-controls">\n <button name="pwSubscribe" class="pw-subscribe-popup-button pw-subscribe-popup-button-active">'+confirmSubscriptionButtonText+'</button>\n <button name="pwAskLater" class="pw-subscribe-popup-button">'+askLaterButtonText+"</button>\n </div>\n </div>"}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(0);exports.getValidColor=function(color){return"transparent"===color?color:constants_1.COLOR_TEST_REGEXP.test(color)?color:"#333"},exports.getGlobal=function(){return Function("return this")()}},function(module,exports,__webpack_require__){var result=__webpack_require__(6);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(7)(void 0)).push([module.i,".pw-subscribe-popup {\n position: fixed;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n z-index: 1000000;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-transition: all .4s ease-out;\n -o-transition: all .4s ease-out;\n transition: all .4s ease-out;\n}\n\n.pw-subscribe-popup.pw-position-top {\n top: calc(-100% - 24px);\n}\n.pw-subscribe-popup.pw-position-top.pw-show {\n top: 0;\n}\n\n.pw-subscribe-popup.pw-position-bottom {\n bottom: calc(-100% - 24px);\n}\n.pw-subscribe-popup.pw-position-bottom.pw-show {\n bottom: 0;\n}\n\n.pw-subscribe-popup.pw-position-center {\n display: none;\n}\n.pw-subscribe-popup.pw-position-center.pw-show {\n top: 50%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n\n.pw-subscribe-popup__overlay {\n position: fixed;\n left: 0;\n right: 0;\n -webkit-transform: none;\n -ms-transform: none;\n transform: none;\n height: 100%;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n background: rgba(0,0,0,.4);\n z-index: 1000000;\n display: none;\n top: 0;\n}\n\n.pw-subscribe-popup__overlay.pw-position-top {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.pw-subscribe-popup__overlay.pw-position-bottom {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n\n.pw-subscribe-popup__overlay.pw-position-center {\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.pw-subscription-popup-inner {\n max-width: 400px;\n font-size: var(--textSize);\n color: var(--textColor);\n font-family: var(--fontFamily);\n border-style: solid;\n border-width: 1px;\n border-color: var(--borderColor);\n background: var(--bgColor);\n -webkit-box-shadow: var(--boxShadow);\n box-shadow: var(--boxShadow);\n}\n\n.pw-subscription-popup-content {\n padding: 16px 16px 4px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: stretch;\n -ms-flex-pack: stretch;\n justify-content: stretch;\n}\n\n.pw-subscription-popup-icon {\n -webkit-box-flex: 0;\n -ms-flex: 0 0 50px;\n flex: 0 0 50px;\n margin-right: 12px;\n padding-top: 4px;\n}\n\n.pw-subscription-popup-icon img {\n max-width: 60px;\n max-height: 60px;\n}\n\n.pw-subscription-popup-text {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 300px;\n flex: 1 1 300px;\n}\n\n.pw-subscription-popup-controls {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n padding: 8px 16px 16px;\n}\n\nbutton.pw-subscribe-popup-button {\n border: solid 1px transparent;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n display: inline-block;\n height: 36px;\n line-height: 36px;\n padding: 0 16px;\n text-transform: uppercase;\n vertical-align: middle;\n -webkit-tap-highlight-color: transparent;\n font-size: 14px;\n outline: 0;\n text-decoration: none;\n color: var(--askLaterBtnTextColor);\n text-align: center;\n letter-spacing: .5px;\n cursor: pointer;\n background: var(--askLaterBtnBgColor);\n margin: 4px 8px;\n}\nbutton.pw-subscribe-popup-button:hover {\n background: rgba(0,0,0,.04);\n}\nbutton.pw-subscribe-popup-button:active {\n background: rgba(0,0,0,.12);\n}\n\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active {\n color: var(--subscribeBtnTextColor);\n background: var(--subscribeBtnBgColor);\n -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:hover {\n -webkit-box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n 0 1px 7px 0 rgba(0,0,0,0.12),\n 0 3px 1px -1px rgba(0,0,0,0.2);\n box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n 0 1px 7px 0 rgba(0,0,0,0.12),\n 0 3px 1px -1px rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:active {\n -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n}\n\n@media screen and (min-width: 541px) {\n\n .pw-subscribe-popup-topbar {\n width: 100%;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-inner {\n max-width: 100%;\n width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding: 2px 40px;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-content {\n padding: 0;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 60%;\n flex: 1 1 60%;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-icon img {\n max-width: 28px;\n max-height: 28px;\n }\n\n .pw-subscribe-popup-topbar button.pw-subscribe-popup-button {\n height: 32px;\n line-height: 32px;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-controls {\n padding: 0 0 0 16px;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n}\n@media screen and (max-width: 540px) {\n .pw-subscribe-popup,\n .pw-subscribe-popup.pw-position-top,\n .pw-subscribe-popup.pw-position-center,\n .pw-subscribe-popup.pw-position-bottom {\n top: auto;\n bottom: -110%;\n left: 0;\n right: 0;\n -webkit-transform: none;\n -ms-transform: none;\n transform: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-transition: bottom .4s ease-out;\n -o-transition: bottom .4s ease-out;\n transition: bottom .4s ease-out;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n }\n\n .pw-subscribe-popup.pw-subscribe-popup__overlay {\n height: 100%;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n }\n\n .pw-subscribe-popup.pw-show {\n bottom: 0;\n }\n\n .pw-subscribe-popup__overlay .pw-subscription-popup-inner {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n -webkit-box-pack: stretch;\n -ms-flex-pack: stretch;\n justify-content: stretch;\n }\n\n .pw-subscription-popup-inner {\n max-width: 100%;\n width: 100%;\n }\n}\n",""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}}])}])});
10
+ exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];for(i+=d,e=s&(1<<-nBits)-1,s>>=-nBits,nBits+=eLen;nBits>0;e=256*e+buffer[offset+i],i+=d,nBits-=8);for(m=e&(1<<-nBits)-1,e>>=-nBits,nBits+=mLen;nBits>0;m=256*m+buffer[offset+i],i+=d,nBits-=8);if(0===e)e=1-eBias;else{if(e===eMax)return m?NaN:1/0*(s?-1:1);m+=Math.pow(2,mLen),e-=eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)},exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=8*nBytes-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=23===mLen?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||0===value&&1/value<0?1:0;for(value=Math.abs(value),isNaN(value)||value===1/0?(m=isNaN(value)?1:0,e=eMax):(e=Math.floor(Math.log(value)/Math.LN2),value*(c=Math.pow(2,-e))<1&&(e--,c*=2),(value+=e+eBias>=1?rt/c:rt*Math.pow(2,1-eBias))*c>=2&&(e++,c/=2),e+eBias>=eMax?(m=0,e=eMax):e+eBias>=1?(m=(value*c-1)*Math.pow(2,mLen),e+=eBias):(m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen),e=0));mLen>=8;buffer[offset+i]=255&m,i+=d,m/=256,mLen-=8);for(e=e<<mLen|m,eLen+=mLen;eLen>0;buffer[offset+i]=255&e,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=128*s}},function(module,exports,__webpack_require__){module.exports=Stream;var EE=__webpack_require__(39).EventEmitter;function Stream(){EE.call(this)}__webpack_require__(15)(Stream,EE),Stream.Readable=__webpack_require__(40),Stream.Writable=__webpack_require__(96),Stream.Duplex=__webpack_require__(97),Stream.Transform=__webpack_require__(98),Stream.PassThrough=__webpack_require__(99),Stream.Stream=Stream,Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){dest.writable&&!1===dest.write(chunk)&&source.pause&&source.pause()}function ondrain(){source.readable&&source.resume&&source.resume()}source.on("data",ondata),dest.on("drain",ondrain),dest._isStdio||options&&!1===options.end||(source.on("end",onend),source.on("close",onclose));var didOnEnd=!1;function onend(){didOnEnd||(didOnEnd=!0,dest.end())}function onclose(){didOnEnd||(didOnEnd=!0,"function"==typeof dest.destroy&&dest.destroy())}function onerror(er){if(cleanup(),0===EE.listenerCount(this,"error"))throw er}function cleanup(){source.removeListener("data",ondata),dest.removeListener("drain",ondrain),source.removeListener("end",onend),source.removeListener("close",onclose),source.removeListener("error",onerror),dest.removeListener("error",onerror),source.removeListener("end",cleanup),source.removeListener("close",cleanup),dest.removeListener("close",cleanup)}return source.on("error",onerror),dest.on("error",onerror),source.on("end",cleanup),source.on("close",cleanup),dest.on("close",cleanup),dest.emit("pipe",source),dest}},function(module,exports){},function(module,exports,__webpack_require__){"use strict";var Buffer=__webpack_require__(28).Buffer,util=__webpack_require__(92);function copyBuffer(src,target,offset){src.copy(target,offset)}module.exports=function(){function BufferList(){!function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function(v){var entry={data:v,next:null};this.length>0?this.tail.next=entry:this.head=entry,this.tail=entry,++this.length},BufferList.prototype.unshift=function(v){var entry={data:v,next:this.head};0===this.length&&(this.tail=entry),this.head=entry,++this.length},BufferList.prototype.shift=function(){if(0!==this.length){var ret=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,ret}},BufferList.prototype.clear=function(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function(s){if(0===this.length)return"";for(var p=this.head,ret=""+p.data;p=p.next;)ret+=s+p.data;return ret},BufferList.prototype.concat=function(n){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var ret=Buffer.allocUnsafe(n>>>0),p=this.head,i=0;p;)copyBuffer(p.data,ret,i),i+=p.data.length,p=p.next;return ret},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var obj=util.inspect({length:this.length});return this.constructor.name+" "+obj})},function(module,exports){},function(module,exports,__webpack_require__){(function(global,process){!function(global,undefined){"use strict";if(!global.setImmediate){var registerImmediate,nextHandle=1,tasksByHandle={},currentlyRunningATask=!1,doc=global.document,attachTo=Object.getPrototypeOf&&Object.getPrototypeOf(global);attachTo=attachTo&&attachTo.setTimeout?attachTo:global,"[object process]"==={}.toString.call(global.process)?registerImmediate=function(handle){process.nextTick(function(){runIfPresent(handle)})}:function(){if(global.postMessage&&!global.importScripts){var postMessageIsAsynchronous=!0,oldOnMessage=global.onmessage;return global.onmessage=function(){postMessageIsAsynchronous=!1},global.postMessage("","*"),global.onmessage=oldOnMessage,postMessageIsAsynchronous}}()?function(){var messagePrefix="setImmediate$"+Math.random()+"$",onGlobalMessage=function(event){event.source===global&&"string"==typeof event.data&&0===event.data.indexOf(messagePrefix)&&runIfPresent(+event.data.slice(messagePrefix.length))};global.addEventListener?global.addEventListener("message",onGlobalMessage,!1):global.attachEvent("onmessage",onGlobalMessage),registerImmediate=function(handle){global.postMessage(messagePrefix+handle,"*")}}():global.MessageChannel?function(){var channel=new MessageChannel;channel.port1.onmessage=function(event){runIfPresent(event.data)},registerImmediate=function(handle){channel.port2.postMessage(handle)}}():doc&&"onreadystatechange"in doc.createElement("script")?function(){var html=doc.documentElement;registerImmediate=function(handle){var script=doc.createElement("script");script.onreadystatechange=function(){runIfPresent(handle),script.onreadystatechange=null,html.removeChild(script),script=null},html.appendChild(script)}}():registerImmediate=function(handle){setTimeout(runIfPresent,0,handle)},attachTo.setImmediate=function(callback){"function"!=typeof callback&&(callback=new Function(""+callback));for(var args=new Array(arguments.length-1),i=0;i<args.length;i++)args[i]=arguments[i+1];var task={callback:callback,args:args};return tasksByHandle[nextHandle]=task,registerImmediate(nextHandle),nextHandle++},attachTo.clearImmediate=clearImmediate}function clearImmediate(handle){delete tasksByHandle[handle]}function runIfPresent(handle){if(currentlyRunningATask)setTimeout(runIfPresent,0,handle);else{var task=tasksByHandle[handle];if(task){currentlyRunningATask=!0;try{!function(task){var callback=task.callback,args=task.args;switch(args.length){case 0:callback();break;case 1:callback(args[0]);break;case 2:callback(args[0],args[1]);break;case 3:callback(args[0],args[1],args[2]);break;default:callback.apply(undefined,args)}}(task)}finally{clearImmediate(handle),currentlyRunningATask=!1}}}}}("undefined"==typeof self?void 0===global?this:global:self)}).call(this,__webpack_require__(11),__webpack_require__(22))},function(module,exports,__webpack_require__){(function(global){function config(name){try{if(!global.localStorage)return!1}catch(_){return!1}var val=global.localStorage[name];return null!=val&&"true"===String(val).toLowerCase()}module.exports=function(fn,msg){if(config("noDeprecation"))return fn;var warned=!1;return function(){if(!warned){if(config("throwDeprecation"))throw new Error(msg);config("traceDeprecation")?console.trace(msg):console.warn(msg),warned=!0}return fn.apply(this,arguments)}}}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";module.exports=PassThrough;var Transform=__webpack_require__(56),util=Object.create(__webpack_require__(23));function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}util.inherits=__webpack_require__(15),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},function(module,exports,__webpack_require__){module.exports=__webpack_require__(41)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(12)},function(module,exports,__webpack_require__){module.exports=__webpack_require__(40).Transform},function(module,exports,__webpack_require__){module.exports=__webpack_require__(40).PassThrough},function(module,exports,__webpack_require__){"use strict";(function(setImmediate){module.exports="function"==typeof setImmediate?setImmediate:function(){var args=[].slice.apply(arguments);args.splice(1,0,0),setTimeout.apply(null,args)}}).call(this,__webpack_require__(54).setImmediate)},function(module,exports,__webpack_require__){"use strict";var immediate=__webpack_require__(102);function INTERNAL(){}var handlers={},REJECTED=["REJECTED"],FULFILLED=["FULFILLED"],PENDING=["PENDING"];function Promise(resolver){if("function"!=typeof resolver)throw new TypeError("resolver must be a function");this.state=PENDING,this.queue=[],this.outcome=void 0,resolver!==INTERNAL&&safelyResolveThenable(this,resolver)}function QueueItem(promise,onFulfilled,onRejected){this.promise=promise,"function"==typeof onFulfilled&&(this.onFulfilled=onFulfilled,this.callFulfilled=this.otherCallFulfilled),"function"==typeof onRejected&&(this.onRejected=onRejected,this.callRejected=this.otherCallRejected)}function unwrap(promise,func,value){immediate(function(){var returnValue;try{returnValue=func(value)}catch(e){return handlers.reject(promise,e)}returnValue===promise?handlers.reject(promise,new TypeError("Cannot resolve promise with itself")):handlers.resolve(promise,returnValue)})}function getThen(obj){var then=obj&&obj.then;if(obj&&("object"==typeof obj||"function"==typeof obj)&&"function"==typeof then)return function(){then.apply(obj,arguments)}}function safelyResolveThenable(self,thenable){var called=!1;function onError(value){called||(called=!0,handlers.reject(self,value))}function onSuccess(value){called||(called=!0,handlers.resolve(self,value))}var result=tryCatch(function(){thenable(onSuccess,onError)});"error"===result.status&&onError(result.value)}function tryCatch(func,value){var out={};try{out.value=func(value),out.status="success"}catch(e){out.status="error",out.value=e}return out}module.exports=Promise,Promise.prototype.finally=function(callback){if("function"!=typeof callback)return this;var p=this.constructor;return this.then(function(value){return p.resolve(callback()).then(function(){return value})},function(reason){return p.resolve(callback()).then(function(){throw reason})})},Promise.prototype.catch=function(onRejected){return this.then(null,onRejected)},Promise.prototype.then=function(onFulfilled,onRejected){if("function"!=typeof onFulfilled&&this.state===FULFILLED||"function"!=typeof onRejected&&this.state===REJECTED)return this;var promise=new this.constructor(INTERNAL);this.state!==PENDING?unwrap(promise,this.state===FULFILLED?onFulfilled:onRejected,this.outcome):this.queue.push(new QueueItem(promise,onFulfilled,onRejected));return promise},QueueItem.prototype.callFulfilled=function(value){handlers.resolve(this.promise,value)},QueueItem.prototype.otherCallFulfilled=function(value){unwrap(this.promise,this.onFulfilled,value)},QueueItem.prototype.callRejected=function(value){handlers.reject(this.promise,value)},QueueItem.prototype.otherCallRejected=function(value){unwrap(this.promise,this.onRejected,value)},handlers.resolve=function(self,value){var result=tryCatch(getThen,value);if("error"===result.status)return handlers.reject(self,result.value);var thenable=result.value;if(thenable)safelyResolveThenable(self,thenable);else{self.state=FULFILLED,self.outcome=value;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callFulfilled(value)}return self},handlers.reject=function(self,error){self.state=REJECTED,self.outcome=error;for(var i=-1,len=self.queue.length;++i<len;)self.queue[i].callRejected(error);return self},Promise.resolve=function(value){if(value instanceof this)return value;return handlers.resolve(new this(INTERNAL),value)},Promise.reject=function(reason){var promise=new this(INTERNAL);return handlers.reject(promise,reason)},Promise.all=function(iterable){var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);var values=new Array(len),resolved=0,i=-1,promise=new this(INTERNAL);for(;++i<len;)allResolver(iterable[i],i);return promise;function allResolver(value,i){self.resolve(value).then(function(outValue){values[i]=outValue,++resolved!==len||called||(called=!0,handlers.resolve(promise,values))},function(error){called||(called=!0,handlers.reject(promise,error))})}},Promise.race=function(iterable){var self=this;if("[object Array]"!==Object.prototype.toString.call(iterable))return this.reject(new TypeError("must be an array"));var len=iterable.length,called=!1;if(!len)return this.resolve([]);var i=-1,promise=new this(INTERNAL);for(;++i<len;)resolver(iterable[i]);return promise;function resolver(value){self.resolve(value).then(function(response){called||(called=!0,handlers.resolve(promise,response))},function(error){called||(called=!0,handlers.reject(promise,error))})}}},function(module,exports,__webpack_require__){"use strict";(function(global){var scheduleDrain,draining,Mutation=global.MutationObserver||global.WebKitMutationObserver;if(Mutation){var called=0,observer=new Mutation(nextTick),element=global.document.createTextNode("");observer.observe(element,{characterData:!0}),scheduleDrain=function(){element.data=called=++called%2}}else if(global.setImmediate||void 0===global.MessageChannel)scheduleDrain="document"in global&&"onreadystatechange"in global.document.createElement("script")?function(){var scriptEl=global.document.createElement("script");scriptEl.onreadystatechange=function(){nextTick(),scriptEl.onreadystatechange=null,scriptEl.parentNode.removeChild(scriptEl),scriptEl=null},global.document.documentElement.appendChild(scriptEl)}:function(){setTimeout(nextTick,0)};else{var channel=new global.MessageChannel;channel.port1.onmessage=nextTick,scheduleDrain=function(){channel.port2.postMessage(0)}}var queue=[];function nextTick(){var i,oldQueue;draining=!0;for(var len=queue.length;len;){for(oldQueue=queue,queue=[],i=-1;++i<len;)oldQueue[i]();len=queue.length}draining=!1}module.exports=function(task){1!==queue.push(task)||draining||scheduleDrain()}}).call(this,__webpack_require__(11))},function(module,exports,__webpack_require__){"use strict";var GenericWorker=__webpack_require__(2),utils=__webpack_require__(0);function ConvertWorker(destType){GenericWorker.call(this,"ConvertWorker to "+destType),this.destType=destType}utils.inherits(ConvertWorker,GenericWorker),ConvertWorker.prototype.processChunk=function(chunk){this.push({data:utils.transformTo(this.destType,chunk.data),meta:chunk.meta})},module.exports=ConvertWorker},function(module,exports,__webpack_require__){"use strict";var Readable=__webpack_require__(50).Readable;function NodejsStreamOutputAdapter(helper,options,updateCb){Readable.call(this,options),this._helper=helper;var self=this;helper.on("data",function(data,meta){self.push(data)||self._helper.pause(),updateCb&&updateCb(meta)}).on("error",function(e){self.emit("error",e)}).on("end",function(){self.push(null)})}__webpack_require__(0).inherits(NodejsStreamOutputAdapter,Readable),NodejsStreamOutputAdapter.prototype._read=function(){this._helper.resume()},module.exports=NodejsStreamOutputAdapter},function(module,exports,__webpack_require__){"use strict";var StreamHelper=__webpack_require__(58),DataWorker=__webpack_require__(60),utf8=__webpack_require__(14),CompressedObject=__webpack_require__(42),GenericWorker=__webpack_require__(2),ZipObject=function(name,data,options){this.name=name,this.dir=options.dir,this.date=options.date,this.comment=options.comment,this.unixPermissions=options.unixPermissions,this.dosPermissions=options.dosPermissions,this._data=data,this._dataBinary=options.binary,this.options={compression:options.compression,compressionOptions:options.compressionOptions}};ZipObject.prototype={internalStream:function(type){var result=null,outputType="string";try{if(!type)throw new Error("No output type specified.");var askUnicodeString="string"===(outputType=type.toLowerCase())||"text"===outputType;"binarystring"!==outputType&&"text"!==outputType||(outputType="string"),result=this._decompressWorker();var isUnicodeString=!this._dataBinary;isUnicodeString&&!askUnicodeString&&(result=result.pipe(new utf8.Utf8EncodeWorker)),!isUnicodeString&&askUnicodeString&&(result=result.pipe(new utf8.Utf8DecodeWorker))}catch(e){(result=new GenericWorker("error")).error(e)}return new StreamHelper(result,outputType,"")},async:function(type,onUpdate){return this.internalStream(type).accumulate(onUpdate)},nodeStream:function(type,onUpdate){return this.internalStream(type||"nodebuffer").toNodejsStream(onUpdate)},_compressWorker:function(compression,compressionOptions){if(this._data instanceof CompressedObject&&this._data.compression.magic===compression.magic)return this._data.getCompressedWorker();var result=this._decompressWorker();return this._dataBinary||(result=result.pipe(new utf8.Utf8EncodeWorker)),CompressedObject.createWorkerFrom(result,compression,compressionOptions)},_decompressWorker:function(){return this._data instanceof CompressedObject?this._data.getContentWorker():this._data instanceof GenericWorker?this._data:new DataWorker(this._data)}};for(var removedMethods=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],removedFn=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<removedMethods.length;i++)ZipObject.prototype[removedMethods[i]]=removedFn;module.exports=ZipObject},function(module,exports,__webpack_require__){"use strict";var compressions=__webpack_require__(63),ZipFileWorker=__webpack_require__(117);exports.generateWorker=function(zip,options,comment){var zipFileWorker=new ZipFileWorker(options.streamFiles,comment,options.platform,options.encodeFileName),entriesCount=0;try{zip.forEach(function(relativePath,file){entriesCount++;var compression=function(fileCompression,zipCompression){var compressionName=fileCompression||zipCompression,compression=compressions[compressionName];if(!compression)throw new Error(compressionName+" is not a valid compression method !");return compression}(file.options.compression,options.compression),compressionOptions=file.options.compressionOptions||options.compressionOptions||{},dir=file.dir,date=file.date;file._compressWorker(compression,compressionOptions).withStreamInfo("file",{name:relativePath,dir:dir,date:date,comment:file.comment||"",unixPermissions:file.unixPermissions,dosPermissions:file.dosPermissions}).pipe(zipFileWorker)}),zipFileWorker.entriesCount=entriesCount}catch(e){zipFileWorker.error(e)}return zipFileWorker}},function(module,exports,__webpack_require__){"use strict";var USE_TYPEDARRAY="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,pako=__webpack_require__(108),utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),ARRAY_TYPE=USE_TYPEDARRAY?"uint8array":"array";function FlateWorker(action,options){GenericWorker.call(this,"FlateWorker/"+action),this._pako=null,this._pakoAction=action,this._pakoOptions=options,this.meta={}}exports.magic="\b\0",utils.inherits(FlateWorker,GenericWorker),FlateWorker.prototype.processChunk=function(chunk){this.meta=chunk.meta,null===this._pako&&this._createPako(),this._pako.push(utils.transformTo(ARRAY_TYPE,chunk.data),!1)},FlateWorker.prototype.flush=function(){GenericWorker.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},FlateWorker.prototype.cleanUp=function(){GenericWorker.prototype.cleanUp.call(this),this._pako=null},FlateWorker.prototype._createPako=function(){this._pako=new pako[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var self=this;this._pako.onData=function(data){self.push({data:data,meta:self.meta})}},exports.compressWorker=function(compressionOptions){return new FlateWorker("Deflate",compressionOptions)},exports.uncompressWorker=function(){return new FlateWorker("Inflate",{})}},function(module,exports,__webpack_require__){"use strict";var pako={};(0,__webpack_require__(8).assign)(pako,__webpack_require__(109),__webpack_require__(112),__webpack_require__(68)),module.exports=pako},function(module,exports,__webpack_require__){"use strict";var zlib_deflate=__webpack_require__(110),utils=__webpack_require__(8),strings=__webpack_require__(66),msg=__webpack_require__(44),ZStream=__webpack_require__(67),toString=Object.prototype.toString,Z_OK=0,Z_DEFAULT_COMPRESSION=-1,Z_DEFAULT_STRATEGY=0,Z_DEFLATED=8;function Deflate(options){if(!(this instanceof Deflate))return new Deflate(options);this.options=utils.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY,to:""},options||{});var opt=this.options;opt.raw&&opt.windowBits>0?opt.windowBits=-opt.windowBits:opt.gzip&&opt.windowBits>0&&opt.windowBits<16&&(opt.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_deflate.deflateInit2(this.strm,opt.level,opt.method,opt.windowBits,opt.memLevel,opt.strategy);if(status!==Z_OK)throw new Error(msg[status]);if(opt.header&&zlib_deflate.deflateSetHeader(this.strm,opt.header),opt.dictionary){var dict;if(dict="string"==typeof opt.dictionary?strings.string2buf(opt.dictionary):"[object ArrayBuffer]"===toString.call(opt.dictionary)?new Uint8Array(opt.dictionary):opt.dictionary,(status=zlib_deflate.deflateSetDictionary(this.strm,dict))!==Z_OK)throw new Error(msg[status]);this._dict_set=!0}}function deflate(input,options){var deflator=new Deflate(options);if(deflator.push(input,!0),deflator.err)throw deflator.msg||msg[deflator.err];return deflator.result}Deflate.prototype.push=function(data,mode){var status,_mode,strm=this.strm,chunkSize=this.options.chunkSize;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?4:0,"string"==typeof data?strm.input=strings.string2buf(data):"[object ArrayBuffer]"===toString.call(data)?strm.input=new Uint8Array(data):strm.input=data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),1!==(status=zlib_deflate.deflate(strm,_mode))&&status!==Z_OK)return this.onEnd(status),this.ended=!0,!1;0!==strm.avail_out&&(0!==strm.avail_in||4!==_mode&&2!==_mode)||("string"===this.options.to?this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output,strm.next_out))):this.onData(utils.shrinkBuf(strm.output,strm.next_out)))}while((strm.avail_in>0||0===strm.avail_out)&&1!==status);return 4===_mode?(status=zlib_deflate.deflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===Z_OK):2!==_mode||(this.onEnd(Z_OK),strm.avail_out=0,!0)},Deflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Deflate.prototype.onEnd=function(status){status===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Deflate=Deflate,exports.deflate=deflate,exports.deflateRaw=function(input,options){return(options=options||{}).raw=!0,deflate(input,options)},exports.gzip=function(input,options){return(options=options||{}).gzip=!0,deflate(input,options)}},function(module,exports,__webpack_require__){"use strict";var configuration_table,utils=__webpack_require__(8),trees=__webpack_require__(111),adler32=__webpack_require__(64),crc32=__webpack_require__(65),msg=__webpack_require__(44),Z_NO_FLUSH=0,Z_PARTIAL_FLUSH=1,Z_FULL_FLUSH=3,Z_FINISH=4,Z_BLOCK=5,Z_OK=0,Z_STREAM_END=1,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_BUF_ERROR=-5,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_RLE=3,Z_FIXED=4,Z_DEFAULT_STRATEGY=0,Z_UNKNOWN=2,Z_DEFLATED=8,MAX_MEM_LEVEL=9,MAX_WBITS=15,DEF_MEM_LEVEL=8,L_CODES=286,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3;function err(strm,errorCode){return strm.msg=msg[errorCode],errorCode}function rank(f){return(f<<1)-(f>4?9:0)}function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}function flush_pending(strm){var s=strm.state,len=s.pending;len>strm.avail_out&&(len=strm.avail_out),0!==len&&(utils.arraySet(strm.output,s.pending_buf,s.pending_out,len,strm.next_out),strm.next_out+=len,s.pending_out+=len,strm.total_out+=len,strm.avail_out-=len,s.pending-=len,0===s.pending&&(s.pending_out=0))}function flush_block_only(s,last){trees._tr_flush_block(s,s.block_start>=0?s.block_start:-1,s.strstart-s.block_start,last),s.block_start=s.strstart,flush_pending(s.strm)}function put_byte(s,b){s.pending_buf[s.pending++]=b}function putShortMSB(s,b){s.pending_buf[s.pending++]=b>>>8&255,s.pending_buf[s.pending++]=255&b}function read_buf(strm,buf,start,size){var len=strm.avail_in;return len>size&&(len=size),0===len?0:(strm.avail_in-=len,utils.arraySet(buf,strm.input,strm.next_in,len,start),1===strm.state.wrap?strm.adler=adler32(strm.adler,buf,len,start):2===strm.state.wrap&&(strm.adler=crc32(strm.adler,buf,len,start)),strm.next_in+=len,strm.total_in+=len,len)}function longest_match(s,cur_match){var match,len,chain_length=s.max_chain_length,scan=s.strstart,best_len=s.prev_length,nice_match=s.nice_match,limit=s.strstart>s.w_size-MIN_LOOKAHEAD?s.strstart-(s.w_size-MIN_LOOKAHEAD):0,_win=s.window,wmask=s.w_mask,prev=s.prev,strend=s.strstart+MAX_MATCH,scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len];s.prev_length>=s.good_match&&(chain_length>>=2),nice_match>s.lookahead&&(nice_match=s.lookahead);do{if(_win[(match=cur_match)+best_len]===scan_end&&_win[match+best_len-1]===scan_end1&&_win[match]===_win[scan]&&_win[++match]===_win[scan+1]){scan+=2,match++;do{}while(_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&_win[++scan]===_win[++match]&&scan<strend);if(len=MAX_MATCH-(strend-scan),scan=strend-MAX_MATCH,len>best_len){if(s.match_start=cur_match,best_len=len,len>=nice_match)break;scan_end1=_win[scan+best_len-1],scan_end=_win[scan+best_len]}}}while((cur_match=prev[cur_match&wmask])>limit&&0!=--chain_length);return best_len<=s.lookahead?best_len:s.lookahead}function fill_window(s){var p,n,m,more,str,_w_size=s.w_size;do{if(more=s.window_size-s.lookahead-s.strstart,s.strstart>=_w_size+(_w_size-MIN_LOOKAHEAD)){utils.arraySet(s.window,s.window,_w_size,_w_size,0),s.match_start-=_w_size,s.strstart-=_w_size,s.block_start-=_w_size,p=n=s.hash_size;do{m=s.head[--p],s.head[p]=m>=_w_size?m-_w_size:0}while(--n);p=n=_w_size;do{m=s.prev[--p],s.prev[p]=m>=_w_size?m-_w_size:0}while(--n);more+=_w_size}if(0===s.strm.avail_in)break;if(n=read_buf(s.strm,s.window,s.strstart+s.lookahead,more),s.lookahead+=n,s.lookahead+s.insert>=MIN_MATCH)for(str=s.strstart-s.insert,s.ins_h=s.window[str],s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+1])&s.hash_mask;s.insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++,s.insert--,!(s.lookahead+s.insert<MIN_MATCH)););}while(s.lookahead<MIN_LOOKAHEAD&&0!==s.strm.avail_in)}function deflate_fast(s,flush){for(var hash_head,bflush;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),0!==hash_head&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head)),s.match_length>=MIN_MATCH)if(bflush=trees._tr_tally(s,s.strstart-s.match_start,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.match_length<=s.max_lazy_match&&s.lookahead>=MIN_MATCH){s.match_length--;do{s.strstart++,s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart}while(0!=--s.match_length);s.strstart++}else s.strstart+=s.match_length,s.match_length=0,s.ins_h=s.window[s.strstart],s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+1])&s.hash_mask;else bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++;if(bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function deflate_slow(s,flush){for(var hash_head,bflush,max_insert;;){if(s.lookahead<MIN_LOOKAHEAD){if(fill_window(s),s.lookahead<MIN_LOOKAHEAD&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(hash_head=0,s.lookahead>=MIN_MATCH&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart),s.prev_length=s.match_length,s.prev_match=s.match_start,s.match_length=MIN_MATCH-1,0!==hash_head&&s.prev_length<s.max_lazy_match&&s.strstart-hash_head<=s.w_size-MIN_LOOKAHEAD&&(s.match_length=longest_match(s,hash_head),s.match_length<=5&&(s.strategy===Z_FILTERED||s.match_length===MIN_MATCH&&s.strstart-s.match_start>4096)&&(s.match_length=MIN_MATCH-1)),s.prev_length>=MIN_MATCH&&s.match_length<=s.prev_length){max_insert=s.strstart+s.lookahead-MIN_MATCH,bflush=trees._tr_tally(s,s.strstart-1-s.prev_match,s.prev_length-MIN_MATCH),s.lookahead-=s.prev_length-1,s.prev_length-=2;do{++s.strstart<=max_insert&&(s.ins_h=(s.ins_h<<s.hash_shift^s.window[s.strstart+MIN_MATCH-1])&s.hash_mask,hash_head=s.prev[s.strstart&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=s.strstart)}while(0!=--s.prev_length);if(s.match_available=0,s.match_length=MIN_MATCH-1,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}else if(s.match_available){if((bflush=trees._tr_tally(s,0,s.window[s.strstart-1]))&&flush_block_only(s,!1),s.strstart++,s.lookahead--,0===s.strm.avail_out)return BS_NEED_MORE}else s.match_available=1,s.strstart++,s.lookahead--}return s.match_available&&(bflush=trees._tr_tally(s,0,s.window[s.strstart-1]),s.match_available=0),s.insert=s.strstart<MIN_MATCH-1?s.strstart:MIN_MATCH-1,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}function Config(good_length,max_lazy,nice_length,max_chain,func){this.good_length=good_length,this.max_lazy=max_lazy,this.nice_length=nice_length,this.max_chain=max_chain,this.func=func}function deflateResetKeep(strm){var s;return strm&&strm.state?(strm.total_in=strm.total_out=0,strm.data_type=Z_UNKNOWN,(s=strm.state).pending=0,s.pending_out=0,s.wrap<0&&(s.wrap=-s.wrap),s.status=s.wrap?INIT_STATE:BUSY_STATE,strm.adler=2===s.wrap?0:1,s.last_flush=Z_NO_FLUSH,trees._tr_init(s),Z_OK):err(strm,Z_STREAM_ERROR)}function deflateReset(strm){var ret=deflateResetKeep(strm);return ret===Z_OK&&function(s){s.window_size=2*s.w_size,zero(s.head),s.max_lazy_match=configuration_table[s.level].max_lazy,s.good_match=configuration_table[s.level].good_length,s.nice_match=configuration_table[s.level].nice_length,s.max_chain_length=configuration_table[s.level].max_chain,s.strstart=0,s.block_start=0,s.lookahead=0,s.insert=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,s.ins_h=0}(strm.state),ret}function deflateInit2(strm,level,method,windowBits,memLevel,strategy){if(!strm)return Z_STREAM_ERROR;var wrap=1;if(level===Z_DEFAULT_COMPRESSION&&(level=6),windowBits<0?(wrap=0,windowBits=-windowBits):windowBits>15&&(wrap=2,windowBits-=16),memLevel<1||memLevel>MAX_MEM_LEVEL||method!==Z_DEFLATED||windowBits<8||windowBits>15||level<0||level>9||strategy<0||strategy>Z_FIXED)return err(strm,Z_STREAM_ERROR);8===windowBits&&(windowBits=9);var s=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new utils.Buf16(2*HEAP_SIZE),this.dyn_dtree=new utils.Buf16(2*(2*D_CODES+1)),this.bl_tree=new utils.Buf16(2*(2*BL_CODES+1)),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new utils.Buf16(MAX_BITS+1),this.heap=new utils.Buf16(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new utils.Buf16(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return strm.state=s,s.strm=strm,s.wrap=wrap,s.gzhead=null,s.w_bits=windowBits,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=memLevel+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+MIN_MATCH-1)/MIN_MATCH),s.window=new utils.Buf8(2*s.w_size),s.head=new utils.Buf16(s.hash_size),s.prev=new utils.Buf16(s.w_size),s.lit_bufsize=1<<memLevel+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new utils.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=level,s.strategy=strategy,s.method=method,deflateReset(strm)}configuration_table=[new Config(0,0,0,0,function(s,flush){var max_block_size=65535;for(max_block_size>s.pending_buf_size-5&&(max_block_size=s.pending_buf_size-5);;){if(s.lookahead<=1){if(fill_window(s),0===s.lookahead&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}s.strstart+=s.lookahead,s.lookahead=0;var max_start=s.block_start+max_block_size;if((0===s.strstart||s.strstart>=max_start)&&(s.lookahead=s.strstart-max_start,s.strstart=max_start,flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE;if(s.strstart-s.block_start>=s.w_size-MIN_LOOKAHEAD&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):(s.strstart>s.block_start&&(flush_block_only(s,!1),s.strm.avail_out),BS_NEED_MORE)}),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],exports.deflateInit=function(strm,level){return deflateInit2(strm,level,Z_DEFLATED,MAX_WBITS,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY)},exports.deflateInit2=deflateInit2,exports.deflateReset=deflateReset,exports.deflateResetKeep=deflateResetKeep,exports.deflateSetHeader=function(strm,head){return strm&&strm.state?2!==strm.state.wrap?Z_STREAM_ERROR:(strm.state.gzhead=head,Z_OK):Z_STREAM_ERROR},exports.deflate=function(strm,flush){var old_flush,s,beg,val;if(!strm||!strm.state||flush>Z_BLOCK||flush<0)return strm?err(strm,Z_STREAM_ERROR):Z_STREAM_ERROR;if(s=strm.state,!strm.output||!strm.input&&0!==strm.avail_in||s.status===FINISH_STATE&&flush!==Z_FINISH)return err(strm,0===strm.avail_out?Z_BUF_ERROR:Z_STREAM_ERROR);if(s.strm=strm,old_flush=s.last_flush,s.last_flush=flush,s.status===INIT_STATE)if(2===s.wrap)strm.adler=0,put_byte(s,31),put_byte(s,139),put_byte(s,8),s.gzhead?(put_byte(s,(s.gzhead.text?1:0)+(s.gzhead.hcrc?2:0)+(s.gzhead.extra?4:0)+(s.gzhead.name?8:0)+(s.gzhead.comment?16:0)),put_byte(s,255&s.gzhead.time),put_byte(s,s.gzhead.time>>8&255),put_byte(s,s.gzhead.time>>16&255),put_byte(s,s.gzhead.time>>24&255),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,255&s.gzhead.os),s.gzhead.extra&&s.gzhead.extra.length&&(put_byte(s,255&s.gzhead.extra.length),put_byte(s,s.gzhead.extra.length>>8&255)),s.gzhead.hcrc&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending,0)),s.gzindex=0,s.status=EXTRA_STATE):(put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,0),put_byte(s,9===s.level?2:s.strategy>=Z_HUFFMAN_ONLY||s.level<2?4:0),put_byte(s,OS_CODE),s.status=BUSY_STATE);else{var header=Z_DEFLATED+(s.w_bits-8<<4)<<8;header|=(s.strategy>=Z_HUFFMAN_ONLY||s.level<2?0:s.level<6?1:6===s.level?2:3)<<6,0!==s.strstart&&(header|=PRESET_DICT),header+=31-header%31,s.status=BUSY_STATE,putShortMSB(s,header),0!==s.strstart&&(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),strm.adler=1}if(s.status===EXTRA_STATE)if(s.gzhead.extra){for(beg=s.pending;s.gzindex<(65535&s.gzhead.extra.length)&&(s.pending!==s.pending_buf_size||(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending!==s.pending_buf_size));)put_byte(s,255&s.gzhead.extra[s.gzindex]),s.gzindex++;s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),s.gzindex===s.gzhead.extra.length&&(s.gzindex=0,s.status=NAME_STATE)}else s.status=NAME_STATE;if(s.status===NAME_STATE)if(s.gzhead.name){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.name.length?255&s.gzhead.name.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.gzindex=0,s.status=COMMENT_STATE)}else s.status=COMMENT_STATE;if(s.status===COMMENT_STATE)if(s.gzhead.comment){beg=s.pending;do{if(s.pending===s.pending_buf_size&&(s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),flush_pending(strm),beg=s.pending,s.pending===s.pending_buf_size)){val=1;break}val=s.gzindex<s.gzhead.comment.length?255&s.gzhead.comment.charCodeAt(s.gzindex++):0,put_byte(s,val)}while(0!==val);s.gzhead.hcrc&&s.pending>beg&&(strm.adler=crc32(strm.adler,s.pending_buf,s.pending-beg,beg)),0===val&&(s.status=HCRC_STATE)}else s.status=HCRC_STATE;if(s.status===HCRC_STATE&&(s.gzhead.hcrc?(s.pending+2>s.pending_buf_size&&flush_pending(strm),s.pending+2<=s.pending_buf_size&&(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),strm.adler=0,s.status=BUSY_STATE)):s.status=BUSY_STATE),0!==s.pending){if(flush_pending(strm),0===strm.avail_out)return s.last_flush=-1,Z_OK}else if(0===strm.avail_in&&rank(flush)<=rank(old_flush)&&flush!==Z_FINISH)return err(strm,Z_BUF_ERROR);if(s.status===FINISH_STATE&&0!==strm.avail_in)return err(strm,Z_BUF_ERROR);if(0!==strm.avail_in||0!==s.lookahead||flush!==Z_NO_FLUSH&&s.status!==FINISH_STATE){var bstate=s.strategy===Z_HUFFMAN_ONLY?function(s,flush){for(var bflush;;){if(0===s.lookahead&&(fill_window(s),0===s.lookahead)){if(flush===Z_NO_FLUSH)return BS_NEED_MORE;break}if(s.match_length=0,bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++,bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}(s,flush):s.strategy===Z_RLE?function(s,flush){for(var bflush,prev,scan,strend,_win=s.window;;){if(s.lookahead<=MAX_MATCH){if(fill_window(s),s.lookahead<=MAX_MATCH&&flush===Z_NO_FLUSH)return BS_NEED_MORE;if(0===s.lookahead)break}if(s.match_length=0,s.lookahead>=MIN_MATCH&&s.strstart>0&&(prev=_win[scan=s.strstart-1])===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]){strend=s.strstart+MAX_MATCH;do{}while(prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&prev===_win[++scan]&&scan<strend);s.match_length=MAX_MATCH-(strend-scan),s.match_length>s.lookahead&&(s.match_length=s.lookahead)}if(s.match_length>=MIN_MATCH?(bflush=trees._tr_tally(s,1,s.match_length-MIN_MATCH),s.lookahead-=s.match_length,s.strstart+=s.match_length,s.match_length=0):(bflush=trees._tr_tally(s,0,s.window[s.strstart]),s.lookahead--,s.strstart++),bflush&&(flush_block_only(s,!1),0===s.strm.avail_out))return BS_NEED_MORE}return s.insert=0,flush===Z_FINISH?(flush_block_only(s,!0),0===s.strm.avail_out?BS_FINISH_STARTED:BS_FINISH_DONE):s.last_lit&&(flush_block_only(s,!1),0===s.strm.avail_out)?BS_NEED_MORE:BS_BLOCK_DONE}(s,flush):configuration_table[s.level].func(s,flush);if(bstate!==BS_FINISH_STARTED&&bstate!==BS_FINISH_DONE||(s.status=FINISH_STATE),bstate===BS_NEED_MORE||bstate===BS_FINISH_STARTED)return 0===strm.avail_out&&(s.last_flush=-1),Z_OK;if(bstate===BS_BLOCK_DONE&&(flush===Z_PARTIAL_FLUSH?trees._tr_align(s):flush!==Z_BLOCK&&(trees._tr_stored_block(s,0,0,!1),flush===Z_FULL_FLUSH&&(zero(s.head),0===s.lookahead&&(s.strstart=0,s.block_start=0,s.insert=0))),flush_pending(strm),0===strm.avail_out))return s.last_flush=-1,Z_OK}return flush!==Z_FINISH?Z_OK:s.wrap<=0?Z_STREAM_END:(2===s.wrap?(put_byte(s,255&strm.adler),put_byte(s,strm.adler>>8&255),put_byte(s,strm.adler>>16&255),put_byte(s,strm.adler>>24&255),put_byte(s,255&strm.total_in),put_byte(s,strm.total_in>>8&255),put_byte(s,strm.total_in>>16&255),put_byte(s,strm.total_in>>24&255)):(putShortMSB(s,strm.adler>>>16),putShortMSB(s,65535&strm.adler)),flush_pending(strm),s.wrap>0&&(s.wrap=-s.wrap),0!==s.pending?Z_OK:Z_STREAM_END)},exports.deflateEnd=function(strm){var status;return strm&&strm.state?(status=strm.state.status)!==INIT_STATE&&status!==EXTRA_STATE&&status!==NAME_STATE&&status!==COMMENT_STATE&&status!==HCRC_STATE&&status!==BUSY_STATE&&status!==FINISH_STATE?err(strm,Z_STREAM_ERROR):(strm.state=null,status===BUSY_STATE?err(strm,Z_DATA_ERROR):Z_OK):Z_STREAM_ERROR},exports.deflateSetDictionary=function(strm,dictionary){var s,str,n,wrap,avail,next,input,tmpDict,dictLength=dictionary.length;if(!strm||!strm.state)return Z_STREAM_ERROR;if(2===(wrap=(s=strm.state).wrap)||1===wrap&&s.status!==INIT_STATE||s.lookahead)return Z_STREAM_ERROR;for(1===wrap&&(strm.adler=adler32(strm.adler,dictionary,dictLength,0)),s.wrap=0,dictLength>=s.w_size&&(0===wrap&&(zero(s.head),s.strstart=0,s.block_start=0,s.insert=0),tmpDict=new utils.Buf8(s.w_size),utils.arraySet(tmpDict,dictionary,dictLength-s.w_size,s.w_size,0),dictionary=tmpDict,dictLength=s.w_size),avail=strm.avail_in,next=strm.next_in,input=strm.input,strm.avail_in=dictLength,strm.next_in=0,strm.input=dictionary,fill_window(s);s.lookahead>=MIN_MATCH;){str=s.strstart,n=s.lookahead-(MIN_MATCH-1);do{s.ins_h=(s.ins_h<<s.hash_shift^s.window[str+MIN_MATCH-1])&s.hash_mask,s.prev[str&s.w_mask]=s.head[s.ins_h],s.head[s.ins_h]=str,str++}while(--n);s.strstart=str,s.lookahead=MIN_MATCH-1,fill_window(s)}return s.strstart+=s.lookahead,s.block_start=s.strstart,s.insert=s.lookahead,s.lookahead=0,s.match_length=s.prev_length=MIN_MATCH-1,s.match_available=0,strm.next_in=next,strm.input=input,strm.avail_in=avail,s.wrap=wrap,Z_OK},exports.deflateInfo="pako deflate (from Nodeca project)"},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),Z_FIXED=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN=2;function zero(buf){for(var len=buf.length;--len>=0;)buf[len]=0}var STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],static_ltree=new Array(2*(L_CODES+2));zero(static_ltree);var static_dtree=new Array(2*D_CODES);zero(static_dtree);var _dist_code=new Array(512);zero(_dist_code);var _length_code=new Array(256);zero(_length_code);var base_length=new Array(LENGTH_CODES);zero(base_length);var static_l_desc,static_d_desc,static_bl_desc,base_dist=new Array(D_CODES);function StaticTreeDesc(static_tree,extra_bits,extra_base,elems,max_length){this.static_tree=static_tree,this.extra_bits=extra_bits,this.extra_base=extra_base,this.elems=elems,this.max_length=max_length,this.has_stree=static_tree&&static_tree.length}function TreeDesc(dyn_tree,stat_desc){this.dyn_tree=dyn_tree,this.max_code=0,this.stat_desc=stat_desc}function d_code(dist){return dist<256?_dist_code[dist]:_dist_code[256+(dist>>>7)]}function put_short(s,w){s.pending_buf[s.pending++]=255&w,s.pending_buf[s.pending++]=w>>>8&255}function send_bits(s,value,length){s.bi_valid>Buf_size-length?(s.bi_buf|=value<<s.bi_valid&65535,put_short(s,s.bi_buf),s.bi_buf=value>>Buf_size-s.bi_valid,s.bi_valid+=length-Buf_size):(s.bi_buf|=value<<s.bi_valid&65535,s.bi_valid+=length)}function send_code(s,c,tree){send_bits(s,tree[2*c],tree[2*c+1])}function bi_reverse(code,len){var res=0;do{res|=1&code,code>>>=1,res<<=1}while(--len>0);return res>>>1}function gen_codes(tree,max_code,bl_count){var bits,n,next_code=new Array(MAX_BITS+1),code=0;for(bits=1;bits<=MAX_BITS;bits++)next_code[bits]=code=code+bl_count[bits-1]<<1;for(n=0;n<=max_code;n++){var len=tree[2*n+1];0!==len&&(tree[2*n]=bi_reverse(next_code[len]++,len))}}function init_block(s){var n;for(n=0;n<L_CODES;n++)s.dyn_ltree[2*n]=0;for(n=0;n<D_CODES;n++)s.dyn_dtree[2*n]=0;for(n=0;n<BL_CODES;n++)s.bl_tree[2*n]=0;s.dyn_ltree[2*END_BLOCK]=1,s.opt_len=s.static_len=0,s.last_lit=s.matches=0}function bi_windup(s){s.bi_valid>8?put_short(s,s.bi_buf):s.bi_valid>0&&(s.pending_buf[s.pending++]=s.bi_buf),s.bi_buf=0,s.bi_valid=0}function smaller(tree,n,m,depth){var _n2=2*n,_m2=2*m;return tree[_n2]<tree[_m2]||tree[_n2]===tree[_m2]&&depth[n]<=depth[m]}function pqdownheap(s,tree,k){for(var v=s.heap[k],j=k<<1;j<=s.heap_len&&(j<s.heap_len&&smaller(tree,s.heap[j+1],s.heap[j],s.depth)&&j++,!smaller(tree,v,s.heap[j],s.depth));)s.heap[k]=s.heap[j],k=j,j<<=1;s.heap[k]=v}function compress_block(s,ltree,dtree){var dist,lc,code,extra,lx=0;if(0!==s.last_lit)do{dist=s.pending_buf[s.d_buf+2*lx]<<8|s.pending_buf[s.d_buf+2*lx+1],lc=s.pending_buf[s.l_buf+lx],lx++,0===dist?send_code(s,lc,ltree):(send_code(s,(code=_length_code[lc])+LITERALS+1,ltree),0!==(extra=extra_lbits[code])&&send_bits(s,lc-=base_length[code],extra),send_code(s,code=d_code(--dist),dtree),0!==(extra=extra_dbits[code])&&send_bits(s,dist-=base_dist[code],extra))}while(lx<s.last_lit);send_code(s,END_BLOCK,ltree)}function build_tree(s,desc){var n,m,node,tree=desc.dyn_tree,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,elems=desc.stat_desc.elems,max_code=-1;for(s.heap_len=0,s.heap_max=HEAP_SIZE,n=0;n<elems;n++)0!==tree[2*n]?(s.heap[++s.heap_len]=max_code=n,s.depth[n]=0):tree[2*n+1]=0;for(;s.heap_len<2;)tree[2*(node=s.heap[++s.heap_len]=max_code<2?++max_code:0)]=1,s.depth[node]=0,s.opt_len--,has_stree&&(s.static_len-=stree[2*node+1]);for(desc.max_code=max_code,n=s.heap_len>>1;n>=1;n--)pqdownheap(s,tree,n);node=elems;do{n=s.heap[1],s.heap[1]=s.heap[s.heap_len--],pqdownheap(s,tree,1),m=s.heap[1],s.heap[--s.heap_max]=n,s.heap[--s.heap_max]=m,tree[2*node]=tree[2*n]+tree[2*m],s.depth[node]=(s.depth[n]>=s.depth[m]?s.depth[n]:s.depth[m])+1,tree[2*n+1]=tree[2*m+1]=node,s.heap[1]=node++,pqdownheap(s,tree,1)}while(s.heap_len>=2);s.heap[--s.heap_max]=s.heap[1],function(s,desc){var h,n,m,bits,xbits,f,tree=desc.dyn_tree,max_code=desc.max_code,stree=desc.stat_desc.static_tree,has_stree=desc.stat_desc.has_stree,extra=desc.stat_desc.extra_bits,base=desc.stat_desc.extra_base,max_length=desc.stat_desc.max_length,overflow=0;for(bits=0;bits<=MAX_BITS;bits++)s.bl_count[bits]=0;for(tree[2*s.heap[s.heap_max]+1]=0,h=s.heap_max+1;h<HEAP_SIZE;h++)(bits=tree[2*tree[2*(n=s.heap[h])+1]+1]+1)>max_length&&(bits=max_length,overflow++),tree[2*n+1]=bits,n>max_code||(s.bl_count[bits]++,xbits=0,n>=base&&(xbits=extra[n-base]),f=tree[2*n],s.opt_len+=f*(bits+xbits),has_stree&&(s.static_len+=f*(stree[2*n+1]+xbits)));if(0!==overflow){do{for(bits=max_length-1;0===s.bl_count[bits];)bits--;s.bl_count[bits]--,s.bl_count[bits+1]+=2,s.bl_count[max_length]--,overflow-=2}while(overflow>0);for(bits=max_length;0!==bits;bits--)for(n=s.bl_count[bits];0!==n;)(m=s.heap[--h])>max_code||(tree[2*m+1]!==bits&&(s.opt_len+=(bits-tree[2*m+1])*tree[2*m],tree[2*m+1]=bits),n--)}}(s,desc),gen_codes(tree,max_code,s.bl_count)}function scan_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),tree[2*(max_code+1)+1]=65535,n=0;n<=max_code;n++)curlen=nextlen,nextlen=tree[2*(n+1)+1],++count<max_count&&curlen===nextlen||(count<min_count?s.bl_tree[2*curlen]+=count:0!==curlen?(curlen!==prevlen&&s.bl_tree[2*curlen]++,s.bl_tree[2*REP_3_6]++):count<=10?s.bl_tree[2*REPZ_3_10]++:s.bl_tree[2*REPZ_11_138]++,count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4))}function send_tree(s,tree,max_code){var n,curlen,prevlen=-1,nextlen=tree[1],count=0,max_count=7,min_count=4;for(0===nextlen&&(max_count=138,min_count=3),n=0;n<=max_code;n++)if(curlen=nextlen,nextlen=tree[2*(n+1)+1],!(++count<max_count&&curlen===nextlen)){if(count<min_count)do{send_code(s,curlen,s.bl_tree)}while(0!=--count);else 0!==curlen?(curlen!==prevlen&&(send_code(s,curlen,s.bl_tree),count--),send_code(s,REP_3_6,s.bl_tree),send_bits(s,count-3,2)):count<=10?(send_code(s,REPZ_3_10,s.bl_tree),send_bits(s,count-3,3)):(send_code(s,REPZ_11_138,s.bl_tree),send_bits(s,count-11,7));count=0,prevlen=curlen,0===nextlen?(max_count=138,min_count=3):curlen===nextlen?(max_count=6,min_count=3):(max_count=7,min_count=4)}}zero(base_dist);var static_init_done=!1;function _tr_stored_block(s,buf,stored_len,last){send_bits(s,(STORED_BLOCK<<1)+(last?1:0),3),function(s,buf,len,header){bi_windup(s),header&&(put_short(s,len),put_short(s,~len)),utils.arraySet(s.pending_buf,s.window,buf,len,s.pending),s.pending+=len}(s,buf,stored_len,!0)}exports._tr_init=function(s){static_init_done||(function(){var n,bits,length,code,dist,bl_count=new Array(MAX_BITS+1);for(length=0,code=0;code<LENGTH_CODES-1;code++)for(base_length[code]=length,n=0;n<1<<extra_lbits[code];n++)_length_code[length++]=code;for(_length_code[length-1]=code,dist=0,code=0;code<16;code++)for(base_dist[code]=dist,n=0;n<1<<extra_dbits[code];n++)_dist_code[dist++]=code;for(dist>>=7;code<D_CODES;code++)for(base_dist[code]=dist<<7,n=0;n<1<<extra_dbits[code]-7;n++)_dist_code[256+dist++]=code;for(bits=0;bits<=MAX_BITS;bits++)bl_count[bits]=0;for(n=0;n<=143;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(;n<=255;)static_ltree[2*n+1]=9,n++,bl_count[9]++;for(;n<=279;)static_ltree[2*n+1]=7,n++,bl_count[7]++;for(;n<=287;)static_ltree[2*n+1]=8,n++,bl_count[8]++;for(gen_codes(static_ltree,L_CODES+1,bl_count),n=0;n<D_CODES;n++)static_dtree[2*n+1]=5,static_dtree[2*n]=bi_reverse(n,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS+1,L_CODES,MAX_BITS),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES,MAX_BITS),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES,MAX_BL_BITS)}(),static_init_done=!0),s.l_desc=new TreeDesc(s.dyn_ltree,static_l_desc),s.d_desc=new TreeDesc(s.dyn_dtree,static_d_desc),s.bl_desc=new TreeDesc(s.bl_tree,static_bl_desc),s.bi_buf=0,s.bi_valid=0,init_block(s)},exports._tr_stored_block=_tr_stored_block,exports._tr_flush_block=function(s,buf,stored_len,last){var opt_lenb,static_lenb,max_blindex=0;s.level>0?(s.strm.data_type===Z_UNKNOWN&&(s.strm.data_type=function(s){var n,black_mask=4093624447;for(n=0;n<=31;n++,black_mask>>>=1)if(1&black_mask&&0!==s.dyn_ltree[2*n])return Z_BINARY;if(0!==s.dyn_ltree[18]||0!==s.dyn_ltree[20]||0!==s.dyn_ltree[26])return Z_TEXT;for(n=32;n<LITERALS;n++)if(0!==s.dyn_ltree[2*n])return Z_TEXT;return Z_BINARY}(s)),build_tree(s,s.l_desc),build_tree(s,s.d_desc),max_blindex=function(s){var max_blindex;for(scan_tree(s,s.dyn_ltree,s.l_desc.max_code),scan_tree(s,s.dyn_dtree,s.d_desc.max_code),build_tree(s,s.bl_desc),max_blindex=BL_CODES-1;max_blindex>=3&&0===s.bl_tree[2*bl_order[max_blindex]+1];max_blindex--);return s.opt_len+=3*(max_blindex+1)+5+5+4,max_blindex}(s),opt_lenb=s.opt_len+3+7>>>3,(static_lenb=s.static_len+3+7>>>3)<=opt_lenb&&(opt_lenb=static_lenb)):opt_lenb=static_lenb=stored_len+5,stored_len+4<=opt_lenb&&-1!==buf?_tr_stored_block(s,buf,stored_len,last):s.strategy===Z_FIXED||static_lenb===opt_lenb?(send_bits(s,(STATIC_TREES<<1)+(last?1:0),3),compress_block(s,static_ltree,static_dtree)):(send_bits(s,(DYN_TREES<<1)+(last?1:0),3),function(s,lcodes,dcodes,blcodes){var rank;for(send_bits(s,lcodes-257,5),send_bits(s,dcodes-1,5),send_bits(s,blcodes-4,4),rank=0;rank<blcodes;rank++)send_bits(s,s.bl_tree[2*bl_order[rank]+1],3);send_tree(s,s.dyn_ltree,lcodes-1),send_tree(s,s.dyn_dtree,dcodes-1)}(s,s.l_desc.max_code+1,s.d_desc.max_code+1,max_blindex+1),compress_block(s,s.dyn_ltree,s.dyn_dtree)),init_block(s),last&&bi_windup(s)},exports._tr_tally=function(s,dist,lc){return s.pending_buf[s.d_buf+2*s.last_lit]=dist>>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&dist,s.pending_buf[s.l_buf+s.last_lit]=255&lc,s.last_lit++,0===dist?s.dyn_ltree[2*lc]++:(s.matches++,dist--,s.dyn_ltree[2*(_length_code[lc]+LITERALS+1)]++,s.dyn_dtree[2*d_code(dist)]++),s.last_lit===s.lit_bufsize-1},exports._tr_align=function(s){send_bits(s,STATIC_TREES<<1,3),send_code(s,END_BLOCK,static_ltree),function(s){16===s.bi_valid?(put_short(s,s.bi_buf),s.bi_buf=0,s.bi_valid=0):s.bi_valid>=8&&(s.pending_buf[s.pending++]=255&s.bi_buf,s.bi_buf>>=8,s.bi_valid-=8)}(s)}},function(module,exports,__webpack_require__){"use strict";var zlib_inflate=__webpack_require__(113),utils=__webpack_require__(8),strings=__webpack_require__(66),c=__webpack_require__(68),msg=__webpack_require__(44),ZStream=__webpack_require__(67),GZheader=__webpack_require__(116),toString=Object.prototype.toString;function Inflate(options){if(!(this instanceof Inflate))return new Inflate(options);this.options=utils.assign({chunkSize:16384,windowBits:0,to:""},options||{});var opt=this.options;opt.raw&&opt.windowBits>=0&&opt.windowBits<16&&(opt.windowBits=-opt.windowBits,0===opt.windowBits&&(opt.windowBits=-15)),!(opt.windowBits>=0&&opt.windowBits<16)||options&&options.windowBits||(opt.windowBits+=32),opt.windowBits>15&&opt.windowBits<48&&0==(15&opt.windowBits)&&(opt.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ZStream,this.strm.avail_out=0;var status=zlib_inflate.inflateInit2(this.strm,opt.windowBits);if(status!==c.Z_OK)throw new Error(msg[status]);if(this.header=new GZheader,zlib_inflate.inflateGetHeader(this.strm,this.header),opt.dictionary&&("string"==typeof opt.dictionary?opt.dictionary=strings.string2buf(opt.dictionary):"[object ArrayBuffer]"===toString.call(opt.dictionary)&&(opt.dictionary=new Uint8Array(opt.dictionary)),opt.raw&&(status=zlib_inflate.inflateSetDictionary(this.strm,opt.dictionary))!==c.Z_OK))throw new Error(msg[status])}function inflate(input,options){var inflator=new Inflate(options);if(inflator.push(input,!0),inflator.err)throw inflator.msg||msg[inflator.err];return inflator.result}Inflate.prototype.push=function(data,mode){var status,_mode,next_out_utf8,tail,utf8str,strm=this.strm,chunkSize=this.options.chunkSize,dictionary=this.options.dictionary,allowBufError=!1;if(this.ended)return!1;_mode=mode===~~mode?mode:!0===mode?c.Z_FINISH:c.Z_NO_FLUSH,"string"==typeof data?strm.input=strings.binstring2buf(data):"[object ArrayBuffer]"===toString.call(data)?strm.input=new Uint8Array(data):strm.input=data,strm.next_in=0,strm.avail_in=strm.input.length;do{if(0===strm.avail_out&&(strm.output=new utils.Buf8(chunkSize),strm.next_out=0,strm.avail_out=chunkSize),(status=zlib_inflate.inflate(strm,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&dictionary&&(status=zlib_inflate.inflateSetDictionary(this.strm,dictionary)),status===c.Z_BUF_ERROR&&!0===allowBufError&&(status=c.Z_OK,allowBufError=!1),status!==c.Z_STREAM_END&&status!==c.Z_OK)return this.onEnd(status),this.ended=!0,!1;strm.next_out&&(0!==strm.avail_out&&status!==c.Z_STREAM_END&&(0!==strm.avail_in||_mode!==c.Z_FINISH&&_mode!==c.Z_SYNC_FLUSH)||("string"===this.options.to?(next_out_utf8=strings.utf8border(strm.output,strm.next_out),tail=strm.next_out-next_out_utf8,utf8str=strings.buf2string(strm.output,next_out_utf8),strm.next_out=tail,strm.avail_out=chunkSize-tail,tail&&utils.arraySet(strm.output,strm.output,next_out_utf8,tail,0),this.onData(utf8str)):this.onData(utils.shrinkBuf(strm.output,strm.next_out)))),0===strm.avail_in&&0===strm.avail_out&&(allowBufError=!0)}while((strm.avail_in>0||0===strm.avail_out)&&status!==c.Z_STREAM_END);return status===c.Z_STREAM_END&&(_mode=c.Z_FINISH),_mode===c.Z_FINISH?(status=zlib_inflate.inflateEnd(this.strm),this.onEnd(status),this.ended=!0,status===c.Z_OK):_mode!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),strm.avail_out=0,!0)},Inflate.prototype.onData=function(chunk){this.chunks.push(chunk)},Inflate.prototype.onEnd=function(status){status===c.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=utils.flattenChunks(this.chunks)),this.chunks=[],this.err=status,this.msg=this.strm.msg},exports.Inflate=Inflate,exports.inflate=inflate,exports.inflateRaw=function(input,options){return(options=options||{}).raw=!0,inflate(input,options)},exports.ungzip=inflate},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),adler32=__webpack_require__(64),crc32=__webpack_require__(65),inflate_fast=__webpack_require__(114),inflate_table=__webpack_require__(115),CODES=0,LENS=1,DISTS=2,Z_FINISH=4,Z_BLOCK=5,Z_TREES=6,Z_OK=0,Z_STREAM_END=1,Z_NEED_DICT=2,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_MEM_ERROR=-4,Z_BUF_ERROR=-5,Z_DEFLATED=8,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592,DEF_WBITS=15;function zswap32(q){return(q>>>24&255)+(q>>>8&65280)+((65280&q)<<8)+((255&q)<<24)}function inflateResetKeep(strm){var state;return strm&&strm.state?(state=strm.state,strm.total_in=strm.total_out=state.total=0,strm.msg="",state.wrap&&(strm.adler=1&state.wrap),state.mode=HEAD,state.last=0,state.havedict=0,state.dmax=32768,state.head=null,state.hold=0,state.bits=0,state.lencode=state.lendyn=new utils.Buf32(ENOUGH_LENS),state.distcode=state.distdyn=new utils.Buf32(ENOUGH_DISTS),state.sane=1,state.back=-1,Z_OK):Z_STREAM_ERROR}function inflateReset(strm){var state;return strm&&strm.state?((state=strm.state).wsize=0,state.whave=0,state.wnext=0,inflateResetKeep(strm)):Z_STREAM_ERROR}function inflateReset2(strm,windowBits){var wrap,state;return strm&&strm.state?(state=strm.state,windowBits<0?(wrap=0,windowBits=-windowBits):(wrap=1+(windowBits>>4),windowBits<48&&(windowBits&=15)),windowBits&&(windowBits<8||windowBits>15)?Z_STREAM_ERROR:(null!==state.window&&state.wbits!==windowBits&&(state.window=null),state.wrap=wrap,state.wbits=windowBits,inflateReset(strm))):Z_STREAM_ERROR}function inflateInit2(strm,windowBits){var ret,state;return strm?(state=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new utils.Buf16(320),this.work=new utils.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},strm.state=state,state.window=null,(ret=inflateReset2(strm,windowBits))!==Z_OK&&(strm.state=null),ret):Z_STREAM_ERROR}var lenfix,distfix,virgin=!0;function fixedtables(state){if(virgin){var sym;for(lenfix=new utils.Buf32(512),distfix=new utils.Buf32(32),sym=0;sym<144;)state.lens[sym++]=8;for(;sym<256;)state.lens[sym++]=9;for(;sym<280;)state.lens[sym++]=7;for(;sym<288;)state.lens[sym++]=8;for(inflate_table(LENS,state.lens,0,288,lenfix,0,state.work,{bits:9}),sym=0;sym<32;)state.lens[sym++]=5;inflate_table(DISTS,state.lens,0,32,distfix,0,state.work,{bits:5}),virgin=!1}state.lencode=lenfix,state.lenbits=9,state.distcode=distfix,state.distbits=5}function updatewindow(strm,src,end,copy){var dist,state=strm.state;return null===state.window&&(state.wsize=1<<state.wbits,state.wnext=0,state.whave=0,state.window=new utils.Buf8(state.wsize)),copy>=state.wsize?(utils.arraySet(state.window,src,end-state.wsize,state.wsize,0),state.wnext=0,state.whave=state.wsize):((dist=state.wsize-state.wnext)>copy&&(dist=copy),utils.arraySet(state.window,src,end-copy,dist,state.wnext),(copy-=dist)?(utils.arraySet(state.window,src,end-copy,copy,0),state.wnext=copy,state.whave=state.wsize):(state.wnext+=dist,state.wnext===state.wsize&&(state.wnext=0),state.whave<state.wsize&&(state.whave+=dist))),0}exports.inflateReset=inflateReset,exports.inflateReset2=inflateReset2,exports.inflateResetKeep=inflateResetKeep,exports.inflateInit=function(strm){return inflateInit2(strm,DEF_WBITS)},exports.inflateInit2=inflateInit2,exports.inflate=function(strm,flush){var state,input,output,next,put,have,left,hold,bits,_in,_out,copy,from,from_source,here_bits,here_op,here_val,last_bits,last_op,last_val,len,ret,opts,n,here=0,hbuf=new utils.Buf8(4),order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!strm||!strm.state||!strm.output||!strm.input&&0!==strm.avail_in)return Z_STREAM_ERROR;(state=strm.state).mode===TYPE&&(state.mode=TYPEDO),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,_in=have,_out=left,ret=Z_OK;inf_leave:for(;;)switch(state.mode){case HEAD:if(0===state.wrap){state.mode=TYPEDO;break}for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(2&state.wrap&&35615===hold){state.check=0,hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0),hold=0,bits=0,state.mode=FLAGS;break}if(state.flags=0,state.head&&(state.head.done=!1),!(1&state.wrap)||(((255&hold)<<8)+(hold>>8))%31){strm.msg="incorrect header check",state.mode=BAD;break}if((15&hold)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(bits-=4,len=8+(15&(hold>>>=4)),0===state.wbits)state.wbits=len;else if(len>state.wbits){strm.msg="invalid window size",state.mode=BAD;break}state.dmax=1<<len,strm.adler=state.check=1,state.mode=512&hold?DICTID:TYPE,hold=0,bits=0;break;case FLAGS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.flags=hold,(255&state.flags)!==Z_DEFLATED){strm.msg="unknown compression method",state.mode=BAD;break}if(57344&state.flags){strm.msg="unknown header flags set",state.mode=BAD;break}state.head&&(state.head.text=hold>>8&1),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=TIME;case TIME:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.time=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,hbuf[2]=hold>>>16&255,hbuf[3]=hold>>>24&255,state.check=crc32(state.check,hbuf,4,0)),hold=0,bits=0,state.mode=OS;case OS:for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.head&&(state.head.xflags=255&hold,state.head.os=hold>>8),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0,state.mode=EXLEN;case EXLEN:if(1024&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length=hold,state.head&&(state.head.extra_len=hold),512&state.flags&&(hbuf[0]=255&hold,hbuf[1]=hold>>>8&255,state.check=crc32(state.check,hbuf,2,0)),hold=0,bits=0}else state.head&&(state.head.extra=null);state.mode=EXTRA;case EXTRA:if(1024&state.flags&&((copy=state.length)>have&&(copy=have),copy&&(state.head&&(len=state.head.extra_len-state.length,state.head.extra||(state.head.extra=new Array(state.head.extra_len)),utils.arraySet(state.head.extra,input,next,copy,len)),512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,state.length-=copy),state.length))break inf_leave;state.length=0,state.mode=NAME;case NAME:if(2048&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.name+=String.fromCharCode(len))}while(len&&copy<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.name=null);state.length=0,state.mode=COMMENT;case COMMENT:if(4096&state.flags){if(0===have)break inf_leave;copy=0;do{len=input[next+copy++],state.head&&len&&state.length<65536&&(state.head.comment+=String.fromCharCode(len))}while(len&&copy<have);if(512&state.flags&&(state.check=crc32(state.check,input,copy,next)),have-=copy,next+=copy,len)break inf_leave}else state.head&&(state.head.comment=null);state.mode=HCRC;case HCRC:if(512&state.flags){for(;bits<16;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(65535&state.check)){strm.msg="header crc mismatch",state.mode=BAD;break}hold=0,bits=0}state.head&&(state.head.hcrc=state.flags>>9&1,state.head.done=!0),strm.adler=state.check=0,state.mode=TYPE;break;case DICTID:for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}strm.adler=state.check=zswap32(hold),hold=0,bits=0,state.mode=DICT;case DICT:if(0===state.havedict)return strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,Z_NEED_DICT;strm.adler=state.check=1,state.mode=TYPE;case TYPE:if(flush===Z_BLOCK||flush===Z_TREES)break inf_leave;case TYPEDO:if(state.last){hold>>>=7&bits,bits-=7&bits,state.mode=CHECK;break}for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}switch(state.last=1&hold,bits-=1,3&(hold>>>=1)){case 0:state.mode=STORED;break;case 1:if(fixedtables(state),state.mode=LEN_,flush===Z_TREES){hold>>>=2,bits-=2;break inf_leave}break;case 2:state.mode=TABLE;break;case 3:strm.msg="invalid block type",state.mode=BAD}hold>>>=2,bits-=2;break;case STORED:for(hold>>>=7&bits,bits-=7&bits;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if((65535&hold)!=(hold>>>16^65535)){strm.msg="invalid stored block lengths",state.mode=BAD;break}if(state.length=65535&hold,hold=0,bits=0,state.mode=COPY_,flush===Z_TREES)break inf_leave;case COPY_:state.mode=COPY;case COPY:if(copy=state.length){if(copy>have&&(copy=have),copy>left&&(copy=left),0===copy)break inf_leave;utils.arraySet(output,input,next,copy,put),have-=copy,next+=copy,left-=copy,put+=copy,state.length-=copy;break}state.mode=TYPE;break;case TABLE:for(;bits<14;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(state.nlen=257+(31&hold),hold>>>=5,bits-=5,state.ndist=1+(31&hold),hold>>>=5,bits-=5,state.ncode=4+(15&hold),hold>>>=4,bits-=4,state.nlen>286||state.ndist>30){strm.msg="too many length or distance symbols",state.mode=BAD;break}state.have=0,state.mode=LENLENS;case LENLENS:for(;state.have<state.ncode;){for(;bits<3;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.lens[order[state.have++]]=7&hold,hold>>>=3,bits-=3}for(;state.have<19;)state.lens[order[state.have++]]=0;if(state.lencode=state.lendyn,state.lenbits=7,opts={bits:state.lenbits},ret=inflate_table(CODES,state.lens,0,19,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid code lengths set",state.mode=BAD;break}state.have=0,state.mode=CODELENS;case CODELENS:for(;state.have<state.nlen+state.ndist;){for(;here_op=(here=state.lencode[hold&(1<<state.lenbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(here_val<16)hold>>>=here_bits,bits-=here_bits,state.lens[state.have++]=here_val;else{if(16===here_val){for(n=here_bits+2;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold>>>=here_bits,bits-=here_bits,0===state.have){strm.msg="invalid bit length repeat",state.mode=BAD;break}len=state.lens[state.have-1],copy=3+(3&hold),hold>>>=2,bits-=2}else if(17===here_val){for(n=here_bits+3;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}bits-=here_bits,len=0,copy=3+(7&(hold>>>=here_bits)),hold>>>=3,bits-=3}else{for(n=here_bits+7;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}bits-=here_bits,len=0,copy=11+(127&(hold>>>=here_bits)),hold>>>=7,bits-=7}if(state.have+copy>state.nlen+state.ndist){strm.msg="invalid bit length repeat",state.mode=BAD;break}for(;copy--;)state.lens[state.have++]=len}}if(state.mode===BAD)break;if(0===state.lens[256]){strm.msg="invalid code -- missing end-of-block",state.mode=BAD;break}if(state.lenbits=9,opts={bits:state.lenbits},ret=inflate_table(LENS,state.lens,0,state.nlen,state.lencode,0,state.work,opts),state.lenbits=opts.bits,ret){strm.msg="invalid literal/lengths set",state.mode=BAD;break}if(state.distbits=6,state.distcode=state.distdyn,opts={bits:state.distbits},ret=inflate_table(DISTS,state.lens,state.nlen,state.ndist,state.distcode,0,state.work,opts),state.distbits=opts.bits,ret){strm.msg="invalid distances set",state.mode=BAD;break}if(state.mode=LEN_,flush===Z_TREES)break inf_leave;case LEN_:state.mode=LEN;case LEN:if(have>=6&&left>=258){strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,inflate_fast(strm,_out),put=strm.next_out,output=strm.output,left=strm.avail_out,next=strm.next_in,input=strm.input,have=strm.avail_in,hold=state.hold,bits=state.bits,state.mode===TYPE&&(state.back=-1);break}for(state.back=0;here_op=(here=state.lencode[hold&(1<<state.lenbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(here_op&&0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;here_op=(here=state.lencode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)])>>>16&255,here_val=65535&here,!(last_bits+(here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,state.length=here_val,0===here_op){state.mode=LIT;break}if(32&here_op){state.back=-1,state.mode=TYPE;break}if(64&here_op){strm.msg="invalid literal/length code",state.mode=BAD;break}state.extra=15&here_op,state.mode=LENEXT;case LENEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.length+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}state.was=state.length,state.mode=DIST;case DIST:for(;here_op=(here=state.distcode[hold&(1<<state.distbits)-1])>>>16&255,here_val=65535&here,!((here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(0==(240&here_op)){for(last_bits=here_bits,last_op=here_op,last_val=here_val;here_op=(here=state.distcode[last_val+((hold&(1<<last_bits+last_op)-1)>>last_bits)])>>>16&255,here_val=65535&here,!(last_bits+(here_bits=here>>>24)<=bits);){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}hold>>>=last_bits,bits-=last_bits,state.back+=last_bits}if(hold>>>=here_bits,bits-=here_bits,state.back+=here_bits,64&here_op){strm.msg="invalid distance code",state.mode=BAD;break}state.offset=here_val,state.extra=15&here_op,state.mode=DISTEXT;case DISTEXT:if(state.extra){for(n=state.extra;bits<n;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}state.offset+=hold&(1<<state.extra)-1,hold>>>=state.extra,bits-=state.extra,state.back+=state.extra}if(state.offset>state.dmax){strm.msg="invalid distance too far back",state.mode=BAD;break}state.mode=MATCH;case MATCH:if(0===left)break inf_leave;if(copy=_out-left,state.offset>copy){if((copy=state.offset-copy)>state.whave&&state.sane){strm.msg="invalid distance too far back",state.mode=BAD;break}copy>state.wnext?(copy-=state.wnext,from=state.wsize-copy):from=state.wnext-copy,copy>state.length&&(copy=state.length),from_source=state.window}else from_source=output,from=put-state.offset,copy=state.length;copy>left&&(copy=left),left-=copy,state.length-=copy;do{output[put++]=from_source[from++]}while(--copy);0===state.length&&(state.mode=LEN);break;case LIT:if(0===left)break inf_leave;output[put++]=state.length,left--,state.mode=LEN;break;case CHECK:if(state.wrap){for(;bits<32;){if(0===have)break inf_leave;have--,hold|=input[next++]<<bits,bits+=8}if(_out-=left,strm.total_out+=_out,state.total+=_out,_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,put-_out):adler32(state.check,output,_out,put-_out)),_out=left,(state.flags?hold:zswap32(hold))!==state.check){strm.msg="incorrect data check",state.mode=BAD;break}hold=0,bits=0}state.mode=LENGTH;case LENGTH:if(state.wrap&&state.flags){for(;bits<32;){if(0===have)break inf_leave;have--,hold+=input[next++]<<bits,bits+=8}if(hold!==(4294967295&state.total)){strm.msg="incorrect length check",state.mode=BAD;break}hold=0,bits=0}state.mode=DONE;case DONE:ret=Z_STREAM_END;break inf_leave;case BAD:ret=Z_DATA_ERROR;break inf_leave;case MEM:return Z_MEM_ERROR;case SYNC:default:return Z_STREAM_ERROR}return strm.next_out=put,strm.avail_out=left,strm.next_in=next,strm.avail_in=have,state.hold=hold,state.bits=bits,(state.wsize||_out!==strm.avail_out&&state.mode<BAD&&(state.mode<CHECK||flush!==Z_FINISH))&&updatewindow(strm,strm.output,strm.next_out,_out-strm.avail_out)?(state.mode=MEM,Z_MEM_ERROR):(_in-=strm.avail_in,_out-=strm.avail_out,strm.total_in+=_in,strm.total_out+=_out,state.total+=_out,state.wrap&&_out&&(strm.adler=state.check=state.flags?crc32(state.check,output,_out,strm.next_out-_out):adler32(state.check,output,_out,strm.next_out-_out)),strm.data_type=state.bits+(state.last?64:0)+(state.mode===TYPE?128:0)+(state.mode===LEN_||state.mode===COPY_?256:0),(0===_in&&0===_out||flush===Z_FINISH)&&ret===Z_OK&&(ret=Z_BUF_ERROR),ret)},exports.inflateEnd=function(strm){if(!strm||!strm.state)return Z_STREAM_ERROR;var state=strm.state;return state.window&&(state.window=null),strm.state=null,Z_OK},exports.inflateGetHeader=function(strm,head){var state;return strm&&strm.state?0==(2&(state=strm.state).wrap)?Z_STREAM_ERROR:(state.head=head,head.done=!1,Z_OK):Z_STREAM_ERROR},exports.inflateSetDictionary=function(strm,dictionary){var state,dictLength=dictionary.length;return strm&&strm.state?0!==(state=strm.state).wrap&&state.mode!==DICT?Z_STREAM_ERROR:state.mode===DICT&&adler32(1,dictionary,dictLength,0)!==state.check?Z_DATA_ERROR:updatewindow(strm,dictionary,dictLength,dictLength)?(state.mode=MEM,Z_MEM_ERROR):(state.havedict=1,Z_OK):Z_STREAM_ERROR},exports.inflateInfo="pako inflate (from Nodeca project)"},function(module,exports,__webpack_require__){"use strict";module.exports=function(strm,start){var state,_in,last,_out,beg,end,dmax,wsize,whave,wnext,s_window,hold,bits,lcode,dcode,lmask,dmask,here,op,len,dist,from,from_source,input,output;state=strm.state,_in=strm.next_in,input=strm.input,last=_in+(strm.avail_in-5),_out=strm.next_out,output=strm.output,beg=_out-(start-strm.avail_out),end=_out+(strm.avail_out-257),dmax=state.dmax,wsize=state.wsize,whave=state.whave,wnext=state.wnext,s_window=state.window,hold=state.hold,bits=state.bits,lcode=state.lencode,dcode=state.distcode,lmask=(1<<state.lenbits)-1,dmask=(1<<state.distbits)-1;top:do{bits<15&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=lcode[hold&lmask];dolen:for(;;){if(hold>>>=op=here>>>24,bits-=op,0===(op=here>>>16&255))output[_out++]=65535&here;else{if(!(16&op)){if(0==(64&op)){here=lcode[(65535&here)+(hold&(1<<op)-1)];continue dolen}if(32&op){state.mode=12;break top}strm.msg="invalid literal/length code",state.mode=30;break top}len=65535&here,(op&=15)&&(bits<op&&(hold+=input[_in++]<<bits,bits+=8),len+=hold&(1<<op)-1,hold>>>=op,bits-=op),bits<15&&(hold+=input[_in++]<<bits,bits+=8,hold+=input[_in++]<<bits,bits+=8),here=dcode[hold&dmask];dodist:for(;;){if(hold>>>=op=here>>>24,bits-=op,!(16&(op=here>>>16&255))){if(0==(64&op)){here=dcode[(65535&here)+(hold&(1<<op)-1)];continue dodist}strm.msg="invalid distance code",state.mode=30;break top}if(dist=65535&here,bits<(op&=15)&&(hold+=input[_in++]<<bits,(bits+=8)<op&&(hold+=input[_in++]<<bits,bits+=8)),(dist+=hold&(1<<op)-1)>dmax){strm.msg="invalid distance too far back",state.mode=30;break top}if(hold>>>=op,bits-=op,dist>(op=_out-beg)){if((op=dist-op)>whave&&state.sane){strm.msg="invalid distance too far back",state.mode=30;break top}if(from=0,from_source=s_window,0===wnext){if(from+=wsize-op,op<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}}else if(wnext<op){if(from+=wsize+wnext-op,(op-=wnext)<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);if(from=0,wnext<len){len-=op=wnext;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}}}else if(from+=wnext-op,op<len){len-=op;do{output[_out++]=s_window[from++]}while(--op);from=_out-dist,from_source=output}for(;len>2;)output[_out++]=from_source[from++],output[_out++]=from_source[from++],output[_out++]=from_source[from++],len-=3;len&&(output[_out++]=from_source[from++],len>1&&(output[_out++]=from_source[from++]))}else{from=_out-dist;do{output[_out++]=output[from++],output[_out++]=output[from++],output[_out++]=output[from++],len-=3}while(len>2);len&&(output[_out++]=output[from++],len>1&&(output[_out++]=output[from++]))}break}}break}}while(_in<last&&_out<end);_in-=len=bits>>3,hold&=(1<<(bits-=len<<3))-1,strm.next_in=_in,strm.next_out=_out,strm.avail_in=_in<last?last-_in+5:5-(_in-last),strm.avail_out=_out<end?end-_out+257:257-(_out-end),state.hold=hold,state.bits=bits}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(8),lbase=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lext=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],dbase=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],dext=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];module.exports=function(type,lens,lens_index,codes,table,table_index,work,opts){var incr,fill,low,mask,next,end,here_bits,here_op,here_val,bits=opts.bits,len=0,sym=0,min=0,max=0,root=0,curr=0,drop=0,left=0,used=0,huff=0,base=null,base_index=0,count=new utils.Buf16(16),offs=new utils.Buf16(16),extra=null,extra_index=0;for(len=0;len<=15;len++)count[len]=0;for(sym=0;sym<codes;sym++)count[lens[lens_index+sym]]++;for(root=bits,max=15;max>=1&&0===count[max];max--);if(root>max&&(root=max),0===max)return table[table_index++]=20971520,table[table_index++]=20971520,opts.bits=1,0;for(min=1;min<max&&0===count[min];min++);for(root<min&&(root=min),left=1,len=1;len<=15;len++)if(left<<=1,(left-=count[len])<0)return-1;if(left>0&&(0===type||1!==max))return-1;for(offs[1]=0,len=1;len<15;len++)offs[len+1]=offs[len]+count[len];for(sym=0;sym<codes;sym++)0!==lens[lens_index+sym]&&(work[offs[lens[lens_index+sym]]++]=sym);if(0===type?(base=extra=work,end=19):1===type?(base=lbase,base_index-=257,extra=lext,extra_index-=257,end=256):(base=dbase,extra=dext,end=-1),huff=0,sym=0,len=min,next=table_index,curr=root,drop=0,low=-1,mask=(used=1<<root)-1,1===type&&used>852||2===type&&used>592)return 1;for(;;){here_bits=len-drop,work[sym]<end?(here_op=0,here_val=work[sym]):work[sym]>end?(here_op=extra[extra_index+work[sym]],here_val=base[base_index+work[sym]]):(here_op=96,here_val=0),incr=1<<len-drop,min=fill=1<<curr;do{table[next+(huff>>drop)+(fill-=incr)]=here_bits<<24|here_op<<16|here_val|0}while(0!==fill);for(incr=1<<len-1;huff&incr;)incr>>=1;if(0!==incr?(huff&=incr-1,huff+=incr):huff=0,sym++,0==--count[len]){if(len===max)break;len=lens[lens_index+work[sym]]}if(len>root&&(huff&mask)!==low){for(0===drop&&(drop=root),next+=min,left=1<<(curr=len-drop);curr+drop<max&&!((left-=count[curr+drop])<=0);)curr++,left<<=1;if(used+=1<<curr,1===type&&used>852||2===type&&used>592)return 1;table[low=huff&mask]=root<<24|curr<<16|next-table_index|0}}return 0!==huff&&(table[next+huff]=len-drop<<24|64<<16|0),opts.bits=root,0}},function(module,exports,__webpack_require__){"use strict";module.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2),utf8=__webpack_require__(14),crc32=__webpack_require__(43),signature=__webpack_require__(69),decToHex=function(dec,bytes){var i,hex="";for(i=0;i<bytes;i++)hex+=String.fromCharCode(255&dec),dec>>>=8;return hex},generateZipParts=function(streamInfo,streamedContent,streamingEnded,offset,platform,encodeFileName){var dosTime,dosDate,file=streamInfo.file,compression=streamInfo.compression,useCustomEncoding=encodeFileName!==utf8.utf8encode,encodedFileName=utils.transformTo("string",encodeFileName(file.name)),utfEncodedFileName=utils.transformTo("string",utf8.utf8encode(file.name)),comment=file.comment,encodedComment=utils.transformTo("string",encodeFileName(comment)),utfEncodedComment=utils.transformTo("string",utf8.utf8encode(comment)),useUTF8ForFileName=utfEncodedFileName.length!==file.name.length,useUTF8ForComment=utfEncodedComment.length!==comment.length,extraFields="",unicodePathExtraField="",unicodeCommentExtraField="",dir=file.dir,date=file.date,dataInfo={crc32:0,compressedSize:0,uncompressedSize:0};streamedContent&&!streamingEnded||(dataInfo.crc32=streamInfo.crc32,dataInfo.compressedSize=streamInfo.compressedSize,dataInfo.uncompressedSize=streamInfo.uncompressedSize);var bitflag=0;streamedContent&&(bitflag|=8),useCustomEncoding||!useUTF8ForFileName&&!useUTF8ForComment||(bitflag|=2048);var extFileAttr=0,versionMadeBy=0;dir&&(extFileAttr|=16),"UNIX"===platform?(versionMadeBy=798,extFileAttr|=function(unixPermissions,isDir){var result=unixPermissions;return unixPermissions||(result=isDir?16893:33204),(65535&result)<<16}(file.unixPermissions,dir)):(versionMadeBy=20,extFileAttr|=function(dosPermissions,isDir){return 63&(dosPermissions||0)}(file.dosPermissions)),dosTime=date.getUTCHours(),dosTime<<=6,dosTime|=date.getUTCMinutes(),dosTime<<=5,dosTime|=date.getUTCSeconds()/2,dosDate=date.getUTCFullYear()-1980,dosDate<<=4,dosDate|=date.getUTCMonth()+1,dosDate<<=5,dosDate|=date.getUTCDate(),useUTF8ForFileName&&(unicodePathExtraField=decToHex(1,1)+decToHex(crc32(encodedFileName),4)+utfEncodedFileName,extraFields+="up"+decToHex(unicodePathExtraField.length,2)+unicodePathExtraField),useUTF8ForComment&&(unicodeCommentExtraField=decToHex(1,1)+decToHex(crc32(encodedComment),4)+utfEncodedComment,extraFields+="uc"+decToHex(unicodeCommentExtraField.length,2)+unicodeCommentExtraField);var header="";return header+="\n\0",header+=decToHex(bitflag,2),header+=compression.magic,header+=decToHex(dosTime,2),header+=decToHex(dosDate,2),header+=decToHex(dataInfo.crc32,4),header+=decToHex(dataInfo.compressedSize,4),header+=decToHex(dataInfo.uncompressedSize,4),header+=decToHex(encodedFileName.length,2),header+=decToHex(extraFields.length,2),{fileRecord:signature.LOCAL_FILE_HEADER+header+encodedFileName+extraFields,dirRecord:signature.CENTRAL_FILE_HEADER+decToHex(versionMadeBy,2)+header+decToHex(encodedComment.length,2)+"\0\0\0\0"+decToHex(extFileAttr,4)+decToHex(offset,4)+encodedFileName+extraFields+encodedComment}};function ZipFileWorker(streamFiles,comment,platform,encodeFileName){GenericWorker.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=comment,this.zipPlatform=platform,this.encodeFileName=encodeFileName,this.streamFiles=streamFiles,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}utils.inherits(ZipFileWorker,GenericWorker),ZipFileWorker.prototype.push=function(chunk){var currentFilePercent=chunk.meta.percent||0,entriesCount=this.entriesCount,remainingFiles=this._sources.length;this.accumulate?this.contentBuffer.push(chunk):(this.bytesWritten+=chunk.data.length,GenericWorker.prototype.push.call(this,{data:chunk.data,meta:{currentFile:this.currentFile,percent:entriesCount?(currentFilePercent+100*(entriesCount-remainingFiles-1))/entriesCount:100}}))},ZipFileWorker.prototype.openedSource=function(streamInfo){this.currentSourceOffset=this.bytesWritten,this.currentFile=streamInfo.file.name;var streamedContent=this.streamFiles&&!streamInfo.file.dir;if(streamedContent){var record=generateZipParts(streamInfo,streamedContent,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:record.fileRecord,meta:{percent:0}})}else this.accumulate=!0},ZipFileWorker.prototype.closedSource=function(streamInfo){this.accumulate=!1;var streamedContent=this.streamFiles&&!streamInfo.file.dir,record=generateZipParts(streamInfo,streamedContent,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(record.dirRecord),streamedContent)this.push({data:function(streamInfo){return signature.DATA_DESCRIPTOR+decToHex(streamInfo.crc32,4)+decToHex(streamInfo.compressedSize,4)+decToHex(streamInfo.uncompressedSize,4)}(streamInfo),meta:{percent:100}});else for(this.push({data:record.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},ZipFileWorker.prototype.flush=function(){for(var localDirLength=this.bytesWritten,i=0;i<this.dirRecords.length;i++)this.push({data:this.dirRecords[i],meta:{percent:100}});var centralDirLength=this.bytesWritten-localDirLength,dirEnd=function(entriesCount,centralDirLength,localDirLength,comment,encodeFileName){var encodedComment=utils.transformTo("string",encodeFileName(comment));return signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+decToHex(entriesCount,2)+decToHex(entriesCount,2)+decToHex(centralDirLength,4)+decToHex(localDirLength,4)+decToHex(encodedComment.length,2)+encodedComment}(this.dirRecords.length,centralDirLength,localDirLength,this.zipComment,this.encodeFileName);this.push({data:dirEnd,meta:{percent:100}})},ZipFileWorker.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},ZipFileWorker.prototype.registerPrevious=function(previous){this._sources.push(previous);var self=this;return previous.on("data",function(chunk){self.processChunk(chunk)}),previous.on("end",function(){self.closedSource(self.previous.streamInfo),self._sources.length?self.prepareNextSource():self.end()}),previous.on("error",function(e){self.error(e)}),this},ZipFileWorker.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},ZipFileWorker.prototype.error=function(e){var sources=this._sources;if(!GenericWorker.prototype.error.call(this,e))return!1;for(var i=0;i<sources.length;i++)try{sources[i].error(e)}catch(e){}return!0},ZipFileWorker.prototype.lock=function(){GenericWorker.prototype.lock.call(this);for(var sources=this._sources,i=0;i<sources.length;i++)sources[i].lock()},module.exports=ZipFileWorker},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),GenericWorker=__webpack_require__(2);function NodejsStreamInputAdapter(filename,stream){GenericWorker.call(this,"Nodejs stream input adapter for "+filename),this._upstreamEnded=!1,this._bindStream(stream)}utils.inherits(NodejsStreamInputAdapter,GenericWorker),NodejsStreamInputAdapter.prototype._bindStream=function(stream){var self=this;this._stream=stream,stream.pause(),stream.on("data",function(chunk){self.push({data:chunk,meta:{percent:0}})}).on("error",function(e){self.isPaused?this.generatedError=e:self.error(e)}).on("end",function(){self.isPaused?self._upstreamEnded=!0:self.end()})},NodejsStreamInputAdapter.prototype.pause=function(){return!!GenericWorker.prototype.pause.call(this)&&(this._stream.pause(),!0)},NodejsStreamInputAdapter.prototype.resume=function(){return!!GenericWorker.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},module.exports=NodejsStreamInputAdapter},function(module,exports,__webpack_require__){"use strict";var utils=__webpack_require__(0),external=__webpack_require__(24),utf8=__webpack_require__(14),ZipEntries=(utils=__webpack_require__(0),__webpack_require__(120)),Crc32Probe=__webpack_require__(62),nodejsUtils=__webpack_require__(29);function checkEntryCRC32(zipEntry){return new external.Promise(function(resolve,reject){var worker=zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);worker.on("error",function(e){reject(e)}).on("end",function(){worker.streamInfo.crc32!==zipEntry.decompressed.crc32?reject(new Error("Corrupted zip : CRC32 mismatch")):resolve()}).resume()})}module.exports=function(data,options){var zip=this;return options=utils.extend(options||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:utf8.utf8decode}),nodejsUtils.isNode&&nodejsUtils.isStream(data)?external.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):utils.prepareContent("the loaded zip file",data,!0,options.optimizedBinaryString,options.base64).then(function(data){var zipEntries=new ZipEntries(options);return zipEntries.load(data),zipEntries}).then(function(zipEntries){var promises=[external.Promise.resolve(zipEntries)],files=zipEntries.files;if(options.checkCRC32)for(var i=0;i<files.length;i++)promises.push(checkEntryCRC32(files[i]));return external.Promise.all(promises)}).then(function(results){for(var zipEntries=results.shift(),files=zipEntries.files,i=0;i<files.length;i++){var input=files[i];zip.file(input.fileNameStr,input.decompressed,{binary:!0,optimizedBinaryString:!0,date:input.date,dir:input.dir,comment:input.fileCommentStr.length?input.fileCommentStr:null,unixPermissions:input.unixPermissions,dosPermissions:input.dosPermissions,createFolders:options.createFolders})}return zipEntries.zipComment.length&&(zip.comment=zipEntries.zipComment),zip})}},function(module,exports,__webpack_require__){"use strict";var readerFor=__webpack_require__(70),utils=__webpack_require__(0),sig=__webpack_require__(69),ZipEntry=__webpack_require__(123),support=(__webpack_require__(14),__webpack_require__(7));function ZipEntries(loadOptions){this.files=[],this.loadOptions=loadOptions}ZipEntries.prototype={checkSignature:function(expectedSignature){if(!this.reader.readAndCheckSignature(expectedSignature)){this.reader.index-=4;var signature=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},isSignature:function(askedIndex,expectedSignature){var currentIndex=this.reader.index;this.reader.setIndex(askedIndex);var result=this.reader.readString(4)===expectedSignature;return this.reader.setIndex(currentIndex),result},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var zipComment=this.reader.readData(this.zipCommentLength),decodeParamType=support.uint8array?"uint8array":"array",decodeContent=utils.transformTo(decodeParamType,zipComment);this.zipComment=this.loadOptions.decodeFileName(decodeContent)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var extraFieldId,extraFieldLength,extraFieldValue,extraDataSize=this.zip64EndOfCentralSize-44;0<extraDataSize;)extraFieldId=this.reader.readInt(2),extraFieldLength=this.reader.readInt(4),extraFieldValue=this.reader.readData(extraFieldLength),this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var i,file;for(i=0;i<this.files.length;i++)file=this.files[i],this.reader.setIndex(file.localHeaderOffset),this.checkSignature(sig.LOCAL_FILE_HEADER),file.readLocalPart(this.reader),file.handleUTF8(),file.processAttributes()},readCentralDir:function(){var file;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(sig.CENTRAL_FILE_HEADER);)(file=new ZipEntry({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(file);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var offset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(offset<0)throw!this.isSignature(0,sig.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(offset);var endOfCentralDirOffset=offset;if(this.checkSignature(sig.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){if(this.zip64=!0,(offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(offset),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,sig.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var expectedEndOfCentralDirOffset=this.centralDirOffset+this.centralDirSize;this.zip64&&(expectedEndOfCentralDirOffset+=20,expectedEndOfCentralDirOffset+=12+this.zip64EndOfCentralSize);var extraBytes=endOfCentralDirOffset-expectedEndOfCentralDirOffset;if(extraBytes>0)this.isSignature(endOfCentralDirOffset,sig.CENTRAL_FILE_HEADER)||(this.reader.zero=extraBytes);else if(extraBytes<0)throw new Error("Corrupted zip: missing "+Math.abs(extraBytes)+" bytes.")},prepareReader:function(data){this.reader=readerFor(data)},load:function(data){this.prepareReader(data),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},module.exports=ZipEntries},function(module,exports,__webpack_require__){"use strict";var DataReader=__webpack_require__(72);function StringReader(data){DataReader.call(this,data)}__webpack_require__(0).inherits(StringReader,DataReader),StringReader.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},StringReader.prototype.lastIndexOfSignature=function(sig){return this.data.lastIndexOf(sig)-this.zero},StringReader.prototype.readAndCheckSignature=function(sig){return sig===this.readData(4)},StringReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=StringReader},function(module,exports,__webpack_require__){"use strict";var Uint8ArrayReader=__webpack_require__(73);function NodeBufferReader(data){Uint8ArrayReader.call(this,data)}__webpack_require__(0).inherits(NodeBufferReader,Uint8ArrayReader),NodeBufferReader.prototype.readData=function(size){this.checkOffset(size);var result=this.data.slice(this.zero+this.index,this.zero+this.index+size);return this.index+=size,result},module.exports=NodeBufferReader},function(module,exports,__webpack_require__){"use strict";var readerFor=__webpack_require__(70),utils=__webpack_require__(0),CompressedObject=__webpack_require__(42),crc32fn=__webpack_require__(43),utf8=__webpack_require__(14),compressions=__webpack_require__(63),support=__webpack_require__(7);function ZipEntry(options,loadOptions){this.options=options,this.loadOptions=loadOptions}ZipEntry.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(reader){var compression,localExtraFieldsLength;if(reader.skip(22),this.fileNameLength=reader.readInt(2),localExtraFieldsLength=reader.readInt(2),this.fileName=reader.readData(this.fileNameLength),reader.skip(localExtraFieldsLength),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(compression=function(compressionMethod){for(var method in compressions)if(compressions.hasOwnProperty(method)&&compressions[method].magic===compressionMethod)return compressions[method];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+utils.pretty(this.compressionMethod)+" unknown (inner file : "+utils.transformTo("string",this.fileName)+")");this.decompressed=new CompressedObject(this.compressedSize,this.uncompressedSize,this.crc32,compression,reader.readData(this.compressedSize))},readCentralPart:function(reader){this.versionMadeBy=reader.readInt(2),reader.skip(2),this.bitFlag=reader.readInt(2),this.compressionMethod=reader.readString(2),this.date=reader.readDate(),this.crc32=reader.readInt(4),this.compressedSize=reader.readInt(4),this.uncompressedSize=reader.readInt(4);var fileNameLength=reader.readInt(2);if(this.extraFieldsLength=reader.readInt(2),this.fileCommentLength=reader.readInt(2),this.diskNumberStart=reader.readInt(2),this.internalFileAttributes=reader.readInt(2),this.externalFileAttributes=reader.readInt(4),this.localHeaderOffset=reader.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");reader.skip(fileNameLength),this.readExtraFields(reader),this.parseZIP64ExtraField(reader),this.fileComment=reader.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var madeBy=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===madeBy&&(this.dosPermissions=63&this.externalFileAttributes),3===madeBy&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(reader){if(this.extraFields[1]){var extraReader=readerFor(this.extraFields[1].value);this.uncompressedSize===utils.MAX_VALUE_32BITS&&(this.uncompressedSize=extraReader.readInt(8)),this.compressedSize===utils.MAX_VALUE_32BITS&&(this.compressedSize=extraReader.readInt(8)),this.localHeaderOffset===utils.MAX_VALUE_32BITS&&(this.localHeaderOffset=extraReader.readInt(8)),this.diskNumberStart===utils.MAX_VALUE_32BITS&&(this.diskNumberStart=extraReader.readInt(4))}},readExtraFields:function(reader){var extraFieldId,extraFieldLength,extraFieldValue,end=reader.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});reader.index<end;)extraFieldId=reader.readInt(2),extraFieldLength=reader.readInt(2),extraFieldValue=reader.readData(extraFieldLength),this.extraFields[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}},handleUTF8:function(){var decodeParamType=support.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=utf8.utf8decode(this.fileName),this.fileCommentStr=utf8.utf8decode(this.fileComment);else{var upath=this.findExtraFieldUnicodePath();if(null!==upath)this.fileNameStr=upath;else{var fileNameByteArray=utils.transformTo(decodeParamType,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(fileNameByteArray)}var ucomment=this.findExtraFieldUnicodeComment();if(null!==ucomment)this.fileCommentStr=ucomment;else{var commentByteArray=utils.transformTo(decodeParamType,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(commentByteArray)}}},findExtraFieldUnicodePath:function(){var upathField=this.extraFields[28789];if(upathField){var extraReader=readerFor(upathField.value);return 1!==extraReader.readInt(1)?null:crc32fn(this.fileName)!==extraReader.readInt(4)?null:utf8.utf8decode(extraReader.readData(upathField.length-5))}return null},findExtraFieldUnicodeComment:function(){var ucommentField=this.extraFields[25461];if(ucommentField){var extraReader=readerFor(ucommentField.value);return 1!==extraReader.readInt(1)?null:crc32fn(this.fileComment)!==extraReader.readInt(4)?null:utf8.utf8decode(extraReader.readData(ucommentField.length-5))}return null}},module.exports=ZipEntry},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStyles=exports.getHTML=void 0,exports.getHTML=function(content,segments){return'\n <div class="pushwoosh-subscription-segments">\n <div class="pushwoosh-subscription-segments__header">\n '+content.headerText+'\n </div>\n <div class="pushwoosh-subscription-segments__body">\n <div class="pushwoosh-subscription-segments__sub-header">\n '+(content.subHeaderText?content.subHeaderText:"")+'\n </div>\n <div class="pushwoosh-subscription-segments__channels">\n '+segments.reduce(function(result,segment){return result+'<div class="pushwoosh-subscription-segments__channel">\n <label class="pushwoosh-subscription-segments__label">\n <input\n class="pushwoosh-subscription-segments__field" \n type="checkbox" \n value="'+segment.code+'"\n checked="true"\n />\n <span class="pushwoosh-subscription-segments__icon">\n <svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n <path d="M18.0303 8.46967C18.3232 8.76256 18.3232 9.23744 18.0303 9.53033L11.0303 16.5303C10.7374 16.8232 10.2626 16.8232 9.96967 16.5303L6.96967 13.5303C6.67678 13.2374 6.67678 12.7626 6.96967 12.4697C7.26256 12.1768 7.73744 12.1768 8.03033 12.4697L10.5 14.9393L16.9697 8.46967C17.2626 8.17678 17.7374 8.17678 18.0303 8.46967Z" fill="currentColor"/>\n </svg>\n </span>\n <span class="pushwoosh-subscription-segments__text">\n '+segment.name+"\n </span>\n </label>\n </div>"},"")+'\n </div>\n <div class="pushwoosh-subscription-segments__controls">\n <button type="button" id="pushwoosh-subscription-segments-deny" class="pushwoosh-subscription-segments__control pushwoosh-subscription-segments__control_deny">\n '+content.controlsDenyButtonText+'\n </button>\n <button type="button" id="pushwoosh-subscription-segments-accept" class="pushwoosh-subscription-segments__control pushwoosh-subscription-segments__control_accept">\n '+content.controlsButtonText+"\n </button>\n </div>\n </div>\n </div>\n "},exports.getStyles=function(content){var styles=document.createElement("style");return styles.innerHTML="\n .pushwoosh-subscription-segments * {\n box-sizing: border-box!important;\n }\n \n .pushwoosh-subscription-segments {\n padding: 24px 16px 16px 24px!important;\n user-select: none!important;\n }\n \n .pushwoosh-subscription-segments__header {\n font-weight: bold!important;\n font-size: 20px!important;\n line-height: 23px!important;\n }\n \n .pushwoosh-subscription-segments__sub-header {\n margin-top: 16px!important;\n font-size: 16px!important;\n line-height: 24px!important;\n color: rgba(0, 0, 0, 0.54)!important;\n }\n \n .pushwoosh-subscription-segments__sub-header:empty {\n display:none!important;\n }\n \n .pushwoosh-subscription-segments__channels {\n margin-top: 16px!important;\n font-size: 16px!important;\n line-height: 24px!important;\n }\n \n .pushwoosh-subscription-segments__channel + .pushwoosh-subscription-segments__channel {\n margin-top: 8px!important;\n }\n \n .pushwoosh-subscription-segments__label {\n display: inline-flex!important;\n align-items: flex-start!important;\n cursor: pointer!important;\n }\n \n .pushwoosh-subscription-segments__field {\n display: none!important;\n }\n \n .pushwoosh-subscription-segments__icon {\n display: block!important;\n line-height: 0!important;\n width: 20px!important;\n height: 20px!important;\n border: 1px solid #ddd!important;\n border-radius: 4px!important;\n color: #fff!important;\n margin: 2px 8px 0 0!important;\n }\n \n .pushwoosh-subscription-segments__text {\n color: "+content.channelsTextColor+"!important;\n }\n \n .pushwoosh-subscription-segments__controls {\n margin-top: 24px!important;\n text-align: right!important;\n }\n \n .pushwoosh-subscription-segments__field:checked + .pushwoosh-subscription-segments__icon {\n background: "+content.channelsToggleColor+"!important;\n border: 1px solid transparent!important;\n }\n \n .pushwoosh-subscription-segments__control {\n appearance: none!important;\n height: 36px!important;\n border-radius: 4px!important;\n padding: 0 16px!important;\n font-weight: bold!important;\n font-size: 14px!important;\n line-height: 16px!important;\n cursor: pointer!important;\n }\n \n .pushwoosh-subscription-segments__control + .pushwoosh-subscription-segments__control {\n margin: 0 0 0 4px!important;\n }\n \n .pushwoosh-subscription-segments__control.pushwoosh-subscription-segments__control_deny {\n border: none!important;\n color: "+content.controlsDenyButtonTextColor+"!important;\n background-color: "+content.controlsDenyButtonBackgroundColor+"!important;\n border-radius: "+content.controlsDenyButtonRound+"!important;\n }\n \n .pushwoosh-subscription-segments__control.pushwoosh-subscription-segments__control_accept {\n border: none!important;\n color: "+content.controlsButtonTextColor+"!important;\n background-color: "+content.controlsButtonBackgroundColor+"!important;\n border-radius: "+content.controlsButtonRound+"!important;\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SubscriptionPromptWidget=void 0;var SubscriptionPromptWidget_helpers_1=__webpack_require__(126),SubscriptionPromptWidget_constants_1=__webpack_require__(74),SubscriptionPromptWidget=function(){function SubscriptionPromptWidget(eventBus,pw){this.eventBus=eventBus,this.pw=pw}return SubscriptionPromptWidget.prototype.init=function(params){if(!this.getRootElement()){var html=SubscriptionPromptWidget_helpers_1.getHTML(params),styles=SubscriptionPromptWidget_helpers_1.getStyles(params);document.body.insertAdjacentHTML("beforeend",html),document.head.appendChild(styles)}this.addEventListeners()},SubscriptionPromptWidget.prototype.show=function(){var rootElement=this.getRootElementWithCheckExist();this.eventBus.dispatchEvent("show-subscription-widget",{}),rootElement.classList.add(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show")},SubscriptionPromptWidget.prototype.hide=function(){var rootElement=this.getRootElementWithCheckExist();rootElement.classList.contains(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show")&&(this.eventBus.dispatchEvent("hide-subscription-widget",{}),rootElement.classList.remove(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show"))},SubscriptionPromptWidget.prototype.getRootElement=function(){return document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-root")},SubscriptionPromptWidget.prototype.getRootElementWithCheckExist=function(){var element=this.getRootElement();if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-root", please use method init first.');return element},SubscriptionPromptWidget.prototype.getDeclineButtonWithCheckExist=function(){var element=document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-decline");if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-decline", please use method init first.');return element},SubscriptionPromptWidget.prototype.getAcceptButtonWithCheckExist=function(){var element=document.getElementById(SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"-accept");if(!element)throw new Error("Can't find element by id \""+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-accept", please use method init first.');return element},SubscriptionPromptWidget.prototype.addEventListeners=function(){var _this=this,rootElement=this.getRootElementWithCheckExist(),declineElement=this.getDeclineButtonWithCheckExist(),acceptElement=this.getAcceptButtonWithCheckExist();document.addEventListener("click",function(event){rootElement.contains(event.target)||_this.hide()}),declineElement.addEventListener("click",function(){_this.hide()}),acceptElement.addEventListener("click",function(){_this.hide(),_this.pw.subscribe()})},SubscriptionPromptWidget}();exports.SubscriptionPromptWidget=SubscriptionPromptWidget},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStyles=exports.getHTML=void 0;var SubscriptionPromptWidget_constants_1=__webpack_require__(74);exports.getHTML=function(params){return'\n <div id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-root" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'">\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__body">\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__header">\n '+params.headerText+'\n </div>\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__description">\n '+params.subheaderText+'\n </div>\n <div class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__controls">\n <button type="button" id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-decline" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control "+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__control_decline">\n '+params.buttonCancelText+'\n </button>\n <button type="button" id="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'-accept" class="'+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control "+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+'__control_accept">\n '+params.buttonAcceptText+"\n </button>\n </div>\n </div>\n </div>\n "},exports.getStyles=function(params){var styles=document.createElement("style");return styles.innerHTML="\n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+" * {\n box-sizing: border-box!important;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+" {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n margin: 0 auto;\n width: 320px;\n display: none;\n z-index: 2147483648;\n opacity: 0.99;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"_show {\n display: block;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__body {\n width: 320px;\n background-color: "+(params.backgroundColor?params.backgroundColor:"#FFFFFF")+";\n box-shadow: 0 9px 15px rgba(0, 0, 0, 0.1), 0 0 6px rgba(0, 0, 0, 0.06);\n border-radius: 4px;\n padding: 20px 20px 12px;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__header {\n color: "+params.headerTextColor+";\n font-size: 18px;\n font-weight: bold; \n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__description {\n color: "+params.subheaderTextColor+";\n font-size: 14px;\n line-height: 1.5;\n margin-top: 14px;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__description:empty {\n display: none;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__controls {\n display: flex;\n flex-wrap: nowrap;\n justify-content: flex-end;\n margin: 20px 0 0;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control {\n -webkit-appearance: none;\n border: 1px solid transparent;\n font-size: 12px;\n font-weight: bold;\n padding: 0 20px;\n height: 32px;\n cursor: pointer;\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control_decline {\n color: "+params.buttonCancelTextColor+";\n background-color: "+params.buttonCancelBackgroundColor+";\n border-radius: "+params.buttonCancelRound+";\n border-color: "+params.buttonCancelBorderColor+";\n }\n \n ."+SubscriptionPromptWidget_constants_1.SUBSCRIPTION_PROMPT_WIDGET_NAMESPACE+"__control_accept {\n color: "+params.buttonAcceptTextColor+";\n background-color: "+params.buttonAcceptBackgroundColor+";\n border-radius: "+params.buttonAcceptRound+";\n border-color: "+params.buttonAcceptBorderColor+";\n margin: 0 0 0 12px;\n }\n ",styles}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1),functions_1=__webpack_require__(10),storage_1=__webpack_require__(5),FacebookModule=function(){function FacebookModule(config){this.userRef=functions_1.generateUUID(),this.config=config,this.init()}return FacebookModule.prototype.init=function(){this.renderCheckbox(),this.initFacebookSDK(),this.loadFacebookSDK()},FacebookModule.prototype.renderCheckbox=function(){for(var _a=this.config,pageId=_a.pageId,containerClass=_a.containerClass,attributes=[{name:"messenger_app_id",value:constants_1.FACEBOOK_APP_ID},{name:"class",value:"fb-messenger-checkbox"},{name:"page_id",value:pageId},{name:"origin",value:window.location.protocol+"//"+window.location.hostname},{name:"user_ref",value:this.userRef},{name:"allow_login",value:"true"},{name:"size",value:"large"},{name:"skin",value:"light"},{name:"center_align",value:"false"}],nodes=document.getElementsByClassName(containerClass),_loop_1=function(index){var node=document.createElement("div");attributes.forEach(function(attribute){node.setAttribute(attribute.name,attribute.value)}),nodes[index].appendChild(node)},index=0;index<nodes.length;index++)_loop_1(index)},FacebookModule.prototype.getHWID=function(){return __awaiter(this,void 0,void 0,function(){var hwid,applicationCode,newHWID;return __generator(this,function(_a){switch(_a.label){case 0:return[4,storage_1.keyValue.get(constants_1.FACEBOOK_HWID_KEY)];case 1:return(hwid=_a.sent())?[3,3]:(applicationCode=this.config.applicationCode,newHWID=applicationCode+"_"+functions_1.generateUUID()+"_fb",[4,storage_1.keyValue.set(constants_1.FACEBOOK_HWID_KEY,newHWID)]);case 2:return _a.sent(),[2,newHWID];case 3:return[2,hwid]}})})},FacebookModule.prototype.userConfirm=function(){return __awaiter(this,void 0,void 0,function(){var _a,pageId,applicationCode,userId,FB,facebookHwid;return __generator(this,function(_b){switch(_b.label){case 0:return _a=this.config,pageId=_a.pageId,applicationCode=_a.applicationCode,userId=_a.userId,FB=window.FB,[4,this.getHWID()];case 1:return facebookHwid=_b.sent(),FB&&FB.AppEvents.logEvent("MessengerCheckboxUserConfirmation",null,{app_id:constants_1.FACEBOOK_APP_ID,page_id:pageId,ref:JSON.stringify({applicationCode:applicationCode,userId:userId,hwid:facebookHwid}),user_ref:this.userRef}),[2]}})})},FacebookModule.prototype.initFacebookSDK=function(){var _this=this;window.fbAsyncInit=function(){window.FB.init({appId:constants_1.FACEBOOK_APP_ID,xfbml:!0,version:"v3.2"}),window.FB.Event.subscribe("messenger_checkbox",function(_a){"checkbox"===_a.event&&_this.userConfirm()})}},FacebookModule.prototype.loadFacebookSDK=function(){var language=navigator.language||"en_US";!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];d.getElementById(id)||((js=d.createElement(s)).id=id,js.src="https://connect.facebook.net/"+language+"/sdk.js",fjs&&fjs.parentNode.insertBefore(js,fjs))}(document,"script","facebook-jssdk")},FacebookModule}();exports.default=FacebookModule},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.InApps=void 0;var Modal_1=__webpack_require__(129),RichMedia_1=__webpack_require__(131),expanders_1=__webpack_require__(141),Data_1=__webpack_require__(4),InApps=function(){function InApps(options,pw,eventBus,api){this.delayInApps=[],this.isLoadedInAppsList=!1,this.pw=pw,this.options=options,this.eventBus=eventBus,this.api=api,this.modal=new Modal_1.Modal(this.options&&this.options.modal?this.options.modal:{}),this.data=new Data_1.Data}return InApps.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var inApps,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return this.subscribeToReceiveMessageFromIFrame(),this.eventBus.addEventHandler("receive-in-app-code",function(_a){var code=_a.code;_this.isLoadedInAppsList?_this.showInApp(code):_this.delayInApps.push(code)}),[4,this.getList()];case 1:return inApps=_a.sent().inApps,this.delayInApps.length&&this.delayInApps.forEach(function(code){_this.showInApp(code)}),this.isLoadedInAppsList=!0,[4,this.data.setInApps(inApps)];case 2:return _a.sent(),this.inApps=inApps,[2]}})})},InApps.prototype.subscribeToReceiveMessageFromIFrame=function(){var _this=this;window.addEventListener("message",function(event){if(event.source&&(event.source===window||"parent"in event.source&&event.source.parent===window))try{var data=JSON.parse(event.data);data&&"object"==typeof data&&_this.onReceiveNewMessageFromIFrame(data)}catch(e){}})},InApps.prototype.onReceiveNewMessageFromIFrame=function(message){var _this=this;switch(message.method){case"subscribe":this.pw.subscribe().then(function(){_this.modal.postMessage({code:message.code})});break;case"unsubscribe":this.pw.unsubscribe().then(function(){_this.modal.postMessage({code:message.code})});break;case"getTags":this.pw.api.getTags().then(function(_a){var result=_a.result;_this.modal.postMessage({code:message.code,tags:result})});break;case"setTags":this.pw.api.setTags(message.options.tags).then(function(){_this.modal.postMessage({code:message.code})});break;case"getChannels":this.data.getFeatures().then(function(_a){var channels=_a.channels;_this.modal.postMessage({code:message.code,channels:channels})});break;case"checkSubscription":this.api.checkDeviceSubscribeForPushNotifications().then(function(state){_this.modal.postMessage({code:message.code,state:state})});break;case"checkManualUnsubscribed":this.data.getStatusManualUnsubscribed().then(function(state){_this.modal.postMessage({code:message.code,state:state})});break;case"closeInApp":this.modal.hide();break;case"openLink":window.open(message.options.href,"_blank")}},InApps.prototype.showInApp=function(code){return __awaiter(this,void 0,void 0,function(){var filteredRichMedia,currentRichMedia,inAppContent;return __generator(this,function(_a){switch(_a.label){case 0:if(1!==(filteredRichMedia=this.inApps.filter(function(inApp){return inApp.code===code})).length)throw new Error("Can't find Rich Media");return this.modal.setLoading().show(),currentRichMedia=filteredRichMedia[0],[4,new RichMedia_1.RichMedia(currentRichMedia.url,this.api,[expanders_1.ExpanderPushwooshSendMessage,expanders_1.ExpanderPushwoosh,expanders_1.ExpanderPushManager]).getContent()];case 1:return inAppContent=_a.sent(),[4,this.modal.setContent(inAppContent)];case 2:return _a.sent(),this.modal.removeLoading().showContent(),[2]}})})},InApps.prototype.getList=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2,this.api.getInApps()]})})},InApps}();exports.InApps=InApps},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Modal=void 0;var Modal_constants_1=__webpack_require__(130),Modal=function(){function Modal(options){var _this=this;void 0===options&&(options={});var wrapper=document.getElementById(Modal_constants_1.MODAL_WRAPPER_NAMESPACE),inner=document.getElementById(Modal_constants_1.MODAL_INNER_NAMESPACE),loader=document.getElementById(Modal_constants_1.MODAL_LOADER_NAMESPACE),iframe=document.getElementById(Modal_constants_1.MODAL_IFRAME_NAMESPACE),close=document.getElementById(Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE);if(this.option=__assign(__assign({},Modal_constants_1.MODAL_DEFAILT_OPTIONS),options),!(wrapper&&inner&&loader&&iframe&&close)){(wrapper=document.createElement("div")).id=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,(inner=document.createElement("div")).id=Modal_constants_1.MODAL_INNER_NAMESPACE,inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,(loader=document.createElement("div")).id=Modal_constants_1.MODAL_LOADER_NAMESPACE,loader.className=Modal_constants_1.MODAL_LOADER_NAMESPACE,(close=document.createElement("button")).id=Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE,close.className=Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE,(iframe=document.createElement("iframe")).id=Modal_constants_1.MODAL_IFRAME_NAMESPACE,iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE,inner.appendChild(iframe),inner.appendChild(close),this.option.isShowPreloader&&inner.appendChild(loader),wrapper.appendChild(inner),document.body.appendChild(wrapper);var style=document.createElement("style");style.innerHTML="\n ."+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+" {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 2147483648;\n opacity: 0.999;\n display:none;\n }\n\n ."+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+"_state-show {\n display: block;\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+" {\n width: 100%;\n height: 100%;\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading {\n background-color: "+this.option.backgroundColor+";\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+" {\n appearance: none;\n border: none;\n background-color: transparent;\n box-shadow: none;\n position: absolute;\n top: 20px;\n right: 20px;\n width: 40px;\n height: 40px;\n cursor: pointer;\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+":after {\n content: '';\n position: absolute;\n top: 50%;\n left:50%;\n width: 30px;\n height: 2px;\n background-color: "+this.option.closeButtonColor+";\n transform: translateX(-50%) translateY(-50%) rotate(-45deg);\n }\n\n ."+Modal_constants_1.MODAL_CLOSE_BUTTON_NAMESPACE+":before {\n content: '';\n position: absolute;\n top: 50%;\n left:50%;\n width: 30px;\n height: 2px;\n background-color: "+this.option.closeButtonColor+";\n transform: translateX(-50%) translateY(-50%) rotate(45deg);\n }\n\n ."+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n display: block;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n display: none;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+",\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before,\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n border-radius: 50%;\n width: 2.5em;\n height: 2.5em;\n -webkit-animation-fill-mode: both;\n animation-fill-mode: both;\n -webkit-animation: "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" 1.8s infinite ease-in-out;\n animation: "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" 1.8s infinite ease-in-out;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n color: #ffffff;\n font-size: 10px;\n text-indent: -9999em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation-delay: -0.16s;\n animation-delay: -0.16s;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before,\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n content: '';\n position: absolute;\n top: 0;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":before {\n left: -3.5em;\n -webkit-animation-delay: -0.32s;\n animation-delay: -0.32s;\n }\n\n ."+Modal_constants_1.MODAL_LOADER_NAMESPACE+":after {\n left: 3.5em;\n }\n\n @-webkit-keyframes "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n 0%,\n 80%,\n 100% {\n box-shadow: 0 2.5em 0 -1.3em "+this.option.preloaderColor+";\n }\n 40% {\n box-shadow: 0 2.5em 0 0 "+this.option.preloaderColor+";\n }\n }\n\n @keyframes "+Modal_constants_1.MODAL_LOADER_NAMESPACE+" {\n 0%,\n 80%,\n 100% {\n box-shadow: 0 2.5em 0 -1.3em "+this.option.preloaderColor+";\n }\n 40% {\n box-shadow: 0 2.5em 0 0 "+this.option.preloaderColor+";\n }\n }\n\n ."+Modal_constants_1.MODAL_IFRAME_NAMESPACE+" {\n width: 100%;\n height: 100%;\n padding: 0;\n border: none;\n display: none;\n }\n\n ."+Modal_constants_1.MODAL_IFRAME_NAMESPACE+"_state-show {\n display: block;\n }\n ",document.head.appendChild(style)}this.wrapper=wrapper,this.inner=inner,this.iframe=iframe,close.addEventListener("click",function(){_this.hide()})}return Modal.prototype.postMessage=function(data){this.iframe.contentWindow.postMessage(JSON.stringify(data),"*")},Modal.prototype.show=function(){return this.wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE+" "+Modal_constants_1.MODAL_WRAPPER_NAMESPACE+"_state-show",document.body.style.overflow="hidden",this},Modal.prototype.hide=function(){return this.wrapper.className=Modal_constants_1.MODAL_WRAPPER_NAMESPACE,document.body.style.overflow="auto",this},Modal.prototype.setLoading=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE+" "+Modal_constants_1.MODAL_INNER_NAMESPACE+"_state-loading",this.iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE,this},Modal.prototype.removeLoading=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,this},Modal.prototype.setContent=function(content){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return this.iframe.srcdoc=content,[2,new Promise(function(resolve,reject){_this.iframe.onload=resolve,_this.iframe.onerror=reject})]})})},Modal.prototype.showContent=function(){return this.inner.className=Modal_constants_1.MODAL_INNER_NAMESPACE,this.iframe.className=Modal_constants_1.MODAL_IFRAME_NAMESPACE+" "+Modal_constants_1.MODAL_IFRAME_NAMESPACE+"_state-show",this},Modal}();exports.Modal=Modal},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MODAL_DEFAILT_OPTIONS=exports.MODAL_IFRAME_NAMESPACE=exports.MODAL_CLOSE_BUTTON_NAMESPACE=exports.MODAL_LOADER_NAMESPACE=exports.MODAL_INNER_NAMESPACE=exports.MODAL_WRAPPER_NAMESPACE=void 0,exports.MODAL_WRAPPER_NAMESPACE="pushwoosh-in-app-modal-wrapper",exports.MODAL_INNER_NAMESPACE="pushwoosh-in-app-modal-inner",exports.MODAL_LOADER_NAMESPACE="pushwoosh-in-app-modal-loader",exports.MODAL_CLOSE_BUTTON_NAMESPACE="pushwoosh-in-app-modal-close-button",exports.MODAL_IFRAME_NAMESPACE="pushwoosh-in-app-modal-iframe",exports.MODAL_DEFAILT_OPTIONS={backgroundColor:"rgba(0, 0, 0, .8)",closeButtonColor:"rgba(255, 255, 255, .8)",closeButtonHoverColor:"rgba(255, 255, 1)",isShowPreloader:!0,preloaderColor:"rgba(255, 255, 255, 1)"}},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.RichMedia=void 0;var detect_browser_1=__webpack_require__(132),getZip_1=__webpack_require__(48),DynamicContent_1=__webpack_require__(133),RichMediaExpander_1=__webpack_require__(135),ExternalResources_1=__webpack_require__(136),RichMedia=function(){function RichMedia(url,api,expanders){this.url=url,this.api=api,this.expanders=expanders}return RichMedia.prototype.getContent=function(){return __awaiter(this,void 0,void 0,function(){var language,jszip,values,_a,_b,content,browser,context;return __generator(this,function(_c){switch(_c.label){case 0:return[4,this.api.getTags()];case 1:return language=_c.sent().result.Language,[4,getZip_1.getZip(this.url)];case 2:if(!(jszip=_c.sent()).files["index.html"])throw new Error("Can't find index.html");if(!jszip.files["pushwoosh.json"])throw new Error("Can't find pushwoosh.json");return _b=(_a=JSON).parse,[4,jszip.file("pushwoosh.json").async("text")];case 3:return values=_b.apply(_a,[_c.sent()]),[4,jszip.file("index.html").async("text")];case 4:return content=_c.sent(),browser=detect_browser_1.detect(),context={platform:"web",browser:browser&&browser.name||"unknown",os:browser&&browser.os||"unknown",isMobileBrowser:this.checkIsMobileBrowser()},content=new DynamicContent_1.DynamicContent(content,values,language).getReplacedContent(),[4,new ExternalResources_1.ExternalResources(content,jszip).getReplacedContent()];case 5:return content=_c.sent(),content=new DynamicContent_1.DynamicContent(content,values,language).getReplacedContent(),content=new RichMediaExpander_1.RichMediaExpander(content,['<script type="text/javascript">\n window.pushwoosh.platform = \''+context.platform.replace(" ","").toLowerCase()+"';\n window.pushwoosh.browser = '"+context.browser.replace(" ","").toLowerCase()+"';\n window.pushwoosh.os = '"+context.os.replace(" ","").toLowerCase()+"';\n window.pushwoosh.isMobileBrowser = "+context.isMobileBrowser+";\n <\/script>"]).uploadExpanders(),[2,content=new RichMediaExpander_1.RichMediaExpander(content,this.expanders).uploadExpanders()]}})})},RichMedia.prototype.checkIsMobileBrowser=function(){var isMobileBrowser=!1;return function(str){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(str)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(str.substr(0,4)))&&(isMobileBrowser=!0)}(navigator.userAgent||navigator.vendor||window.opera),isMobileBrowser},RichMedia}();exports.RichMedia=RichMedia},function(module,exports,__webpack_require__){"use strict";(function(process){var __spreadArrays=this&&this.__spreadArrays||function(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;var r=Array(s),k=0;for(i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r};Object.defineProperty(exports,"__esModule",{value:!0});var BrowserInfo=function(){return function(name,version,os){this.name=name,this.version=version,this.os=os}}();exports.BrowserInfo=BrowserInfo;var NodeInfo=function(){return function(version){this.version=version,this.name="node",this.os=process.platform}}();exports.NodeInfo=NodeInfo;var BotInfo=function(){return function(){this.bot=!0,this.name="bot",this.version=null,this.os=null}}();exports.BotInfo=BotInfo;var REQUIRED_VERSION_PARTS=3,userAgentRules=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["vivaldi",/Vivaldi\/([0-9\.]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/Edg\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],operatingSystemRules=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/],["Search Bot",/(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp)|(MSNBot)|(Ask Jeeves\/Teoma)|(ia_archiver)/]];function parseUserAgent(ua){var matchedRule=""!==ua&&userAgentRules.reduce(function(matched,_a){var browser=_a[0],regex=_a[1];if(matched)return matched;var uaMatch=regex.exec(ua);return!!uaMatch&&[browser,uaMatch]},!1);if(!matchedRule)return null;var name=matchedRule[0],match=matchedRule[1];if("searchbot"===name)return new BotInfo;var versionParts=match[1]&&match[1].split(/[._]/).slice(0,3);return versionParts?versionParts.length<REQUIRED_VERSION_PARTS&&(versionParts=__spreadArrays(versionParts,function(count){for(var output=[],ii=0;ii<count;ii++)output.push("0");return output}(REQUIRED_VERSION_PARTS-versionParts.length))):versionParts=[],new BrowserInfo(name,versionParts.join("."),detectOS(ua))}function detectOS(ua){for(var ii=0,count=operatingSystemRules.length;ii<count;ii++){var _a=operatingSystemRules[ii],os=_a[0];if(_a[1].test(ua))return os}return null}function getNodeVersion(){return void 0!==process&&process.version?new NodeInfo(process.version.slice(1)):null}exports.detect=function(userAgent){return userAgent?parseUserAgent(userAgent):"undefined"!=typeof navigator?parseUserAgent(navigator.userAgent):getNodeVersion()},exports.parseUserAgent=parseUserAgent,exports.detectOS=detectOS,exports.getNodeVersion=getNodeVersion}).call(this,__webpack_require__(22))},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamicContent=void 0;var DynamicContent_constants_1=__webpack_require__(134),DynamicContent=function(){function DynamicContent(content,values,language){this.content=content,this.values=values,this.language=language}return DynamicContent.prototype.getReplacedContent=function(){var _this=this,regexp=new RegExp("\\{\\{[^\\}\\}]*}}","gm");return this.content.replace(regexp,function(substring){var pattern=substring.replace("}}","").replace("{{","");return _this.getResultingContent(pattern)})},DynamicContent.prototype.getResultingContent=function(pattern){var _a=pattern.split("|"),name=_a[0],modifier=_a[1],_b=_a[2],value=void 0===_b?"":_b,hasReplacedValueByCurrentLanguage=this.values.localization&&this.values.localization[this.language]&&this.values.localization[this.language][name],hasReplacedValueByDefaultLanguage=this.values.localization&&this.values.localization[this.values.default_language]&&this.values.localization[this.values.default_language][name];return hasReplacedValueByCurrentLanguage?value=this.values.localization[this.language][name]:hasReplacedValueByDefaultLanguage&&(value=this.values.localization[this.values.default_language][name]),this.updateStringByModifier(value,modifier)},DynamicContent.prototype.updateStringByModifier=function(string,modifier){switch(modifier.toLowerCase()){case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_FIRST:return string=(string=string.toLowerCase()).charAt(0).toUpperCase()+string.substring(1);case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_ALL_FIRST:for(var arrLetters=string.toLowerCase().split(" "),i=0;i<arrLetters.length;i++)arrLetters[i]=arrLetters[i].charAt(0).toUpperCase()+arrLetters[i].substring(1);return string=arrLetters.join(" ");case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_UPPERCASE:return string.toUpperCase();case DynamicContent_constants_1.DYNAMIC_CONTENT_MODIFIER_LOWERCASE:return string.toLowerCase();default:return string}},DynamicContent}();exports.DynamicContent=DynamicContent},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DYNAMIC_CONTENT_MODIFIER_LOWERCASE=exports.DYNAMIC_CONTENT_MODIFIER_UPPERCASE=exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_ALL_FIRST=exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_FIRST=void 0,exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_FIRST="capitalizefirst",exports.DYNAMIC_CONTENT_MODIFIER_CAPITALIZE_ALL_FIRST="capitalizeallfirst",exports.DYNAMIC_CONTENT_MODIFIER_UPPERCASE="uppercase",exports.DYNAMIC_CONTENT_MODIFIER_LOWERCASE="lowercase"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RichMediaExpander=void 0;var RichMediaExpander=function(){function RichMediaExpander(content,expanders){void 0===expanders&&(expanders=[]),this.content=content,this.expanders=expanders}return RichMediaExpander.prototype.uploadExpanders=function(){var merge=this.expanders.join("\r\n");return this.content.replace("<head>","<head>"+merge)},RichMediaExpander}();exports.RichMediaExpander=RichMediaExpander},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExternalResources=void 0;var logger_1=__webpack_require__(3),UrlParser_1=__webpack_require__(137),ExternalResources_constants_1=__webpack_require__(140),ExternalResources=function(){function ExternalResources(content,jszip){this.content=content,this.jszip=jszip}return ExternalResources.prototype.getReplacedContent=function(){return __awaiter(this,void 0,void 0,function(){var _this=this;return __generator(this,function(_a){return[2,this.replaceExternalStyles(this.content).then(function(content){return _this.replaceExternalBackgroundUrl(content)}).then(function(content){return _this.replaceExternalImage(content)}).then(function(content){return _this.replaceExternalScript(content)})]})})},ExternalResources.prototype.replaceExternalStyles=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("style"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,relative;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("text")]:[2,substring];case 2:return content=_a.sent(),relative=path.split("/").splice(-1,1).join("/"),[4,this.replaceExternalBackgroundUrl(content,relative)];case 3:return[2,'<style type="text/css">'+_a.sent().replace("\n","")+"</style>"]}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalBackgroundUrl=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("backgroundUrl"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,extension;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("base64")]:[2,substring];case 2:return content=_a.sent(),[2,'url("data:image/'+("svg"===(extension=path.split(".").pop())?"svg+xml":extension)+";base64,"+content+'")']}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalImage=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("image"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path,content,extension;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("base64")]:[2,substring];case 2:return content=_a.sent(),[2,'<img src="data:image/'+("svg"===(extension=path.split(".").pop())?"svg+xml":extension)+";base64,"+content+'" alt="">']}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.replaceExternalScript=function(content,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var pattern,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return pattern=this.getSearchPattern("script"),[4,this.replacer(content,pattern,function(substring){return __awaiter(_this,void 0,void 0,function(){var path;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.getReplacedFilePath(substring,pattern,ExternalResources_constants_1.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP,base)];case 1:return(path=_a.sent())?[4,this.jszip.file(path).async("text")]:[2,substring];case 2:return[2,"<script>"+_a.sent()+"<\/script>"]}})})})];case 1:return[2,_a.sent()]}})})},ExternalResources.prototype.getSearchPattern=function(type){switch(type){case"style":return"<link[^>]*href=('|\")([^>]*.(css))('|\")[^>]*>";case"backgroundUrl":return"url\\s*\\(('|\")?([^)]*\\.(gif|jpg|jpeg|png|svg))('|\")?\\s*\\)";case"image":return"<img[^\\/?>]*src=('|\")([^>]*\\.(gif|jpg|jpeg|png|svg))('|\")[^\\/?>]*>";case"script":return"<script[^>]*src=('|\")(.*\\.js)('|\")[^>]*>(\\n|\\r|\\s)*<\\/script>"}},ExternalResources.prototype.replacer=function(content,pattern,callback){return __awaiter(this,void 0,void 0,function(){var arPromises,regexp,replaces;return __generator(this,function(_a){switch(_a.label){case 0:return arPromises=[],regexp=new RegExp(pattern,"g"),content.replace(regexp,function(substring){return arPromises.push(callback(substring)),substring}),[4,Promise.all(arPromises)];case 1:return replaces=_a.sent(),[2,content.replace(regexp,function(){return replaces.shift()||""})]}})})},ExternalResources.prototype.getReplacedFilePath=function(substring,pattern,matchPosition,base){return void 0===base&&(base="/"),__awaiter(this,void 0,void 0,function(){var regexp,matches,match,url,path;return __generator(this,function(_a){return regexp=new RegExp(pattern),(matches=substring.match(regexp))&&matches.length?(match=matches[matchPosition],(url=new UrlParser_1.UrlParser(match,base)).checkIsAbsolutePath()?[2]:(path=url.getRelativePath(),this.jszip.files[path]?[2,path]:(logger_1.Logger.write("error",'Not found file: "'+path+'" for replace.'),[2]))):[2]})})},ExternalResources}();exports.ExternalResources=ExternalResources},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UrlParser=void 0;var resolver=__webpack_require__(138),UrlParser_constants_1=__webpack_require__(139),UrlParser=function(){function UrlParser(url,base){void 0===base&&(base="/"),this.url=url,this.base=base}return UrlParser.prototype.checkIsAbsolutePath=function(){return new RegExp("^(?:[a-z]+:)?//","i").test(this.url)},UrlParser.prototype.getRelativePath=function(){var pathWithBase=resolver(UrlParser_constants_1.URL_PARSER_PSEUDO_DOMAIN,this.base);return resolver(pathWithBase,this.url).replace(UrlParser_constants_1.URL_PARSER_PSEUDO_DOMAIN,"")},UrlParser}();exports.UrlParser=UrlParser},function(module,exports,__webpack_require__){"use strict";function _addSlash(url){return url+("/"===url[url.length-1]?"":"/")}function _pathResolve(path){var pathSplit=path.split("/");""===pathSplit[0]&&(pathSplit=pathSplit.slice(1));var resultArray=[];return pathSplit.forEach(function(current,index){"."!==current&&(".."===current?resultArray.pop():""!==current&&resultArray.push(current))}),"/"+resultArray.join("/")}module.exports=function(base,relative){if(base=base.trim(),(relative=relative.trim()).startsWith("about:"))return relative;if(""===base)return _shouldAddSlash(relative)?_addSlash(relative):relative;var baseObj=function(base){var resultObject={host:"",path:"",query:"",protocol:""},path=base,protocolEndIndex=base.indexOf("//");if(-1===protocolEndIndex)throw new Error("Error, protocol is not specified");resultObject.protocol=path.substring(0,protocolEndIndex),protocolEndIndex+=2;var pathIndex=base.indexOf("/",protocolEndIndex),queryIndex=base.indexOf("?"),hashIndex=base.indexOf("#");-1!==hashIndex&&(path=path.substring(0,hashIndex));if(-1!==queryIndex){var query=path.substring(queryIndex);resultObject.query=query,path=path.substring(0,queryIndex)}if(-1!==pathIndex){var host=path.substring(0,pathIndex);resultObject.host=host,path=path.substring(pathIndex),resultObject.path=path}else resultObject.host=path;return resultObject}(base);if(""===relative){var host=baseObj.host,path=baseObj.path,query=baseObj.query;return path||query?host+path+query:_addSlash(host)}var relativeObj=function(relative){var resultObject={href:relative,hash:"",query:"",netPath:!1,absolutePath:!1,relativePath:!1};if(_isAbsolute.test(relative))return resultObject.netPath=!0,resultObject;"/"===relative[0]?resultObject.absolutePath=!0:resultObject.relativePath=!0;var path=relative,queryIndex=relative.indexOf("?"),hashIndex=relative.indexOf("#");if(-1!==hashIndex){var hash=path.substring(hashIndex);resultObject.hash=hash,path=path.substring(0,hashIndex)}if(-1!==queryIndex){var query=path.substring(queryIndex);resultObject.query=query,path=path.substring(0,queryIndex)}return resultObject.path=path,resultObject}(relative);if(relativeObj.netPath)return function(url){return url.startsWith("//")}(relativeObj.href)&&(relativeObj.href=baseObj.protocol+relativeObj.href),_shouldAddSlash(relativeObj.href)?_addSlash(relativeObj.href):relativeObj.href;if(relativeObj.absolutePath){var _path=relativeObj.path,_query=relativeObj.query,hash=relativeObj.hash;return baseObj.host+_pathResolve(_path)+_query+hash}if(relativeObj.relativePath){var resolvePath,_path2=relativeObj.path,_query2=relativeObj.query,_hash=relativeObj.hash,basePath=baseObj.path,resultString=baseObj.host;return 0===_path2.length?resolvePath=basePath:(basePath=basePath.substring(0,basePath.lastIndexOf("/")),resolvePath=_pathResolve(basePath+"/"+_path2)),resultString+=""!==resolvePath||_query2||_hash?resolvePath+_query2+_hash:"/"}};var _isAbsolute=new RegExp("^(".concat("[a-z][a-z0-9+.-]*",":)?//"),"i");function _shouldAddSlash(url){var protocolIndex=url.indexOf("//")+2,noPath=!url.includes("/",protocolIndex),noQuery=!url.includes("?",protocolIndex),noHash=!url.includes("#",protocolIndex);return noPath&&noQuery&&noHash}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.URL_PARSER_PSEUDO_DOMAIN=void 0,exports.URL_PARSER_PSEUDO_DOMAIN="https://pushwoosh.com/"},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP=void 0,exports.EXTERNAL_RESOURCES_REGEXP_SECOND_GROUP=2},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExpanderPushwooshSendMessage=exports.ExpanderPushManager=exports.ExpanderPushwoosh=void 0;var RichMediaPushwooshSendMessage_html_1=__webpack_require__(142);exports.ExpanderPushwooshSendMessage=RichMediaPushwooshSendMessage_html_1.default;var RichMediaPushwoosh_html_1=__webpack_require__(143);exports.ExpanderPushwoosh=RichMediaPushwoosh_html_1.default;var RichMediaPushManager_html_1=__webpack_require__(144);exports.ExpanderPushManager=RichMediaPushManager_html_1.default},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default='<script type="text/javascript">\n function PushwooshSendMessage(message, success, failure) {\n var code = uuidv4();\n\n if (success) {\n window.addEventListener(\'message\', function (event) {\n if (!event.source) {\n return;\n }\n\n if (window.top === event.source.parent) {\n try {\n const data = JSON.parse(event.data);\n\n if (data && data.code === code) {\n success && success(data);\n }\n } catch (error) {\n failure && failure(error);\n }\n }\n });\n }\n\n var data = Object.assign(\n message,\n {\n code: code\n }\n );\n\n window.parent.postMessage(JSON.stringify(data), "*");\n\n function uuidv4() {\n return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) {\n var r = (Math.random() * 16) | 0,\n v = c == "x" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n }\n<\/script>\n'},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default="<script type=\"text/javascript\">\n function PushwooshBridge() {\n var self = this;\n\n self.isWebSDK = true;\n self.isSafari = navigator.userAgent.toLowerCase().indexOf('safari') !== -1\n && navigator.userAgent.toLowerCase().indexOf('chrome') === -1;\n\n self.registerForPushNotifications = function () {\n PushwooshSendMessage({\n method: 'subscribe',\n })\n };\n\n self.unregisterForPushNotifications = function () {\n PushwooshSendMessage({\n method: 'unsubscribe',\n });\n };\n\n self.getTags = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'getTags',\n }, function (result) {\n onSuccessCallback(result && result.tags);\n })\n };\n\n self.sendTags = function (tags) {\n PushwooshSendMessage({\n method: 'setTags',\n options: {\n tags: tags\n },\n });\n };\n\n self.isRegisteredForPushNotifications = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'checkSubscription',\n }, function (result) {\n onSuccessCallback(result.state)\n });\n };\n\n self.isManualUnregisterForPushNotifications = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'checkManualUnsubscribed',\n }, function (result) {\n onSuccessCallback(result.state)\n });\n };\n\n self.getChannels = function (onSuccessCallback) {\n PushwooshSendMessage({\n method: 'getChannels',\n }, function (result) {\n onSuccessCallback(result.channels)\n });\n };\n }\n\n window.pushwoosh = new PushwooshBridge();\n<\/script>\n"},function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_exports__.default="<script type=\"text/javascript\">\n function PushwooshPushManagerBridge() {\n var self = this;\n var absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');\n\n self.closeInApp = function (options) {\n PushwooshSendMessage({\n method: 'closeInApp',\n options: options,\n });\n };\n\n self.openLink = function (options) {\n PushwooshSendMessage({\n method: 'openLink',\n options: options,\n });\n };\n\n window.addEventListener('load', function () {\n var closeLinks = document.querySelectorAll('a[href=\"pushwoosh://close\"]');\n var otherLinks = document.querySelectorAll('a:not([href=\"pushwoosh://close\"])');\n\n for (var i = 0; i < closeLinks.length; i++) {\n closeLinks[i].addEventListener('click', function (event) {\n event.preventDefault();\n\n self.closeInApp();\n });\n }\n\n for (var j = 0; j < otherLinks.length; j++) {\n var href = otherLinks[j].getAttribute('href');\n\n if (absoluteURLPattern.test(href)) {\n otherLinks[j].addEventListener('click', function (event) {\n event.preventDefault();\n\n self.openLink({\n href: event.target.href\n });\n\n self.closeInApp();\n });\n }\n }\n });\n }\n\n window.pushManager = new PushwooshPushManagerBridge();\n<\/script>\n"},function(module,exports,__webpack_require__){"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):function(value){return value instanceof P?value:new P(function(resolve){resolve(value)})}(result.value).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1),PlatformChecker_1=__webpack_require__(75),constants_2=__webpack_require__(77),positioning_1=__webpack_require__(146),bell_1=__webpack_require__(147),storage_1=__webpack_require__(5),SubscribeWidget=function(){function SubscribeWidget(pw){var _this=this;if(this.pw=pw,PlatformChecker_1.default.isAvailableNotifications){this.clickBell=this.clickBell.bind(this),this.onSubscribeEvent=this.onSubscribeEvent.bind(this),this.onUnsubscribeEvent=this.onUnsubscribeEvent.bind(this),this.onPermissionDeniedEvent=this.onPermissionDeniedEvent.bind(this),this.clickOutOfPopover=this.clickOutOfPopover.bind(this),this.onClickBellIfEnableChannels=this.onClickBellIfEnableChannels.bind(this);var tooltipText=Object.assign(constants_2.SUBSCRIBE_WIDGET_DEFAULT_CONFIG.tooltipText,pw.subscribeWidgetConfig.tooltipText);this.config=Object.assign({},constants_2.SUBSCRIBE_WIDGET_DEFAULT_CONFIG,pw.subscribeWidgetConfig),this.config.tooltipText=tooltipText;var arrActions=[],isEnableChannels=pw.isEnableChannels(),isSubscribed=pw.isSubscribed();arrActions.push(isEnableChannels),arrActions.push(isSubscribed),Promise.all(arrActions).then(function(_a){var isEnableChannels=_a[0],isSubscribed=_a[1];isEnableChannels&&(_this.isEnableChannels=!0),isSubscribed&&!isEnableChannels||_this.render()})}else console.warn("Browser does not support push notifications")}return SubscribeWidget.prototype.addStylesToElement=function(styles,element){Object.keys(styles).forEach(function(st){element.style[st]=styles[st]})},SubscribeWidget.prototype.createContainer=function(){var container=document.createElement("div");container.id=constants_2.WIDGET_CONTAINER_ID,container.className="pushwoosh-subscribe-widget";var position=positioning_1.default.getBellPosition(this.config.position,this.config.indent),styles=Object.assign({zIndex:this.config.zIndex},position);return this.addStylesToElement(styles,container),container},SubscribeWidget.prototype.createStyle=function(){var styles=__webpack_require__(148),styleNode=document.createElement("style");return styleNode.innerHTML=styles,styleNode},SubscribeWidget.prototype.createBell=function(){var bell,config=this.config;return config.buttonImage?(bell=document.createElement("img")).src=config.buttonImage:(bell=document.createElement("div"),this.addStylesToElement({backgroundColor:config.bgColor,boxShadow:config.shadow,lineHeight:config.size,border:config.bellButtonBorder},bell),bell.innerHTML=bell_1.default(config.bellColor,config.bellStrokeColor)),this.addStylesToElement({width:config.size,height:config.size},bell),bell.className="pushwoosh-subscribe-widget__bell-button",bell},SubscribeWidget.prototype.createTooltip=function(){return __awaiter(this,void 0,void 0,function(){var tooltip,_a,position,modification,_b,_c;return __generator(this,function(_d){switch(_d.label){case 0:return tooltip=document.createElement("div"),_a=positioning_1.default.getTooltipPosition(this.config.position,this.config.size),position=_a[0],modification=_a[1],tooltip.className="pushwoosh-subscribe-widget__tooltip pushwoosh-subscribe-widget__tooltip__"+modification,this.addStylesToElement(position,tooltip),_c=(_b=tooltip).appendChild,[4,this.createTooltipContent()];case 1:return _c.apply(_b,[_d.sent()]),[2,tooltip]}})})},SubscribeWidget.prototype.createTooltipContent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return tooltipContent=document.createElement("div"),_a=tooltipContent,[4,this.tooltipTextFactory()];case 1:return _a.innerText=_b.sent(),tooltipContent.className="pushwoosh-subscribe-widget__tooltip-content",[2,tooltipContent]}})})},SubscribeWidget.prototype.tooltipTextFactory=function(){return __awaiter(this,void 0,void 0,function(){var permission,tooltipText,isManuallyUnsubscribed;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.pw.driver.getPermission()];case 1:return permission=_a.sent(),tooltipText=this.config.tooltipText,[4,storage_1.keyValue.get(constants_1.MANUAL_UNSUBSCRIBE)];case 2:switch(isManuallyUnsubscribed=_a.sent(),permission){case constants_1.PERMISSION_GRANTED:return[2,isManuallyUnsubscribed?tooltipText.needSubscribe:tooltipText.alreadySubscribed];case constants_1.PERMISSION_PROMPT:return[2,tooltipText.needSubscribe];case constants_1.PERMISSION_DENIED:return[2,tooltipText.blockSubscribe];default:return[2,tooltipText.needSubscribe]}return[2]}})})},SubscribeWidget.prototype.createPopover=function(){var popoverContentWrapper=document.createElement("div"),popover=document.createElement("div"),_a=positioning_1.default.getPopoverPosition(this.config.position,this.config.size),position=_a[0],modification=_a[1];popover.className="pushwoosh-subscribe-widget__popover pushwoosh-subscribe-widget__popover__"+modification,popoverContentWrapper.className="pushwoosh-subscribe-widget__popover-content-wrapper",this.style.innerHTML+=positioning_1.default.getPopoverArrowPosition(this.config.position,this.config.size);var styles=Object.assign({maxWidth:"calc(100vw - "+this.config.indent+" - "+this.config.indent+")"},position);return this.addStylesToElement(styles,popover),popoverContentWrapper.appendChild(this.createPopoverContent()),popover.appendChild(popoverContentWrapper),popover},SubscribeWidget.prototype.getBrowserName=function(){return PlatformChecker_1.default.isOpera?"opera":11===PlatformChecker_1.default.platform&&navigator.userAgent.match(/Android/i)?"mobileChrome":12===PlatformChecker_1.default.platform?"firefox":10===PlatformChecker_1.default.platform?"safari":150===PlatformChecker_1.default.platform?"edge":"chrome"},SubscribeWidget.prototype.createPopoverContent=function(){var config=this.config,popoverContent=document.createElement("div");popoverContent.className="pushwoosh-subscribe-widget__popover-content";var browser=this.getBrowserName(),userImageSrc=config.contentImages&&config.contentImages[browser];if(userImageSrc){var image=document.createElement("img");image.src=userImageSrc,popoverContent.appendChild(image)}else{var standardImage={opera:"opera",mobileChrome:"mobile_chrome",firefox:"FF",safari:"safari"}[browser]||"chrome";[{src:this.getImageSrc(standardImage),width:500,height:130},{src:this.getImageSrc(standardImage+"_unlock"),width:500,height:230}].forEach(function(imageAttrs){var image=document.createElement("img");Object.assign(image,imageAttrs),popoverContent.appendChild(image)})}return popoverContent},SubscribeWidget.prototype.getImageSrc=function(img){return"https://cdn.pushwoosh.com/webpush/img/"+img+".jpg"},SubscribeWidget.prototype.render=function(){return __awaiter(this,void 0,void 0,function(){var bell,_a,_b;return __generator(this,function(_c){switch(_c.label){case 0:return this.widget=this.createContainer(),this.style=this.createStyle(),bell=this.createBell(),_a=this,[4,this.createTooltip()];case 1:return _a.tooltip=_c.sent(),_b=this,[4,this.createPopover()];case 2:return _b.popover=_c.sent(),this.widget.appendChild(this.style),this.widget.appendChild(bell),this.widget.appendChild(this.tooltip),this.widget.appendChild(this.popover),document.body.appendChild(this.widget),this.pw.push(["onSubscribe",this.onSubscribeEvent]),this.pw.push(["onUnsubscribe",this.onUnsubscribeEvent]),this.pw.push(["onPermissionDenied",this.onPermissionDeniedEvent]),this.isEnableChannels?(this.widget.addEventListener("click",this.onClickBellIfEnableChannels),[2]):(this.addEventListenersIfDisabledChannels(),[2])}})})},SubscribeWidget.prototype.onClickBellIfEnableChannels=function(){var _this=this;this.pw.push(function(api){_this.pw.driver.checkIsPermissionDefault()?_this.pw.subscriptionSegmentWidget.init():api.postEvent(constants_1.SUBSCRIPTION_SEGMENT_EVENT,{})})},SubscribeWidget.prototype.addEventListenersIfDisabledChannels=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return this.widget.addEventListener("click",this.clickBell),window.addEventListener("click",this.clickOutOfPopover),[4,this.triggerPwEvent(constants_1.EVENT_SHOW_SUBSCRIBE_BUTTON,constants_1.KEY_SHOW_SUBSCRIBE_WIDGET)];case 1:return _a.sent(),[2]}})})},SubscribeWidget.prototype.toggleHelpPopover=function(){this.popover.classList.toggle("pushwoosh-subscribe-widget__popover__visible")},SubscribeWidget.prototype.clickBell=function(){return __awaiter(this,void 0,void 0,function(){var permission;return __generator(this,function(_b){switch(_b.label){case 0:switch(permission=this.pw.driver.getPermission(),permission){case constants_1.PERMISSION_GRANTED:return[3,1];case constants_1.PERMISSION_PROMPT:return[3,3];case constants_1.PERMISSION_DENIED:return[3,5]}return[3,6];case 1:return[4,this.pw.subscribe()];case 2:return _b.sent(),[3,7];case 3:return[4,this.pw.subscribe()];case 4:return _b.sent(),[3,7];case 5:return this.toggleHelpPopover(),[3,7];case 6:console.warn("Unknown browser notification permission"),_b.label=7;case 7:return[4,this.triggerPwEvent(constants_1.EVENT_CLICK_SUBSCRIBE_BUTTON,constants_1.KEY_CLICK_SUBSCRIBE_WIDGET)];case 8:return _b.sent(),[2]}})})},SubscribeWidget.prototype.onSubscribeEvent=function(){return __awaiter(this,void 0,void 0,function(){var isEnableChannels,tooltipContent,_this=this;return __generator(this,function(_a){return isEnableChannels=this.pw.isEnableChannels(),null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(tooltipContent.innerText=this.config.tooltipText.successSubscribe,this.tooltip.classList.add("pushwoosh-subscribe-widget__tooltip__visible"),setTimeout(function(){return __awaiter(_this,void 0,void 0,function(){var _a;return __generator(this,function(_b){switch(_b.label){case 0:return this.tooltip.classList.remove("pushwoosh-subscribe-widget__tooltip__visible"),_a=tooltipContent,[4,this.tooltipTextFactory()];case 1:return _a.innerText=_b.sent(),isEnableChannels||this.widget.classList.add("pushwoosh-subscribe-widget__subscribed"),[2]}})})},2e3),[2])})})},SubscribeWidget.prototype.onPermissionDeniedEvent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return[4,this.pw.isEnableChannels()];case 1:return _b.sent()&&(this.widget.removeEventListener("click",this.onClickBellIfEnableChannels),this.addEventListenersIfDisabledChannels()),null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(_a=tooltipContent,[4,this.tooltipTextFactory()]);case 2:return _a.innerText=_b.sent(),[2]}})})},SubscribeWidget.prototype.clickOutOfPopover=function(ev){this.popover.classList.contains("pushwoosh-subscribe-widget__popover__visible")&&!ev.target.classList.contains("pushwoosh-subscribe-widget__popover")&&null===ev.target.closest(".pushwoosh-subscribe-widget__popover")&&!ev.target.classList.contains("pushwoosh-subscribe-widget__bell-button")&&null===ev.target.closest(".pushwoosh-subscribe-widget__bell-button")&&this.popover.classList.remove("pushwoosh-subscribe-widget__popover__visible")},SubscribeWidget.prototype.triggerPwEvent=function(event,widget){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return[2]})})},SubscribeWidget.prototype.onUnsubscribeEvent=function(){return __awaiter(this,void 0,void 0,function(){var tooltipContent,_a;return __generator(this,function(_b){switch(_b.label){case 0:return null===(tooltipContent=this.tooltip.querySelector("div"))?[2]:(_a=tooltipContent,[4,this.tooltipTextFactory()]);case 1:return _a.innerText=_b.sent(),[2]}})})},SubscribeWidget}();document.addEventListener("pushwoosh.initialized",function(ev){ev.detail.pw.subscribeWidgetConfig.enable&&new SubscribeWidget(ev.detail.pw)})},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(77),Positioning=function(){function Positioning(){}return Positioning.getBellPosition=function(position,indent){var positionStyles;switch(position){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={top:"auto",left:"auto",bottom:indent,right:indent};break;case constants_1.BELL_POSITION_BOTTOM_LEFT:positionStyles={top:"auto",left:indent,bottom:indent,right:"auto"};break;case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={top:indent,left:indent,bottom:"auto",right:"auto"};break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={top:indent,left:"auto",bottom:"auto",right:indent};break;default:positionStyles={top:"auto",left:"auto",bottom:indent,right:indent}}return positionStyles},Positioning.getTooltipPosition=function(bellPosition,bellSize){var positionStyles,tooltipModification,increaseIndent=parseInt(bellSize)+12+"px";switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={right:increaseIndent},tooltipModification="right";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={left:increaseIndent},tooltipModification="left";break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={right:increaseIndent},tooltipModification="right";break;default:positionStyles={right:increaseIndent},tooltipModification="right"}return[positionStyles,tooltipModification]},Positioning.getPopoverPosition=function(bellPosition,bellSize){var positionStyles,popoverModification,increaseIndent=parseInt(bellSize)+15+"px";switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:positionStyles={bottom:increaseIndent,right:"0",left:"auto",top:"auto"},popoverModification="bottom";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:positionStyles={bottom:increaseIndent,left:"0",right:"auto",top:"auto"},popoverModification="bottom";break;case constants_1.BELL_POSITION_TOP_LEFT:positionStyles={top:increaseIndent,left:"0",right:"auto",bottom:"auto"},popoverModification="top";break;case constants_1.BELL_POSITION_TOP_RIGHT:positionStyles={top:increaseIndent,right:"0",left:"auto",bottom:"auto"},popoverModification="top";break;default:positionStyles={bottom:increaseIndent,right:"0",left:"auto",top:"auto"},popoverModification="bottom"}return[positionStyles,popoverModification]},Positioning.getPopoverArrowPosition=function(bellPosition,bellSize){var arrowAdditionalStyles;switch(bellPosition){case constants_1.BELL_POSITION_BOTTOM_RIGHT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px";break;case constants_1.BELL_POSITION_BOTTOM_LEFT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {right: auto; left: "+(parseInt(bellSize)/2-12)+"px";break;case constants_1.BELL_POSITION_TOP_LEFT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__top:after {right: auto; left: "+(parseInt(bellSize)/2-12)+"px";break;case constants_1.BELL_POSITION_TOP_RIGHT:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__top:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px";break;default:arrowAdditionalStyles="\n.pushwoosh-subscribe-widget__popover__bottom:after {left: auto; right: "+(parseInt(bellSize)/2-4)+"px"}return arrowAdditionalStyles},Positioning}();exports.default=Positioning},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(fillColor,strokeColor){return'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg\n xmlns:dc="http://purl.org/dc/elements/1.1/"\n xmlns:cc="http://creativecommons.org/ns#"\n xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"\n xmlns:svg="http://www.w3.org/2000/svg"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"\n xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"\n version="1.1"\n id="Capa_1"\n x="0px"\n y="0px"\n viewBox="0 0 346.013 346.013"\n style="enable-background:new 0 0 346.013 346.013;width: 80%; height: auto; vertical-align: middle;"\n xml:space="preserve"\n inkscape:version="0.91 r13725"\n sodipodi:docname="alarm_white.svg"><metadata\n id="metadata51"><rdf:RDF><cc:Work\n rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type\n rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs\n id="defs49" /><sodipodi:namedview\n borderopacity="1"\n objecttolerance="10"\n gridtolerance="10"\n guidetolerance="10"\n inkscape:pageopacity="0"\n inkscape:pageshadow="2"\n inkscape:window-width="1618"\n inkscape:window-height="828"\n id="namedview47"\n showgrid="false"\n inkscape:zoom="0.6820553"\n inkscape:cx="173.0065"\n inkscape:cy="173.0065"\n inkscape:window-x="0"\n inkscape:window-y="0"\n inkscape:window-maximized="0"\n inkscape:current-layer="g3" /><g\n id="g3"><path\n d="m 256.76227,220.19006 c -1.77513,-2.69766 -3.45154,-5.24564 -3.98966,-7.46382 -0.042,-0.17861 -0.0911,-0.36128 -0.16237,-0.61436 -2.28354,-7.67647 0.69147,-24.43921 2.46886,-34.45124 0.26788,-1.50394 0.52274,-2.94197 0.75286,-4.29035 0.0232,-0.13675 0.044,-0.27211 0.0724,-0.48006 1.95582,-15.28051 2.58811,-37.91956 -5.51044,-58.99147 -5.6032,-14.57978 -14.45978,-25.82612 -26.3559,-33.48393 1.26598,-9.812938 -4.85967,-19.343691 -14.66682,-22.0511 -9.80715,-2.70741 -19.95724,2.33226 -23.90298,11.405413 -14.1382,0.467533 -27.51111,5.577097 -39.80114,15.219267 -17.76129,13.9298 -28.83431,33.68757 -34.99389,47.80757 l -0.0479,0.11335 c -0.0512,0.12175 -0.0998,0.24114 -0.13249,0.32962 -0.49733,1.28292 -1.01552,2.64514 -1.55689,4.07255 -3.61311,9.51043 -9.66004,25.42824 -15.611995,30.89342 -0.106524,0.10027 -0.208228,0.20187 -0.362362,0.35435 -1.636243,1.66563 -4.382941,2.99463 -7.288979,4.40101 -7.145531,3.45301 -22.013613,10.64166 -17.206389,31.67844 0.929154,4.07105 4.008437,7.29057 8.033861,8.40185 l 167.570804,46.2604 c 4.02253,1.11048 8.31521,-0.0729 11.2052,-3.08958 14.91617,-15.58874 5.84693,-29.38668 1.48625,-36.02133 z"\n id="path5"\n inkscape:connector-curvature="0"\n vector-effect="non-scaling-stroke"\n style="fill:'+fillColor+"; stroke: "+strokeColor+'; stroke-width: 1; " /><path\n vector-effect="non-scaling-stroke"\n d="m 174.26737,259.72378 -38.76399,-10.70137 c -1.59243,-0.43962 -3.28183,-0.15596 -4.63548,0.7754 -2.53909,1.7494 -2.84182,4.93159 -3.02304,6.83188 l -0.0151,0.15247 c -1.22819,12.67106 6.79854,24.33046 19.08688,27.72284 12.51583,3.45518 25.8324,-2.91586 30.9681,-14.80385 l 0.0935,-0.19205 c 0.52305,-1.06418 1.74613,-3.55554 0.50882,-6.31116 -0.44302,-0.98439 -1.5794,-2.74529 -4.21964,-3.47416 z"\n id="path7"\n inkscape:connector-curvature="0"\n style="fill:'+fillColor+"; stroke: "+strokeColor+'; stroke-width: 1;" /></g><g\n id="g17" /><g\n id="g19" /><g\n id="g21" /><g\n id="g23" /><g\n id="g25" /><g\n id="g27" /><g\n id="g29" /><g\n id="g31" /><g\n id="g33" /><g\n id="g35" /><g\n id="g37" /><g\n id="g39" /><g\n id="g41" /><g\n id="g43" /><g\n id="g45" /></svg>'}},function(module,exports,__webpack_require__){var result=__webpack_require__(149);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(150)(void 0)).push([module.i,'/* Widget */\n.pushwoosh-subscribe-widget {\n position: fixed;\n display: block;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n}\n\n.pushwoosh-subscribe-widget__subscribed {\n display: none;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button {\n -webkit-border-radius: 50%;\n border-radius: 50%;\n cursor: pointer;\n font-size: 0;\n text-align: center;\n -webkit-transform: scale(0.9) translate3d(0, 0, 0);\n transform: scale(0.9) translate3d(0, 0, 0);\n -webkit-transition: -webkit-transform .3s ease-in-out;\n transition: -webkit-transform .3s ease-in-out;\n -o-transition: transform .3s ease-in-out;\n transition: transform .3s ease-in-out;\n transition: transform .3s ease-in-out, -webkit-transform .3s ease-in-out;\n position: relative;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__bell-button:hover {\n -webkit-transform: scale(1);\n -ms-transform: scale(1);\n transform: scale(1);\n}\n\n/* Tooltip */\n.pushwoosh-subscribe-widget__tooltip {\n position: absolute;\n height: 48px;\n max-width: 300px;\n min-width: 200px;\n padding: 5px 7px;\n background-color: #3b444b;\n color: #ffffff;\n text-align: center;\n vertical-align: middle;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n line-height: 38px;\n font-size: 0;\n font-weight: normal;\n visibility: hidden;\n opacity: 0;\n -webkit-transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n -o-transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n transition: visibility 0s ease-in .3s,\n opacity .3s ease-in;\n top: 50%;\n -webkit-transform: translate(0, -50%);\n -ms-transform: translate(0, -50%);\n transform: translate(0, -50%);\n -webkit-box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n box-shadow: 1px 1px 5px 0 rgba(0,0,0,0.5);\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after,\n.pushwoosh-subscribe-widget__tooltip__left:after {\n content: "";\n top: 50%;\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n background: #3b444b;\n}\n\n.pushwoosh-subscribe-widget__tooltip__right:after {\n left: calc(100% - 7px);\n border-top: 5px solid #3b444b;\n border-left: 5px solid #3b444b;\n border-right: 5px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 2px 2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__tooltip__left:after {\n left: -7px;\n border-top: 5px solid #3b444b;\n border-right: 5px solid #3b444b;\n border-left: 5px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n -webkit-box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n box-shadow: -2px -2px 2px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__bell-button:hover + .pushwoosh-subscribe-widget__tooltip,\n.pushwoosh-subscribe-widget__tooltip.pushwoosh-subscribe-widget__tooltip__visible {\n display: block;\n visibility: visible;\n opacity: 1;\n -webkit-transition-delay: 0s;\n -o-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__tooltip-content {\n display: inline-block;\n vertical-align: middle;\n font-size: 14px;\n line-height: 1.4;\n white-space: nowrap;\n overflow: hidden;\n padding-right: 5px;\n -o-text-overflow: ellipsis;\n text-overflow: ellipsis;\n max-width: 100%;\n}\n\n/* Popover */\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover {\n position: absolute;\n right: auto;\n -webkit-box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n box-shadow: 1px 1px 5px 0 rgba(0, 0, 0, 0.5);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: #9ca8b1;\n visibility: hidden;\n opacity: 0;\n -webkit-transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n -o-transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n transition: visibility 0s ease-in .5s,\n opacity .5s ease-in;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover__visible {\n display: block;\n visibility: visible;\n opacity: 1;\n -webkit-transition-delay: 0s;\n -o-transition-delay: 0s;\n transition-delay: 0s;\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after,\n.pushwoosh-subscribe-widget__popover__top:after {\n content: "";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n border-right: 8px solid transparent;\n border-left: 8px solid #9ca8b1;\n background: #9ca8b1;\n -webkit-transform-origin: 0 0;\n -ms-transform-origin: 0 0;\n transform-origin: 0 0;\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n transform: rotate(-45deg);\n}\n\n.pushwoosh-subscribe-widget__popover__bottom:after {\n border-bottom: 8px solid #9ca8b1;\n border-top: 8px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n box-shadow: -2px 2px 1px 0 rgba(0, 0, 0, 0.25);\n bottom: -16px;\n}\n\n.pushwoosh-subscribe-widget__popover__top:after {\n top: 0;\n border-top: 8px solid #9ca8b1;\n border-bottom: 8px solid transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 1px -1px 1px 0 rgba(0, 0, 0, 0.25);\n}\n\n.pushwoosh-subscribe-widget__popover-content-wrapper {\n overflow: auto;\n max-width: 100%;\n}\n\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n padding: 14px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n float: left;\n min-width: 100%;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n display: block;\n}\n\n.pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-bottom: 14px;\n}\n\n@media (max-width: 767px) and (orientation: portrait) {\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n max-width: 280px;\n height: auto;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-right: 0;\n margin-bottom: 14px;\n }\n}\n@media (max-width: 767px) and (orientation: landscape) {\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover-content {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img {\n max-width: 280px;\n height: auto;\n }\n .pushwoosh-subscribe-widget .pushwoosh-subscribe-widget__popover img:first-child {\n margin-right: 14px;\n margin-bottom: 0;\n }\n}\n',""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var pwInboxWidget=__webpack_require__(152);document.addEventListener("pushwoosh.initialized",function(ev){ev.detail.pw.pwinbox&&ev.detail.pw.inboxWidgetConfig.enable&&(ev.detail.pw.pwinboxWidget=new pwInboxWidget.PWInboxWidget(ev.detail.pw))})},function(module,exports,__webpack_require__){module.exports=function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=2)}([function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(1);exports.isElementFixed=function isElementFixed(element){var isFixed="fixed"===window.getComputedStyle(element).position;return!isFixed&&element.parentElement&&(isFixed=isElementFixed(element.parentElement)),isFixed},exports.getGlobal=function(){return Function("return this")()},exports.getMessageTime=function(date){var localDate=new Date(date),localTime=localDate.getHours()+localDate.getTimezoneOffset()/60;localDate.setHours(localTime);var gap=(new Date).getTime()-localDate.getTime();return gap<=6e4?"Just now":gap<constants_1.MILLISECONDS_IN_HOUR&&gap>0?Math.floor(gap/6e4)+" minutes ago":gap<constants_1.MILLISECONDS_IN_DAY&&gap>0?Math.floor(gap/36e5)+" hours ago":localDate.getDate()+" "+constants_1.MONTHS[localDate.getMonth()]+" "+localDate.getFullYear()+", "+localDate.getHours()+":"+("0"+localDate.getMinutes().toString()).slice(-2)},exports.getValidColor=function(color){return"transparent"===color?color:constants_1.COLOR_TEST_REGEXP.test(color)?color:"#333"},exports.compareBySendDate=function(dateOne,dateTwo){var localDateOne=new Date(dateOne),localTimeOne=localDateOne.getHours()+localDateOne.getTimezoneOffset()/60,localDateTwo=new Date(dateTwo),localTimeTwo=localDateTwo.getHours()+localDateTwo.getTimezoneOffset()/60;return localDateOne.setHours(localTimeOne),localDateTwo.setHours(localTimeTwo),localDateTwo.getTime()-localDateOne.getTime()}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MILLISECONDS_IN_DAY=864e5,exports.MILLISECONDS_IN_HOUR=36e5,exports.MONTHS=["Jan","Feb","Mar","Apr","May","June","July","Aug","Sept","Oct","Nov","Dec"],exports.CONFIG_STYLES=[{name:"widgetWidth",type:"size"},{name:"borderRadius",type:"size"},{name:"zIndex",type:"number"},{name:"fontFamily",type:"string"},{name:"bgColor",type:"color"},{name:"textColor",type:"color"},{name:"arrowBorderColor",type:"color"},{name:"borderColor",type:"color"},{name:"badgeBgColor",type:"color"},{name:"badgeTextColor",type:"color"},{name:"timeTextColor",type:"color"},{name:"messageTitleColor",type:"color"},{name:"emptyInboxTitleColor",type:"color"},{name:"emptyInboxTextColor",type:"color"}],exports.DEFAULT_CONFIG={enable:!1,triggerId:"pwInbox",position:"bottom",appendTo:"body",title:"Inbox",bgColor:"#ffffff",textColor:"#333333",fontFamily:"inherit",borderRadius:4,borderColor:"transparent",badgeBgColor:"#ff4c00",badgeTextColor:"#ffffff",widgetWidth:350,zIndex:100,messageTitleColor:"#7a7a7a",timeTextColor:"#c4c4c4",emptyInboxTitle:"You're all caught up",emptyInboxTitleColor:"#333333",emptyInboxText:"There are no new messages. Stay tuned!",emptyInboxTextColor:"#7a7a7a",emptyInboxIconUrl:"https://pushon.pushwoosh.com/images/icon-empty-inbox.png",arrowBorderColor:"rgba(0,0,0,.1)"},exports.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var InboxWidget_1=__webpack_require__(3);exports.PWInboxWidget=InboxWidget_1.default},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t};Object.defineProperty(exports,"__esModule",{value:!0});var widgetTemplates_1=__webpack_require__(4),constants_1=__webpack_require__(1),helpers_1=__webpack_require__(0),InboxWidget=function(){function InboxWidget(pw){this.pw=pw,this.config=__assign({},constants_1.DEFAULT_CONFIG,{arrowBorderColor:this.pw.inboxWidgetConfig.borderColor&&"transparent"!==this.pw.inboxWidgetConfig.borderColor?this.pw.inboxWidgetConfig.borderColor:"rgba(0,0,0,.1)"},this.pw.inboxWidgetConfig),this.updateInbox=this.updateInbox.bind(this),this.markVisibleItemsAsRead=this.markVisibleItemsAsRead.bind(this),this.onWidgetClickHandler=this.onWidgetClickHandler.bind(this),this.onTriggerClickHandler=this.onTriggerClickHandler.bind(this),this.onWindowScrollHandler=this.onWindowScrollHandler.bind(this),this.toggle=this.toggle.bind(this);try{this.initTrigger(),this.updateInbox(),this.addListeners()}catch(err){console.warn(err)}}return InboxWidget.prototype.toggle=function(isOpened){(void 0===isOpened?!this.isOpened:isOpened)?this.openWidget():this.closeWidget()},InboxWidget.prototype.initTrigger=function(){if(!this.pw.pwinbox)throw new Error("Web inbox is not allowed.");var trigger=document.getElementById(this.config.triggerId);if(!trigger)throw new Error("Inbox trigger element doesn't exist. You must set triggerId in inboxWidget config. See the documentation.");this.trigger=trigger,this.trigger.classList.add("pw-inbox-trigger"),this.defaultMargin=12,this.messagesElements={},this.messages=[],this.readItems=[],this.updateCounter(0),this.isOpened=!1,this.renderWidget(),this.isFixed=helpers_1.isElementFixed(this.trigger)},InboxWidget.prototype.renderWidget=function(){this.widget=document.createElement("div"),this.widget.id="pwInboxWidget",this.widget.className="pw-inbox-widget",this.widget.classList.toggle("pw-open",this.isOpened),this.widgetParent=document.querySelector(this.config.appendTo)||document.body,this.widgetParent.appendChild(this.widget),this.widgetParent.appendChild(this.getStyle()),this.renderWidgetInner()},InboxWidget.prototype.getStyle=function(){var styles=__webpack_require__(5),styleNode=document.createElement("style");return styleNode.innerHTML=this.configureStyle(styles),styleNode},InboxWidget.prototype.configureStyle=function(styles){var _this=this,resultStyles=styles.toString();return constants_1.CONFIG_STYLES.forEach(function(style){var template=new RegExp("var\\(--"+style.name+"\\)","ig"),result=_this.getStyleFormatter(style);resultStyles=resultStyles.replace(template,result)}),resultStyles},InboxWidget.prototype.getStyleFormatter=function(style){switch(style.type){case"size":return(this.config[style.name]||0)+"px";case"number":return parseFloat(this.config[style.name].toString()).toString();case"string":return this.config[style.name].toString();case"color":return helpers_1.getValidColor(this.config[style.name].toString());default:return"none"}},InboxWidget.prototype.renderWidgetInner=function(){if(this.messages.length>0)this.widget.classList.remove("pw-inbox-widget--empty"),this.widget.innerHTML=widgetTemplates_1.widgetTemplate(this.config.title),this.renderMessages();else{this.widget.classList.add("pw-inbox-widget--empty");var _a=this.config,emptyInboxTitle=_a.emptyInboxTitle,emptyInboxText=_a.emptyInboxText,emptyInboxIconUrl=_a.emptyInboxIconUrl;this.widget.innerHTML=widgetTemplates_1.widgetTemplateEmpty(emptyInboxIconUrl,emptyInboxTitle,emptyInboxText)}},InboxWidget.prototype.renderMessages=function(){var _this=this;this.list=this.widget.querySelector(".pw-inbox_list")||document.createElement("ul"),this.messages.forEach(function(message){var messageElement=document.createElement("li");messageElement.className="pw-inbox_item",messageElement.classList.toggle("pw-new",!message.isRead),messageElement.classList.toggle("pw-unread",!message.isActionPerformed),messageElement.setAttribute("data-pw-inbox-message-id",message.code),messageElement.innerHTML=widgetTemplates_1.messageTemplate(message),_this.list.appendChild(messageElement),_this.messagesElements[message.code]=messageElement})},InboxWidget.prototype.updateCounter=function(count){this.count=count,this.trigger.setAttribute("data-pw-count",""+this.count),this.trigger.classList.toggle("pw-empty",0===this.count)},InboxWidget.prototype.updateInboxMessages=function(messages){this.messages=messages.sort(function(_a,_b){var sendDateOne=_a.sendDate,sendDateTwo=_b.sendDate;return helpers_1.compareBySendDate(sendDateOne,sendDateTwo)}),this.renderWidgetInner()},InboxWidget.prototype.openWidget=function(){this.isOpened=!0,this.widget.classList.add("pw-open"),document.addEventListener("click",this.onWidgetClickHandler),window.addEventListener("scroll",this.onWindowScrollHandler),window.addEventListener("resize",this.onWindowScrollHandler),this.markVisibleItemsAsRead(),this.messages.length>0&&this.list.addEventListener("scroll",this.markVisibleItemsAsRead),this.positionWidget()},InboxWidget.prototype.closeWidget=function(){this.isOpened=!1,document.removeEventListener("click",this.onWidgetClickHandler),document.removeEventListener("click",this.onWindowScrollHandler),window.removeEventListener("resize",this.onWindowScrollHandler),this.updateReadStatus(),this.messages.length>0&&this.list.removeEventListener("scroll",this.markVisibleItemsAsRead),this.widget.classList.remove("pw-open","pw-top","pw-bottom","pw-right","pw-left"),this.widget.removeAttribute("style")},InboxWidget.prototype.positionWidget=function(){this.isOpened&&(this.widgetParent===document.body?this.defaultPlaceWidget():this.customPlaceWidget())},InboxWidget.prototype.customPlaceWidget=function(){var position=this.config.position;this.widgetParent.style.position="relative",this.widget.classList.add("pw-inbox-widget--inset"),this.widget.classList.add("pw-"+position)},InboxWidget.prototype.defaultPlaceWidget=function(){var position=this.pw.inboxWidgetConfig.position?this.config.position:this.getDefaultPosition(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0);switch(widgetRect.width+2*this.defaultMargin>windowWidth&&(this.widget.style.width=windowWidth-2*this.defaultMargin+"px"),widgetRect.height+24>windowHeight&&(this.widget.style.height=windowHeight-2*this.defaultMargin+"px"),position){case"top":this.alignWidgetTop();break;case"right":this.alignWidgetRight();break;case"left":this.alignWidgetLeft();break;case"bottom":this.alignWidgetBottom()}}},InboxWidget.prototype.alignWidgetTop=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-top");var left=pageXOffset+triggerRect.left+Math.floor(triggerRect.width/2)-Math.floor(widgetRect.width/2),isUnderLeft=left<pageXOffset,isUnderRight=left+widgetRect.width>pageXOffset+windowWidth;isUnderLeft&&(left=pageXOffset+this.defaultMargin),isUnderRight&&(left=pageXOffset+windowWidth-widgetRect.width-this.defaultMargin);var top=pageYOffset+triggerRect.top-widgetRect.height;this.alignWidgetElement(left,top),arrow.style.left=triggerRect.left+Math.floor(triggerRect.width/2)-left+"px";var topMargin=this.widget.getBoundingClientRect().top;if(topMargin<0){var newHeight=this.widget.getBoundingClientRect().height+topMargin-this.defaultMargin,newTop=this.widget.getBoundingClientRect().top-topMargin+this.defaultMargin;this.widget.style.height=newHeight+"px",this.widget.style.top=newTop+"px"}}},InboxWidget.prototype.alignWidgetRight=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-right");var top=pageYOffset+triggerRect.top+Math.floor(triggerRect.height/2)-Math.floor(widgetRect.height/2),isUnderTop=top<pageYOffset,isUnderBottom=pageYOffset+windowHeight<top+widgetRect.height;isUnderTop&&(top=pageYOffset+this.defaultMargin),isUnderBottom&&(top=pageYOffset+windowHeight-widgetRect.height-this.defaultMargin);var left=pageXOffset+triggerRect.left+triggerRect.width;this.alignWidgetElement(left,top),arrow.style.top=triggerRect.top+Math.floor(triggerRect.height/2)-top+"px";var rightMargin=windowWidth-this.widget.getBoundingClientRect().right;if(rightMargin<this.defaultMargin){var newWidth=this.widget.getBoundingClientRect().width+rightMargin-this.defaultMargin;this.widget.style.width=newWidth+"px"}}},InboxWidget.prototype.alignWidgetLeft=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-left");var top=pageYOffset+triggerRect.top+Math.floor(triggerRect.height/2)-Math.floor(widgetRect.height/2),isUnderTop=top<pageYOffset,isUnderBottom=pageYOffset+windowHeight<top+widgetRect.height;isUnderTop&&(top=pageYOffset+this.defaultMargin),isUnderBottom&&(top=pageYOffset+windowHeight-widgetRect.height-this.defaultMargin);var left=pageXOffset+triggerRect.left-widgetRect.width;this.alignWidgetElement(left,top),arrow.style.top=triggerRect.top+Math.floor(triggerRect.height/2)-top+"px";var leftMargin=this.widget.getBoundingClientRect().left;if(leftMargin<0){var newWidth=this.widget.getBoundingClientRect().width+leftMargin-this.defaultMargin,newLeft=this.widget.getBoundingClientRect().left-leftMargin;this.widget.style.width=newWidth+"px",this.widget.style.left=newLeft+"px"}}},InboxWidget.prototype.alignWidgetBottom=function(){var triggerRect=this.trigger.getBoundingClientRect(),widgetRect=this.widget.getBoundingClientRect();if(document.documentElement){var windowWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),windowHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),arrow=this.widget.querySelector(".pw-inbox__arrow")||document.createElement("div");this.widget.classList.add("pw-bottom");var left=pageXOffset+triggerRect.left+Math.floor(triggerRect.width/2)-Math.floor(widgetRect.width/2),isUnderLeft=left<pageXOffset,isUnderRight=left+widgetRect.width>pageXOffset+windowWidth;isUnderLeft&&(left=pageXOffset+this.defaultMargin),isUnderRight&&(left=pageXOffset+windowWidth-widgetRect.width-12);var top=pageYOffset+triggerRect.top+triggerRect.height;this.alignWidgetElement(left,top),arrow.style.left=triggerRect.left+Math.floor(triggerRect.width/2)-left+"px";var bottomRange=windowHeight-this.widget.getBoundingClientRect().bottom;if(bottomRange<this.defaultMargin){var newHeight=this.widget.getBoundingClientRect().height+bottomRange-this.defaultMargin;this.widget.style.height=newHeight+"px"}}},InboxWidget.prototype.alignWidgetElement=function(left,top){this.widget.style.left=left+"px",this.widget.style.top=top+"px"},InboxWidget.prototype.getDefaultPosition=function(){var _a=this.trigger.getBoundingClientRect(),left=_a.left,top=_a.top,width=_a.width,height=_a.height;if(!document.documentElement)return"";var antiMargins={right:left,bottom:top,left:Math.max(document.documentElement.clientWidth,window.innerWidth||0)-(left+width),top:Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(top+height)},leastMargin=Math.min(left,top,antiMargins.left,antiMargins.top),position="bottom";return Object.keys(antiMargins).forEach(function(key){antiMargins[key]===leastMargin&&(position=key)}),position},InboxWidget.prototype.addListeners=function(){var _this=this;this.trigger.addEventListener("click",this.onTriggerClickHandler),this.pw.push(["onPutNewMessageToInboxStore",function(){_this.updateInbox()}]),this.pw.push(["onUpdateInboxMessages",function(){_this.updateInbox()}])},InboxWidget.prototype.markVisibleItemsAsRead=function(){var _this=this;if(0!==this.messages.length){var scrollTop=this.list.clientHeight+this.list.scrollTop-50;Object.keys(this.messagesElements).forEach(function(code){if(_this.messagesElements[code]&&!(_this.messagesElements[code].offsetTop>scrollTop)){var message=_this.messages.find(function(message){return message.code===code});!message||message.isRead||_this.readItems.indexOf(code)+1||_this.readItems.push(code)}})}},InboxWidget.prototype.updateReadStatus=function(){this.pw.pwinbox.readMessagesWithCodes(this.readItems).then(this.updateInbox)},InboxWidget.prototype.updateInbox=function(){var _this=this;this.pw.pwinbox.loadMessages().then(function(messages){_this.updateInboxMessages(messages)}),this.pw.pwinbox.unreadMessagesCount().then(function(count){_this.updateCounter(count)})},InboxWidget.prototype.performMessageAction=function(code){var _this=this;this.pw.pwinbox.performActionForMessageWithCode(code).then(function(){_this.updateInbox()})},InboxWidget.prototype.removeMessages=function(messages){var _this=this;messages.forEach(function(code){_this.readItems=_this.readItems.slice(_this.readItems.indexOf(code),1)}),this.pw.pwinbox.deleteMessagesWithCodes(messages).then(function(){_this.updateInbox()})},InboxWidget.prototype.onTriggerClickHandler=function(event){event.stopPropagation(),event.target&&this.toggle()},InboxWidget.prototype.onWidgetClickHandler=function(event){if(event.target){var itemElement=event.target.closest(".pw-inbox_item");if(itemElement){var messageCode=itemElement.getAttribute("data-pw-inbox-message-id");messageCode&&(event.target.closest(".pw-inbox_item-remove")?this.removeMessages([messageCode]):this.performMessageAction(messageCode))}else this.toggle()}},InboxWidget.prototype.onWindowScrollHandler=function(){this.isFixed&&this.isOpened?this.toggle():this.positionWidget()},InboxWidget}();exports.default=InboxWidget},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helpers_1=__webpack_require__(0);exports.widgetTemplate=function(title){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_inner">\n <div class="pw-inbox_title">\n '+title+'\n </div>\n <ul class="pw-inbox_list">\n \n </ul>\n</div>'},exports.widgetTemplateEmpty=function(emptyInboxIconUrl,emptyInboxTitle,emptyInboxText){return'\n<div class="pw-inbox__arrow"></div>\n<div class="pw-inbox_list--empty">\n <div class="pw-inbox_list-icon">\n <img src="'+emptyInboxIconUrl+'" alt="'+emptyInboxTitle+'">\n </div>\n <div class="pw-inbox_list-title">\n '+emptyInboxTitle+'\n </div>\n <div class="ipw-inbox_list-body">\n '+emptyInboxText+"\n </div>\n</div>"},exports.messageTemplate=function(_a){var imageUrl=_a.imageUrl,title=_a.title,message=_a.message,sendDate=_a.sendDate;return'\n<div class="pw-inbox_item-inner">\n <div class="pw-inbox_icon">\n <img src="'+imageUrl+'" alt="'+(title||message)+'" class="pw-inbox_message-image">\n </div>\n <div class="pw-inbox_content">\n '+(title?'<div class="pw-inbox_item-title">\n '+title+"\n </div>":null)+'\n <div class="pw-inbox_item-body">\n '+message+'\n </div>\n <div class="pw-inbox_item-time">\n '+helpers_1.getMessageTime(sendDate)+'\n </div>\n </div>\n</div>\n<span class="pw-inbox_item-remove"></span>'}},function(module,exports,__webpack_require__){var result=__webpack_require__(6);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(7)(void 0)).push([module.i,".pw-inbox-trigger {\n position: relative;\n cursor: pointer;\n}\n\n.pw-inbox-trigger:after {\n content: attr(data-pw-count);\n display: block;\n position: absolute;\n right: 0;\n top: 0;\n background: var(--badgeBgColor);\n -webkit-border-radius: 8px;\n border-radius: 8px;\n color: var(--badgeTextColor);\n font-size: 10px;\n font-weight: normal;\n line-height: 16px;\n width: 16px;\n padding: 0 2px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n text-align: center;\n}\n\n.pw-inbox-trigger.pw-empty:after {\n display: none;\n}\n\n.pw-inbox-widget * {\n position: static;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-size: 1em;\n outline: none;\n font-family: var(--fontFamily);\n}\n.pw-inbox-widget {\n font-size: 14px;\n position: absolute;\n top: 0;\n left: -1000px;\n background: var(--bgColor);\n border: solid 1px var(--borderColor);\n -webkit-border-radius: var(--borderRadius);\n border-radius: var(--borderRadius);\n width: var(--widgetWidth);\n -webkit-box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n box-shadow: 0 1px 4px 0 rgba(0,0,0,.25);\n z-index: var(--zIndex);\n opacity: 0;\n -webkit-transition: opacity .6s ease;\n -o-transition: opacity .6s ease;\n transition: opacity .6s ease;\n -webkit-transition-delay: 100ms;\n -o-transition-delay: 100ms;\n transition-delay: 100ms;\n}\n.pw-inbox-widget.pw-open {\n opacity: 1;\n -webkit-transition-delay: 0ms;\n -o-transition-delay: 0ms;\n transition-delay: 0ms;\n}\n.pw-inbox-widget.pw-inbox-widget--inset {\n top: auto;\n left: auto;\n display: none;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-open {\n display: block;\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-bottom {\n top: 100%;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-top {\n bottom: 100%;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-right {\n left: 100%;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--inset.pw-left {\n right: 100%;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-inbox-widget--empty {\n max-height: none;\n}\n.pw-inbox-widget .pw-inbox__arrow {\n display: block;\n width: 0;\n height: 0;\n border-width: 10px;\n border-style: solid;\n border-color: transparent;\n position: absolute;\n}\n.pw-inbox-widget .pw-inbox__arrow:before {\n content: \"\";\n display: block;\n width: 0;\n height: 0;\n border-width: 10px;\n border-style: solid;\n border-color: transparent;\n position: absolute;\n}\n.pw-inbox-widget.pw-top {\n margin-top: -12px;\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow {\n border-top-color: var(--arrowBorderColor);\n bottom: -21px;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-top .pw-inbox__arrow:before {\n border-top-color: var(--bgColor);\n top: -11px;\n left: -10px;\n}\n.pw-inbox-widget.pw-bottom {\n margin-top: 12px;\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow {\n border-bottom-color: var(--arrowBorderColor);\n top: -21px;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n}\n.pw-inbox-widget.pw-bottom .pw-inbox__arrow:before {\n border-bottom-color: var(--bgColor);\n bottom: -11px;\n left: -10px;\n}\n.pw-inbox-widget.pw-left {\n margin-left: -12px;\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow {\n border-left-color: var(--arrowBorderColor);\n right: -21px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-left .pw-inbox__arrow:before {\n border-left-color: var(--bgColor);\n left: -11px;\n top: -10px;\n}\n.pw-inbox-widget.pw-right {\n margin-left: 12px;\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow {\n border-right-color: var(--arrowBorderColor);\n left: -21px;\n top: 50%;\n -webkit-transform: translateY(-50%);\n -ms-transform: translateY(-50%);\n transform: translateY(-50%);\n}\n.pw-inbox-widget.pw-right .pw-inbox__arrow:before {\n border-right-color: var(--bgColor);\n right: -11px;\n top: -10px;\n}\n.pw-inbox_inner {\n overflow: hidden;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n height: 100%;\n}\n.pw-inbox_title {\n color: var(--textColor);\n margin: 0;\n padding: 28px 32px 12px;\n font-size: 24px;\n font-weight: 500;\n line-height: 1.1;\n text-align: left;\n -webkit-box-flex: 0;\n -ms-flex: 0 0 66px;\n flex: 0 0 66px;\n}\n.pw-inbox_list {\n overflow-x: hidden;\n overflow-y: auto;\n min-width: 200px;\n max-height: 300px;\n padding: 0;\n margin: 0;\n list-style: none;\n position: relative;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 auto;\n flex: 1 1 auto;\n}\n\n.pw-inbox_item {\n position: relative;\n padding: 8px 32px;\n margin: 0;\n text-align: left;\n}\n.pw-inbox_item-inner {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n cursor: pointer;\n}\n.pw-inbox_icon {\n -webkit-box-flex: 0;\n -ms-flex: 0 0 40px;\n flex: 0 0 40px;\n}\n.pw-inbox_message-image {\n width: 28px;\n}\n.pw-inbox_content {\n -webkit-box-flex: 0;\n -ms-flex: 0 1 100%;\n flex: 0 1 100%;\n}\n.pw-inbox_item-title {\n color: var(--messageTitleColor);\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n}\n.pw-inbox_item-body {\n color: var(--textColor);\n font-size: 14px;\n line-height: 20px;\n margin-bottom: 4px;\n}\n.pw-inbox_item-time {\n color: var(--timeTextColor);\n font-size: 12px;\n line-height: 17px;\n}\n.pw-inbox_item-remove {\n position: absolute;\n z-index: 2;\n top: 8px;\n right: 8px;\n display: none;\n width: 10px;\n height: 10px;\n background: transparent url('https://cdn.pushwoosh.com/webpush/img/iconClose.svg') 50% no-repeat;\n cursor: pointer;\n}\n.pw-inbox_item:hover .pw-inbox_item-remove {\n display: block;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-title {\n color: var(--textColor);\n font-weight: 700;\n}\n\n.pw-inbox_item.pw-new .pw-inbox_item-body {\n font-weight: 700;\n}\n\n.pw-inbox_list--empty {\n padding: 50px 16px;\n text-align: center;\n max-height: 100%;\n overflow: auto;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-icon {\n text-align: center;\n margin-bottom: 30px;\n}\n.pw-inbox_list--empty .pw-inbox_list-icon img {\n max-width: 100%;\n}\n\n.pw-inbox_list--empty .pw-inbox_list-title {\n font-size: 28px;\n line-height: 36px;\n color: var(--emptyInboxTitleColor);\n margin-bottom: 20px;\n}\n\n.pw-inbox_list--empty .ipw-inbox_list-body {\n font-size: 14px;\n line-height: 18px;\n color: var(--emptyInboxTextColor);\n}\n",""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}}])},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var web_push_subscribe_popup_1=__webpack_require__(154);document.addEventListener("pushwoosh.initialized",function(ev){if(ev.detail.pw.subscribePopupConfig&&ev.detail.pw.subscribePopupConfig.enable){var popup_1=new web_push_subscribe_popup_1.PWSubscribePopup(ev.detail.pw);popup_1.initPopup().then(function(){ev.detail.pw.subscribePopup=popup_1})}})},function(module,exports,__webpack_require__){module.exports=function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.r=function(exports){Object.defineProperty(exports,"__esModule",{value:!0})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DEFAULT_CONFIG={text:"Don’t miss out on our news and updates! Enable push notifications",askLaterButtonText:"Not now",confirmSubscriptionButtonText:"Subscribe",delay:60,retryOffset:604800,overlay:!1,position:"top",bgColor:"#fff",borderColor:"transparent",boxShadow:"0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)",textColor:"#000",textSize:"inherit",fontFamily:"inherit",subscribeBtnBgColor:"#4285f4",subscribeBtnTextColor:"#fff",askLaterBtnBgColor:"transparent",askLaterBtnTextColor:"#000",theme:"material",viewport:"html"},exports.COLOR_TEST_REGEXP=/^(#([\da-f]{3}){1,2}$|(rgb|hsl)a\((\d{1,3}%?,\s?){3}(1|0?\.\d+)\)$|(rgb|hsl)\(\d{1,3}%?(,\s?\d{1,3}%?){2}\)$)/,exports.PERMISSION_DENIED="denied",exports.PERMISSION_GRANTED="granted",exports.CONFIG_STYLES=[{name:"bgColor",type:"color"},{name:"borderColor",type:"color"},{name:"boxShadow",type:"string"},{name:"textColor",type:"color"},{name:"textSize",type:"string"},{name:"fontFamily",type:"string"},{name:"subscribeBtnBgColor",type:"color"},{name:"subscribeBtnTextColor",type:"color"},{name:"askLaterBtnBgColor",type:"color"},{name:"askLaterBtnTextColor",type:"color"}]},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var SubscribePopup_1=__webpack_require__(2);exports.PWSubscribePopup=SubscribePopup_1.default},function(module,exports,__webpack_require__){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++)for(var p in s=arguments[i])Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p]);return t},__awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})},__generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return function(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}([n,v])}}};Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(0),popupTemplates_1=__webpack_require__(3),constants_2=__webpack_require__(0),helpers_1=__webpack_require__(4),SubscribePopup=function(){function SubscribePopup(pw){this.pw=pw,this.config=__assign({},constants_1.DEFAULT_CONFIG,this.pw.subscribePopupConfig),this.onAskLaterClick=this.onAskLaterClick.bind(this),this.onSubscribeClick=this.onSubscribeClick.bind(this)}return SubscribePopup.prototype.initPopup=function(){return __awaiter(this,void 0,void 0,function(){var isSubscribed,isManualUnsubscribed,permission,lastPopupOpen,lastPopupOpenTime,now,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.pw.isSubscribed()];case 1:return isSubscribed=_a.sent(),[4,this.pw.data.getStatusManualUnsubscribed()];case 2:return isManualUnsubscribed=_a.sent(),isSubscribed||isManualUnsubscribed?[2]:[4,this.pw.driver.getPermission()];case 3:return(permission=_a.sent())===constants_2.PERMISSION_GRANTED||permission===constants_2.PERMISSION_DENIED?[2]:(this.renderPopup(),this.appendStyles(),lastPopupOpen=localStorage.getItem("LAST_OPEN_SUBSCRIPTION_POPUP"),lastPopupOpenTime=lastPopupOpen?parseInt(lastPopupOpen):0,now=(new Date).getTime(),lastPopupOpenTime+1e3*this.config.retryOffset<now&&setTimeout(function(){_this.toggle(!0)},1e3*this.config.delay),[2])}})})},SubscribePopup.prototype.toggle=function(isShown){("boolean"==typeof isShown?isShown:!this.isShown)?(this.showPopup(),this.pw.eventBus.dispatchEvent("subscribe-popup-show",{})):(this.closePopup(),this.pw.eventBus.dispatchEvent("subscribe-popup-hide",{}))},SubscribePopup.prototype.showPopup=function(){this.isShown=!0,this.popup.classList.add("pw-show"),document.body.classList.add("pw-popup-opened");var event=new CustomEvent("showPopup",{bubbles:!1,cancelable:!1,detail:{popup:this.popup}});if(this.popup.dispatchEvent(event),!(Math.max(document.documentElement.clientWidth,window.innerWidth||0)<541)){var _a=this.config,theme=_a.theme,viewport=_a.viewport,position=_a.position;if("topbar"===theme&&"top"===position){var viewportElement=document.querySelector(viewport)||document.createElement("div"),currentMarginTop=window.getComputedStyle(viewportElement).marginTop||"0";viewportElement.style.transition="margin-top .3s ease-out",viewportElement.style.marginTop=parseInt(currentMarginTop)+this.popup.getBoundingClientRect().height+"px"}}},SubscribePopup.prototype.closePopup=function(){this.isShown=!1,this.popup.classList.remove("pw-show"),document.body.classList.remove("pw-popup-opened");var event=new CustomEvent("hidePopup",{bubbles:!1,cancelable:!1,detail:{popup:this.popup}});this.popup.dispatchEvent(event);var now=(new Date).getTime().toString();if(localStorage.setItem("LAST_OPEN_SUBSCRIPTION_POPUP",now),!(Math.max(document.documentElement.clientWidth,window.innerWidth||0)<541)){var _a=this.config,theme=_a.theme,viewport=_a.viewport,position=_a.position;if("topbar"===theme&&"top"===position){var viewportElement=document.querySelector(viewport)||document.createElement("div"),currentMarginTop=window.getComputedStyle(viewportElement).marginTop||"0";viewportElement.style.marginTop=parseInt(currentMarginTop)-this.popup.getBoundingClientRect().height+"px"}}},SubscribePopup.prototype.renderPopup=function(){this.popup=document.createElement("div"),this.popup.id="pwSubscribePopup";var _a=this.config,text=_a.text,askLaterButtonText=_a.askLaterButtonText,confirmSubscriptionButtonText=_a.confirmSubscriptionButtonText,iconUrl=_a.iconUrl,position=_a.position,overlay=_a.overlay,theme=_a.theme;this.popup.className="pw-subscribe-popup pw-position-"+position+" pw-subscribe-popup-"+theme,this.popup.classList.toggle("pw-subscribe-popup__overlay",overlay),this.popup.innerHTML=popupTemplates_1.innerTemplate({text:text,askLaterButtonText:askLaterButtonText,confirmSubscriptionButtonText:confirmSubscriptionButtonText,iconUrl:iconUrl}),document.body.appendChild(this.popup),this.addListeners()},SubscribePopup.prototype.appendStyles=function(){var styles=__webpack_require__(5),style=document.createElement("style");style.innerHTML=this.configureStyle(styles),document.body.appendChild(style)},SubscribePopup.prototype.getStyleFormatter=function(style){switch(style.type){case"size":return(this.config[style.name]||0)+"px";case"number":return parseFloat(this.config[style.name].toString()).toString();case"string":return this.config[style.name].toString();case"color":return helpers_1.getValidColor(this.config[style.name].toString());default:return"none"}},SubscribePopup.prototype.configureStyle=function(styles){var _this=this,resultStyles=styles.toString();return constants_1.CONFIG_STYLES.forEach(function(style){var template=new RegExp("var\\(--"+style.name+"\\)","ig"),result=_this.getStyleFormatter(style);resultStyles=resultStyles.replace(template,result)}),resultStyles},SubscribePopup.prototype.addListeners=function(){var askLaterButton=this.popup.querySelector('button[name="pwAskLater"]')||document.createElement("button"),subscribeButton=this.popup.querySelector('button[name="pwSubscribe"]')||document.createElement("button");askLaterButton.addEventListener("click",this.onAskLaterClick),subscribeButton.addEventListener("click",this.onSubscribeClick)},SubscribePopup.prototype.onAskLaterClick=function(){this.toggle(!1),this.pw.eventBus.dispatchEvent("subscribe-popup-decline",{})},SubscribePopup.prototype.onSubscribeClick=function(){this.toggle(!1),this.pw.eventBus.dispatchEvent("subscribe-popup-accept",{}),this.pw.subscribe()},SubscribePopup}();exports.default=SubscribePopup},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.innerTemplate=function(_a){var iconUrl=_a.iconUrl,text=_a.text,askLaterButtonText=_a.askLaterButtonText,confirmSubscriptionButtonText=_a.confirmSubscriptionButtonText;return'<div class="pw-subscription-popup-inner">\n <div class="pw-subscription-popup-content">\n '+(iconUrl?'<div class="pw-subscription-popup-icon">\n <img src="'+iconUrl+'">\n </div>':"")+'\n <div class="pw-subscription-popup-text">\n '+text+'\n </div>\n </div>\n <div class="pw-subscription-popup-controls">\n <button name="pwSubscribe" class="pw-subscribe-popup-button pw-subscribe-popup-button-active">'+confirmSubscriptionButtonText+'</button>\n <button name="pwAskLater" class="pw-subscribe-popup-button">'+askLaterButtonText+"</button>\n </div>\n </div>"}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var constants_1=__webpack_require__(0);exports.getValidColor=function(color){return"transparent"===color?color:constants_1.COLOR_TEST_REGEXP.test(color)?color:"#333"},exports.getGlobal=function(){return Function("return this")()}},function(module,exports,__webpack_require__){var result=__webpack_require__(6);module.exports="string"==typeof result?result:result.toString()},function(module,exports,__webpack_require__){(module.exports=__webpack_require__(7)(void 0)).push([module.i,".pw-subscribe-popup {\n position: fixed;\n left: 50%;\n -webkit-transform: translateX(-50%);\n -ms-transform: translateX(-50%);\n transform: translateX(-50%);\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n z-index: 1000000;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-transition: all .4s ease-out;\n -o-transition: all .4s ease-out;\n transition: all .4s ease-out;\n}\n\n.pw-subscribe-popup.pw-position-top {\n top: calc(-100% - 24px);\n}\n.pw-subscribe-popup.pw-position-top.pw-show {\n top: 0;\n}\n\n.pw-subscribe-popup.pw-position-bottom {\n bottom: calc(-100% - 24px);\n}\n.pw-subscribe-popup.pw-position-bottom.pw-show {\n bottom: 0;\n}\n\n.pw-subscribe-popup.pw-position-center {\n display: none;\n}\n.pw-subscribe-popup.pw-position-center.pw-show {\n top: 50%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n\n.pw-subscribe-popup__overlay {\n position: fixed;\n left: 0;\n right: 0;\n -webkit-transform: none;\n -ms-transform: none;\n transform: none;\n height: 100%;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n background: rgba(0,0,0,.4);\n z-index: 1000000;\n display: none;\n top: 0;\n}\n\n.pw-subscribe-popup__overlay.pw-position-top {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.pw-subscribe-popup__overlay.pw-position-bottom {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n\n.pw-subscribe-popup__overlay.pw-position-center {\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n\n.pw-subscription-popup-inner {\n max-width: 400px;\n font-size: var(--textSize);\n color: var(--textColor);\n font-family: var(--fontFamily);\n border-style: solid;\n border-width: 1px;\n border-color: var(--borderColor);\n background: var(--bgColor);\n -webkit-box-shadow: var(--boxShadow);\n box-shadow: var(--boxShadow);\n}\n\n.pw-subscription-popup-content {\n padding: 16px 16px 4px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: stretch;\n -ms-flex-pack: stretch;\n justify-content: stretch;\n}\n\n.pw-subscription-popup-icon {\n -webkit-box-flex: 0;\n -ms-flex: 0 0 50px;\n flex: 0 0 50px;\n margin-right: 12px;\n padding-top: 4px;\n}\n\n.pw-subscription-popup-icon img {\n max-width: 60px;\n max-height: 60px;\n}\n\n.pw-subscription-popup-text {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 300px;\n flex: 1 1 300px;\n}\n\n.pw-subscription-popup-controls {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n padding: 8px 16px 16px;\n}\n\nbutton.pw-subscribe-popup-button {\n border: solid 1px transparent;\n -webkit-border-radius: 2px;\n border-radius: 2px;\n display: inline-block;\n height: 36px;\n line-height: 36px;\n padding: 0 16px;\n text-transform: uppercase;\n vertical-align: middle;\n -webkit-tap-highlight-color: transparent;\n font-size: 14px;\n outline: 0;\n text-decoration: none;\n color: var(--askLaterBtnTextColor);\n text-align: center;\n letter-spacing: .5px;\n cursor: pointer;\n background: var(--askLaterBtnBgColor);\n margin: 4px 8px;\n}\nbutton.pw-subscribe-popup-button:hover {\n background: rgba(0,0,0,.04);\n}\nbutton.pw-subscribe-popup-button:active {\n background: rgba(0,0,0,.12);\n}\n\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active {\n color: var(--subscribeBtnTextColor);\n background: var(--subscribeBtnBgColor);\n -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:hover {\n -webkit-box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n 0 1px 7px 0 rgba(0,0,0,0.12),\n 0 3px 1px -1px rgba(0,0,0,0.2);\n box-shadow: 0 3px 3px 0 rgba(0,0,0,0.14),\n 0 1px 7px 0 rgba(0,0,0,0.12),\n 0 3px 1px -1px rgba(0,0,0,0.2);\n}\nbutton.pw-subscribe-popup-button.pw-subscribe-popup-button-active:active {\n -webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),\n 0 3px 1px -2px rgba(0,0,0,0.12),\n 0 1px 5px 0 rgba(0,0,0,0.2);\n}\n\n@media screen and (min-width: 541px) {\n\n .pw-subscribe-popup-topbar {\n width: 100%;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-inner {\n max-width: 100%;\n width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding: 2px 40px;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-wrap: nowrap;\n flex-wrap: nowrap;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-content {\n padding: 0;\n -webkit-box-pack: start;\n -ms-flex-pack: start;\n justify-content: flex-start;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 60%;\n flex: 1 1 60%;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-icon img {\n max-width: 28px;\n max-height: 28px;\n }\n\n .pw-subscribe-popup-topbar button.pw-subscribe-popup-button {\n height: 32px;\n line-height: 32px;\n }\n\n .pw-subscribe-popup-topbar .pw-subscription-popup-controls {\n padding: 0 0 0 16px;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n }\n}\n@media screen and (max-width: 540px) {\n .pw-subscribe-popup,\n .pw-subscribe-popup.pw-position-top,\n .pw-subscribe-popup.pw-position-center,\n .pw-subscribe-popup.pw-position-bottom {\n top: auto;\n bottom: -110%;\n left: 0;\n right: 0;\n -webkit-transform: none;\n -ms-transform: none;\n transform: none;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-transition: bottom .4s ease-out;\n -o-transition: bottom .4s ease-out;\n transition: bottom .4s ease-out;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n }\n\n .pw-subscribe-popup.pw-subscribe-popup__overlay {\n height: 100%;\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n }\n\n .pw-subscribe-popup.pw-show {\n bottom: 0;\n }\n\n .pw-subscribe-popup__overlay .pw-subscription-popup-inner {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n -webkit-box-pack: stretch;\n -ms-flex-pack: stretch;\n justify-content: stretch;\n }\n\n .pw-subscription-popup-inner {\n max-width: 100%;\n width: 100%;\n }\n}\n",""])},function(module,exports){module.exports=function(useSourceMap){var list=[];return list.toString=function(){return this.map(function(item){var content=function(item,useSourceMap){var content=item[1]||"",cssMapping=item[3];if(!cssMapping)return content;if(useSourceMap&&"function"==typeof btoa){var sourceMapping=function(sourceMap){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"}(cssMapping),sourceURLs=cssMapping.sources.map(function(source){return"/*# sourceURL="+cssMapping.sourceRoot+source+" */"});return[content].concat(sourceURLs).concat([sourceMapping]).join("\n")}return[content].join("\n")}(item,useSourceMap);return item[2]?"@media "+item[2]+"{"+content+"}":content}).join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];"number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}}])}])});